[webkit-help] FFT normalization in RealtimeAnalyser

Info info at wothke.ch
Wed Aug 13 14:02:28 PDT 2014


In order to understand the idiotic differences between the data ranges  
of the AnalyzerNode's getFloatFrequencyData() and  
getByteFrequencyData() APIs I finally found myself analyzing the  
WebKit sources:  
https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp

What surprises me there is the:
     const double magnitudeScale = 1.0 / DefaultFFTSize;
which is used to normalize the FFT results (see  
RealtimeAnalyser::doFFTAnalysis()).

Should the correct scaling factor not rather be: 2/actualFftSize?




More information about the webkit-help mailing list