Explore BrainMass

Plot Magnitude of a Sequence in Matlab

Consider a sequence x[n]={1,-1,1,-1}.
I need help in determining how to use the function fft to find the DFT coefficients X[k] of x[n] in Matlab. Also, how would you plot the magnitude of X[k] in Matlab?

Solution Preview

The DFT in Matlab is done by function fft (see a reference page from Matlab Help in the attached Word file).

The Fourier transform is ...

Solution Summary

This solution explains how to determine the use of the function fft to find the DFT coefficients.