📄 fre_fir2.m
字号:
%==========================================================================
% Name:fre_fir.m
% The program compute the DTFT of discrete-time sequence x(n),
% and plot the curves.
%==========================================================================
clear;
h=input('Type in the impulse response h(n)=');
N=length(h);
w=0:0.1:2*pi;Hg1=0;
for i=0:N-1
m=-N/2+i-0.5;
Hg=h(i+1)*sin(((N-1)/2-i)*w);
Hg1=Hg1+h(i+1)*sin(((N-1)/2-i)*w);
end
n=0:N-1;
subplot(2,1,1);stem(n,h,'.');grid on;
xlabel('Index n');ylabel('the curve of h(n)');
title('The frequence response of the filter h(n)');
subplot(2,1,2);plot(w/(pi),Hg1);grid on;axis([0,2,min(Hg1),max(Hg1)])
xlabel('w');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -