FFT not working

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
btb4198
Posts: 16
Joined: Fri Sep 26, 2014 12:31 pm
Operating System: Please select

FFT not working

Post by btb4198 » Mon Nov 17, 2014 3:33 pm

ok I am using this site to test :
http://onlinetonegenerator.com/

and I am using 261Hz and I am doing a sawtooth wave.
but the fft give me this back :
the highest point is 1291.992188 hz that is not close to 261 hz
please see attachments
Attachments
spectrum2.txt
(6.13 KiB) Downloaded 92 times

steve
Site Admin
Posts: 80679
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: FFT not working

Post by steve » Mon Nov 17, 2014 3:51 pm

The problem is probably the online generator.

This picture shows the online generator waveform (downloaded as a WAV file) in the top track, and an accurate 261 Hz saw wave below it.
Note that the waveform from the online generator is offset vertically from the centre line:
tracks004.png
tracks004.png (17.18 KiB) Viewed 2041 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

btb4198
Posts: 16
Joined: Fri Sep 26, 2014 12:31 pm
Operating System: Please select

Re: FFT not working

Post by btb4198 » Mon Nov 17, 2014 7:32 pm

ok if you download the file from the site ( and not just recording) and increase the Size to 4096 the fft seem to work.
also but how about this one
I did the Generate Pluck
Pluck MIDI pitch: 60 hz
and
when I do the fft I get
the peaks are 1832 hz and 3401 hz

that is not close at all

billw58
Forum Staff
Posts: 5565
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: FFT not working

Post by billw58 » Mon Nov 17, 2014 11:33 pm

MIDI Pitch 60 is not 60 Hz, it is middle C: 261.63 Hz.

In order to accurately show lower frequencies in the spectrogram you need to increase the Size, but I can see the 261 Hz peak with a size of 256 (although it reports as 253 Hz). Increasing the size to 4096 (not unreasonable) and changing to log frequency (not strictly necessary, but it makes it easier to see the low frequency peaks), Plot Spectrum reports a peak at 262 Hz.

-- Bill

steve
Site Admin
Posts: 80679
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: FFT not working

Post by steve » Tue Nov 18, 2014 6:32 am

btb4198 wrote:the peaks are 1832 hz and 3401 hz
Where do those numbers come from?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

btb4198
Posts: 16
Joined: Fri Sep 26, 2014 12:31 pm
Operating System: Please select

Re: FFT not working

Post by btb4198 » Tue Nov 18, 2014 4:32 pm

steve,

I got those numbers from the plot
please see the pic1.png and spectrum4.txt
Attachments
spectrum4.txt
(49.89 KiB) Downloaded 89 times
pic1.png
pic1.png (111.13 KiB) Viewed 2008 times

billw58
Forum Staff
Posts: 5565
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: FFT not working

Post by billw58 » Tue Nov 18, 2014 4:45 pm

btb4198 wrote: the peaks are 1832 hz and 3401 hz
I got those numbers from the plot
please see the pic1.png and spectrum4.txt
Your plot shows a fundamental at about 262 Hz, which is correct for a pluck at middle C.

The frequencies you've identified are the 7th and 13th harmonics.

Nobody said the fundamental would be the highest peak (although it often is).

The FFT (Plot Spectrum) is working fine.

-- Bill

btb4198
Posts: 16
Joined: Fri Sep 26, 2014 12:31 pm
Operating System: Please select

Re: FFT not working

Post by btb4198 » Tue Nov 18, 2014 5:30 pm

Bill
"Nobody said the fundamental would be the highest peak (although it often is)."

It is always...

how are you getting 261.63???

looking at this graphic i would not get that the fundamental F is 261.63
how are you getting that ?

steve
Site Admin
Posts: 80679
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: FFT not working

Post by steve » Tue Nov 18, 2014 6:03 pm

btb4198 wrote:how are you getting 261.63???
261.63 is the standard tuning for C4 (middle C) based on A440 tuning. Other standard frequencies can be found here: http://www.phy.mtu.edu/~suits/notefreqs.html
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

btb4198
Posts: 16
Joined: Fri Sep 26, 2014 12:31 pm
Operating System: Please select

Re: FFT not working

Post by btb4198 » Tue Nov 18, 2014 6:07 pm

I know that 261.63 is C4 or middle C
but how did you get that from looking that the graphic?

If I did not say that I did a MIDI Pitch 60 Pluck , would you know that the fundamental frequency 261.63 Hz from the graphic ?

that is what I am asking.

Post Reply