采用窗函数法设计一个FIR数字低通滤波器,在MATLAB里输入程序hd=ideal_lp(Wc,N)时,出现错误

2025-03-07 10:04:23
推荐回答(1个)
回答1:

解决了没有?我知道了,你是不是在学习呀!关键是你没有定义这个函数,此函数为
function hd=ideal_lp(wc,M);
%Ideal Lowpass filter computation
%------------------------------------
%[hd]=ideal_lp(wc,M)
% hd=ideal impulse response between 0 to M-1
% wc=cutoff frequency in radians
% M=length of the ideal filter
%
alpha=(M-1)/2;
n=[0:1:(M-1)];
m=n-alpha+eps;
hd=sin(wc*m)./(pi*m);
点击file中的new中M-file,新建上面的函数,保存后就可以运行了