Question FFT spectrum rebuild and result interpretation

DSP related issues, mathematics, processing and techniques
Post Reply
User avatar
chackl
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Question FFT spectrum rebuild and result interpretation

Post by chackl »

Hello!

I did a research again on some FFT things i did in the past and grabbed some older examples. But i always had an little error at iFFT that gave me a wron signal back (Not that wrong that you just notice it fast)

So i just to ask if someone can confirm this:

If you do a FFT with let's say 512 points you will get a magnitude spectrum that is "symetric" - But it is not that symetric as i thought:

Magnitude:
Point 0 is kind of Frequency 0 and defines the amp off-set from the whole wave
Point 1 to 255 is the spectrum
Point 256 is the amp of Frequency 1 - But it has added the symetric part too - so the real value is its half.
Point 257 to 511 is the amp-spectrum reversed without Point 256 and 0

So the point count of the real magnitude is 257 (N/2+1)

Phase:
Point 0 is the phase of the sin-offset
Point 1 to 255 phase for each frequenzy
Point 256 is the phase for frequenzy 1 - But it seems to have no symetric here
Point 257 to 511 is the phase of ech frequenzy inverted and reversed.

Am i missing something again?
Thx, C.Hackl
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Question FFT spectrum rebuild and result interpretation

Post by martinvicanek »

Think of the array as circular, with both ends joined seamlessly.
One way to visualize the symmetry of the Fourier transform is this:

Code: Select all

    ----------------------------------->
    X[1],   X[2],   ...   X[254], X[255],
X[0],                                   X[256],
    X[511], X[510], ...   X[258], X[257],
    <-----------------------------------

The first element, X[0], denotes the DC offset. Then the upper row X[1] through X[255] represent bins with increasing frequrncy up to X[256], wich is the Nyquist frequency. Then the array folds back going from X[257] to the last element X{511]. The next element would be X[0], which closes the loop.

Arranged in this way, for a Fourier transform of a real input array the magnitudes of two elements on top of each other (for instance X[2] and X[510]) are equal, whereas their phases are equal in magnitude but with opposite signs.

If you prefer to look at real and imaginary parts rather than magnitude and phase, then we can say: two elements on top of each other have the same real part and have opposite imaginary parts.
User avatar
chackl
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: Question FFT spectrum rebuild and result interpretation

Post by chackl »

Thank you!

Got it now and marked many example-schematics as "wrong" (as it just was the nyquist wrong)
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
wlangfor@uoguelph.ca
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada
Contact:

Re: Question FFT spectrum rebuild and result interpretation

Post by wlangfor@uoguelph.ca »

FFT is exciting, I've wanted to delve into it but I've been busy trying to get filters and graphics elements working like commercial apps.

Nice idea with fft.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
Post Reply