View Single Post
  #2 (permalink)  
Old 06-16-2006, 10:54 PM
Rune Christensen
Guest
 
Posts: n/a
Default Re: 1024 point FFT on a vector of size less than 1024

"Rajan" <[email protected]> skrev i en meddelelse
news:[email protected]..
>
> Hi all!
> I am a newbie to DSP. I have some basic questions. I will really
> appreciate if someone answers them.
>
> 1. Is it logical to perform 1024 point FFT on a vector of size less than
> 1024 (say 150) in MATLAB ?


It will increase the resolution of the spectrum and FFT of a 2^n vector is
easier/faster to calculate.

> 2. If yes, then -does MATLAB perform zero padding automatically in above
> case or do we need to do it manually ?


Use the help function in matlab and you will get an answer to some of your
questions.

>> help fft


FFT Discrete Fourier transform.
FFT(X) is the discrete Fourier transform (DFT) of vector X. For
matrices, the FFT operation is applied to each column. For N-D
arrays, the FFT operation operates on the first non-singleton
dimension.

FFT(X,N) is the N-point FFT, padded with zeros if X has less
than N points and truncated if it has more.

FFT(X,[],DIM) or FFT(X,N,DIM) applies the FFT operation across the
dimension DIM.

For length N input vector x, the DFT is a length N vector X,
with elements
N
X(k) = sum x(n)*exp(-j*2*pi*(k-1)*(n-1)/N), 1 <= k <= N.
n=1
The inverse DFT (computed by IFFT) is given by
N
x(n) = (1/N) sum X(k)*exp( j*2*pi*(k-1)*(n-1)/N), 1 <= n <= N.
k=1

See also IFFT, FFT2, IFFT2, FFTSHIFT.

Overloaded methods
help qfft/fft.m

> 3. what kind of output will it give ?


A small example could be:

subplot(1,3,1); plot(abs(fftshift(fft([1 2 3 4], 4))))
subplot(1,3,2); plot(abs(fftshift(fft([1 2 3 4], 16))))
subplot(1,3,3); plot(abs(fftshift(fft([1 2 3 4], 128))))

To reconstruct the signal ifft(fft([1 2 3 4])) you only need 4 points but
when you want to use the graph in a report then you could make a high
resolution graph by increasing N.

/Rune


Reply With Quote