Page 2 of 3
Re: How to increase FFT resolution?
Posted: Fri Mar 01, 2013 3:48 pm
by steve
fonon wrote:The "Size" parameter in "Analyze/Plot Spectrum" is still restricted to 2^14 samples (Windows version). Could you explain what it means and why the ranges of "window size" in "Preference/Spectrograms" and "size" in "Analyze/Plot Spectrum" are different?
I previously asked:
"Which FFT window size are you asking about? Plot Spectrum? Wave track spectrogram view? The Equalization effect? Somewhere else?"
Your reply was ambiguous. Do I take it that you are referring to "
Plot Spectrum"?
Other places where FFT size is implanted include the
Equalization effect and the track
Spectrogram view. The latter is set in
Spectrograms Preferences and it is here where the FFT size has options up to 2^15 and it is here where it is too slow to raise it higher than 2^15.
Re: How to increase FFT resolution?
Posted: Fri Mar 01, 2013 5:07 pm
by fonon
steve wrote:I previously asked:
"Which FFT window size are you asking about? Plot Spectrum? Wave track spectrogram view? The Equalization effect? Somewhere else?"
Your reply was ambiguous. Do I take it that you are referring to "
Plot Spectrum"?
OK. The second post in thread by Kozikowski was focused on "Plot Spectrum" and we are going this path. I need to do the spectral analysis of the wave file with numeric output. The "Analyse/Plot Spectrum" seems to be a corresponding option. How to increase the FFT window size used in this procedure up to 2^16 samples?
f.
Re: How to increase FFT resolution?
Posted: Fri Mar 01, 2013 5:37 pm
by steve
fonon wrote:OK. The second post in thread by Kozikowski was focused on "Plot Spectrum"
The post by Koz was about the Spectrogram preferences:
Audacity > Preferences > Spectrograms > FFT Window.
That's the only setting I know of.
Koz"
I suspected that this was not what you meant, which is why I asked.

Anyway, I think we're clear now that we are talking about "Plot Spectrum".
This seems to be a simple change and I agree that it could be useful when looking at lower frequencies.
The downside is (there had to be one didn't there

) is that spikes in the graph can become so thin that they are "invisible" for example, this is a 100 Hz square wave - you will notice that many of the expected harmonics cannot be seen with such a large FFT size, so this feature, if implemented, needs to be used intelligently.

- sqwave.png (41.55 KiB) Viewed 3399 times
I've attached a patch against the current "svn head" source code. If you'd like to test this and it works for you then I'll submit the patch to the developers for their review and consideration.
Re: How to increase FFT resolution?
Posted: Sat Mar 02, 2013 12:10 am
by Robert J. H.
If you only want the numerical values, you can as well use the ttf function of Nyquist. As far as I know, the bins are not limited.
A very simple example, that lets you hear the amplitudes within a saw-table. Resolution is 32768 bins. The resulting array is immediately reversed into a sound in order to modulate the sine tone.
Code: Select all
(setf sig (abs-env (osc (hz-to-step 2000)
(/ 32768 *sound-srate*) *saw-table*)))
(setf fft (snd-from-array 0 4410 (snd-fft sig 32768 32768 nil)))
(setf fft (snd-avg fft 30 1 op-peak))
(setf peak (peak fft ny:all))
(abs-env (hzosc (sum 440 (mult (/ 440.0 peak) fft))))
Re: How to increase FFT resolution?
Posted: Mon Mar 04, 2013 2:42 pm
by fonon
steve wrote:
I suspected that this was not what you meant, which is why I asked.

Anyway, I think we're clear now that we are talking about "Plot Spectrum".
My mistake! I'm very sorry. I must be blind.
steve wrote:
This seems to be a simple change and I agree that it could be useful when looking at lower frequencies.
The downside is (there had to be one didn't there

) is that spikes in the graph can become so thin that they are "invisible" for example, this is a 100 Hz square wave - you will notice that many of the expected harmonics cannot be seen with such a large FFT size, so this feature, if implemented, needs to be used intelligently.
The graph of amplitude spectrum is based on window size/2 data points.There is a problem with visualization of any high-resolution spectrum. The resolution of standard computer monitor doesn't exceed 2000 pixels in horizontal dimension. The spectrum calculated with window size over 2^12 samples can't be displayed properly on the screen in full. Fortunately, there is numeric output...
steve wrote:
I've attached a patch against the current "svn head" source code. If you'd like to test this and it works for you then I'll submit the patch to the developers for their review and consideration.
Unfortunately, I can't compile both svn and regular source code on my machine. I tried, but the operating system (MDV2011 x64) crashed due to upgrade of libraries requested by compiler. Now, I must reinstall it.
Regards,
f.
Re: How to increase FFT resolution?
Posted: Mon Mar 04, 2013 4:38 pm
by steve
fonon wrote:Unfortunately, I can't compile both svn and regular source code on my machine.
Not to worry.
I've submitted the patch for consideration.
Re: How to increase FFT resolution?
Posted: Fri Mar 08, 2013 5:29 pm
by steve
Update: The patch that I submitted has passed preliminary testing and has been marked as "patch_ready". The next step is "code review" by one of the developers, which involves checking that the code tackles the issue in the correct way and meets coding standards (it's a simple patch so I see no reason why it shouldn't), then. assuming that it is OK, the patch will be "committed", which means that it will appear in the next release of Audacity.
Re: How to increase FFT resolution?
Posted: Sat Mar 09, 2013 11:54 am
by fonon
Thank You very much. I'm waiting for the next release of Audacity! I have a few questions for other FFT analysis parameters. I want to start a new thread.
Regards,
f.
Re: How to increase FFT resolution?
Posted: Mon Apr 08, 2013 1:03 pm
by waxcylinder
I assume that as Steve has supplied his patch, then this FR does not require transferring to the Wiki - correct?
Peter.
Re: How to increase FFT resolution?
Posted: Mon Apr 08, 2013 5:23 pm
by steve
waxcylinder wrote:I assume that as Steve has supplied his patch, then this FR does not require transferring to the Wiki - correct?
It probably is worth putting on the wiki so that it does not get forgotten. It is currently logged on bugzilla as bug 622 (P4 Enhancement: marked "Patch Ready")