在这篇论文之后,我试图在 MATLAB 中制作一个最小二乘算法,但是对于 I 类(我知道firls()
)。
N = 41;
M = (N-1)/2;
wp=0.2;
ws = 0.4;
K = 2;
fp = wp/2;
fs = ws/2;
q= [fp+K*(1-fs), (fp*sinc(fp*[1:2*M])-K*fs*sinc(fs*[1:2*M]))];
Q1 = toeplitz(q([0:M]+1));
Q2 = hankel(q([0:M]+1),q([M:2*M]+1));
Q = (Q1 + Q2)/2;
b = fp*sinc(fp*[0:M]');
a = Q\b;
h = [a(M+1:-1:2)/2; a(1); a(2:M)/2]