<< FFTWwrapper | FFTW | fft2 >> |
Y = fft(X) |
Y = fft(X, n) |
Y = fft(X, n, dim) |
a vector, matrix or N-D array (double, single, integer, logical).
transform length: a non negative integer scalar or [] (default).
dimension: a positive integer scalar.
a vector, matrix, N-D array: frequency domain representation.
fft(X) computes the discrete Fourier transform of X using a Fast Fourier Transform (FFT) algorithm based on FFTW library.
% Sampling frequency
Fs = 150;
% Time vector of 1 second
t = 0:1*inv(Fs):1;
% Creates a sine wave of f Hz.
f = 5;
x = sin(2 * pi * t * f);
% Length of FFT
nfft = 1024;
% Take fft, padding with zeros so that length(X) is equal to nfft
X = fft(x, nfft)
% FFT is symmetrix
X = X(1:nfft*inv(2))
% Frequency vector
f = (0:nfft *inv(2) -1)*Fs * inv(nfft);
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET