HydrogenAudio

Hydrogenaudio Forum => Scientific Discussion => Topic started by: Ethan Winer on 2010-03-27 20:41:30

Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2010-03-27 20:41:30
Folks,

I'd like to learn more about FFTs. I'm not a math guy, so I imagine I'll never fully understand all the nuances. But I'd like to try anyway. I understand the general concept, that an FFT shows how much energy is present at different frequencies. What I'd like to know is how to set the various parameters such as FFT Size and Overlap, when to use the different types of window smoothing and why, and so forth. Below is a list of settings in the Rightmark FFT analyzer with my associated questions, and hopefully this is a good place to start.

[blockquote]FFT Size: I understand that the higher the number, the better the frequency resolution. So why is this
even adjustable? Why not just use the highest resolution possible automatically?

Zero Padding: This ranges from None through 8x. What does this do?

FFT Overlap: What is this for, and when would you use higher or lower values?

FFT Window: I recognize some of the names, but have no idea when or why one would select these choices.

Kaiser Window beta: I have no idea what this does either.

I noticed that Sound Forge lets you pick the number of slices to show. What are slices and why is more than
one needed to analyze a Wave file?[/blockquote]
I realize this is a lot to ask! If anyone knows of a good newbie-level tutorial that explains this in plain English with minimal math, I'd love to see it. Everything I've found through Google starts right in with math that's way over my head.

--Ethan
Title: FFT Analysis for Dummies
Post by: lvqcl on 2010-03-27 21:23:26
[indent]FFT Size: I understand that the higher the number, the better the frequency resolution. So why is this
even adjustable? Why not just use the highest resolution possible automatically?

"better frequency resolution" means "worse time resolution", and vice versa.

FFT Window: I recognize some of the names, but have no idea when or why one would select these choices.

Kaiser Window beta: I have no idea what this does either.

There's a good Wikipedia article about window functions (http://en.wikipedia.org/wiki/Window_function):
Quote
In summary, spectral analysis involves a tradeoff between resolving comparable strength signals with similar frequencies and resolving disparate strength signals with dissimilar frequencies. That tradeoff occurs when the window function is chosen.
Title: FFT Analysis for Dummies
Post by: Paulhoff on 2010-03-27 21:46:50
"better frequency resolution" means "worse time resolution", and vice versa.


Believe it or not, this still means very little.

Not everyone uses the same words the same way.   

Paul

       

Title: FFT Analysis for Dummies
Post by: AndyH-ha on 2010-03-27 22:36:45
In most music the frequency changes over time. Very often there are multiple frequecies present at any given instant. If the frequencies are resolved more fully for a given period of time, for instance, displayed as graphic or numerical data, the information of when any particular frequency occurs in the selected period is less precisely available.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2010-03-28 00:00:35
Ok.

An FFT is a discrete-time, finite length linear algebraic transform. It is orthonormal, which is to say it is a tight frame, or 1 to 1 and onto.

It uses a set of basis vectors that are derived directly from the complex exponential used in the continuous-time, continuous-frequency Fourier Transform.

As a result of the periodic nature of the FFT basis vectors, it is periodic across block boundaries, i.e. it looks like the data repeats to infinity, if you are doing a 2-point fft on two values, say 1 and -1 (yes, that's ridiculous, but it makes the point), the result is the same as calculating the full integral form on the infinite sequence 1 -1 1 -1 1 -1 1 -1 1 -1 ....

Among other things, this means that for signals that are not periodic at a block length, there will be a discontinuity at the ends.

This is why you do windowing, it removes the discontinuity at the ends of the block by windowing the signal to zero.

A window is nothing but the impulse response of a lowpass filter with specific properties.

I have to go shopping. So more later?

Some points, an FFT is not an approximation, nor is it a model. It is a precise transform with a precise inverse, one that obeys power and amplitude conservation both in the time and short-term frequency domain. In this it is actually marginally more precise than the full Fourier Transform, which suffers some zero-power, small amplitude issues, but that only with signals that can not exist in the real world, perhaps outside of astrophysics.

Must go, spouse grumbling.
Title: FFT Analysis for Dummies
Post by: Notat on 2010-03-28 00:55:28
I'm not a super math dude but I have been reading math texts lately and I'm going to give this a try. If you don't know it, you can't teach it and all. Please be kind.

First off FFT refers to an optimized implementation of the discrete Fourier transform (DFT). The FFT produces the same results as a DFT.
The discrete Fouier transform is for sampled data (i.e. digital audio).

The basic idea is you transform a block of samples representing signal intensity from time 0 to time N to a block of samples representing frequency intensity from frequency 0 to frequency N. N is the window or block size. If you choose N large (e.g. as long as a whole track) you'll get detailed frequency information for the whole track but you won't have a clue where in the track those components exist. Using numerous shorter blocks, you can pinpoint where in time the various frequencies are occurring (e.g. when which notes are being played) but in using the shorter block you only get a coarse idea about what frequencies are present (e.g. can't distinguish C from C#).

To overcome this, frequency analysis applications will often use the longer blocks and instead of placing them one after another, the blocks will be overlapped. This sort of gives you the best of both worlds. I does require more processing to do the transform - if your overlap is 50%, you are computing FFTs for twice as many samples.

When you edit audio on a workstation you create clicks or other artifacts at the edit points. We have this same problem when we edit audio to do FFTs. In editing, we address this by cross fading at the edit points. And that's exactly what we do with FFTs. We apply an envelope to the audio data in each block (fade it up at the beginning, fade it back down at the end) before performing the FFT. Mathemiticians call these envelopes "windows". There are many shapes of windows because there are many compromises to be made when you're slicing and dicing like this.
Title: FFT Analysis for Dummies
Post by: hellokeith on 2010-03-28 04:02:48
I had a very informative conversation about transforms with SebastianG that seems relevant to post in this thread:

You have PCM data and perform a transform to get a spectral view. Is this an exact process or is there more than one way (transform) to do it?
Quote
Generating spectral views a la Cool Edit (http://images.google.de/images?q=cool%20edit%20spectral%20view) is usually done by applying the FFT on overlapping "windows" (portions of the signal). There are a lot of possibilities regarding windowing functions, block size, how blocks overlap etc, though. Also, what you see -- coded via color -- is also just one half of the information (amplitude) and the phase informations are lost during display.


After the transform, can the data be stored in a "frequency" view and then losslessly transformed back into standard PCM data?
Quote
What's the point in going back? What are you aiming for? What exactly do you mean by "view"? There are various ways for these kinds of transformations with different trade-offs. There are those that blow up the amount of data (non-critically sampled) and those that retain the amount of data (critically-sampled) which are used in many lossy codecs for example. The latter group is full of different time/frequency resolution trade-offs and other things like phase response that can be considered. A prominent example is the MDCT (used by MP3,AAC,Vorbis,WMA). Mathematically the MDCT (the transform as a whole on many consecutive blocks with special care taken at the start and end) is reversible. In practise, however, computers work with finite precision arithmetics which means that rounding errors accumulate. So, it's not exactly lossless. But there is a way to make it work even for lossless codecs which is what Fraunhofer did (IntMDCT (http://www.google.de/search?q=IntMDCT+multidimensional+lifting)).


Is there any correlation between wordlength (16 bit vs 24 bit) and how the spectral content will be distributed/displayed?
Quote
These kinds of transform are usually defined on real numbers and applied with the help of floating point numbers in practise. No notion of wordlength. If you convert your signal from 24 bits to 16 bits then you're usually adding noise which can affect your "spectral view". In any case (16 or 24) you'd convert the samples to floating point numbers and run the FFT or something like that.

Cheers,
SG
Title: FFT Analysis for Dummies
Post by: Arnold B. Krueger on 2010-03-28 04:26:36
After the transform, can the data be stored in a "frequency" view and then losslessly transformed back into standard PCM data?


No.  In order to route data through a FFT transform, and then back through the inverse, and get your origional data back, you must use both the amplitude and phase information that the FFT produces. Only the amplitude information is required for a frequency analysis.

Here is one of the best discussions of FFT filtering that I've found yet:

A FFT filtering tool from the world of communicaions that may have more general usage (http://www.dxzone.com/cgi-bin/dir/jump2.cgi?ID=9270)
Title: FFT Analysis for Dummies
Post by: Woodinville on 2010-03-28 05:23:10
The basic idea is you transform a block of samples representing signal intensity from time 0 to time N to a block of samples representing frequency intensity from frequency 0 to frequency N. N is the window or block size.


If you have 'n' real-valued samples (i.e. no complex numbers on input, as most PCM supplies) you have n/2 +1 complex frequency values, where (starting at n=0 for DC and ending at n=N/2 for Nyquist) you have two real values (DC and Nyquist) and N/2-2 complex values. The complex values are echoed (by conjugation, i.e. changing the sign of the imaginary part) at the negative frequencies (for a real signal, you have both positive and negative frequencies, one is the complex conjugate value of the other).

There are other transforms (DCT, DST, etc) that are real to real, and that provide N frequency components instead of N/2 complex components, effectively, but then phase is encoded in interesting ways inside of twice as many real values.

While it may seem odd that you have N/2 components, they are complex, so you actually have N results, half real, half imaginary.
Title: FFT Analysis for Dummies
Post by: honestguv on 2010-03-28 10:46:16
Ethan, perhaps the best single resource to answer this type of question is the Bruel and Kjaer online library:

http://www.bksv.com/Library/Technical%20Re...mp;st=1984-1980 (http://www.bksv.com/Library/Technical%20Reviews.aspx?year=1984-1980&st=1984-1980)

The publications are not only aimed at engineers but also technicians and some at wholly non-technical people. There is rather a lot of information but I would suggest starting by browsing the earlier publications since the more complete explanations were often given when the techniques were relatively new.
Title: FFT Analysis for Dummies
Post by: Notat on 2010-03-28 14:45:48
While it may seem odd that you have N/2 components, they are complex, so you actually have N results, half real, half imaginary.

Thanks JJ. Dumbing it down a little bit: You start with N samples. The DCT produces N/2 frequency amplitude results and N/2 corresponding phase results. The phase information is typically discarded in spectral analysis applications.
Title: FFT Analysis for Dummies
Post by: benski on 2010-03-28 16:53:37
Answering a bit more than your question asks, for anyone else who might be interested in this thread.

A transform is just a different way of representing the same set of data.  If we have three samples, 4, 7 and 12, we could use a polynomial transform and use transformed coefficients of 4, 2, 1 and recreate the original samples through the equation a + b * x + c * x^2 by plugging in x for each sample (f(0) = 4, f(1) = 7, f(2) = 12).  We havn't stored any less or any more data by using the transform rather than the samples, and we can change between them without loss.

A fourier transform is the same thing, but the equation to recreate the samples is a + b*sin(x) + c*cos(x) + d*sin(2x) + e*cos(2x) + ...
Taking the fourier transform is done by solving a giant system of equations to determine the correct coefficients to recreate the original samples out of this equation.
The fourier transform has the nice property that it it transforms the sample data into a representation that models the human ear (and other physical systems) very well.

When we take the FT (via FFT or DFT) of a large audio file, we are going to get coefficients representing different frequency bands.  Unfortunately, this information gives us only the average energy of each frequency band, not the precise occurrence of the frequency within the song.  If you had a weird high-pitch noise in some small section of the song, you could see it in the spectrograph, but would have no idea where it occurs.  Just as looking at the streaming of audio samples gives you "time" data but no frequency information.  The frequency coefficients of a fourier transform give you "frequency" data but no time information.

To work around this issue, we take the FT of sub-sections of the song called windows.  A smaller window gives us less frequency bands, but if we see the weird high-pitched noise, at least we've narrowed it down to the current window.  In the FT lingo, you can tradeoff "time resolution" and "frequency resolution" by using smaller or larger windows of audio.  In Sound Forge, "FFT Size" corresponds to window size.  At the extreme smaller end of window sizes, you have something called "Short Time Fourier Transform" which is often doing an FFT with windows of 4 samples.  Wavelets are used when time and frequency resolution need to be adjusted more precisely, but that's a conversation for another day

When you see a spectrogram (2D spectrograph over time), it is a series of windowed FTs.  Each vertical "strip" is one window.

Windowing the audio, however, causes an annoying artifact.  If you were to play the sub-section of audio out of your speakers, you'd likely get a 'click' at the beginning and the end since they don't occur at zero crossings.  It shows up as noise in the spectrograph just like it shows up as noise on the speakers.  And because you can't tell "where" the noise occurs within the window, there's no way to isolate it out.  You can see this phenomenon in low bitrate video as "blocking" artifacts - same reason.  A windowing function is using to avoid these blocking artifacts.  Conceptually, it fades in the start of the window and fades out the end of the window.

But as you can imagine, a windowing function is also destroying out data.  This is where overlap comes in.  If we let the windows overlap each other - e.g. first window is samples 0 through 1023 and the second window is samples 512 through 1535, we can avoid destroying the data.  This is because the audio we "faded out" during the current window becomes part of the "fade in" of the next window.  The downside of the windowing function is that the data has "smeared" itself across two windows.  Different windowing functions change the amount of smear, allowing a trade-off between blocking artifacts and smear.

Hope that helps.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2010-03-28 16:59:36
Thanks for the advice and links. I thought to Google "FFT for dummies" and found a few more. I'm reading through this one now:

http://www.dspdimension.com/admin/dft-a-pied/ (http://www.dspdimension.com/admin/dft-a-pied/)

I'll be back with questions. I promise.

--Ethan
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2010-03-29 18:16:08
Okay, I have a few quick questions:

In Sound Forge I can select a portion of a Wave file for analysis, but I see no equivalent feature in the Rightmark analyzer. Is there a way to do that? If not, where in the file does Rightmark grab the specified number of samples to analyze?

Let's say I have a long wave file and I load it into Sound Forge and select a 5-second section. I understand that the FFT Size is the number of samples to analyze. But if my highlighted section is 5 seconds long, from where does Sound Forge take those samples? Are they contiguous? Does it skip every third sample so the total number (say, 65,536) starts at the beginning of the highlighted area and ends at the end? I realize the total number of samples dictates the lowest frequency that can be read, so that implies contiguous.

I have other questions, but I won't overload y'all for now. Also, assume that the two reasons I want to use FFT are:

1) To measure the frequency response of something, for example after passing white or pink noise through it.

2) To see the spectral content in a music file, as if I were to try to apply EQ in one audio file to match another as Harbal does. I'm not interested in doing such EQ matching! But I might want to know what frequencies are present in a music file and in what amounts.

--Ethan
Title: FFT Analysis for Dummies
Post by: ExUser on 2010-03-29 18:35:39
Thanks JJ. Dumbing it down a little bit: You start with N samples. The DCT produces N/2 frequency amplitude results and N/2 corresponding phase results. The phase information is typically discarded in spectral analysis applications.
I think you used the wrong word here. The DCT produces N real outputs from N real inputs.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2010-03-30 00:10:17
While it may seem odd that you have N/2 components, they are complex, so you actually have N results, half real, half imaginary.

Thanks JJ. Dumbing it down a little bit: You start with N samples. The DCT produces N/2 frequency amplitude results and N/2 corresponding phase results. The phase information is typically discarded in spectral analysis applications.



You meant DFT ...

DCT is real to real.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2010-03-30 00:13:55
Note:

I generally point at "Fourier Analysis" by Norman Morrison as a good primer.

Warning: Mathematics will be involved.
Title: FFT Analysis for Dummies
Post by: Arnold B. Krueger on 2010-03-30 02:14:23
Okay, I have a few quick questions:

In Sound Forge I can select a portion of a Wave file for analysis, but I see no equivalent feature in the Rightmark analyzer. Is there a way to do that? If not, where in the file does Rightmark grab the specified number of samples to analyze?


You'd need a waveform screen to do that. I see none in RMAA. The assmuption is that you edited the data before you ran the analysis.


Quote
Let's say I have a long wave file and I load it into Sound Forge and select a 5-second section. I understand that the FFT Size is the number of samples to analyze. But if my highlighted section is 5 seconds long, from where does Sound Forge take those samples?


If the sample is larger than the size of the FFT, then the program walks usually down the wave, repeating the FFT over and over again on each chunk, and averaging the spectral information.

Quote
Are they contiguous?


Not unless the chunks are overlapping. Soem programs let you specify overalp

Quote
Does it skip every third sample so the total number (say, 65,536) starts at the beginning of the highlighted area and ends at the end?


No. That would give you a FFT of a different wave. The dopped samples would have the effect of changing the frequency of the wave you were analyzing.


Quote
I have other questions, but I won't overload y'all for now. Also, assume that the two reasons I want to use FFT are:

1) To measure the frequency response of something, for example after passing white or pink noise through it.


Right. This only works easily if the test signal is in some sense flat. The good news is that white and pink noise are in some sense flat.  This also works with multitones, if you are willing to look at a FR curve that is a series of peaks that are supposed to be the same height.

Quote
2) To see the spectral content in a music file, as if I were to try to apply EQ in one audio file to match another as Harbal does. I'm not interested in doing such EQ matching! But I might want to know what frequencies are present in a music file and in what amounts.


IME Eq is something you always apply by ear, unless you have some very special technical purpose.

Title: FFT Analysis for Dummies
Post by: Notat on 2010-03-30 03:15:42
You meant DFT ...

DCT is real to real.

Yes, I did. We'll do DCT another day.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2010-03-30 21:02:43
You'd need a waveform screen to do that. I see none in RMAA. The assmuption is that you edited the data before you ran the analysis.

Excellent Arnie, thanks for that and all the other answers.

--Ethan
Title: FFT Analysis for Dummies
Post by: Woodinville on 2010-03-30 21:20:22
You meant DFT ...

DCT is real to real.

Yes, I did. We'll do DCT another day.


Should we start a thread on the mathematics of orthonormal transforms?
Title: FFT Analysis for Dummies
Post by: ExUser on 2010-03-30 21:32:37
I say we start with the Z-transform and express everything else as special cases of that!
Title: FFT Analysis for Dummies
Post by: Woodinville on 2010-03-30 21:50:17
I say we start with the Z-transform and express everything else as special cases of that!


Naah, we should stick to continuous infinite length systems, and functional algebra
Title: FFT Analysis for Dummies
Post by: Alexey Lukin on 2010-04-03 18:52:12
In Sound Forge I can select a portion of a Wave file for analysis, but I see no equivalent feature in the Rightmark analyzer. Is there a way to do that? If not, where in the file does Rightmark grab the specified number of samples to analyze?

RMAA always analyzes the whole WAV file that you load and averages spectrum over all FFT blocks.
For more flexible analysis (including spectrograms) I recommend downloading a demo of iZotope RX (http://www.izotope.com/products/audio/rx/). It doesn't require authorization to perform analysis. Here's a few screenshots:
(http://audio.rightmark.org/lukin/temp/rmm/CellPhone.png)

(http://audio.rightmark.org/lukin/temp/rmm/TruncateVsDither.png)


FFT Size: I understand that the higher the number, the better the frequency resolution. So why is this
even adjustable? Why not just use the highest resolution possible automatically?

Because smaller FFT size will allow you to spread more FFT windows throughout the file and get less noise variance due to averaging of spectra.


Zero Padding: This ranges from None through 8x. What does this do?

This is a frequency interpolation of the resulting spectrum, it will allow you to better see what is happening "between the FFT bins".


FFT Overlap: What is this for, and when would you use higher or lower values?

It tells how densely FFT windows cover the WAV file, and how "evenly" the file is analyzed. More overlap does better averaging of spectrum (more is typically better for this parameter).


FFT Window: I recognize some of the names, but have no idea when or why one would select these choices.

It's a subtle moment: they control shape of spectral peaks. "Stronger" windows somewhat widen peaks (which can be compensated by increasing FFT size), but suppress "false" surrounding "skirts" around these peaks. Rectangular is "weakest", Kaiser with high "beta" is "strongest".


Kaiser Window beta: I have no idea what this does either.

It's the strength of a window's ability to suppress "false" surrounding around spectral peaks (at the expense of slight widening of peaks).


What are slices and why is more than
one needed to analyze a Wave file?

Averaging spectrum across many slices allows you to reduce noise variance and see white or pink noise more as lines rather than clouds of random data.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2010-04-04 17:47:00
Thanks very much Alexey! Lots for me to digest.

--Ethan
Title: FFT Analysis for Dummies
Post by: C.R.Helmrich on 2010-04-04 18:21:03
Back in the days I learned the discrete Fourier transform with this online book (http://www.dspguide.com/pdfbook.htm). I still recommend it to anyone new to the subject. It uses very simple math and a lot of pictures.

Chris
Title: FFT Analysis for Dummies
Post by: Arnold B. Krueger on 2010-04-05 12:21:04
Back in the days I learned the discrete Fourier transform with this online book (http://www.dspguide.com/pdfbook.htm). I still recommend it to anyone new to the subject. It uses very simple math and a lot of pictures.


Looks like an interesting book.

In it I find the following:

"If the input to a linear system is a sinusoidal wave, the output will also be a sinusoidal wave, and at exactly the same frequency as the input."

This supports a claim I made recently here that a linear system creates no new frequencies from any signal that is fed into it.
Title: FFT Analysis for Dummies
Post by: SebastianG on 2010-04-05 16:39:42
This supports a claim I made recently here that a linear system creates no new frequencies from any signal that is fed into it.

Linearity alone isn't sufficient. Your system also needs to be "time invariant" (or "shift invariant", different term, same thing). Unfortunately, people often say just "linear" meaning "linear and time-invariant".

Cheers,
SG
Title: FFT Analysis for Dummies
Post by: hypervelocity on 2011-04-26 14:43:08
Hello guys,

I'm working on my undergraduate thesis, and our topic revolves around the FFT.

Quick question: How do you pick the appropriate N for the transform? Is there any specific rule in selecting N?
Title: FFT Analysis for Dummies
Post by: pdq on 2011-04-26 16:16:17
That would depend on the sampling rate of your data and the desired frequency resolution of the transform.
Title: FFT Analysis for Dummies
Post by: Arnold B. Krueger on 2011-05-02 13:42:13
Hello guys,

I'm working on my undergraduate thesis, and our topic revolves around the FFT.

Quick question: How do you pick the appropriate N for the transform? Is there any specific rule in selecting N?



First off, select N large enough to obtain the desired low frequency bandpass. ;-)

The other number to worry about is the number of individual analyses that you nned to average together for your "final answer".

Many of the things that you analyze aren't really all that time-invariant. That is especially true of acoustics, particularly the acoustics of large spaces. One scary thing is the fact that the acoustics of a space can wander around by several dB while you are measuring it.  So, you need to average a bunch of measurements to get your results to converge to their mean.
Title: FFT Analysis for Dummies
Post by: Natalia on 2012-01-12 07:49:38
Hi guys!

I am trying to sort out samples according to their peak frequency, but one sample which I expected to show a certain frequency showed the tallest peak at a frequency twice as high as the one I expected (there is a second but shorter peak at the expected frequency as well). Does it mean something, or it's just a coincidence? Can the fundamental frequency appearing on the spectrogram be doubled due to some logical reasons?

Thank you! 
Title: FFT Analysis for Dummies
Post by: xnor on 2012-01-12 17:10:59
I am trying to sort out samples according to their peak frequency

If I understand you right you're trying to find out which time-domain samples contribute most to certain peaks in the frequency response??
Either that or you're confusing samples with frequency bins.

Quote
but one sample which I expected to show a certain frequency showed the tallest peak at a frequency twice as high as the one I expected

One sample doesn't show a certain frequency. An impulse results in a flat line in the frequency domain.

Quote
Can the fundamental frequency appearing on the spectrogram be doubled due to some logical reasons?

I'm not sure I understand but it looks like there's a bug in your code that changes the fft size or sampling rate or ...
Title: FFT Analysis for Dummies
Post by: Natalia on 2012-01-13 00:49:20
Well, I guess I should've made it clear from the beginning.

It's not audio samples I'm studying; I am doing functional MRI, studying activation of the brain to a certain auditory stimuli (presented every 68 seconds) and I ran independent component analysis on scanned images - it decomposes brain networks into statistically independent spatial maps (components) based upon similarity of their time courses.

So I am running FFT on time courses of each separated component (brain network), and I expect certain components (such as auditory cortex and auditory centers) to have fundamental frequency matching with that of auditory stimulus presentation (i.e., 68 seconds=0.147 Hz), meaning that these networks activate in response to the stimulus.

Almost all of them showed it correctly but one which is very much auditory-looking have only a second tall peak at the desired frequency (0.0147 Hz), and the first tall (the tallest) peak is at 0.296 Hz, which is basically the double of stimulus frequency.

I am sorry if this is not the place I should be asking such questions, but I am very new to FFT and I have now idea if this double frequency peak is just a coincidence or it can happen due to some logical reasons.

I use Matlab to run FFT, and I am sure the script works fine as it showed no problems for the other analyses and components.

Sorry if this explanation took too long  I will be grateful for any insight on the matter.

Thank you!
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-13 01:08:43
The irony of this thread being ressurrected is:

http://www.aes.org/sections/pnw/ (http://www.aes.org/sections/pnw/)

Title: FFT Analysis for Dummies
Post by: Natalia on 2012-01-13 01:55:25
Wish I could attend
Title: FFT Analysis for Dummies
Post by: xnor on 2012-01-13 10:41:19
Natalie, do these stimuli cause spikes every 68 seconds or are they really sinusoidal waves with very low frequency such as 0.147 Hz? (btw, 1/68 = 0.0147 Hz)
Anyway, I'm not sure I can be of any help since you said almost all of them looked correctly. I was guessing that your fft size might not be large enough -> too low resolution in the freq. domain, but on the other hand I don't think that your sampling rate (number of measured samples per second) is very high so that seems to be fine too (resolution = Fs/N).
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2012-01-13 16:48:21
http://www.aes.org/sections/pnw/ (http://www.aes.org/sections/pnw/)


Oh geez, I really wish I could attend.

--Ethan
Title: FFT Analysis for Dummies
Post by: Kees de Visser on 2012-01-13 18:03:29
Oh geez, I really wish I could attend.
You're probably not the only one. Will it be recorded ?
BTW, judging by the "Nearby Eateries" it's in Fast Food Town.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-14 22:14:31
Oh geez, I really wish I could attend.
You're probably not the only one. Will it be recorded ?
BTW, judging by the "Nearby Eateries" it's in Fast Food Town.


It's on Microsoft campus, so kinda ...

We have real restaurants, too.
Title: FFT Analysis for Dummies
Post by: C.R.Helmrich on 2012-01-14 22:48:23
I am sorry if this is not the place I should be asking such questions, but I am very new to FFT and I have now idea if this double frequency peak is just a coincidence or it can happen due to some logical reasons.

In audio analysis, it's quite possible to find a frequency which is twice or half as high as the "true" frequency. Since you seem to be new to the subject: have you heard of - or done - windowing (http://en.wikipedia.org/wiki/Window_function) and DC removal (http://en.wikipedia.org/wiki/DC_offset) prior to computing the FFT? And how long (in seconds) is your time course of which you compute the FFT?

Chris
Title: FFT Analysis for Dummies
Post by: Gumboot on 2012-01-14 23:25:42
Some points, an FFT is not an approximation, nor is it a model. It is a precise transform with a precise inverse, one that obeys power and amplitude conservation both in the time and short-term frequency domain.


I take exception to this.  An FFT, like anything else, is a model and/or an approximation if it is used as such.  Sometimes 3 is an approximation of pi.  There's no fantastic mathematical property that can stop something from being used as a very blunt instrument.
Title: FFT Analysis for Dummies
Post by: xnor on 2012-01-14 23:40:58
I take exception to this.  An FFT, like anything else, is a model and/or an approximation if it is used as such.  Sometimes 3 is an approximation of pi.  There's no fantastic mathematical property that can stop something from being used as a very blunt instrument.

Because 3 is an approximation of pi, pi itself is an approximation? Because 0.3425 + 0.4354 cannot be represented exactly with 32 bit floating numbers, addition is just an approximation? I hope you see where this is heading...

It's an invertible, discrete, linear transformation.
Title: FFT Analysis for Dummies
Post by: ExUser on 2012-01-15 00:05:53
Oh geez, I really wish I could attend.
I know exactly how you feel. The sad part is, the way things are going, in a couple months it would be possible for me. Oh well, there will be future PNW meetings. I will come down from Vancouver to attend one sooner or later.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-15 00:26:42
Some points, an FFT is not an approximation, nor is it a model. It is a precise transform with a precise inverse, one that obeys power and amplitude conservation both in the time and short-term frequency domain.


I take exception to this.  An FFT, like anything else, is a model and/or an approximation if it is used as such.  Sometimes 3 is an approximation of pi.  There's no fantastic mathematical property that can stop something from being used as a very blunt instrument.



No, an FFT is an orthonormal projection, no matter how it's used. It's not the FFT's fault (it has no violition, so how can it be) if somebody uses it in a particular way.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-27 01:50:17
Slide deck and octave scripts are up at www.aes.org/sections/pnw

Will try to get recording somehow.

Still making no sense of the "approximation" thing.  An orthonormal transform is what it is.
Title: FFT Analysis for Dummies
Post by: neelX on 2012-01-27 10:49:13
Slide deck and octave scripts are up at www.aes.org/sections/pnw


404 on the two .zip files :/
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-27 23:13:34
Slide deck and octave scripts are up at www.aes.org/sections/pnw


404 on the two .zip files :/


Should be fixed.  If you still have trouble let me know and I'll pass it along.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-28 04:19:30
.zip files still fubar. Webmaster pinged.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-28 10:56:29
.zip fixed.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2012-01-28 17:50:44
.zip fixed.


Great! But what's an ".m" file and how do you open it?

--Ethan
Title: FFT Analysis for Dummies
Post by: xnor on 2012-01-28 19:01:04
The .m files are scripts for GNU Octave, but you can open them with any text editor.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2012-01-29 18:09:37
The .m files are scripts for GNU Octave, but you can open them with any text editor.


Ah, I see that now. Thanks.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-30 01:59:10
So, Ethan, did you run some of the scripts yet?

Note, in order to use the script "crunch" you need to record the "swisha" signal put out through a speaker to a mic, in channel 1, and loopback the DAC to channel two, so you have a stereo signal with the system response in one channel and the stimulus in the second channel.  Save this as "foo.wav".

You need to record at least 23 seconds more or less centered on the "swisha" signal.

Make sure you don't clip or anything.

When you have a reference, move "foo.wav" to "bar.wav" and put your new measurements in foo.wav and then run crunch3, and you get to see the differences.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2012-01-30 17:45:44
So, Ethan, did you run some of the scripts yet?


No, I don't have any way to do anything useful with those files. By "deck" I thought this was a Power point show I could learn from.

--Ethan
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-01-30 22:59:50
So, Ethan, did you run some of the scripts yet?


No, I don't have any way to do anything useful with those files. By "deck" I thought this was a Power point show I could learn from.

--Ethan



You can upload octave for free for apple, linux, or windows. So yes, you can get a way to do it.

Ditto audacity.

Ditto gvim.

Then you can design your own scripts. 

There are a couple of powerpoint decks, too, of course. But you want to upload octave (instructions at www.aes.org/sections/pnw very soon if not now) and actually play with this stuff.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2012-02-01 22:14:16
Hey, I watched an FFT tutorial "webinar" put on by Prism Sound today, and it was excellent. It was aimed at non-math people like me, and I learned a lot. They said it will be on their web site in about a week for all to see. If anyone cares I'll post a link when it's up.

--Ethan
Title: FFT Analysis for Dummies
Post by: Roseval on 2012-02-01 22:56:40
The irony of this thread being ressurrected is:
http://www.aes.org/sections/pnw/ (http://www.aes.org/sections/pnw/)


Oops, where it the FFT power point? The link points to

AES PNW SectionFebruary Meeting Notice

The Future of Mobile GamingANDanother gaming topic
Title: FFT Analysis for Dummies
Post by: romor on 2012-02-02 01:37:12
http://www.aes.org/sections/pnw/scripts/ (http://www.aes.org/sections/pnw/scripts/)
Title: FFT Analysis for Dummies
Post by: Roseval on 2012-02-02 09:14:16
Thanks 

Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-02-02 10:02:21
The irony of this thread being ressurrected is:
http://www.aes.org/sections/pnw/ (http://www.aes.org/sections/pnw/)


Oops, where it the FFT power point? The link points to

AES PNW SectionFebruary Meeting Notice

The Future of Mobile GamingANDanother gaming topic



As you have found out, the announcement has moved to the powerpoint directory, or thereabouts.

That's because the meeting is over.
Title: FFT Analysis for Dummies
Post by: Speedskater on 2012-02-02 14:31:26
Were you able to find anyone to make an audio recording of the seminars ?
Title: FFT Analysis for Dummies
Post by: xnor on 2012-02-02 18:37:55
If anyone cares I'll post a link when it's up.

I care. 
Title: FFT Analysis for Dummies
Post by: C.R.Helmrich on 2012-02-02 22:14:10
Me too. To many people, such a resource will be more helpful than an .m file and the instruction to download Octave. After all, this thread is called "FFT Analysis for Dummies"...

Chris (thinking of - maybe one day - making an explanatory Youtube video on the DFT)
Title: FFT Analysis for Dummies
Post by: Roseval on 2012-02-02 22:36:12
Chris (thinking of - maybe one day - making an explanatory Youtube video on the DFT)

Do!
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-02-04 01:48:33
Were you able to find anyone to make an audio recording of the seminars ?


There are two audio recordings, but I have no idea of their provenance or availability yet.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-02-04 06:20:29
Were you able to find anyone to make an audio recording of the seminars ?


There are two audio recordings, but I have no idea of their provenance or availability yet.


I'm told I might get a rough copy of the recording over the weekend.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-02-06 04:52:52
http://www.aes.org/sections/pnw/pnwrecaps/2012/jj_jan/ (http://www.aes.org/sections/pnw/pnwrecaps/2012/jj_jan/)

Contains both high and low-rate MP3's of the talk. No video, but audio. ppt decks and scripts available.
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-02-06 05:17:52
Me too. To many people, such a resource will be more helpful than an .m file and the instruction to download Octave. After all, this thread is called "FFT Analysis for Dummies"...

Chris (thinking of - maybe one day - making an explanatory Youtube video on the DFT)


So, you can't upload the .ppt decks or something?
Title: FFT Analysis for Dummies
Post by: romor on 2012-02-08 08:53:13
So, you can't upload the .ppt decks or something?

I made cue sheets while listening to fft talk:

part 1: http://pastebin.com/dPS5c0ZJ (http://pastebin.com/dPS5c0ZJ)
part 2: http://pastebin.com/Ag8Hpxw4 (http://pastebin.com/Ag8Hpxw4)

Then using it, yesterday I created 720p video slideshow with mencoder and uploaded to youtube - but they didn't accept it as it was too long (I wasn't aware of such restiction)
then on vimeo, but they transcode it, and result wasn't good, so I deleted it

Hope someone finds cue sheets handy
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-02-09 02:52:06
So, you can't upload the .ppt decks or something?

I made cue sheets while listening to fft talk:

part 1: http://pastebin.com/dPS5c0ZJ (http://pastebin.com/dPS5c0ZJ)
part 2: http://pastebin.com/Ag8Hpxw4 (http://pastebin.com/Ag8Hpxw4)

Then using it, yesterday I created 720p video slideshow with mencoder and uploaded to youtube - but they didn't accept it as it was too long (I wasn't aware of such restiction)
then on vimeo, but they transcode it, and result wasn't good, so I deleted it

Hope someone finds cue sheets handy


Thank you, and a pox on those services who won't deal with it!

Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2012-02-28 17:38:57
Hey, I watched an FFT tutorial "webinar" put on by Prism Sound today, and it was excellent. It was aimed at non-math people like me, and I learned a lot. They said it will be on their web site in about a week for all to see. If anyone cares I'll post a link when it's up.


The Prism Sound FFT webinar is now available for download:

http://www.prismsound.com/test_measure/web...3&src=SRWmm (http://www.prismsound.com/test_measure/webinars.php?wid=23&src=SRWmm)

You have to tell them who you are, but the query form is not otherwise intrusive. You'll get an email with the real download link after only a minute or two.

--Ethan
Title: FFT Analysis for Dummies
Post by: Woodinville on 2012-03-01 00:01:37
Hey, I watched an FFT tutorial "webinar" put on by Prism Sound today, and it was excellent. It was aimed at non-math people like me, and I learned a lot. They said it will be on their web site in about a week for all to see. If anyone cares I'll post a link when it's up.


The Prism Sound FFT webinar is now available for download:

http://www.prismsound.com/test_measure/web...3&src=SRWmm (http://www.prismsound.com/test_measure/webinars.php?wid=23&src=SRWmm)

You have to tell them who you are, but the query form is not otherwise intrusive. You'll get an email with the real download link after only a minute or two.

--Ethan


No ID required for the recordings and powerpoint decks at www.aes.org/sections/pnw

Free software there, too.  Not, as somebody put it "some scripts and advice to upload octave".
Title: FFT Analysis for Dummies
Post by: Arnold B. Krueger on 2012-03-01 13:00:12
Hey, I watched an FFT tutorial "webinar" put on by Prism Sound today, and it was excellent. It was aimed at non-math people like me, and I learned a lot. They said it will be on their web site in about a week for all to see. If anyone cares I'll post a link when it's up.


The Prism Sound FFT webinar is now available for download:

http://www.prismsound.com/test_measure/web...3&src=SRWmm (http://www.prismsound.com/test_measure/webinars.php?wid=23&src=SRWmm)

You have to tell them who you are, but the query form is not otherwise intrusive. You'll get an email with the real download link after only a minute or two.



Not only that, but the email will allow you to download any or all of their entire library of videos. I've only had time to watch a few minutes of the FFT video, but it looks like a keeper.
Title: FFT Analysis for Dummies
Post by: romor on 2012-03-01 14:25:10
No ID required for the recordings and powerpoint decks at www.aes.org/sections/pnw


I uploaded jj talk video on my dropbox account:

What is FFT (part 1) (http://db.tt/vdd86OZh) 56:05 - 37.5 MB
What is FFT (part 2) (http://db.tt/xuh1V1Qk) 47:58 - 32.4 MB

It's in AVI container because of mp3 audio source. I used already provided CUE sheets, and some obvious parts are removed (named with string chars in CUE sheets). Basically this line was used:

Code: [Select]
for f in *.mp3
do mencoder mf://${f%.*}.png -mf w=1280:h=720:fps=1/`mp3info -p "%S" $f`:type=png -audiofile $f \
-ovc lavc -lavcopts vcodec=mpeg4 -oac copy -ofps 30000/1001 -o ${f%.*}.avi
done

in Linux box.

If someone thinks that it can be hosted on HA, please uploaded it

Cheers
Title: FFT Analysis for Dummies
Post by: icstm on 2012-03-01 17:43:33
thanks for hosting.
Title: FFT Analysis for Dummies
Post by: Ethan Winer on 2012-03-01 19:03:16
No ID required for the recordings and powerpoint decks at www.aes.org/sections/pnw

Thanks JJ, I'm downloading from romor's links now.

--Ethan