Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Discussion Groups

Discussion Groups | Matlab DSP | RE: FFT in Matlab

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

FFT in Matlab - ngweelee - Feb 17 21:09:00 2002



Hi guys,

Can anyone please tell me how to perform fft on an array produced by
matlab function 'wavread' and the result plotted on a figure to get
the pitch of the wav file?

Any help is greatly appreciated.

Thanks






(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

RE: FFT in Matlab - Sridhar Nandula - Feb 19 4:34:00 2002

Hi,
FFT in matlab can be done using direct FFT function.

let us say k is an array of size N
then call fft directly. using

fftk= fft(k,N);

Once you got fft in the array fftk, you can easily plot isnt it?
For more info, you can see the FFT help from MATLAB.

%FFT Discrete Fourier transform.
% FFT(X) is the discrete Fourier transform (DFT) of vector X. If the
% length of X is a power of two, a fast radix-2 fast-Fourier
% transform algorithm is used. If the length of X is not a
% power of two, a slower non-power-of-two algorithm is employed.
% 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
%
% The relationship between the DFT and the Fourier coefficients a and b in
% N/2
% x(n) = a0 + sum
a(k)*cos(2*pi*k*t(n)/(N*dt))+b(k)*sin(2*pi*k*t(n)/(N*dt))
% k=1
% is
% a0 = 2*X(1)/N, a(k) = 2*real(X(k+1))/N, b(k) = 2*imag(X(k+1))/N,
% where x is a length N discrete signal sampled at times t with spacing
dt.

Regards,
Sridhar

-----Original Message-----
From: ngweelee [mailto:]
Sent: Monday, February 18, 2002 2:39 AM
To:
Subject: [matlab] FFT in Matlab Hi guys,

Can anyone please tell me how to perform fft on an array produced by
matlab function 'wavread' and the result plotted on a figure to get
the pitch of the wav file?

Any help is greatly appreciated.

Thanks

_____________________________________
/groups.php3





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )