question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FFT spectrum normalization

See original GitHub issue

Hello, @corbanbrook I have some question regarding the normalization of FFT results. See the link:

https://github.com/corbanbrook/dsp.js/blob/master/dsp.js#L269

Why you choose bSi = 2 / this.bufferSize? In general, to return a FFT amplitude equal to the amplitude signal which performs in FFT, need to normalize FFT data by the number of sample points. Like this:

bSi = 1 / this.bufferSize

I think it’s a bug.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
tekheddcommented, Mar 13, 2018

I also believe this is a bug. To test it empirically (hey why not), I calculated the RMS of the input signal and the RMS of the transformed signal. They should be ~equal. The default is simply wrong. If you change to 1 (or divide the magnitude of the output bins by 2) the results are correct within 5-6% for noise signals and look like a rounding error for a pure sine input.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FFT Normalisation for Beginners (really it's just for me)
Hi are the (complex) FFT values. • Parseval's theorem should be true for any well behaved FFT algorithm. • It can be used...
Read more >
FFT normalization - signal processing - Stack Overflow
Common trick: take FFT of known signal and normalize by the value of the peak. Say in the above example your peak is...
Read more >
How to Normalize a fft to plot in frequency domain? - MathWorks
When I plot the frequency domain the power is not 3 and 5 as I expect. I read the documentation for fft() and...
Read more >
fourier transform - FFT and Power Spectrum Normalization
On many websites, including MathWorks, it was suggested to normalize the fft spectrum (MATLAB or numpy) by dividing it by the total number ......
Read more >
The Fundamentals of FFT-Based Signal Analysis and ...
The Fast Fourier Transform (FFT) and the power spectrum are powerful ... Bandwidth of PCI-4450 Family Input Versus Frequency, Normalized to Sampling Rate....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found