DSPRelated.com
Forums

The points of FFT transform

Started by jia May 31, 2006
Hi, here

A basic problem of DSP make me confused. When we want to the spectrum
character of a signal sequence, we can use the function "fft( )" of
Matlab.

fft(X,n) returns the n-point DFT.
1) If the length of X is less than n, X is padded with trailing zeros
to length n.
2) If the length of X is greater than n, the sequence X is truncated.

If we want to do a DFT of a sequence of discrete signal X, with the
length of N.

What is the proper points for DFT? just "n=N" is enought, or the
bigger, the better?

If n>N, then padded zeros, it is equal to interpolation. While, if "n"
is infinite, it maybe equal to the fourier transform of continuous
signal. So, I am confused.

What is the proper points for DFT?

Thanks

"jia" <jia.qinghua@gmail.com> wrote in message 
news:1149068748.138082.66680@i39g2000cwa.googlegroups.com...
> Hi, here > > A basic problem of DSP make me confused. When we want to the spectrum > character of a signal sequence, we can use the function "fft( )" of > Matlab. > > fft(X,n) returns the n-point DFT. > 1) If the length of X is less than n, X is padded with trailing zeros > to length n. > 2) If the length of X is greater than n, the sequence X is truncated. > > If we want to do a DFT of a sequence of discrete signal X, with the > length of N. > > What is the proper points for DFT? just "n=N" is enought, or the > bigger, the better? > > If n>N, then padded zeros, it is equal to interpolation. While, if "n" > is infinite, it maybe equal to the fourier transform of continuous > signal. So, I am confused. > > What is the proper points for DFT?
The simplest thing to do is to use fft(X). Anything you do is "proper" if it meets your intent. It appears you understand what happens if n>N. Unless you need this, it's extra computation that provides no additional information - just more points. Fred
Thanks for yr reply.

When the FFT is computed with the points larger than the number of
samples in x[n], it fills in the samples after x[n] with zeros.

Let's assume, the length of x[n] is equal to N, and the FFT points is
2*N.
-- That is like taking a time sequence x[n] of length 2*N, and
multiplying it with a rectangular box of length N.
-- A multiplication of a box and a sequence in the time domain should
result in the convolution of a sinc with impulses in the frequency
domain. Can this padded zeros in FFT be regarded as a contamination to
the original signal?

Any idea?

---------------------------------------------------
Another thing I am confused.

If we want to observe the "magnitude response" of a signal. We can use
such Matlab code.
>>Y = fft(x,n)*Ts >>magnitude = abs(Y)
where, x is time domain sequence, Ts is sampling interval. However, someone prefer to this
>>Y = fft(x,n) >>magnitude = abs(Y)/(n-1)
Maybe anyone is OK because the difference between the two methods is only the scale. Such scale can be cancellation when magnitude is in [dB] scale. The question is which method do you think is more reasonable? Thanks
"jia" <jia.qinghua@gmail.com> wrote in message 
news:1149137061.635640.8380@i40g2000cwc.googlegroups.com...
> Thanks for yr reply. > > When the FFT is computed with the points larger than the number of > samples in x[n], it fills in the samples after x[n] with zeros. > > Let's assume, the length of x[n] is equal to N, and the FFT points is > 2*N. > -- That is like taking a time sequence x[n] of length 2*N, and > multiplying it with a rectangular box of length N.
***Actually, it's like appending N zeros to the sequence.
> -- A multiplication of a box and a sequence in the time domain should > result in the convolution of a sinc with impulses in the frequency > domain. Can this padded zeros in FFT be regarded as a contamination to > the original signal?
***Not really applicable here. The appending of N zeros results in interpolation in frequency by a factor of 2. Other ratios may cause affects that you'd consider to be "contamination" I suppose.
> --------------------------------------------------- > Another thing I am confused. > > If we want to observe the "magnitude response" of a signal. We can use > such Matlab code. >>>Y = fft(x,n)*Ts >>>magnitude = abs(Y) > where, x is time domain sequence, Ts is sampling interval. > > However, someone prefer to this >>>Y = fft(x,n) >>>magnitude = abs(Y)/(n-1) > > Maybe anyone is OK because the difference between the two methods is > only the scale. Such scale can be cancellation when magnitude is in > [dB] scale. > > The question is which method do you think is more reasonable?
Either method you like. You will find threads on comp.dsp that discuss different scaling conventions. Fred
Thanks, Fred