Using Audacity 2.3.2, I found a bug while attempting to clean up a recorded file. Plot Spectrum indicated a peak of 58 Hz. When I applied a narrow (50.0) Notch Filter at 58 Hz, it made no difference. Turns out the actual peak was at 60 Hz; after I applied the Notch Filter at 60 Hz, Plot Spectrum showed the noise was gone.
Reproducing the bug is very easy...
1. Open a New file (File > New)
2. Generate > Tone...
3. Waveform: Sine, Frequency (Hz): 60, Amplitude (0-1): 0.25, Duration: 1.000s, click OK
4. Analyze > Plot Spectrum...
5. In the Frequency Analysis window (Algorithm: Spectrum, Size: 8192, Function: Rectangular, Axis: Log & make it as large as possible to see detail), place the cursor at the exact peak of the plot. Note the Cursor: value indicates the peak is at 59 Hz, while the Peak: value says 58 Hz (A#1). (But you know you generated a 60 Hz tone.)
If you wish, experiment with the Notch Filter to further examine the problem.
Plot Spectrum reports wrong peak Hz
Forum rules
This forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Re: Plot Spectrum reports wrong peak Hz
As shown below, I'm seeing the peak reported as 61 Hz, but you are using a different window function (I'm using the default "Hann" window as you can see)RichR wrote: ↑Fri Nov 15, 2019 5:20 pm5. In the Frequency Analysis window (Algorithm: Spectrum, Size: 8192, Function: Rectangular, Axis: Log & make it as large as possible to see detail), place the cursor at the exact peak of the plot. Note the Cursor: value indicates the peak is at 59 Hz, while the Peak: value says 58 Hz (A#1). (But you know you generated a 60 Hz tone.)
Plot Spectrum uses FFT analysis, which gives an approximation of the frequency spectrum. A larger window size gives a closer approximation on frequency values:
It's not a bug, it's a limitation of FFT analysis that the smaller the window, the less precise the approximation is.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Plot Spectrum reports wrong peak Hz
Hmm... knowing nothing about FFT analysis, I had supposed the smaller window would result in a more precise approximation.
However, I found using the 32768 window gave the proper results, no matter what tone I chose for my tests.
Good to know.
Thanks!
Re: Plot Spectrum reports wrong peak Hz
There is a bit of information about it, in not too technical language, here: https://manual.audacityteam.org/man/plot_spectrum.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)