ex9_26.m
来自「基于WEB与MATLAB编写的信号处理的源码,书名为"应用WEB和MATLAB的」· M 代码 · 共 29 行
M
29 行
% Example 9.26
%
% Analog Chebyshev filter design for a highpass filter
%
%
w0 = 4; % cutoff frequency
% create a 3 pole Chebyshev Type I filter with 3-dB passband
[z,p,k] = cheb1ap(3,3); % 3 pole Chebyshev Type I filter;
[b,a] = zp2tf(z,p,k); %coverts the zeros and poles to polynomials
[b,a]=lp2hp(b,a,w0); % converts the lowpass filter to a highpass
% with cutoff frequency w0
% plot the frequency response
w = 0:.025:10;
[mag,phase] = bode(b,a,w); % numerator and denom. must be row vectors
phase = unwrap(phase); % removes jumps of 360 deg for smoother plot
disp('b = ');disp(b');
disp('a = ');disp(a');
%
clf
subplot(211)
plot(w,mag)
ylabel('|H|')
xlabel('Frequency (rad/sec)')
title('Example 9.25 Highpass Filter Design')
subplot(212)
plot(w,phase)
ylabel('Angle(H), degrees')
xlabel('Frequency (rad/sec)')
subplot(111)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?