dtft code does not work...please help me

1 view (last 30 days)
LcySkywalker
LcySkywalker on 9 May 2021
Commented: LcySkywalker on 10 May 2021
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
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)
magHm_dtft = 
Notice the result is independent of the value of omega, which explains why your plot was a constant.

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!