cleanup: remove legacy cpp sources (now on GitHub)
Browse files- cpp/CMakeLists.txt +0 -45
- cpp/build_ax650.sh +0 -30
- cpp/config.h +0 -16
- cpp/fastenhancer.cpp +0 -253
- cpp/fastenhancer.hpp +0 -49
- cpp/main.cpp +0 -84
- cpp/toolchains/aarch64-none-linux-gnu.toolchain.cmake +0 -22
- cpp/windows.h +0 -9
cpp/CMakeLists.txt
DELETED
|
@@ -1,45 +0,0 @@
|
|
| 1 |
-
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
|
| 2 |
-
project(fastenhancer)
|
| 3 |
-
|
| 4 |
-
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
| 5 |
-
set(CMAKE_CXX_STANDARD 17)
|
| 6 |
-
endif()
|
| 7 |
-
|
| 8 |
-
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
| 9 |
-
set(CMAKE_CXX_FLAGS "-fvisibility=hidden -g -O0")
|
| 10 |
-
else()
|
| 11 |
-
set(CMAKE_CXX_FLAGS "-fvisibility=hidden -O2 -fdata-sections -ffunction-sections")
|
| 12 |
-
endif()
|
| 13 |
-
|
| 14 |
-
# Platform (same as ZipVoice.AXERA)
|
| 15 |
-
if(AX650)
|
| 16 |
-
add_definitions(-DAX650)
|
| 17 |
-
if(NOT BSP_MSP_DIR)
|
| 18 |
-
set(BSP_MSP_DIR /data/shared/huyuan/toolchains/ax650n_bsp_sdk/msp/out)
|
| 19 |
-
endif()
|
| 20 |
-
if(NOT EXISTS ${BSP_MSP_DIR})
|
| 21 |
-
message(FATAL_ERROR "BSP_MSP_DIR ${BSP_MSP_DIR} not exist.")
|
| 22 |
-
endif()
|
| 23 |
-
include_directories(${BSP_MSP_DIR}/include)
|
| 24 |
-
link_directories(${BSP_MSP_DIR}/lib)
|
| 25 |
-
set(MSP_LIBS ax_sys ax_engine ax_interpreter)
|
| 26 |
-
else()
|
| 27 |
-
message(FATAL_ERROR "Use -DAX650")
|
| 28 |
-
endif()
|
| 29 |
-
|
| 30 |
-
# Model variant: 16k (default) or 48k
|
| 31 |
-
set(FE_MODEL "16k" CACHE STRING "Model variant: 16k or 48k")
|
| 32 |
-
if(FE_MODEL STREQUAL "48k")
|
| 33 |
-
add_definitions(-DFE_MODEL_48K)
|
| 34 |
-
message(STATUS "Model: 48kHz")
|
| 35 |
-
else()
|
| 36 |
-
message(STATUS "Model: 16kHz")
|
| 37 |
-
endif()
|
| 38 |
-
|
| 39 |
-
include_directories(${CMAKE_SOURCE_DIR})
|
| 40 |
-
|
| 41 |
-
add_executable(fastenhancer_demo main.cpp fastenhancer.cpp)
|
| 42 |
-
target_link_libraries(fastenhancer_demo ${MSP_LIBS} pthread m)
|
| 43 |
-
|
| 44 |
-
install(TARGETS fastenhancer_demo RUNTIME DESTINATION ./)
|
| 45 |
-
set_target_properties(fastenhancer_demo PROPERTIES INSTALL_RPATH "$ORIGIN/")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpp/build_ax650.sh
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
#!/usr/bin/env bash
|
| 2 |
-
# Cross-compile FastEnhancer C++ demo for AX650.
|
| 3 |
-
#
|
| 4 |
-
# Prerequisites:
|
| 5 |
-
# 1. aarch64 cross toolchain (Arm GNU 9.2 or system aarch64-linux-gnu-g++)
|
| 6 |
-
# 2. AX650 BSP SDK at BSP_MSP_DIR (default /data/shared/huyuan/toolchains/ax650n_bsp_sdk/msp/out)
|
| 7 |
-
#
|
| 8 |
-
# Usage:
|
| 9 |
-
# bash build_ax650.sh # 16kHz
|
| 10 |
-
# bash build_ax650.sh 48k # 48kHz
|
| 11 |
-
set -e
|
| 12 |
-
|
| 13 |
-
MODEL="${1:-16k}"
|
| 14 |
-
BUILD_DIR="build_${MODEL}"
|
| 15 |
-
BSP_MSP_DIR="${BSP_MSP_DIR:-/data/shared/huyuan/toolchains/ax650n_bsp_sdk/msp/out}"
|
| 16 |
-
|
| 17 |
-
rm -rf "$BUILD_DIR" && mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
| 18 |
-
cmake .. \
|
| 19 |
-
-DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-none-linux-gnu.toolchain.cmake \
|
| 20 |
-
-DCMAKE_BUILD_TYPE=Release \
|
| 21 |
-
-DAX650=ON \
|
| 22 |
-
-DBSP_MSP_DIR="$BSP_MSP_DIR" \
|
| 23 |
-
-DFE_MODEL="$MODEL"
|
| 24 |
-
make -j"$(nproc)"
|
| 25 |
-
|
| 26 |
-
echo ""
|
| 27 |
-
echo "Built: $BUILD_DIR/fastenhancer_demo (${MODEL})"
|
| 28 |
-
echo "Deploy to AX650 board:"
|
| 29 |
-
echo " scp $BUILD_DIR/fastenhancer_demo model.axmodel noisy.wav root@<board>:/tmp/"
|
| 30 |
-
echo " ssh root@<board> 'cd /tmp && LD_LIBRARY_PATH=/soc/lib ./fastenhancer_demo model.axmodel noisy.wav enhanced.wav'"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpp/config.h
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
#pragma once
|
| 2 |
-
// Model selection: build with -DFE_MODEL_48K for 48kHz, default is 16kHz.
|
| 3 |
-
|
| 4 |
-
#ifdef FE_MODEL_48K
|
| 5 |
-
#define FE_NFFT 1024
|
| 6 |
-
#define FE_HOP 512
|
| 7 |
-
#define FE_GRU_F 24
|
| 8 |
-
#define FE_GRU_C 20
|
| 9 |
-
#define FE_SAMPLE_RATE 48000
|
| 10 |
-
#else
|
| 11 |
-
#define FE_NFFT 512
|
| 12 |
-
#define FE_HOP 256
|
| 13 |
-
#define FE_GRU_F 16
|
| 14 |
-
#define FE_GRU_C 20
|
| 15 |
-
#define FE_SAMPLE_RATE 16000
|
| 16 |
-
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpp/fastenhancer.cpp
DELETED
|
@@ -1,253 +0,0 @@
|
|
| 1 |
-
#include "fastenhancer.hpp"
|
| 2 |
-
#include "windows.h"
|
| 3 |
-
#include "ax_engine_type.h"
|
| 4 |
-
#include "ax_engine_api.h"
|
| 5 |
-
#include "ax_sys_api.h"
|
| 6 |
-
#include <cmath>
|
| 7 |
-
#include <cstring>
|
| 8 |
-
#include <cstdio>
|
| 9 |
-
#include <cstdlib>
|
| 10 |
-
|
| 11 |
-
namespace {
|
| 12 |
-
constexpr double kPi = 3.14159265358979323846;
|
| 13 |
-
constexpr float kCompPow = 0.3f - 1.0f;
|
| 14 |
-
constexpr float kDecompPow = 1.0f / 0.3f - 1.0f;
|
| 15 |
-
|
| 16 |
-
// Radix-2 DIT FFT (same algorithm as kiss_fft / rnnoise, self-contained).
|
| 17 |
-
// Reference: Lightweight-Speech-Denoising.axera and ZipVoice.AXERA
|
| 18 |
-
|
| 19 |
-
static void fft_c2c(float* re, float* im, int N, int inv) {
|
| 20 |
-
for (int i = 1, j = 0; i < N; ++i) {
|
| 21 |
-
int m = N >> 1;
|
| 22 |
-
for (; j & m; m >>= 1) j ^= m;
|
| 23 |
-
j ^= m;
|
| 24 |
-
if (i < j) { float t=re[i]; re[i]=re[j]; re[j]=t; t=im[i]; im[i]=im[j]; im[j]=t; }
|
| 25 |
-
}
|
| 26 |
-
for (int L = 2; L <= N; L <<= 1) {
|
| 27 |
-
double a = (inv ? 2.0 : -2.0) * kPi / L;
|
| 28 |
-
for (int k = 0; k < N; k += L) {
|
| 29 |
-
double wr = 1.0, wi = 0.0, wdr = std::cos(a), wdi = std::sin(a);
|
| 30 |
-
for (int j = 0; j < L/2; ++j) {
|
| 31 |
-
int i1 = k+j, i2 = k+j+L/2;
|
| 32 |
-
float tr = (float)(wr*re[i2] - wi*im[i2]);
|
| 33 |
-
float ti = (float)(wr*im[i2] + wi*re[i2]);
|
| 34 |
-
re[i2] = re[i1] - tr; im[i2] = im[i1] - ti;
|
| 35 |
-
re[i1] += tr; im[i1] += ti;
|
| 36 |
-
double nwr = wr*wdr - wi*wdi; wi = wr*wdi + wi*wdr; wr = nwr;
|
| 37 |
-
}
|
| 38 |
-
}
|
| 39 |
-
}
|
| 40 |
-
if (inv) { for (int i = 0; i < N; ++i) { re[i] /= N; im[i] /= N; } }
|
| 41 |
-
}
|
| 42 |
-
|
| 43 |
-
static void rfft(const float* x, float* re_out, float* im_out, int N) {
|
| 44 |
-
float re[N], im[N];
|
| 45 |
-
for (int i = 0; i < N; ++i) { re[i] = x[i]; im[i] = 0; }
|
| 46 |
-
fft_c2c(re, im, N, 0);
|
| 47 |
-
int H = N/2 + 1;
|
| 48 |
-
for (int k = 0; k < H; ++k) { re_out[k] = re[k]; im_out[k] = im[k]; }
|
| 49 |
-
}
|
| 50 |
-
|
| 51 |
-
static void ifft_real(const float* re_half, const float* im_half, float* out, int N) {
|
| 52 |
-
float re[N], im[N]; int H = N/2;
|
| 53 |
-
for (int k = 0; k <= H; ++k) { re[k] = re_half[k]; im[k] = im_half[k]; }
|
| 54 |
-
for (int k = 1; k < H; ++k) { re[N-k] = re_half[k]; im[N-k] = -im_half[k]; }
|
| 55 |
-
fft_c2c(re, im, N, 1);
|
| 56 |
-
for (int i = 0; i < N; ++i) out[i] = re[i];
|
| 57 |
-
}
|
| 58 |
-
} // namespace
|
| 59 |
-
|
| 60 |
-
FastEnhancer::FastEnhancer()
|
| 61 |
-
: handle_(0), context_(0), loaded_(false),
|
| 62 |
-
model_data_(nullptr), model_size_(0), io_data_(nullptr), io_info_(nullptr) {
|
| 63 |
-
std::memset(cache_stft_, 0, sizeof(cache_stft_));
|
| 64 |
-
std::memset(cache_istft_, 0, sizeof(cache_istft_));
|
| 65 |
-
std::memset(gru0_, 0, sizeof(gru0_));
|
| 66 |
-
std::memset(gru1_, 0, sizeof(gru1_));
|
| 67 |
-
}
|
| 68 |
-
|
| 69 |
-
FastEnhancer::~FastEnhancer() {
|
| 70 |
-
if (io_data_) {
|
| 71 |
-
AX_ENGINE_IO_T* io = (AX_ENGINE_IO_T*)io_data_;
|
| 72 |
-
for (AX_U32 i = 0; i < io->nInputSize; ++i)
|
| 73 |
-
AX_SYS_MemFree(io->pInputs[i].phyAddr, io->pInputs[i].pVirAddr);
|
| 74 |
-
for (AX_U32 i = 0; i < io->nOutputSize; ++i)
|
| 75 |
-
AX_SYS_MemFree(io->pOutputs[i].phyAddr, io->pOutputs[i].pVirAddr);
|
| 76 |
-
delete[] io->pInputs;
|
| 77 |
-
delete[] io->pOutputs;
|
| 78 |
-
delete io;
|
| 79 |
-
}
|
| 80 |
-
if (handle_) AX_ENGINE_DestroyHandle(handle_);
|
| 81 |
-
std::free(model_data_);
|
| 82 |
-
AX_ENGINE_Deinit();
|
| 83 |
-
AX_SYS_Deinit();
|
| 84 |
-
}
|
| 85 |
-
|
| 86 |
-
bool FastEnhancer::load(const char* model_path) {
|
| 87 |
-
// 0. read model file into memory
|
| 88 |
-
FILE* f = std::fopen(model_path, "rb");
|
| 89 |
-
if (!f) { std::fprintf(stderr, "FastEnhancer: cannot open %s\n", model_path); return false; }
|
| 90 |
-
std::fseek(f, 0, SEEK_END); model_size_ = std::ftell(f); std::fseek(f, 0, SEEK_SET);
|
| 91 |
-
model_data_ = std::malloc(model_size_);
|
| 92 |
-
if (!model_data_ || std::fread(model_data_, 1, model_size_, f) != model_size_) {
|
| 93 |
-
std::fclose(f); return false;
|
| 94 |
-
}
|
| 95 |
-
std::fclose(f);
|
| 96 |
-
|
| 97 |
-
// 1. init SYS + ENGINE
|
| 98 |
-
if (AX_SYS_Init() != 0) { std::fprintf(stderr, "FastEnhancer: AX_SYS_Init failed\n"); return false; }
|
| 99 |
-
AX_ENGINE_NPU_ATTR_T npu_attr;
|
| 100 |
-
std::memset(&npu_attr, 0, sizeof(npu_attr));
|
| 101 |
-
npu_attr.eHardMode = AX_ENGINE_VIRTUAL_NPU_DISABLE;
|
| 102 |
-
if (AX_ENGINE_Init(&npu_attr) != 0) { std::fprintf(stderr, "FastEnhancer: AX_ENGINE_Init failed\n"); return false; }
|
| 103 |
-
|
| 104 |
-
// 2. create handle + context
|
| 105 |
-
if (AX_ENGINE_CreateHandle(&handle_, model_data_, model_size_) != 0 || !handle_) {
|
| 106 |
-
std::fprintf(stderr, "FastEnhancer: CreateHandle failed\n"); return false;
|
| 107 |
-
}
|
| 108 |
-
if (AX_ENGINE_CreateContext(handle_) != 0) {
|
| 109 |
-
std::fprintf(stderr, "FastEnhancer: CreateContext failed\n"); return false;
|
| 110 |
-
}
|
| 111 |
-
|
| 112 |
-
// 3. get IO info
|
| 113 |
-
AX_ENGINE_IO_INFO_T* info = nullptr;
|
| 114 |
-
if (AX_ENGINE_GetIOInfo(handle_, &info) != 0 || !info) {
|
| 115 |
-
std::fprintf(stderr, "FastEnhancer: GetIOInfo failed\n"); return false;
|
| 116 |
-
}
|
| 117 |
-
io_info_ = info;
|
| 118 |
-
|
| 119 |
-
// 4. allocate CMM I/O buffers (physically contiguous, DMA-capable)
|
| 120 |
-
AX_ENGINE_IO_T* io = new AX_ENGINE_IO_T;
|
| 121 |
-
std::memset(io, 0, sizeof(*io));
|
| 122 |
-
io->pInputs = new AX_ENGINE_IO_BUFFER_T[info->nInputSize];
|
| 123 |
-
std::memset(io->pInputs, 0, sizeof(AX_ENGINE_IO_BUFFER_T) * info->nInputSize);
|
| 124 |
-
io->nInputSize = info->nInputSize;
|
| 125 |
-
for (AX_U32 i = 0; i < info->nInputSize; ++i) {
|
| 126 |
-
AX_ENGINE_IO_BUFFER_T* b = &io->pInputs[i];
|
| 127 |
-
b->nSize = info->pInputs[i].nSize;
|
| 128 |
-
if (AX_SYS_MemAlloc((AX_U64*)&b->phyAddr, &b->pVirAddr, b->nSize, 128,
|
| 129 |
-
(const AX_S8*)"fastenhancer") != 0) {
|
| 130 |
-
std::fprintf(stderr, "FastEnhancer: MemAlloc input %u failed\n", i); return false;
|
| 131 |
-
}
|
| 132 |
-
std::memset(b->pVirAddr, 0, b->nSize);
|
| 133 |
-
}
|
| 134 |
-
io->pOutputs = new AX_ENGINE_IO_BUFFER_T[info->nOutputSize];
|
| 135 |
-
std::memset(io->pOutputs, 0, sizeof(AX_ENGINE_IO_BUFFER_T) * info->nOutputSize);
|
| 136 |
-
io->nOutputSize = info->nOutputSize;
|
| 137 |
-
for (AX_U32 i = 0; i < info->nOutputSize; ++i) {
|
| 138 |
-
AX_ENGINE_IO_BUFFER_T* b = &io->pOutputs[i];
|
| 139 |
-
b->nSize = info->pOutputs[i].nSize;
|
| 140 |
-
if (AX_SYS_MemAlloc((AX_U64*)&b->phyAddr, &b->pVirAddr, b->nSize, 128,
|
| 141 |
-
(const AX_S8*)"fastenhancer") != 0) {
|
| 142 |
-
std::fprintf(stderr, "FastEnhancer: MemAlloc output %u failed\n", i); return false;
|
| 143 |
-
}
|
| 144 |
-
}
|
| 145 |
-
io_data_ = io;
|
| 146 |
-
loaded_ = true;
|
| 147 |
-
return true;
|
| 148 |
-
}
|
| 149 |
-
|
| 150 |
-
void FastEnhancer::stft_forward(const float* hop, float* spec_out) {
|
| 151 |
-
float x[kNfft];
|
| 152 |
-
std::memcpy(x, cache_stft_, kCacheLen * sizeof(float));
|
| 153 |
-
std::memcpy(x + kCacheLen, hop, kHop * sizeof(float));
|
| 154 |
-
std::memcpy(cache_stft_, x + (kNfft - kCacheLen), kCacheLen * sizeof(float));
|
| 155 |
-
for (int i = 0; i < kNfft; ++i) x[i] *= kWindow[i];
|
| 156 |
-
float re[kFreq], im[kFreq];
|
| 157 |
-
rfft(x, re, im, kNfft);
|
| 158 |
-
for (int k = 0; k < kFreq; ++k) {
|
| 159 |
-
spec_out[k * 2 + 0] = re[k];
|
| 160 |
-
spec_out[k * 2 + 1] = im[k];
|
| 161 |
-
}
|
| 162 |
-
}
|
| 163 |
-
|
| 164 |
-
void FastEnhancer::istft_inverse(const float* spec_in, float* hop_out) {
|
| 165 |
-
float re[kNfft] = {0}, im[kNfft] = {0};
|
| 166 |
-
for (int k = 0; k < kFreq; ++k) {
|
| 167 |
-
re[k] = spec_in[k * 2 + 0];
|
| 168 |
-
im[k] = spec_in[k * 2 + 1];
|
| 169 |
-
}
|
| 170 |
-
float x_0 = spec_in[0 * 2 + 0];
|
| 171 |
-
float x_last = spec_in[(kFreq - 1) * 2 + 0];
|
| 172 |
-
float t[kNfft];
|
| 173 |
-
ifft_real(re, im, t, kNfft);
|
| 174 |
-
for (int j = 0; j < kNfft / 2; ++j) {
|
| 175 |
-
t[j * 2 + 0] = 2.0f * t[j * 2 + 0] - (x_0 + x_last) / kNfft;
|
| 176 |
-
t[j * 2 + 1] = 2.0f * t[j * 2 + 1] - (x_0 - x_last) / kNfft;
|
| 177 |
-
}
|
| 178 |
-
for (int i = 0; i < kNfft; ++i) t[i] *= kWindowIstft[i];
|
| 179 |
-
for (int i = 0; i < kCacheLen; ++i) t[i] += cache_istft_[i];
|
| 180 |
-
std::memcpy(hop_out, t, kHop * sizeof(float));
|
| 181 |
-
std::memcpy(cache_istft_, t + kHop, kCacheLen * sizeof(float));
|
| 182 |
-
}
|
| 183 |
-
|
| 184 |
-
bool FastEnhancer::run_core(const float* comp_spec, float* mask) {
|
| 185 |
-
const int specBytes = kF * 2 * sizeof(float);
|
| 186 |
-
const int gruBytes = kGruF * kGruC * sizeof(float);
|
| 187 |
-
AX_ENGINE_IO_T* io = (AX_ENGINE_IO_T*)io_data_;
|
| 188 |
-
|
| 189 |
-
// Fill CMM input buffers (order: comp_spec, cache_in_0, cache_in_1)
|
| 190 |
-
std::memcpy(io->pInputs[0].pVirAddr, comp_spec, specBytes);
|
| 191 |
-
std::memcpy(io->pInputs[1].pVirAddr, gru0_, gruBytes);
|
| 192 |
-
std::memcpy(io->pInputs[2].pVirAddr, gru1_, gruBytes);
|
| 193 |
-
|
| 194 |
-
if (AX_ENGINE_RunSync(handle_, io) != 0) return false;
|
| 195 |
-
|
| 196 |
-
// Read CMM output buffers (order: mask, cache_out_0, cache_out_1)
|
| 197 |
-
std::memcpy(mask, io->pOutputs[0].pVirAddr, specBytes);
|
| 198 |
-
std::memcpy(gru0_, io->pOutputs[1].pVirAddr, gruBytes);
|
| 199 |
-
std::memcpy(gru1_, io->pOutputs[2].pVirAddr, gruBytes);
|
| 200 |
-
return true;
|
| 201 |
-
}
|
| 202 |
-
|
| 203 |
-
std::vector<float> FastEnhancer::enhance(const std::vector<float>& wav_in) {
|
| 204 |
-
int length = static_cast<int>(wav_in.size());
|
| 205 |
-
std::vector<float> wav(length + kNfft, 0.0f);
|
| 206 |
-
for (int i = 0; i < length; ++i) {
|
| 207 |
-
float v = wav_in[i];
|
| 208 |
-
wav[i] = v > 1.0f ? 1.0f : (v < -1.0f ? -1.0f : v);
|
| 209 |
-
}
|
| 210 |
-
std::memset(cache_stft_, 0, sizeof(cache_stft_));
|
| 211 |
-
std::memset(cache_istft_, 0, sizeof(cache_istft_));
|
| 212 |
-
std::memset(gru0_, 0, sizeof(gru0_));
|
| 213 |
-
std::memset(gru1_, 0, sizeof(gru1_));
|
| 214 |
-
|
| 215 |
-
std::vector<float> out;
|
| 216 |
-
out.reserve(length + kNfft);
|
| 217 |
-
float spec[kFreq * 2], comp[kF * 2], mask[kF * 2], sh[kFreq * 2], hop_out[kHop];
|
| 218 |
-
for (int i = 0; i + kHop <= static_cast<int>(wav.size()); i += kHop) {
|
| 219 |
-
stft_forward(&wav[i], spec);
|
| 220 |
-
// compress: drop last bin, comp = s * mag^-0.7
|
| 221 |
-
for (int k = 0; k < kF; ++k) {
|
| 222 |
-
float re = spec[k * 2 + 0], im = spec[k * 2 + 1];
|
| 223 |
-
float mag = std::sqrt(re * re + im * im);
|
| 224 |
-
if (mag < 1e-5f) mag = 1e-5f;
|
| 225 |
-
float scale = std::pow(mag, kCompPow);
|
| 226 |
-
comp[k * 2 + 0] = re * scale;
|
| 227 |
-
comp[k * 2 + 1] = im * scale;
|
| 228 |
-
}
|
| 229 |
-
if (!run_core(comp, mask)) break;
|
| 230 |
-
// apply complex mask + decompress
|
| 231 |
-
for (int k = 0; k < kF; ++k) {
|
| 232 |
-
float cr = comp[k * 2 + 0], cimg = comp[k * 2 + 1];
|
| 233 |
-
float mr = mask[k * 2 + 0], mi = mask[k * 2 + 1];
|
| 234 |
-
float hr = cr * mr - cimg * mi;
|
| 235 |
-
float hi = cr * mi + cimg * mr;
|
| 236 |
-
float mag = std::sqrt(hr * hr + hi * hi);
|
| 237 |
-
float scale = std::pow(mag, kDecompPow);
|
| 238 |
-
sh[k * 2 + 0] = hr * scale;
|
| 239 |
-
sh[k * 2 + 1] = hi * scale;
|
| 240 |
-
}
|
| 241 |
-
sh[kF * 2 + 0] = 0.0f; // padded last bin
|
| 242 |
-
sh[kF * 2 + 1] = 0.0f;
|
| 243 |
-
istft_inverse(sh, hop_out);
|
| 244 |
-
out.insert(out.end(), hop_out, hop_out + kHop);
|
| 245 |
-
}
|
| 246 |
-
int start = kNfft - kHop;
|
| 247 |
-
std::vector<float> result(length, 0.0f);
|
| 248 |
-
for (int i = 0; i < length && start + i < static_cast<int>(out.size()); ++i) {
|
| 249 |
-
float v = out[start + i];
|
| 250 |
-
result[i] = v > 1.0f ? 1.0f : (v < -1.0f ? -1.0f : v);
|
| 251 |
-
}
|
| 252 |
-
return result;
|
| 253 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpp/fastenhancer.hpp
DELETED
|
@@ -1,49 +0,0 @@
|
|
| 1 |
-
#pragma once
|
| 2 |
-
// Model: default 16kHz. Build with -DFE_MODEL_48K for 48kHz model.
|
| 3 |
-
#include "config.h"
|
| 4 |
-
#include <cstdint>
|
| 5 |
-
#include <cstddef>
|
| 6 |
-
#include <cstdio>
|
| 7 |
-
#include <vector>
|
| 8 |
-
|
| 9 |
-
// FastEnhancer streaming speech enhancement (AX650 NPU).
|
| 10 |
-
//
|
| 11 |
-
// Split pipeline — host does FFT + magnitude compression, NPU does the neural
|
| 12 |
-
// core (compressed spec -> complex mask), host does mask + decompression + ISTFT.
|
| 13 |
-
// Compression/decompression stay on host because mag^2.333 amplifies quant error.
|
| 14 |
-
//
|
| 15 |
-
// Dimensions from config.h (switched via -DFE_MODEL_48K at build time).
|
| 16 |
-
class FastEnhancer {
|
| 17 |
-
public:
|
| 18 |
-
static constexpr int kNfft = FE_NFFT;
|
| 19 |
-
static constexpr int kHop = FE_HOP;
|
| 20 |
-
static constexpr int kCacheLen = kNfft - kHop;
|
| 21 |
-
static constexpr int kFreq = kNfft / 2 + 1;
|
| 22 |
-
static constexpr int kF = kNfft / 2;
|
| 23 |
-
static constexpr int kGruF = FE_GRU_F;
|
| 24 |
-
static constexpr int kGruC = FE_GRU_C;
|
| 25 |
-
static constexpr int kSampleRate = FE_SAMPLE_RATE;
|
| 26 |
-
|
| 27 |
-
FastEnhancer();
|
| 28 |
-
~FastEnhancer();
|
| 29 |
-
|
| 30 |
-
bool load(const char* model_path);
|
| 31 |
-
std::vector<float> enhance(const std::vector<float>& wav);
|
| 32 |
-
|
| 33 |
-
private:
|
| 34 |
-
bool run_core(const float* comp_spec, float* mask);
|
| 35 |
-
void stft_forward(const float* hop, float* spec_out);
|
| 36 |
-
void istft_inverse(const float* spec_in, float* hop_out);
|
| 37 |
-
|
| 38 |
-
void* handle_;
|
| 39 |
-
void* context_; // AX_ENGINE context
|
| 40 |
-
bool loaded_;
|
| 41 |
-
void* model_data_; // model file bytes
|
| 42 |
-
size_t model_size_;
|
| 43 |
-
void* io_data_; // AX_ENGINE_IO_T* (CMM-allocated I/O buffers)
|
| 44 |
-
void* io_info_; // AX_ENGINE_IO_INFO_T*
|
| 45 |
-
float cache_stft_[kCacheLen];
|
| 46 |
-
float cache_istft_[kCacheLen];
|
| 47 |
-
float gru0_[kGruF * kGruC];
|
| 48 |
-
float gru1_[kGruF * kGruC];
|
| 49 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpp/main.cpp
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
#include "fastenhancer.hpp"
|
| 2 |
-
#include <cstdio>
|
| 3 |
-
#include <cstdint>
|
| 4 |
-
#include <cstring>
|
| 5 |
-
#include <cmath>
|
| 6 |
-
#include <vector>
|
| 7 |
-
#include <fstream>
|
| 8 |
-
#include <ctime>
|
| 9 |
-
#include <chrono>
|
| 10 |
-
|
| 11 |
-
// Minimal WAV I/O (16-bit PCM mono).
|
| 12 |
-
static std::vector<float> read_wav(const char* path, int* sr) {
|
| 13 |
-
std::ifstream f(path, std::ios::binary);
|
| 14 |
-
if (!f) { std::fprintf(stderr, "cannot open %s\n", path); return {}; }
|
| 15 |
-
char hdr[44];
|
| 16 |
-
f.read(hdr, 44);
|
| 17 |
-
*sr = *reinterpret_cast<int32_t*>(hdr + 24);
|
| 18 |
-
int16_t ch = *reinterpret_cast<int16_t*>(hdr + 22);
|
| 19 |
-
// Read raw PCM data
|
| 20 |
-
std::vector<char> raw((std::istreambuf_iterator<char>(f)), {});
|
| 21 |
-
int16_t* p = reinterpret_cast<int16_t*>(raw.data());
|
| 22 |
-
size_t n = raw.size() / 2;
|
| 23 |
-
std::vector<float> out;
|
| 24 |
-
for (size_t i = 0; i < n; i += ch) out.push_back(p[i] / 32768.0f);
|
| 25 |
-
return out;
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
static void write_wav(const char* path, const std::vector<float>& data, int sr) {
|
| 29 |
-
std::ofstream f(path, std::ios::binary);
|
| 30 |
-
int32_t n = static_cast<int32_t>(data.size());
|
| 31 |
-
int32_t byte_rate = sr * 2, data_bytes = n * 2, chunk = 36 + data_bytes;
|
| 32 |
-
int16_t one = 1, two = 2, sixteen = 16;
|
| 33 |
-
f.write("RIFF", 4); f.write(reinterpret_cast<char*>(&chunk), 4); f.write("WAVE", 4);
|
| 34 |
-
f.write("fmt ", 4); int32_t sz = 16; f.write(reinterpret_cast<char*>(&sz), 4);
|
| 35 |
-
f.write(reinterpret_cast<char*>(&one), 2); f.write(reinterpret_cast<char*>(&one), 2);
|
| 36 |
-
f.write(reinterpret_cast<char*>(&sr), 4); f.write(reinterpret_cast<char*>(&byte_rate), 4);
|
| 37 |
-
f.write(reinterpret_cast<char*>(&two), 2); f.write(reinterpret_cast<char*>(&sixteen), 2);
|
| 38 |
-
f.write("data", 4); f.write(reinterpret_cast<char*>(&data_bytes), 4);
|
| 39 |
-
for (float v : data) {
|
| 40 |
-
int16_t s = static_cast<int16_t>((v > 1 ? 1 : (v < -1 ? -1 : v)) * 32767);
|
| 41 |
-
f.write(reinterpret_cast<char*>(&s), 2);
|
| 42 |
-
}
|
| 43 |
-
}
|
| 44 |
-
|
| 45 |
-
static float rms(const std::vector<float>& x) {
|
| 46 |
-
double s = 0; for (float v : x) s += double(v) * v;
|
| 47 |
-
return x.empty() ? 0.f : std::sqrt(s / x.size());
|
| 48 |
-
}
|
| 49 |
-
|
| 50 |
-
int main(int argc, char** argv) {
|
| 51 |
-
const char* model = argc > 1 ? argv[1] : "../models/model.axmodel";
|
| 52 |
-
const char* input = argc > 2 ? argv[2] : "sample_noisy.wav";
|
| 53 |
-
const char* output = argc > 3 ? argv[3] : "enhanced.wav";
|
| 54 |
-
|
| 55 |
-
int sr = 0;
|
| 56 |
-
std::vector<float> wav = read_wav(input, &sr);
|
| 57 |
-
if (wav.empty()) return 1;
|
| 58 |
-
if (sr != FastEnhancer::kSampleRate)
|
| 59 |
-
std::fprintf(stderr, "WARNING: sr=%d, model expects %d Hz\n", sr, FastEnhancer::kSampleRate);
|
| 60 |
-
|
| 61 |
-
bool bench = false;
|
| 62 |
-
for (int i = 1; i < argc; ++i) if (std::strcmp(argv[i], "--bench") == 0) bench = true;
|
| 63 |
-
|
| 64 |
-
FastEnhancer fe;
|
| 65 |
-
if (!fe.load(model)) return 1;
|
| 66 |
-
|
| 67 |
-
std::vector<float> enhanced = fe.enhance(wav); // warmup
|
| 68 |
-
|
| 69 |
-
if (bench) {
|
| 70 |
-
const int N = 3;
|
| 71 |
-
auto t0 = std::chrono::steady_clock::now();
|
| 72 |
-
for (int i = 0; i < N; ++i) enhanced = fe.enhance(wav);
|
| 73 |
-
auto t1 = std::chrono::steady_clock::now();
|
| 74 |
-
double sec = std::chrono::duration<double>(t1 - t0).count() / N;
|
| 75 |
-
double dur = double(wav.size()) / FastEnhancer::kSampleRate;
|
| 76 |
-
std::printf("Benchmark %dkHz: %.3fs / %.1fs audio, RTF=%.4f\n",
|
| 77 |
-
FastEnhancer::kSampleRate / 1000, sec, dur, sec / dur);
|
| 78 |
-
} else {
|
| 79 |
-
write_wav(output, enhanced, FastEnhancer::kSampleRate);
|
| 80 |
-
std::printf("FastEnhancer %dkHz done.\n input rms = %.4f\n output rms = %.4f\n saved: %s\n",
|
| 81 |
-
FastEnhancer::kSampleRate / 1000, rms(wav), rms(enhanced), output);
|
| 82 |
-
}
|
| 83 |
-
return 0;
|
| 84 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpp/toolchains/aarch64-none-linux-gnu.toolchain.cmake
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 1 |
-
# AX650 / AX630C aarch64 cross-compile toolchain
|
| 2 |
-
#
|
| 3 |
-
# Download:
|
| 4 |
-
# wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
|
| 5 |
-
# tar -xf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
|
| 6 |
-
#
|
| 7 |
-
# Set TOOLCHAIN_DIR: export TOOLCHAIN_DIR=/path/to/gcc-arm-...
|
| 8 |
-
# or pass: cmake -DTOOLCHAIN_DIR=/path/to/...
|
| 9 |
-
|
| 10 |
-
if(NOT DEFINED TOOLCHAIN_DIR)
|
| 11 |
-
set(TOOLCHAIN_DIR "/usr")
|
| 12 |
-
endif()
|
| 13 |
-
|
| 14 |
-
set(CMAKE_SYSTEM_NAME Linux)
|
| 15 |
-
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
| 16 |
-
|
| 17 |
-
set(CMAKE_C_COMPILER "${TOOLCHAIN_DIR}/bin/aarch64-linux-gnu-gcc")
|
| 18 |
-
set(CMAKE_CXX_COMPILER "${TOOLCHAIN_DIR}/bin/aarch64-linux-gnu-g++")
|
| 19 |
-
|
| 20 |
-
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
| 21 |
-
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
| 22 |
-
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cpp/windows.h
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
// Auto-generated Hann window buffers. Selected by FE_MODEL_48K.
|
| 2 |
-
#pragma once
|
| 3 |
-
#ifdef FE_MODEL_48K
|
| 4 |
-
static const float kWindow[1024]={0.000000000f,0.000009418f,0.000037640f,0.000084698f,0.000150591f,0.000235289f,0.000338823f,0.000461131f,0.000602275f,0.000762224f,0.000940949f,0.001138479f,0.001354784f,0.001589864f,0.001843691f,0.002116293f,0.002407640f,0.002717704f,0.003046513f,0.003394037f,0.003760248f,0.004145116f,0.004548699f,0.004970908f,0.005411744f,0.005871207f,0.006349295f,0.006845951f,0.007361174f,0.007894963f,0.008447260f,0.009018064f,0.009607345f,0.010215104f,0.010841310f,0.011485934f,0.012148947f,0.012830317f,0.013530016f,0.014248043f,0.014984369f,0.015738964f,0.016511768f,0.017302781f,0.018111974f,0.018939286f,0.019784749f,0.020648271f,0.021529824f,0.022429407f,0.023346990f,0.024282485f,0.025235921f,0.026207209f,0.027196348f,0.028203279f,0.029227972f,0.030270398f,0.031330496f,0.032408237f,0.033503592f,0.034616530f,0.035746962f,0.036894888f,0.038060248f,0.039242983f,0.040443063f,0.041660458f,0.042895138f,0.044146985f,0.045416027f,0.046702147f,0.048005342f,0.049325585f,0.050662756f,0.052016884f,0.053387851f,0.054775625f,0.056180209f,0.057601452f,0.059039384f,0.060493886f,0.061964959f,0.063452512f,0.064956516f,0.066476882f,0.068013579f,0.069566548f,0.071135700f,0.072721004f,0.074322402f,0.075939834f,0.077573210f,0.079222530f,0.080887645f,0.082568586f,0.084265202f,0.085977495f,0.087705374f,0.089448750f,0.091207594f,0.092981845f,0.094771415f,0.096576214f,0.098396242f,0.100231379f,0.102081537f,0.103946716f,0.105826795f,0.107721686f,0.109631389f,0.111555785f,0.113494784f,0.115448326f,0.117416382f,0.119398832f,0.121395588f,0.123406619f,0.125431806f,0.127471119f,0.129524440f,0.131591737f,0.133672893f,0.135767817f,0.137876451f,0.139998764f,0.142134607f,0.144283891f,0.146446615f,0.148622632f,0.150811881f,0.153014272f,0.155229747f,0.157458186f,0.159699500f,0.161953658f,0.164220542f,0.166500032f,0.168792129f,0.171096653f,0.173413604f,0.175742805f,0.178084224f,0.180437803f,0.182803363f,0.185180902f,0.187570274f,0.189971417f,0.192384213f,0.194808602f,0.197244495f,0.199691772f,0.202150345f,0.204620153f,0.207101077f,0.209593028f,0.212095916f,0.214609653f,0.217134088f,0.219669223f,0.222214907f,0.224771023f,0.227337509f,0.229914248f,0.232501179f,0.235098183f,0.237705171f,0.240322024f,0.242948651f,0.245584965f,0.248230785f,0.250886142f,0.253550887f,0.256224930f,0.258908153f,0.261600405f,0.264301658f,0.267011762f,0.269730628f,0.272458196f,0.275194347f,0.277938962f,0.280691922f,0.283453107f,0.286222458f,0.288999856f,0.291785240f,0.294578433f,0.297379375f,0.300187945f,0.303004026f,0.305827469f,0.308658302f,0.311496317f,0.314341426f,0.317193508f,0.320052505f,0.322918296f,0.325790644f,0.328669637f,0.331555068f,0.334446847f,0.337344885f,0.340249002f,0.343159169f,0.346075177f,0.348997027f,0.351924568f,0.354857683f,0.357796252f,0.360740185f,0.363689363f,0.366643608f,0.369602948f,0.372567177f,0.375536203f,0.378509939f,0.381488234f,0.384470940f,0.387458026f,0.390449405f,0.393444866f,0.396444321f,0.399447709f,0.402454883f,0.405465662f,0.408480048f,0.411497891f,0.414519072f,0.417543471f,0.420570970f,0.423601449f,0.426634759f,0.429670870f,0.432709664f,0.435750961f,0.438794672f,0.441840708f,0.444888949f,0.447939187f,0.450991422f,0.454045534f,0.457101375f,0.460158825f,0.463217765f,0.466278076f,0.469339639f,0.472402394f,0.475466162f,0.478530884f,0.481596410f,0.484662622f,0.487729430f,0.490796626f,0.493864238f,0.496932060f,0.500000000f,0.503067970f,0.506135821f,0.509203434f,0.512270629f,0.515337408f,0.518403649f,0.521469176f,0.524533868f,0.527597666f,0.530660391f,0.533721983f,0.536782265f,0.539841235f,0.542898655f,0.545954525f,0.549008608f,0.552060843f,0.555111110f,0.558159351f,0.561205328f,0.564249098f,0.567290366f,0.570329189f,0.573365271f,0.576398611f,0.579429090f,0.582456589f,0.585480988f,0.588502169f,0.591520011f,0.594534397f,0.597545147f,0.600552320f,0.603555679f,0.606555164f,0.609550655f,0.612542033f,0.615529120f,0.618511796f,0.621490121f,0.624463797f,0.627432823f,0.630397081f,0.633356452f,0.636310697f,0.639259815f,0.642203808f,0.645142376f,0.648075461f,0.651003003f,0.653924882f,0.656840861f,0.659751058f,0.662655175f,0.665553212f,0.668444991f,0.671330392f,0.674209356f,0.677081764f,0.679947495f,0.682806492f,0.685658634f,0.688503742f,0.691341758f,0.694172561f,0.696996033f,0.699812114f,0.702620685f,0.705421627f,0.708214760f,0.711000085f,0.713777542f,0.716546893f,0.719308138f,0.722061098f,0.724805713f,0.727541804f,0.730269432f,0.732988298f,0.735698462f,0.738399684f,0.741091967f,0.743775129f,0.746449113f,0.749113798f,0.751769185f,0.754415035f,0.757051349f,0.759678006f,0.762294888f,0.764901876f,0.767498851f,0.770085812f,0.772662520f,0.775229037f,0.777785182f,0.780330777f,0.782865882f,0.785390377f,0.787904084f,0.790406942f,0.792898953f,0.795379877f,0.797849655f,0.800308287f,0.802755594f,0.805191457f,0.807615876f,0.810028672f,0.812429786f,0.814819098f,0.817196608f,0.819562197f,0.821915746f,0.824257195f,0.826586425f,0.828903377f,0.831207871f,0.833500028f,0.835779548f,0.838046432f,0.840300560f,0.842541933f,0.844770312f,0.846985698f,0.849188089f,0.851377368f,0.853553414f,0.855716109f,0.857865453f,0.860001266f,0.862123609f,0.864232183f,0.866327167f,0.868408322f,0.870475650f,0.872528911f,0.874568224f,0.876593351f,0.878604412f,0.880601168f,0.882583618f,0.884551644f,0.886505246f,0.888444245f,0.890368640f,0.892278314f,0.894173265f,0.896053314f,0.897918463f,0.899768710f,0.901603818f,0.903423786f,0.905228615f,0.907018185f,0.908792377f,0.910551250f,0.912294626f,0.914022565f,0.915734828f,0.917431474f,0.919112384f,0.920777559f,0.922426820f,0.924060225f,0.925677657f,0.927278996f,0.928864300f,0.930433512f,0.931986451f,0.933523118f,0.935043514f,0.936547518f,0.938035071f,0.939506173f,0.940960646f,0.942398548f,0.943819880f,0.945224404f,0.946612120f,0.947983146f,0.949337244f,0.950674415f,0.951994658f,0.953297853f,0.954584002f,0.955853045f,0.957104921f,0.958339572f,0.959556937f,0.960757017f,0.961939812f,0.963105202f,0.964253068f,0.965383470f,0.966496408f,0.967591763f,0.968669534f,0.969729662f,0.970772028f,0.971796751f,0.972803712f,0.973792791f,0.974764109f,0.975717545f,0.976653039f,0.977570653f,0.978470206f,0.979351759f,0.980215251f,0.981060743f,0.981888056f,0.982697248f,0.983488262f,0.984261036f,0.985015631f,0.985751987f,0.986469984f,0.987169743f,0.987851083f,0.988514066f,0.989158690f,0.989784896f,0.990392685f,0.990981936f,0.991552711f,0.992105067f,0.992638826f,0.993154049f,0.993650675f,0.994128823f,0.994588256f,0.995029092f,0.995451331f,0.995854855f,0.996239781f,0.996605992f,0.996953487f,0.997282267f,0.997592330f,0.997883677f,0.998156309f,0.998410165f,0.998645186f,0.998861551f,0.999059081f,0.999237776f,0.999397755f,0.999538898f,0.999661207f,0.999764681f,0.999849439f,0.999915302f,0.999962330f,0.999990582f,1.000000000f,0.999990582f,0.999962330f,0.999915302f,0.999849439f,0.999764681f,0.999661207f,0.999538898f,0.999397755f,0.999237776f,0.999059081f,0.998861551f,0.998645186f,0.998410106f,0.998156309f,0.997883677f,0.997592330f,0.997282267f,0.996953487f,0.996605992f,0.996239781f,0.995854855f,0.995451331f,0.995029092f,0.994588256f,0.994128823f,0.993650675f,0.993154049f,0.992638826f,0.992105007f,0.991552711f,0.990981936f,0.990392625f,0.989784837f,0.989158630f,0.988514066f,0.987851024f,0.987169683f,0.986469984f,0.985751987f,0.985015631f,0.984261036f,0.983488202f,0.982697248f,0.981888056f,0.981060684f,0.980215251f,0.979351699f,0.978470147f,0.977570593f,0.976652980f,0.975717545f,0.974764109f,0.973792791f,0.972803652f,0.971796751f,0.970772028f,0.969729602f,0.968669474f,0.967591763f,0.966496348f,0.965383410f,0.964253008f,0.963105083f,0.961939752f,0.960757017f,0.959556937f,0.958339512f,0.957104862f,0.955852985f,0.954584002f,0.953297853f,0.951994658f,0.950674415f,0.949337184f,0.947983086f,0.946612120f,0.945224404f,0.943819821f,0.942398548f,0.940960646f,0.939506054f,0.938035011f,0.936547458f,0.935043454f,0.933523059f,0.931986392f,0.930433393f,0.928864241f,0.927278936f,0.925677598f,0.924060166f,0.922426820f,0.920777440f,0.919112325f,0.917431414f,0.915734768f,0.914022505f,0.912294626f,0.910551190f,0.908792377f,0.907018125f,0.905228496f,0.903423727f,0.901603758f,0.899768591f,0.897918463f,0.896053314f,0.894173205f,0.892278314f,0.890368581f,0.888444185f,0.886505187f,0.884551644f,0.882583618f,0.880601168f,0.878604352f,0.876593351f,0.874568224f,0.872528911f,0.870475531f,0.868408263f,0.866327107f,0.864232183f,0.862123489f,0.860001206f,0.857865334f,0.855716050f,0.853553295f,0.851377308f,0.849188089f,0.846985638f,0.844770312f,0.842541814f,0.840300500f,0.838046312f,0.835779428f,0.833499908f,0.831207871f,0.828903317f,0.826586485f,0.824257255f,0.821915805f,0.819562197f,0.817196667f,0.814819098f,0.812429786f,0.810028553f,0.807615757f,0.805191398f,0.802755475f,0.800308228f,0.797849596f,0.795379758f,0.792898893f,0.790406942f,0.787904024f,0.785390258f,0.782865822f,0.780330658f,0.777785003f,0.775228858f,0.772662401f,0.770085573f,0.767498672f,0.764901638f,0.762294650f,0.759678006f,0.757051408f,0.754415095f,0.751769185f,0.749113858f,0.746449113f,0.743775070f,0.741091847f,0.738399625f,0.735698342f,0.732988238f,0.730269313f,0.727541745f,0.724805593f,0.722061038f,0.719308019f,0.716546834f,0.713777483f,0.711000025f,0.708214700f,0.705421448f,0.702620506f,0.699811995f,0.696995854f,0.694172382f,0.691341579f,0.688503563f,0.685658634f,0.682806551f,0.679947555f,0.677081823f,0.674209356f,0.671330392f,0.668444932f,0.665553153f,0.662655115f,0.659750998f,0.656840861f,0.653924763f,0.651002944f,0.648075402f,0.645142257f,0.642203689f,0.639259756f,0.636310577f,0.633356273f,0.630396962f,0.627432704f,0.624463677f,0.621489942f,0.618511677f,0.615528882f,0.612541795f,0.609550476f,0.606554985f,0.603555739f,0.600552380f,0.597545207f,0.594534338f,0.591519952f,0.588502109f,0.585480928f,0.582456529f,0.579429030f,0.576398551f,0.573365211f,0.570329070f,0.567290306f,0.564248979f,0.561205268f,0.558159232f,0.555110991f,0.552060723f,0.549008489f,0.545954347f,0.542898536f,0.539841115f,0.536782146f,0.533721805f,0.530660212f,0.527597427f,0.524533689f,0.521468937f,0.518403649f,0.515337467f,0.512270629f,0.509203374f,0.506135762f,0.503067970f,0.500000000f,0.496932030f,0.493864208f,0.490796596f,0.487729341f,0.484662563f,0.481596321f,0.478530794f,0.475466073f,0.472402304f,0.469339550f,0.466277927f,0.463217616f,0.460158646f,0.457101226f,0.454045385f,0.450991273f,0.447939038f,0.444888741f,0.441840529f,0.438794494f,0.435750991f,0.432709694f,0.429670930f,0.426634789f,0.423601419f,0.420570940f,0.417543441f,0.414519042f,0.411497861f,0.408480018f,0.405465633f,0.402454793f,0.399447620f,0.396444261f,0.393444777f,0.390449286f,0.387457967f,0.384470850f,0.381488085f,0.378509790f,0.375536084f,0.372567058f,0.369602799f,0.366643488f,0.363689184f,0.360740006f,0.357796073f,0.354857504f,0.351924598f,0.348997056f,0.346075207f,0.343159139f,0.340249002f,0.337344855f,0.334446847f,0.331555068f,0.328669608f,0.325790644f,0.322918177f,0.320052445f,0.317193449f,0.314341336f,0.311496228f,0.308658183f,0.305827379f,0.303003877f,0.300187796f,0.297379225f,0.294578314f,0.291785091f,0.288999736f,0.286222309f,0.283452928f,0.280691743f,0.277938783f,0.275194168f,0.272458255f,0.269730687f,0.267011762f,0.264301658f,0.261600375f,0.258908093f,0.256224900f,0.253550887f,0.250886142f,0.248230785f,0.245584875f,0.242948592f,0.240321934f,0.237705082f,0.235098124f,0.232501119f,0.229914188f,0.227337420f,0.224770904f,0.222214788f,0.219669104f,0.217133969f,0.214609504f,0.212095767f,0.209592879f,0.207100928f,0.204620004f,0.202150375f,0.199691772f,0.197244495f,0.194808602f,0.192384213f,0.189971387f,0.187570244f,0.185180873f,0.182803333f,0.180437744f,0.178084195f,0.175742745f,0.173413545f,0.171096593f,0.168792039f,0.166499972f,0.164220452f,0.161953568f,0.159699410f,0.157458067f,0.155229628f,0.153014183f,0.150811762f,0.148622513f,0.146446496f,0.144283772f,0.142134458f,0.139998615f,0.137876481f,0.135767817f,0.133672893f,0.131591737f,0.129524440f,0.127471119f,0.125431806f,0.123406589f,0.121395558f,0.119398773f,0.117416352f,0.115448296f,0.113494724f,0.111555725f,0.109631330f,0.107721657f,0.105826735f,0.103946656f,0.102081478f,0.100231290f,0.098396152f,0.096576154f,0.094771326f,0.092981756f,0.091207504f,0.089448631f,0.087705255f,0.085977376f,0.084265202f,0.082568586f,0.080887645f,0.079222530f,0.077573210f,0.075939834f,0.074322402f,0.072721004f,0.071135670f,0.069566518f,0.068013549f,0.066476852f,0.064956456f,0.063452482f,0.061964899f,0.060493827f,0.059039325f,0.057601392f,0.056180120f,0.054775566f,0.053387791f,0.052016795f,0.050662696f,0.049325496f,0.048005283f,0.046702057f,0.045415938f,0.044146985f,0.042895138f,0.041660488f,0.040443063f,0.039242983f,0.038060218f,0.036894858f,0.035746962f,0.034616500f,0.033503592f,0.032408237f,0.031330466f,0.030270368f,0.029227942f,0.028203249f,0.027196318f,0.026207179f,0.025235862f,0.024282455f,0.023346931f,0.022429377f,0.021529794f,0.020648211f,0.019784689f,0.018939257f,0.018111914f,0.017302722f,0.016511708f,0.015738964f,0.014984369f,0.014248043f,0.013530016f,0.012830317f,0.012148917f,0.011485934f,0.010841310f,0.010215104f,0.009607345f,0.009018064f,0.008447230f,0.007894933f,0.007361174f,0.006845951f,0.006349266f,0.005871207f,0.005411714f,0.004970878f,0.004548669f,0.004145116f,0.003760219f,0.003394008f,0.003046513f,0.002717704f,0.002407610f,0.002116263f,0.001843691f,0.001589864f,0.001354784f,0.001138479f,0.000940949f,0.000762224f,0.000602275f,0.000461131f,0.000338823f,0.000235289f,0.000150591f,0.000084698f,0.000037640f,0.000009418f};
|
| 5 |
-
static const float kWindowIstft[1024]={0.000000000f,0.000009418f,0.000037643f,0.000084713f,0.000150636f,0.000235400f,0.000339052f,0.000461557f,0.000603001f,0.000763387f,0.000942721f,0.001141074f,0.001358460f,0.001594928f,0.001850502f,0.002125269f,0.002419262f,0.002732516f,0.003065132f,0.003417155f,0.003788634f,0.004179623f,0.004590268f,0.005020573f,0.005470635f,0.005940553f,0.006430435f,0.006940327f,0.007470345f,0.008020608f,0.008591178f,0.009182181f,0.009793720f,0.010425933f,0.011078927f,0.011752818f,0.012447727f,0.013163773f,0.013901091f,0.014659838f,0.015440158f,0.016242187f,0.017066045f,0.017911907f,0.018779933f,0.019670257f,0.020583099f,0.021518566f,0.022476831f,0.023458108f,0.024462579f,0.025490362f,0.026541721f,0.027616791f,0.028715799f,0.029838918f,0.030986369f,0.032158356f,0.033355076f,0.034576748f,0.035823613f,0.037095893f,0.038393762f,0.039717507f,0.041067336f,0.042443473f,0.043846175f,0.045275718f,0.046732344f,0.048216250f,0.049727760f,0.051267073f,0.052834507f,0.054430343f,0.056054793f,0.057708200f,0.059390787f,0.061102852f,0.062844768f,0.064616695f,0.066419035f,0.068252012f,0.070115983f,0.072011232f,0.073938102f,0.075896859f,0.077887848f,0.079911418f,0.081967823f,0.084057443f,0.086180612f,0.088337667f,0.090528898f,0.092754781f,0.095015474f,0.097311467f,0.099643029f,0.102010578f,0.104414433f,0.106854931f,0.109332465f,0.111847423f,0.114400163f,0.116990969f,0.119620338f,0.122288592f,0.124996044f,0.127743170f,0.130530313f,0.133357778f,0.136226103f,0.139135554f,0.142086491f,0.145079345f,0.148114532f,0.151192412f,0.154313326f,0.157477692f,0.160685852f,0.163938269f,0.167235300f,0.170577288f,0.173964649f,0.177397698f,0.180876896f,0.184402585f,0.187975138f,0.191594824f,0.195262194f,0.198977455f,0.202741027f,0.206553280f,0.210414499f,0.214325115f,0.218285352f,0.222295687f,0.226356342f,0.230467618f,0.234629914f,0.238843471f,0.243108571f,0.247425571f,0.251794726f,0.256216377f,0.260690540f,0.265217751f,0.269798040f,0.274431825f,0.279119104f,0.283860207f,0.288655400f,0.293504626f,0.298408300f,0.303366423f,0.308379114f,0.313446522f,0.318568796f,0.323745996f,0.328978002f,0.334265202f,0.339607298f,0.345004439f,0.350456566f,0.355963737f,0.361525714f,0.367142588f,0.372814178f,0.378540158f,0.384320676f,0.390155464f,0.396044195f,0.401986748f,0.407982856f,0.414032221f,0.420134574f,0.426289231f,0.432496190f,0.438754916f,0.445064902f,0.451425731f,0.457836926f,0.464297771f,0.470807940f,0.477366537f,0.483973116f,0.490626961f,0.497327268f,0.504073441f,0.510864496f,0.517699659f,0.524578154f,0.531498849f,0.538461030f,0.545463622f,0.552505314f,0.559585512f,0.566703022f,0.573856592f,0.581044972f,0.588267088f,0.595521569f,0.602807105f,0.610122502f,0.617466092f,0.624836743f,0.632232845f,0.639652908f,0.647095442f,0.654558957f,0.662041664f,0.669541955f,0.677058280f,0.684588730f,0.692131698f,0.699685454f,0.707248032f,0.714817703f,0.722392440f,0.729970634f,0.737550080f,0.745128810f,0.752705157f,0.760276318f,0.767841399f,0.775397778f,0.782943487f,0.790476263f,0.797994256f,0.805495143f,0.812976956f,0.820437491f,0.827874601f,0.835285962f,0.842669904f,0.850023746f,0.857345819f,0.864633441f,0.871884882f,0.879097939f,0.886270225f,0.893399775f,0.900484741f,0.907522559f,0.914511323f,0.921449006f,0.928333700f,0.935163200f,0.941935480f,0.948648632f,0.955300808f,0.961889505f,0.968413949f,0.974871635f,0.981260836f,0.987579763f,0.993826687f,1.000000000f,1.006098032f,1.012119174f,1.018061996f,1.023924589f,1.029706120f,1.035404682f,1.041019082f,1.046548128f,1.051990390f,1.057345033f,1.062610626f,1.067786217f,1.072870731f,1.077863216f,1.082762718f,1.087568879f,1.092280149f,1.096896410f,1.101416826f,1.105840683f,1.110167265f,1.114396691f,1.118528366f,1.122561932f,1.126496911f,1.130333185f,1.134070516f,1.137709022f,1.141248345f,1.144688606f,1.148030162f,1.151272774f,1.154416680f,1.157462120f,1.160409331f,1.163258672f,1.166010618f,1.168665648f,1.171224236f,1.173686624f,1.176053762f,1.178325891f,1.180504084f,1.182588696f,1.184580684f,1.186480880f,1.188289762f,1.190008640f,1.191637754f,1.193178892f,1.194632530f,1.195999861f,1.197281480f,1.198479056f,1.199593186f,1.200625062f,1.201576114f,1.202446938f,1.203239083f,1.203953624f,1.204591870f,1.205154777f,1.205643773f,1.206060171f,1.206404924f,1.206679583f,1.206885338f,1.207023382f,1.207095146f,1.207101941f,1.207044959f,1.206925273f,1.206744552f,1.206504107f,1.206205130f,1.205848813f,1.205436349f,1.204969525f,1.204449415f,1.203877091f,1.203254342f,1.202582002f,1.201861501f,1.201093912f,1.200281024f,1.199423432f,1.198522925f,1.197580338f,1.196597219f,1.195574403f,1.194513321f,1.193415403f,1.192281246f,1.191112638f,1.189910412f,1.188675642f,1.187409759f,1.186113477f,1.184787989f,1.183434486f,1.182054162f,1.180647850f,1.179216623f,1.177761555f,1.176283598f,1.174783826f,1.173263311f,1.171722770f,1.170163274f,1.168585777f,1.166991115f,1.165380359f,1.163754225f,1.162113428f,1.160459161f,1.158791900f,1.157112837f,1.155422568f,1.153721809f,1.152011514f,1.150292397f,1.148565173f,1.146830559f,1.145089269f,1.143342137f,1.141589642f,1.139832377f,1.138071179f,1.136306763f,1.134539604f,1.132770419f,1.130999446f,1.129227877f,1.127455831f,1.125684142f,1.123913050f,1.122143507f,1.120375633f,1.118610144f,1.116847396f,1.115088105f,1.113332391f,1.111581087f,1.109834313f,1.108092785f,1.106356740f,1.104626775f,1.102903008f,1.101186275f,1.099476457f,1.097774267f,1.096079826f,1.094393849f,1.092716336f,1.091047883f,1.089388609f,1.087738872f,1.086099029f,1.084469318f,1.082850099f,1.081241608f,1.079644322f,1.078058124f,1.076483607f,1.074920893f,1.073370218f,1.071831942f,1.070306182f,1.068793058f,1.067292929f,1.065806150f,1.064332485f,1.062872529f,1.061426401f,1.059994340f,1.058576345f,1.057172656f,1.055783510f,1.054408908f,1.053049326f,1.051704526f,1.050375104f,1.049060702f,1.047761917f,1.046478510f,1.045210838f,1.043959022f,1.042723060f,1.041503310f,1.040299535f,1.039112329f,1.037941217f,1.036786556f,1.035648823f,1.034527659f,1.033423185f,1.032335639f,1.031265020f,1.030211329f,1.029175043f,1.028155804f,1.027153850f,1.026169300f,1.025202036f,1.024252415f,1.023320317f,1.022405744f,1.021508932f,1.020629883f,1.019768715f,1.018925190f,1.018099546f,1.017292023f,1.016502500f,1.015730858f,1.014977455f,1.014242053f,1.013525009f,1.012825847f,1.012145281f,1.011482835f,1.010838747f,1.010212898f,1.009605408f,1.009016633f,1.008446097f,1.007893920f,1.007360339f,1.006845355f,1.006348848f,1.005870819f,1.005411506f,1.004970551f,1.004548550f,1.004145026f,1.003760099f,1.003394008f,1.003046393f,1.002717733f,1.002407670f,1.002116323f,1.001843691f,1.001589894f,1.001354814f,1.001138449f,1.000940919f,1.000762224f,1.000602245f,1.000461102f,1.000338793f,1.000235319f,1.000150561f,1.000084758f,1.000037670f,1.000009418f,1.000000000f,1.000009418f,1.000037670f,1.000084758f,1.000150561f,1.000235319f,1.000338793f,1.000461102f,1.000602245f,1.000762224f,1.000940919f,1.001138449f,1.001354814f,1.001589894f,1.001843691f,1.002116323f,1.002407670f,1.002717733f,1.003046393f,1.003394008f,1.003760099f,1.004145026f,1.004548550f,1.004970551f,1.005411506f,1.005870819f,1.006348848f,1.006845355f,1.007360339f,1.007893920f,1.008446097f,1.009016633f,1.009605527f,1.010212898f,1.010838747f,1.011482835f,1.012145281f,1.012825966f,1.013525009f,1.014242053f,1.014977455f,1.015730858f,1.016502500f,1.017292023f,1.018099546f,1.018925190f,1.019768715f,1.020630002f,1.021509051f,1.022405863f,1.023320317f,1.024252415f,1.025202036f,1.026169300f,1.027153850f,1.028155804f,1.029175043f,1.030211449f,1.031265020f,1.032335639f,1.033423305f,1.034527779f,1.035648823f,1.036786795f,1.037941337f,1.039112329f,1.040299535f,1.041503429f,1.042723179f,1.043959141f,1.045210838f,1.046478510f,1.047761917f,1.049060702f,1.050375104f,1.051704645f,1.053049326f,1.054408908f,1.055783510f,1.057172656f,1.058576345f,1.059994459f,1.061426520f,1.062872648f,1.064332604f,1.065806150f,1.067293048f,1.068793178f,1.070306182f,1.071831942f,1.073370337f,1.074920893f,1.076483607f,1.078058362f,1.079644322f,1.081241727f,1.082850099f,1.084469438f,1.086099029f,1.087738872f,1.089388609f,1.091047883f,1.092716455f,1.094393849f,1.096079946f,1.097774267f,1.099476457f,1.101186275f,1.102903128f,1.104626775f,1.106356859f,1.108092904f,1.109834313f,1.111581087f,1.113332391f,1.115088105f,1.116847515f,1.118610144f,1.120375633f,1.122143507f,1.123913288f,1.125684142f,1.127455831f,1.129227877f,1.130999684f,1.132770300f,1.134539604f,1.136306763f,1.138071299f,1.139832377f,1.141589522f,1.143342137f,1.145089269f,1.146830559f,1.148565173f,1.150292516f,1.152011633f,1.153721929f,1.155422568f,1.157112956f,1.158791780f,1.160459042f,1.162113428f,1.163754225f,1.165380359f,1.166991115f,1.168585777f,1.170163512f,1.171722889f,1.173263431f,1.174784064f,1.176283717f,1.177761674f,1.179216743f,1.180647850f,1.182054162f,1.183434486f,1.184788108f,1.186113358f,1.187409759f,1.188675761f,1.189910531f,1.191112757f,1.192281723f,1.193415523f,1.194513559f,1.195574522f,1.196597099f,1.197580218f,1.198522687f,1.199423432f,1.200280905f,1.201093912f,1.201861382f,1.202582121f,1.203254342f,1.203877211f,1.204449534f,1.204969645f,1.205436587f,1.205848694f,1.206204891f,1.206503987f,1.206744432f,1.206925273f,1.207044840f,1.207101822f,1.207095146f,1.207023382f,1.206885338f,1.206679583f,1.206405044f,1.206060171f,1.205643892f,1.205154657f,1.204591632f,1.203953505f,1.203238964f,1.202446938f,1.201576114f,1.200625181f,1.199593186f,1.198479056f,1.197281599f,1.195999742f,1.194632649f,1.193179011f,1.191637874f,1.190008402f,1.188289642f,1.186480522f,1.184580445f,1.182588577f,1.180503964f,1.178325891f,1.176053643f,1.173686504f,1.171223998f,1.168665767f,1.166010857f,1.163258553f,1.160409212f,1.157461762f,1.154416323f,1.151272535f,1.148030162f,1.144688606f,1.141248345f,1.137708902f,1.134070516f,1.130333066f,1.126496911f,1.122561932f,1.118528485f,1.114396691f,1.110167384f,1.105840325f,1.101416469f,1.096896052f,1.092279911f,1.087568521f,1.082762718f,1.077862978f,1.072870493f,1.067785859f,1.062610388f,1.057344913f,1.051990271f,1.046548009f,1.041018963f,1.035404444f,1.029706001f,1.023924470f,1.018061876f,1.012119174f,1.006098032f,1.000000000f,0.993826628f,0.987579584f,0.981260777f,0.974871576f,0.968414068f,0.961889565f,0.955300331f,0.948648214f,0.941935003f,0.935162783f,0.928333282f,0.921448827f,0.914510965f,0.907522261f,0.900484204f,0.893399596f,0.886269927f,0.879097641f,0.871884644f,0.864633322f,0.857345581f,0.850023687f,0.842669725f,0.835285962f,0.827874422f,0.820437431f,0.812976837f,0.805495083f,0.797994077f,0.790476084f,0.782943368f,0.775397897f,0.767841458f,0.760276496f,0.752704799f,0.745128453f,0.737549543f,0.729970157f,0.722392201f,0.714817286f,0.707247734f,0.699685156f,0.692131400f,0.684588373f,0.677057922f,0.669541717f,0.662041247f,0.654558659f,0.647095382f,0.639652848f,0.632232666f,0.624836743f,0.617465973f,0.610122383f,0.602807045f,0.595521450f,0.588267028f,0.581044972f,0.573856533f,0.566703022f,0.559585571f,0.552505195f,0.545463204f,0.538460672f,0.531498432f,0.524577737f,0.517699301f,0.510864139f,0.504073083f,0.497327030f,0.490626752f,0.483972847f,0.477366239f,0.470807582f,0.464297533f,0.457836568f,0.451425731f,0.445064843f,0.438754827f,0.432496071f,0.426289141f,0.420134366f,0.414032191f,0.407982856f,0.401986808f,0.396044195f,0.390155435f,0.384320647f,0.378540039f,0.372813880f,0.367142290f,0.361525506f,0.355963409f,0.350456357f,0.345004171f,0.339607030f,0.334264964f,0.328977823f,0.323745728f,0.318568528f,0.313446313f,0.308378845f,0.303366125f,0.298408270f,0.293504596f,0.288655281f,0.283860147f,0.279119045f,0.274431705f,0.269797981f,0.265217692f,0.260690540f,0.256216288f,0.251794696f,0.247425526f,0.243108526f,0.238843352f,0.234629795f,0.230467483f,0.226356164f,0.222295508f,0.218285218f,0.214324906f,0.210414335f,0.206553146f,0.202740878f,0.198977277f,0.195262000f,0.191594645f,0.187974885f,0.184402376f,0.180876866f,0.177397698f,0.173964635f,0.170577273f,0.167235255f,0.163938269f,0.160685852f,0.157477647f,0.154313266f,0.151192337f,0.148114488f,0.145079300f,0.142086402f,0.139135450f,0.136225998f,0.133357748f,0.130530223f,0.127743095f,0.124995969f,0.122288458f,0.119620211f,0.116990887f,0.114400029f,0.111847319f,0.109332360f,0.106854782f,0.104414292f,0.102010421f,0.099643014f,0.097311452f,0.095015459f,0.092754751f,0.090528898f,0.088337652f,0.086180605f,0.084057435f,0.081967779f,0.079911366f,0.077887803f,0.075896822f,0.073938027f,0.072011195f,0.070115909f,0.068251938f,0.066418968f,0.064616628f,0.062844664f,0.061102785f,0.059390724f,0.057708096f,0.056054719f,0.054430246f,0.052834440f,0.051266979f,0.049727663f,0.048216242f,0.046732340f,0.045275744f,0.043846175f,0.042443473f,0.041067299f,0.039717462f,0.038393755f,0.037095856f,0.035823610f,0.034576748f,0.033355042f,0.032158323f,0.030986337f,0.029838886f,0.028715763f,0.027616760f,0.026541660f,0.025490332f,0.024462514f,0.023458073f,0.022476798f,0.021518501f,0.020583035f,0.019670224f,0.018779872f,0.017911844f,0.017065981f,0.016242187f,0.015440158f,0.014659838f,0.013901091f,0.013163771f,0.012447694f,0.011752818f,0.011078926f,0.010425931f,0.009793719f,0.009182181f,0.008591148f,0.008020577f,0.007470345f,0.006940327f,0.006430405f,0.005940553f,0.005470605f,0.005020543f,0.004590238f,0.004179623f,0.003788603f,0.003417125f,0.003065132f,0.002732516f,0.002419232f,0.002125239f,0.001850502f,0.001594928f,0.001358460f,0.001141074f,0.000942721f,0.000763387f,0.000603001f,0.000461557f,0.000339052f,0.000235400f,0.000150636f,0.000084713f,0.000037643f,0.000009418f};
|
| 6 |
-
#else
|
| 7 |
-
static const float kWindow[512]={0.000000000f,0.000037640f,0.000150591f,0.000338823f,0.000602275f,0.000940949f,0.001354784f,0.001843691f,0.002407640f,0.003046513f,0.003760248f,0.004548699f,0.005411744f,0.006349295f,0.007361174f,0.008447260f,0.009607345f,0.010841310f,0.012148947f,0.013530016f,0.014984369f,0.016511768f,0.018111974f,0.019784749f,0.021529824f,0.023346990f,0.025235921f,0.027196348f,0.029227972f,0.031330496f,0.033503592f,0.035746962f,0.038060248f,0.040443063f,0.042895138f,0.045416027f,0.048005342f,0.050662756f,0.053387851f,0.056180209f,0.059039384f,0.061964959f,0.064956516f,0.068013579f,0.071135700f,0.074322402f,0.077573210f,0.080887645f,0.084265202f,0.087705374f,0.091207594f,0.094771415f,0.098396242f,0.102081537f,0.105826795f,0.109631389f,0.113494784f,0.117416382f,0.121395588f,0.125431806f,0.129524440f,0.133672893f,0.137876451f,0.142134607f,0.146446615f,0.150811881f,0.155229747f,0.159699500f,0.164220542f,0.168792129f,0.173413604f,0.178084224f,0.182803363f,0.187570274f,0.192384213f,0.197244495f,0.202150345f,0.207101077f,0.212095916f,0.217134088f,0.222214907f,0.227337509f,0.232501179f,0.237705171f,0.242948651f,0.248230785f,0.253550887f,0.258908153f,0.264301658f,0.269730628f,0.275194347f,0.280691922f,0.286222458f,0.291785240f,0.297379375f,0.303004026f,0.308658302f,0.314341426f,0.320052505f,0.325790644f,0.331555068f,0.337344885f,0.343159169f,0.348997027f,0.354857683f,0.360740185f,0.366643608f,0.372567177f,0.378509939f,0.384470940f,0.390449405f,0.396444321f,0.402454883f,0.408480048f,0.414519072f,0.420570970f,0.426634759f,0.432709664f,0.438794672f,0.444888949f,0.450991422f,0.457101375f,0.463217765f,0.469339639f,0.475466162f,0.481596410f,0.487729430f,0.493864238f,0.500000000f,0.506135821f,0.512270629f,0.518403649f,0.524533868f,0.530660391f,0.536782265f,0.542898655f,0.549008608f,0.555111110f,0.561205328f,0.567290366f,0.573365271f,0.579429090f,0.585480988f,0.591520011f,0.597545147f,0.603555679f,0.609550655f,0.615529120f,0.621490121f,0.627432823f,0.633356452f,0.639259815f,0.645142376f,0.651003003f,0.656840861f,0.662655175f,0.668444991f,0.674209356f,0.679947495f,0.685658634f,0.691341758f,0.696996033f,0.702620685f,0.708214760f,0.713777542f,0.719308138f,0.724805713f,0.730269432f,0.735698462f,0.741091967f,0.746449113f,0.751769185f,0.757051349f,0.762294888f,0.767498851f,0.772662520f,0.777785182f,0.782865882f,0.787904084f,0.792898953f,0.797849655f,0.802755594f,0.807615876f,0.812429786f,0.817196608f,0.821915746f,0.826586425f,0.831207871f,0.835779548f,0.840300560f,0.844770312f,0.849188089f,0.853553414f,0.857865453f,0.862123609f,0.866327167f,0.870475650f,0.874568224f,0.878604412f,0.882583618f,0.886505246f,0.890368640f,0.894173265f,0.897918463f,0.901603818f,0.905228615f,0.908792377f,0.912294626f,0.915734828f,0.919112384f,0.922426820f,0.925677657f,0.928864300f,0.931986451f,0.935043514f,0.938035071f,0.940960646f,0.943819880f,0.946612120f,0.949337244f,0.951994658f,0.954584002f,0.957104921f,0.959556937f,0.961939812f,0.964253068f,0.966496408f,0.968669534f,0.970772028f,0.972803712f,0.974764109f,0.976653039f,0.978470206f,0.980215251f,0.981888056f,0.983488262f,0.985015631f,0.986469984f,0.987851083f,0.989158690f,0.990392685f,0.991552711f,0.992638826f,0.993650675f,0.994588256f,0.995451331f,0.996239781f,0.996953487f,0.997592330f,0.998156309f,0.998645186f,0.999059081f,0.999397755f,0.999661207f,0.999849439f,0.999962330f,1.000000000f,0.999962330f,0.999849439f,0.999661207f,0.999397755f,0.999059081f,0.998645186f,0.998156309f,0.997592330f,0.996953487f,0.996239781f,0.995451331f,0.994588256f,0.993650675f,0.992638826f,0.991552711f,0.990392625f,0.989158630f,0.987851024f,0.986469984f,0.985015631f,0.983488202f,0.981888056f,0.980215251f,0.978470147f,0.976652980f,0.974764109f,0.972803652f,0.970772028f,0.968669474f,0.966496348f,0.964253008f,0.961939752f,0.959556937f,0.957104862f,0.954584002f,0.951994658f,0.949337184f,0.946612120f,0.943819821f,0.940960646f,0.938035011f,0.935043454f,0.931986392f,0.928864241f,0.925677598f,0.922426820f,0.919112325f,0.915734768f,0.912294626f,0.908792377f,0.905228496f,0.901603758f,0.897918463f,0.894173205f,0.890368581f,0.886505187f,0.882583618f,0.878604352f,0.874568224f,0.870475531f,0.866327107f,0.862123489f,0.857865334f,0.853553295f,0.849188089f,0.844770312f,0.840300500f,0.835779428f,0.831207871f,0.826586485f,0.821915805f,0.817196667f,0.812429786f,0.807615757f,0.802755475f,0.797849596f,0.792898893f,0.787904024f,0.782865822f,0.777785003f,0.772662401f,0.767498672f,0.762294650f,0.757051408f,0.751769185f,0.746449113f,0.741091847f,0.735698342f,0.730269313f,0.724805593f,0.719308019f,0.713777483f,0.708214700f,0.702620506f,0.696995854f,0.691341579f,0.685658634f,0.679947555f,0.674209356f,0.668444932f,0.662655115f,0.656840861f,0.651002944f,0.645142257f,0.639259756f,0.633356273f,0.627432704f,0.621489942f,0.615528882f,0.609550476f,0.603555739f,0.597545207f,0.591519952f,0.585480928f,0.579429030f,0.573365211f,0.567290306f,0.561205268f,0.555110991f,0.549008489f,0.542898536f,0.536782146f,0.530660212f,0.524533689f,0.518403649f,0.512270629f,0.506135762f,0.500000000f,0.493864208f,0.487729341f,0.481596321f,0.475466073f,0.469339550f,0.463217616f,0.457101226f,0.450991273f,0.444888741f,0.438794494f,0.432709694f,0.426634789f,0.420570940f,0.414519042f,0.408480018f,0.402454793f,0.396444261f,0.390449286f,0.384470850f,0.378509790f,0.372567058f,0.366643488f,0.360740006f,0.354857504f,0.348997056f,0.343159139f,0.337344855f,0.331555068f,0.325790644f,0.320052445f,0.314341336f,0.308658183f,0.303003877f,0.297379225f,0.291785091f,0.286222309f,0.280691743f,0.275194168f,0.269730687f,0.264301658f,0.258908093f,0.253550887f,0.248230785f,0.242948592f,0.237705082f,0.232501119f,0.227337420f,0.222214788f,0.217133969f,0.212095767f,0.207100928f,0.202150375f,0.197244495f,0.192384213f,0.187570244f,0.182803333f,0.178084195f,0.173413545f,0.168792039f,0.164220452f,0.159699410f,0.155229628f,0.150811762f,0.146446496f,0.142134458f,0.137876481f,0.133672893f,0.129524440f,0.125431806f,0.121395558f,0.117416352f,0.113494724f,0.109631330f,0.105826735f,0.102081478f,0.098396152f,0.094771326f,0.091207504f,0.087705255f,0.084265202f,0.080887645f,0.077573210f,0.074322402f,0.071135670f,0.068013549f,0.064956456f,0.061964899f,0.059039325f,0.056180120f,0.053387791f,0.050662696f,0.048005283f,0.045415938f,0.042895138f,0.040443063f,0.038060218f,0.035746962f,0.033503592f,0.031330466f,0.029227942f,0.027196318f,0.025235862f,0.023346931f,0.021529794f,0.019784689f,0.018111914f,0.016511708f,0.014984369f,0.013530016f,0.012148917f,0.010841310f,0.009607345f,0.008447230f,0.007361174f,0.006349266f,0.005411714f,0.004548669f,0.003760219f,0.003046513f,0.002407610f,0.001843691f,0.001354784f,0.000940949f,0.000602275f,0.000338823f,0.000150591f,0.000037640f};
|
| 8 |
-
static const float kWindowIstft[512]={0.000000000f,0.000037643f,0.000150636f,0.000339052f,0.000603001f,0.000942721f,0.001358460f,0.001850502f,0.002419262f,0.003065132f,0.003788634f,0.004590268f,0.005470635f,0.006430435f,0.007470345f,0.008591178f,0.009793720f,0.011078927f,0.012447727f,0.013901091f,0.015440158f,0.017066045f,0.018779933f,0.020583099f,0.022476831f,0.024462579f,0.026541721f,0.028715799f,0.030986369f,0.033355076f,0.035823613f,0.038393762f,0.041067336f,0.043846175f,0.046732344f,0.049727760f,0.052834507f,0.056054793f,0.059390787f,0.062844768f,0.066419035f,0.070115983f,0.073938102f,0.077887848f,0.081967823f,0.086180612f,0.090528898f,0.095015474f,0.099643029f,0.104414433f,0.109332465f,0.114400163f,0.119620338f,0.124996044f,0.130530313f,0.136226103f,0.142086491f,0.148114532f,0.154313326f,0.160685852f,0.167235300f,0.173964649f,0.180876896f,0.187975138f,0.195262194f,0.202741027f,0.210414499f,0.218285352f,0.226356342f,0.234629914f,0.243108571f,0.251794726f,0.260690540f,0.269798040f,0.279119104f,0.288655400f,0.298408300f,0.308379114f,0.318568796f,0.328978002f,0.339607298f,0.350456566f,0.361525714f,0.372814178f,0.384320676f,0.396044195f,0.407982856f,0.420134574f,0.432496190f,0.445064902f,0.457836926f,0.470807940f,0.483973116f,0.497327268f,0.510864496f,0.524578154f,0.538461030f,0.552505314f,0.566703022f,0.581044972f,0.595521569f,0.610122502f,0.624836743f,0.639652908f,0.654558957f,0.669541955f,0.684588730f,0.699685454f,0.714817703f,0.729970634f,0.745128810f,0.760276318f,0.775397778f,0.790476263f,0.805495143f,0.820437491f,0.835285962f,0.850023746f,0.864633441f,0.879097939f,0.893399775f,0.907522559f,0.921449006f,0.935163200f,0.948648632f,0.961889505f,0.974871635f,0.987579763f,1.000000000f,1.012119174f,1.023924589f,1.035404682f,1.046548128f,1.057345033f,1.067786217f,1.077863216f,1.087568879f,1.096896410f,1.105840683f,1.114396691f,1.122561932f,1.130333185f,1.137709022f,1.144688606f,1.151272774f,1.157462120f,1.163258672f,1.168665648f,1.173686624f,1.178325891f,1.182588696f,1.186480880f,1.190008640f,1.193178892f,1.195999861f,1.198479056f,1.200625062f,1.202446938f,1.203953624f,1.205154777f,1.206060171f,1.206679583f,1.207023382f,1.207101941f,1.206925273f,1.206504107f,1.205848813f,1.204969525f,1.203877091f,1.202582002f,1.201093912f,1.199423432f,1.197580338f,1.195574403f,1.193415403f,1.191112638f,1.188675642f,1.186113477f,1.183434486f,1.180647850f,1.177761555f,1.174783826f,1.171722770f,1.168585777f,1.165380359f,1.162113428f,1.158791900f,1.155422568f,1.152011514f,1.148565173f,1.145089269f,1.141589642f,1.138071179f,1.134539604f,1.130999446f,1.127455831f,1.123913050f,1.120375633f,1.116847396f,1.113332391f,1.109834313f,1.106356740f,1.102903008f,1.099476457f,1.096079826f,1.092716336f,1.089388609f,1.086099029f,1.082850099f,1.079644322f,1.076483607f,1.073370218f,1.070306182f,1.067292929f,1.064332485f,1.061426401f,1.058576345f,1.055783510f,1.053049326f,1.050375104f,1.047761917f,1.045210838f,1.042723060f,1.040299535f,1.037941217f,1.035648823f,1.033423185f,1.031265020f,1.029175043f,1.027153850f,1.025202036f,1.023320317f,1.021508932f,1.019768715f,1.018099546f,1.016502500f,1.014977455f,1.013525009f,1.012145281f,1.010838747f,1.009605408f,1.008446097f,1.007360339f,1.006348848f,1.005411506f,1.004548550f,1.003760099f,1.003046393f,1.002407670f,1.001843691f,1.001354814f,1.000940919f,1.000602245f,1.000338793f,1.000150561f,1.000037670f,1.000000000f,1.000037670f,1.000150561f,1.000338793f,1.000602245f,1.000940919f,1.001354814f,1.001843691f,1.002407670f,1.003046393f,1.003760099f,1.004548550f,1.005411506f,1.006348848f,1.007360339f,1.008446097f,1.009605527f,1.010838747f,1.012145281f,1.013525009f,1.014977455f,1.016502500f,1.018099546f,1.019768715f,1.021509051f,1.023320317f,1.025202036f,1.027153850f,1.029175043f,1.031265020f,1.033423305f,1.035648823f,1.037941337f,1.040299535f,1.042723179f,1.045210838f,1.047761917f,1.050375104f,1.053049326f,1.055783510f,1.058576345f,1.061426520f,1.064332604f,1.067293048f,1.070306182f,1.073370337f,1.076483607f,1.079644322f,1.082850099f,1.086099029f,1.089388609f,1.092716455f,1.096079946f,1.099476457f,1.102903128f,1.106356859f,1.109834313f,1.113332391f,1.116847515f,1.120375633f,1.123913288f,1.127455831f,1.130999684f,1.134539604f,1.138071299f,1.141589522f,1.145089269f,1.148565173f,1.152011633f,1.155422568f,1.158791780f,1.162113428f,1.165380359f,1.168585777f,1.171722889f,1.174784064f,1.177761674f,1.180647850f,1.183434486f,1.186113358f,1.188675761f,1.191112757f,1.193415523f,1.195574522f,1.197580218f,1.199423432f,1.201093912f,1.202582121f,1.203877211f,1.204969645f,1.205848694f,1.206503987f,1.206925273f,1.207101822f,1.207023382f,1.206679583f,1.206060171f,1.205154657f,1.203953505f,1.202446938f,1.200625181f,1.198479056f,1.195999742f,1.193179011f,1.190008402f,1.186480522f,1.182588577f,1.178325891f,1.173686504f,1.168665767f,1.163258553f,1.157461762f,1.151272535f,1.144688606f,1.137708902f,1.130333066f,1.122561932f,1.114396691f,1.105840325f,1.096896052f,1.087568521f,1.077862978f,1.067785859f,1.057344913f,1.046548009f,1.035404444f,1.023924470f,1.012119174f,1.000000000f,0.987579584f,0.974871576f,0.961889565f,0.948648214f,0.935162783f,0.921448827f,0.907522261f,0.893399596f,0.879097641f,0.864633322f,0.850023687f,0.835285962f,0.820437431f,0.805495083f,0.790476084f,0.775397897f,0.760276496f,0.745128453f,0.729970157f,0.714817286f,0.699685156f,0.684588373f,0.669541717f,0.654558659f,0.639652848f,0.624836743f,0.610122383f,0.595521450f,0.581044972f,0.566703022f,0.552505195f,0.538460672f,0.524577737f,0.510864139f,0.497327030f,0.483972847f,0.470807582f,0.457836568f,0.445064843f,0.432496071f,0.420134366f,0.407982856f,0.396044195f,0.384320647f,0.372813880f,0.361525506f,0.350456357f,0.339607030f,0.328977823f,0.318568528f,0.308378845f,0.298408270f,0.288655281f,0.279119045f,0.269797981f,0.260690540f,0.251794696f,0.243108526f,0.234629795f,0.226356164f,0.218285218f,0.210414335f,0.202740878f,0.195262000f,0.187974885f,0.180876866f,0.173964635f,0.167235255f,0.160685852f,0.154313266f,0.148114488f,0.142086402f,0.136225998f,0.130530223f,0.124995969f,0.119620211f,0.114400029f,0.109332360f,0.104414292f,0.099643014f,0.095015459f,0.090528898f,0.086180605f,0.081967779f,0.077887803f,0.073938027f,0.070115909f,0.066418968f,0.062844664f,0.059390724f,0.056054719f,0.052834440f,0.049727663f,0.046732340f,0.043846175f,0.041067299f,0.038393755f,0.035823610f,0.033355042f,0.030986337f,0.028715763f,0.026541660f,0.024462514f,0.022476798f,0.020583035f,0.018779872f,0.017065981f,0.015440158f,0.013901091f,0.012447694f,0.011078926f,0.009793719f,0.008591148f,0.007470345f,0.006430405f,0.005470605f,0.004590238f,0.003788603f,0.003065132f,0.002419232f,0.001850502f,0.001358460f,0.000942721f,0.000603001f,0.000339052f,0.000150636f,0.000037643f};
|
| 9 |
-
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|