fft
1D Fast Fourier Transform.
Syntax
Section titled “Syntax”Y = fft(X)Y = fft(X, n)Y = fft(X, n, dim)Description
Section titled “Description”Returns the discrete Fourier transform of X along the first non-singleton dimension. With n, zero-pads or truncates X to length n first. With dim, transforms along that dimension. Uses an optimized FFT (radix-2 + mixed-radix) on power-of-two and other composite lengths.
Examples
Section titled “Examples”% Spectrum of a sine wavet = 0:0.001:1; x = sin(2*pi*50*t);Y = fft(x);P = abs(Y).^2; % power spectrum