diff options
Diffstat (limited to 'src/audio/fft.cc')
| -rw-r--r-- | src/audio/fft.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/audio/fft.cc b/src/audio/fft.cc index 6029454..ddd442e 100644 --- a/src/audio/fft.cc +++ b/src/audio/fft.cc @@ -143,7 +143,8 @@ void dct_fft(const float* input, float* output, size_t N) { // IMDCT via FFT // Produces 2N time-domain samples from N MDCT coefficients. // Formula: x[n] = (2/N) * sum_{k=0}^{N-1} X[k] * cos(pi*(2n+1+N)*(2k+1)/(2N)) -// When windowed (Hann, length 2N) and OLA'd with hop N, gives perfect reconstruction. +// When windowed (Hann, length 2N) and OLA'd with hop N, gives perfect +// reconstruction. void imdct_fft(const float* input, float* output, size_t N) { const float PI = 3.14159265358979323846f; const size_t M = 2 * N; // output length @@ -172,7 +173,8 @@ void imdct_fft(const float* input, float* output, size_t N) { imag[i] *= scale; } - // Post-multiply by 2N * exp(-j*pi*(2n+1)/(4N)) and take real part, scale by 2/N + // Post-multiply by 2N * exp(-j*pi*(2n+1)/(4N)) and take real part, scale by + // 2/N const float gain = 2.0f; for (size_t n = 0; n < M; n++) { const float angle = -PI * (2.0f * n + 1.0f) / (4.0f * N); |
