⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exa5_26.m

📁 matlab应用实例。如:FIR、IIR数字滤波器设计等。
💻 M
字号:
%--------------------------------------------------------------------------
% exa060609_cremez.m,   for example 6.6.9;
% to test cremez and to design allpass FIR filter;
%-------------------------------------------------------------------------

n = 22;            % Filter order
f = [-1 1];        % Frequency band edges
w = [1 1];         % Weights for optimization
gf = linspace(-1,1,256);% Grid of frequency points 
d = exp(-1i*pi*gf*n/2 + 1i*pi*pi*sign(gf).*gf.*gf*(4/pi)); % Desired frequency response
b = cremez(n,f,'allpass',w,'real'); % Approximation
freqz(b,1,256,'whole');
subplot(2,1,1); hold on      %overlay desired response
plot(pi*(gf+1),20*log10(abs(fftshift(d))),'k*')
subplot(2,1,2); hold on
plot(pi*(gf+1),unwrap(angle(fftshift(d)))*180/pi,'k.')
legend('逼近值','理想值')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -