Quick FFT question

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I don't know mouch about FFT analyzing a signal, so I have questions :
I know that I have to store the signal in a table with size power of 2. Than I have to make a wavetable comtaining a sine wave (or raised cosine?).
I search for the peak amplitude, and store it for later.
Than I substract the sine waveform from the signal table, search for maximum in the result table, and store the ratio between the two peak walues. Than I make the same for sin(2x),sin(3x) ...
Am I far away from truth ?
If I'm close, than does it matter the phase of the source signal ?
What about cosine components ? Every spectrum analyzer shows sine components only.
Can anybody point me to the right direction?
Thanks,
A.F.

Post

Wow!!

Fourier Transform is not reduced to powers of two!!
First search on the Internet what it is, just for a background.
FFT is classical implementation of DFT - for Discrete FT -, which WAS limited to powers of two. Nowadays, it doesn't matter if you catch the good librairy - FFTW is far the best, implemented in Matlab -.
Consider using a existant librairy, it'll be safer. BUT if you want to do it yourself :
- have a sine wave in your table
- use the FFT radix2 or radix4 for less multiplications. If you try convolution, it's not FFT, it still costs O(N^2) whereas FFT costs only O(N log(N))
- you then have the complex amplitude of the frequency in the table between 0 and N/2-1. What is shown is the absolute value of the complex amplitude, never the real - cos - or imagniary - sin - part.

You can check chirp z-transform for other frenquency analysis or wavelets when you'll be at ease with the FFT ;)

Post

:-o I think I'm going to sleep now...
The mouch new info, can damage my brain.
- use the FFT radix2 or radix4
??? It's chemistry for me
- convolution ? I heard of it, never got a good explanation
- wavelets ? Lot of math.

Post

tranceinstitute wrote::-o I think I'm going to sleep now...
The mouch new info, can damage my brain.
- use the FFT radix2 or radix4
??? It's chemistry for me
with power of two, you get radix2 because each time you process 2 samples, with power of 4, you get radix4 beacause each time, you process 4 samples. The avantages of these radix are that it is mainly additions and not multiplications, and as multiplications are the more time consumming, the less the better :D.

Begin with a discret normal fourier transform, not the FFT, before. If you have something like numerical recipes in C, try it, or on the net it's explained first in the continuous case, and then in the discrete case.
- convolution ? I heard of it, never got a good explanation
Well, my fault, it's not convolution you used, but correlation, which is almost the same...
convolution(j) = sum(x(i)h(j-i), i=-inf...+inf)
correlation(j) = sum(x(i)h(i+j), i=-inf...+inf)
- wavelets ? Lot of math.
Yes...

Post

Miles1981 wrote: First search on the Internet what it is, just for a background.
Can you paste some good links please :?:

Post

tranceinstitute wrote: - convolution ? I heard of it, never got a good explanation
Convolution is one of the most important aspects of DSP.
Basically an FIR uses convolution - its essentially a multitap delay where the number of taps = the number of samples in the impulse response, and the magnitude and sign of each tap is represented by the value of the samples in the impulse response. The delay time of each tap is equal to the offset into the impulse response in samples.
It is also possible to convolve in the frequency domain using FFT & iFFT.

Post

Yes, it is one of the advantages of the FFT - although you must pay attention to the side effects :| -.

A page with some links, taken from FFTW : http://www.fftw.org/links.html it's the fastest FFT I've ever seen.

Post

What is the difference between adding up
N sine waves with given amplitude,phase
and doing it with iFFT (nasty complex numbers) ?
:?

Post

The inverse FFT has a complexity of NlogN, whereas adding the sines - making a inverse transform in the "normal way" - is N². It speeds up the function. But you can't use the past of the signal, so if you filtered something in the spectral domain, I don't know if the signal will join correctly. At this time, you should filter the signal with the past - the Fourier transform and its inverse transform are mainly 2 filters with specials coefficients -

Post

My question is simple:
Is is correct to make my waveform by adding up sines with a for(;;;) instead of iFFT ?
If not, why ?
What is the advantage on iFFT over adding up sines ? Other than speed. I ask this to decide to transform my wavetable engine to iFFT (meaning i have to deal with complex numbers and other nasty stuff) or keep it the way it is. :idea: :?:

Post

yes, it is valid, as iFFT is just a reformulation of the for.

The warning is still there : if the signal has a past, it could be incorrect.

The advantages of iFFT is its speed, its only a reformulation of the inverse transform discribed by adding sines.

You can deal without complex numbers : a sine is described by its frequency, its phase and its amplitude. The complex numbers take care of the frequancy and the phase, that's all. It's not that nasty ;)

Post

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
the book elements of computer music (http://www.amazon.com/exec/obidos/tg/detail/-/0132525526/qid=1086965971/sr=8-1/ref=pd_ka_1/002-3153664-7323258?v=glance&s=books&n=507846) by f. richard moore has a pretty straightforward explanation of fft, convolution, etc. it's all in the context of the applications to audio purposes as well, with a lot of code examples too. it's a bit pricey since it's a college textbook but worth checking out if you can find a used copy at least.

Post

tranceinstitute wrote: Can you paste some good links please :?:
http://www.dspguide.com/

It's great: v informative, easy to read & it has several chapters devoted to DFT/FFT, which you can download as pdf's free of charge..

Post Reply

Return to “DSP and Plugin Development”