dftidft1 clc clear all close all X=input( 'Enter the Input Sequence' ); N=input( 'Enter the Value of N such that N-point DFT is to be Calculated' ); % INPUTS ARE GIVEN % Y= fft(X,N) %DFT IS CALCULATED% L=length(Y); n=0:1:L-1; figure,plot(n,abs(Y)),title( 'Magnitude Response of DFT' ) figure, plot(n, angle(Y)), title( 'Phase Response of DFT' ) %MAGNITUDE and PHASERESPONSE OF DFT SIGNAL IS PLOTTED% Yinv=ifft(Y,N) %IDFT IS CALCULATED% figure,plot(n,abs(Yinv)),title( 'Magnitude Response of IDFT' ) figure, plot(n, angle(Yinv)), title( 'Phase Response of IDFT' ) %MAGNITUDE and PHASERESPONSE OF ORIGINAL SIGNAL IS PLOTTED% Error using input Cannot call INPUT from EVALC. Error in dftidft1 (line 5) X=input('Enter the Input Sequence'); Published with MATLAB® R2013b

Comments
Post a Comment