According to FFT , if the input is real, FFT results are symmetrical (sampling point for the N, then N/2 FFT results are effective results)

My question is:

What do we have?

N frequency components or N/2 frequency components?

Sorry for my english

Author

Message

According to FFT , if the input is real, FFT results are symmetrical (sampling point for the N, then N/2 FFT results are effective results)

My question is:

What do we have?

N frequency components or N/2 frequency components?

Sorry for my english

Not being my regular field, I'd have to dig through all the references. IIRC, "it depends" on how you do the FFT.

My reference of choice, mentioned first in

https://www.avrfreaks.net/index.p...

http://www.dspguide.com/pdfbook.htm

Quote:

Quote:The Scientist and Engineer's Guide to Digital Signal Processing

This does get rave reviews at Amazon, but also consider this "review" if you are going to purchase a hard copy:

Quote:

A great book, but his newer edition is cheaper!, January 3, 2003 ...

Evarything that the other reviewers say is true. However, his newer book is an update with added material, improve typesetiing, and a CD with programs.

Buy the new book, which has a slightly different title, "DSP for Engineers and Scientists..."I believe that this refers to "Digital Signal Processing: A Practical Guide for Engineers and Scientists"

ISBN: 075067444XLee

1. Wrong forum, not AVR related.

Administrator please move to: off-topic

2. Real-FFT-input then FFT-Output: N/2 complex values

(real + imaginary part or phase+amplitude)

Are the DFT results different form FFT results?

the result of FFT and DFT are identical, FFT just takes some shortcuts and reuses values that will always be the same(and there is not one single method for FFT, you have several)

It is true that you will get N results for N data, but only N/2 are meaningful.

.....

Last Edited: Sat. Dec 18, 2010 - 01:00 PM

it can Calculate N frequency components,and its Resolution is M/N, then 0 to N/2 frequency components is mirrored to N/2 to N frequency components.

Is that true?

thanks all you gays

True.

(but because of the mirroring i´d say there are N/2 frequency components)

To calculate the amplitude of each frequency you have to square both, the real and the imaginary part, add them and take the squareroot.

If that is true,its Resolution should be 2*M/N.

Is it true?

it confuses me

With a FFT you can calculate frequencies up to the half sample frequency.

with a sample frequency of 10.000 Hz and a 1024 FFT you

get 512 frequencies from 0 Hz (DC), up to 511*f-sample/1024= 4990Hz with equal stepsize/bandwidth of f-sample/1024 = 9.766Hz.

it makes senses to me now.

but I still don't know why,is there any article concerning this?

Google or try the recommended book.

Also nyquist says that you only can recognize frequencies up to f-sample/2.

Quote:

I recall that the FFT produces "amplitude only" for 0.000 Hz (DC) and 5000 Hz (Nyquist) since neither has any phase information. By convention the amplitude at Nyquist is stored as the phase of the DC component. Or did it originate there by definition? Sorry, don't recall.
from 0 Hz (DC), up to 511*f-sample/1024= 4990Hz

EDIT: rather the Nyquist amplitude is stored as the imaginary component of the DC pair.

I don´t think the FFT gives any result for nyquist frequency.

In my eyes the DC component has no phase information.

It's been a few years, but this is what I remember:

Nyquist theorem provides for information at half the sample rate, not half the sample rate less the line width.

Say you sample a pure 5000 Hz signal at 10000 Hz. Depending on the phase of sampling versus the signal, the amplitude of the samples will represent a triangle wave at the correct frequency but with amplitude from 0% to 100%. (However, phase cannot be detected with two points.)

Relying on such information is probably foolish. This is also true for results in the neighborhood of Nyquist. Depending on the application 10 samples per cycle may be a limit, or 3 samples, but you are allowed to use down to and including 2.

DFT:

As JGRUNT said, do some hand calculations to

understand what happens. For example N=4

(DFT Matrix obtainable from Wikipedia)

Then transoform input sequence (1,-1,1,-1)

(What frequency ?)

Or Transform (i,i,i,i)

(What frequency, what phase ?)

Nyquist:

The Nyquist Sampling Theorem says under which

circumstances you can reconstruct a continous

time-signal from samples. It has not directly

something to do with DFT.

Read books or articles from the web ! Take

some time, think about it and re-read the books.

Quote:

Read books or articles from the web ! Take

some time, think about it and re-read the books.

Gee, I wish >>I<< would have thought to take the time to post a link to a definitive, free, quality reference.

Lee

Quote:

Relying on such information is probably foolish. This is also true for results in the neighborhood of Nyquist. Depending on the application 10 samples per cycle may be a limit, or 3 samples, but you are allowed to use down to and including 2.

with an FFT you have a number of samples. let´s say 1024. The FFT not only sees 2 or 3 points. It takes all points into account.

if you now have a signal at 511/1024*f_sample you plot the points than you see the amplitude varying from 0 to 100%.

But the POINTS are not what nyquist or the mathematics says. You have to form it into a line. usually one does this with a lowpassfilter.

Often there is a simple lowpassfilter used. (especially with scopes) but the mathematics says that for reconstruting the true signal you need an sin(x)/x filter. This filter takes care of the varying amplitude and indeed forms back a constant amplitude sinewave.

But an exach sin(x)/x filter is impossible to build. neither possible in digital nor in analog. So one (the high end analog freaks) try to get as close as possible to the filter. usually with both analog and digital techniques.

On one side i like the idea to reconstruct the (audio) signal as good as possible. On the other side i can not hear those high frequencies, and one can not hear the difference/(resolution) of the 9Hz at those high frequencies.

(because the FFT works with equal distances and the human ear works with multiplying frequencies - one ocatve is i multiply by 2 in frequency)

And with digital scopes it is something different than with audio. Here some scope use the effects of undersampling and the shifted frequencies. One (ab-)uses the nyquistin a special way to visualise frequencies often far above nyquist- and even sampling-frequency.

Here one can neither work with anti-aliasing filters nor with sin(x)/x reconstruction filters.

Quote:

Nyquist:

The Nyquist Sampling Theorem says under which

circumstances you can reconstruct a continous

time-signal from samples. It has not directly

something to do with DFT.

True. They play together - but don´t harm each other.

Quote:

Sorry to not be clear on this. I didn't mean 2 or 3 points in a frame, but 2 or three points defining the content of the higher frequencies of the spectrum.
FFT not only sees 2 or 3 points. It takes all points into account.

Again, sampling a 5000 Hz sinusoidal signal at 10000 Hz provides an estimate of content (amplitude only) as long as the sampling does not fall exactly at the zero crossings; in such case the samples will be all zero.

On the other hand, a 5001 Hz signal will be lost (aliased) entirely as the sampled waveform will appear to be something like a 1 Hz sinusoid.

But as you state, in most cases you'd better be filtering well below Nyquist or the analysis will be faulty.

EDIT: Wrong, a 5001 Hz signal will be aliased into 4999 Hz signal.

Are you sure the FFT result includes f_sample/2?

I´m just imagine an 8 sample FFT with a samplerate of 16000Hz

gives 4 results and the mirrors of them:

0Hz (=DC)

2000Hz

4000Hz

6000Hz

6000Hz mirrored

4000Hz mirrored

2000Hz mirrored

0Hz (DC) mirrored

Am i wrong here?

For sure you can run a DFT for 8000Hz, but - as you said - the result of it is useless.

************

Yes, it must be 4999Hz

Consider the first element of the resulting complex array, i.e. the DC value. Obviously there is no phase so you would expect the real component to give the DC amplitude, and the imaginary component to always be zero.

I checked my FFT routine and the imaginary component evaluated to a non-zero value in proportion to the amplitude at the Nyquist frequency. (If sampled at zero phase the samples were all zero and of course the imaginary component of the DC element was also zero.)

Quote:

Consider the first element of the resulting complex array, i.e. the DC value. Obviously there is no phase so you would expect the real component to give the DC amplitude, and the imaginary component to always be zero.

I see, makes sense now.

For me its not obvious, that DC has no phase.

Imagine: imaginary DC (Input i,i,i,i,i,i,,,,,).

Example: InPhase / QuadraturePhase in

digital receivers.

Well, in terms of Fourier analysis I think DC has no phase. Perhaps it can be more complicated when you consider that the elements of the complex result represent lines of the spectrum and therefore a range of frequencies.

So say your SR=1000 Hz, frame size is 1024, then each line of the spectrum "covers" 0.976563 Hz. The DC element then is presumably a statistical average of all frequencies from 0 up to but not including df (0.976563).

So any signal content at 0.5 Hz say DOES have phase, however, the FFT will be unable to discern (quantify) it. You could use a larger frame size so that df = 0.488281 Hz and the second complex value will provide phase information for 0.5 Hz.

This could be verified easily with matlab but sorry, I don't have time.

?

Last Edited: Fri. Jan 21, 2011 - 04:07 AM

Quote:

What no answer yet? Let's make it multiple choice:what's the phase of -5VDC or 5*cos(2*pi*0*n/N + pi)

- a) 0
b) PI

c) 42

OR, if you meant...

2*pi*0*n = 0, (0/N) + pi) = pi, 5*cos(pi) = -5

a, b or c you say?

Or:

- d) Undefined

Now I think I see your point, jgrunt.

The phase of the DC component can indeed vary from zero to pi based on the polarity of the real term of the complex result.

So, the phase of a +V is 0 and the phase of -V is 180 degrees...?

One can measure the phase with the help of time difference and the wavelength/period time.

DC has infite period time and inifinite wavelength.

Also with DC you can not measure time difference.

Short: DC has no phase (-shift).

Assume you have a multiplying mixer followed by a

low-pass. (Usual RF-front-end) You feed

the mixer with the local-oscillator signal (LO)

and the RF-signal happens to have the same frquency as

the LO. What frequency has the mixer output signal ?

Has it a phase ?

Or better: If you know the

amplitude of the input-signal and of the LO and the

mixer-gain. What can you knowledge is contained

in the mixer-output-signal.

But if you compare the FFT results for a postive signal versus a negative (constant) their phases will differ by 180 degrees.

For a complex FFT result C(i) = re(i) + j Im(i) the phase angle is given by:

phase = atan2( Im(i), Re(i) );

While the imaginary term Im(i) is zero at DC, re(i) may be negative or positive; therefore the phase may be 0 or 180 degrees.

Sorry.