DSPRelated.com
Forums

DFT and close frequency components

Started by jjole64 October 9, 2009
This is a problem.
It's a homework :), i read various ebooks on DSP and simulated this in
matlab with various window length.
This is how i figure it. DFT is sampled DTFT. We get DFT from DTFT when we
get N samples from DTFT basic period (w=2*pi/N*k).So we have k positions of
DFT spectrum which matches freqencies w=2*pi/N*k in DTFT. The problem is
when freqencies of start signal doesn't fall on 2*pi/N*k (k=0...N-1)
that's when we get leaking (as i figure it).Another thing (in my case when
i got 2 freq. components) is when they fall on 2*pi/N*k and the "k"-s are
neighbors (all amplitudes of other "k"-s are zeros).Then I get 2 neighbor
amplitudes (in DFT) which are equal( all other amplitudes in spectrum are
zero),so i can't interpolate DFT spectrum (to get aprox. of DTFT spectrum),
couse it won't show 2 spectrum components.I need atleast 1 component in DFT
with small or zero amplitude between 2 "big" amplitudes so that the
interpolation would be meaningful.
I did testing on this and conclusion is that this depends on N (samples of
signal, window length) and I figure it that for some (minimum) N is
possible to get "good" DFT, to reconstruct DFT (to get aprox. of
DTFT,continuous spectrum).

Is there some analitic term for (minimum) N for which is possible to
distinguish 2 frequnecy components in DFT.

It isn't really important that i get answer to this , but i would like to
know (couse i'm trying to figure it for some time now). Is it possible to
know just by knowing discrete signal (their discrete frequencies), for
which N (window length) will be possible to distinguish
spectrum components in DFT.

This is DFT of signals in matlab i got

http://img218.imageshack.us/i/probg.jpg/

Task is
I have 3 signals which are given as a sum of 2 cosine

a) x(n)=cos(pi/4*n)+cos(17*pi/64)
b) x(n)=cos(pi/4*n)+0.8*cos(21*pi/64)
c) x(n)=cos(pi/4*n)+0.001*cos(21*pi/64)
(As you see it frequencies are tight)
We want to estimate spectrum of each signal, so we limit each one with
rectangle window of Ld and then we calculte DFT in 64 points. For which
signals we can expect to distinguish 2 spectral components in DFT which
match frequencies of two cosines?

Clarify you solution analitic and graphic
J Jole-

> This is a problem.
> It's a homework :), i read various ebooks on DSP and simulated this in
> matlab with various window length.
> This is how i figure it. DFT is sampled DTFT. We get DFT from DTFT when we
> get N samples from DTFT basic period (w=2*pi/N*k).So we have k positions of
> DFT spectrum which matches freqencies w=2*pi/N*k in DTFT. The problem is
> when freqencies of start signal doesn't fall on 2*pi/N*k (k=0...N-1)
> that's when we get leaking (as i figure it).Another thing (in my case when
> i got 2 freq. components) is when they fall on 2*pi/N*k and the "k"-s are
> neighbors (all amplitudes of other "k"-s are zeros).Then I get 2 neighbor
> amplitudes (in DFT) which are equal( all other amplitudes in spectrum are
> zero),so i can't interpolate DFT spectrum (to get aprox. of DTFT spectrum),
> couse it won't show 2 spectrum components.I need atleast 1 component in DFT
> with small or zero amplitude between 2 "big" amplitudes so that the
> interpolation would be meaningful.
> I did testing on this and conclusion is that this depends on N (samples of
> signal, window length) and I figure it that for some (minimum) N is
> possible to get "good" DFT, to reconstruct DFT (to get aprox. of
> DTFT,continuous spectrum).
>
> Is there some analitic term for (minimum) N for which is possible to
> distinguish 2 frequnecy components in DFT.

If you think in terms of real world, and your input signal has sampling rate Fs, and you do an N-point DFT, then
resulting DFT bins are spaced by Fs/N Hz. I.e. you can resolve frequencies down to that many Hz. Anything lower
would be "smeared" between bins.

Your analysis and testing above seems Ok, but I see no mention of actual sampling rate or period. You can't escape
Nyquist, so at some point his limit has to enter the picture for results to be meaningful.

In the examples you give below, it seems you can derive an Fs. In the x[n] series given, f = Fs/8, so you could
choose Fs to be, say 1024 Hz, and f would be 128 Hz (or f = 1 Hz and Fs = 8 Hz, etc). Then you can convert the phase
offsets to Hz and you would know what N is needed to resolve them.

-Jeff

> It isn't really important that i get answer to this , but i would like to
> know (couse i'm trying to figure it for some time now). Is it possible to
> know just by knowing discrete signal (their discrete frequencies), for
> which N (window length) will be possible to distinguish
> spectrum components in DFT.
>
> This is DFT of signals in matlab i got
>
> http://img218.imageshack.us/i/probg.jpg/
>
> Task is
> I have 3 signals which are given as a sum of 2 cosine
>
> a) x(n)=cos(pi/4*n)+cos(17*pi/64)
> b) x(n)=cos(pi/4*n)+0.8*cos(21*pi/64)
> c) x(n)=cos(pi/4*n)+0.001*cos(21*pi/64)
> (As you see it frequencies are tight)
> We want to estimate spectrum of each signal, so we limit each one with
> rectangle window of Ld and then we calculte DFT in 64 points. For which
> signals we can expect to distinguish 2 spectral components in DFT which
> match frequencies of two cosines?
>
> Clarify you solution analitic and graphic