MATLAB CODE FOR DTFT For xn 2 31 2 Generate a plot in MATLA

MATLAB CODE FOR DTFT

For x{n} = [-2, 3,-1, 2] Generate a plot in MATLAB for the magnitude and phase of the DTFT overlaid with the 4 point DFT

Solution

            % to compute discrete fourier transform of a given sequence.

         

clear all;

close all;

%x=[ -2,3,-1,2]

x=input(\'enter the input sequence\');

n=input(\'enter the lenth of DFT\');

subplot(4,1,1);

stem(x);

xlabel(\'time\');

ylabel(\'amplitude\');

title(\'input signal\');

y=fft(x,n);

subplot(4,1,2);

stem(y);

xlabel(\'frequency\');

ylabel(\'amplitude\');

title(\'discrete fourier transform\');

z=abs(y);

subplot(4,1,3);

stem(z);

xlabel(\'frequency\');

ylabel(\'magnitude\');

u=angle(y);

subplot(4,1,4);

stem(u);

xlabel(\'frequency\');

ylabel(\'phase plot\');

MATLAB CODE FOR DTFT For x{n} = [-2, 3,-1, 2] Generate a plot in MATLAB for the magnitude and phase of the DTFT overlaid with the 4 point DFTSolution % to compu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site