0% found this document useful (0 votes)
56 views

Uday

This MATLAB code takes in a numeric sequence from the user, performs a discrete Fourier transform on the sequence, and plots the resulting magnitude and phase spectra. It prompts the user to enter the length of the sequence and the sequence values, calculates the DFT using the discrete Fourier transform kernel, and displays the magnitude and phase spectra in separate subplots for analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Uday

This MATLAB code takes in a numeric sequence from the user, performs a discrete Fourier transform on the sequence, and plots the resulting magnitude and phase spectra. It prompts the user to enter the length of the sequence and the sequence values, calculates the DFT using the discrete Fourier transform kernel, and displays the magnitude and phase spectra in separate subplots for analysis.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

clc;

clear all;
N=input('enter the value of "n":');
x=input('enter the sequence:');
n=(0:1:N-1);
k=(0:1:N-1);
WN=exp((-1*1j*2*pi)/N);
nk=n'*k;
WNnk=WN.^nk;
xk=x*WNnk;
magx=abs(xk);
phasex=angle(xk)*180/pi;
subplot(2,1,1);
plot(k,phasex);
subplot(2,1,2);
plot(k,magx);
title('magnitude');

You might also like