?? fre_fir2.m
字號(hào):
%==========================================================================
% 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');
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -