summaryrefslogtreecommitdiff
path: root/src/fft.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fft.cpp')
-rw-r--r--src/fft.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/fft.cpp b/src/fft.cpp
index 8f94986..2802346 100644
--- a/src/fft.cpp
+++ b/src/fft.cpp
@@ -104,6 +104,11 @@ FFT::Compute(const ComplexWindow& input)
(void *) this->out_,
lhl * sizeof(fftw_complex));
+ /* fftw does not normalize; divide by the window size */
+ for (auto& v : output) {
+ v /= (double)output.size();
+ }
+
return output;
}
@@ -231,4 +236,4 @@ FFT::Crop(const RealWindow& input, double rate, double fmin, double fmax)
/* return corresponding subvector */
return RealWindow(input.begin() + i_fmin, input.begin() + i_fmax);
-} \ No newline at end of file
+}