[Bug] The numberOfFourierSamples may be changed after a window function is applied to the sound data in the menu command "View spectral slice“
fncokg opened this issue · comments
The sound editor has a menu command View spectral slice
, which calls the Sound_and_Spectrum
to do FFT. However, I noticed in the codes of this command, the selection was first applied to a window, and then passed to Sound_and_Spectrum
with the fast
argument set to true
.
praat/foned/SoundAnalysisArea.cpp
Lines 913 to 935 in c3a783d
However, with
fast
set to true
, the numberOfFourierSamples
is likely to be changed:praat/fon/Sound_and_Spectrum.cpp
Line 24 in c3a783d
This doesn't matter when the function is used to perform FFT to a whole sound, but in the case of the View spectral slice
call, the data passed in has already been added to a window. In this situation, narrowing the numberOfFourierSamples
is problematic.
The solution is setting the fast
argument in this line to false
to avoid narrowing the numberOfFourierSamples
.
praat/foned/SoundAnalysisArea.cpp
Line 932 in c3a783d
This will not, in most cases, cause a speed concern, since the command View spectral slice
is usually used to analyze a small segment of sounds.