代码:
h = [1, 2, 3, 4, 3, 2, 1]/15; M = length(h); n = 0:M-1; [Hr, w, a, L] = Hr_Type1(h); a L amax = max(a) + 1; amin = min(a) - 1; figure(‘NumberTitle‘, ‘off‘, ‘Name‘, ‘Exameple 7.22‘) set(gcf,‘Color‘,‘white‘); plot(w/pi, Hr); grid on; xlabel(‘frequency in \pi units‘); ylabel(‘Hr‘); title(‘Type-1 Amplitude Response‘);
运行结果:
从上图看出,在开区间(0,π)有L-1=2个极值点;误差函数有L+3=6个极值点。
时间: 2024-10-21 23:23:48