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 DFTSolution
% 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 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](/WebImages/25/matlab-code-for-dtft-for-xn-2-31-2-generate-a-plot-in-matla-1063573-1761555983-0.webp)