dtft code does not work...please help me
1 view (last 30 days)
Show older comments
clc;
clear;
clear all;
m=3;
omegac=(pi/4);
omega=(-pi:0.01:pi);
Hm_dtft=(sin(omegac*m)./(pi*m)).*exp(-1j*omega*m);
magHm_dtft=abs(Hm_dtft);
plot(omega, abs(Hm_dtft),'k');grid;
xlabel('\Omega '); ylabel ('|Hm(e^{j\Omega})|')
title('Magnitude Part')
Answers (1)
Walter Roberson
on 9 May 2021
m=3;
omegac=(sym(pi)/4);
syms omega real
Hm_dtft=(sin(omegac*m)./(pi*m)).*exp(-1j*omega*m);
magHm_dtft=abs(Hm_dtft)
Notice the result is independent of the value of omega, which explains why your plot was a constant.
See Also
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!