?? lptransform.m
字號(hào):
% Example 8.24 低通濾波器的設(shè)計(jì)(此為網(wǎng)站參考程序)
%
% Analog Butterworth filter design
%
% design an 3-pole filter with a bandwidth of 5 Hz
%
[z,p,k] = buttap(3); % 3 pole filter
[b,a] = zp2tf(z,p,k); % convert the zeros and poles to polynomials
wb = 5*2*pi; % new bandwidth in rad/sec
[b,a] = lp2lp(b,a,wb); % transforms to the new bandwidth
f = 0:15/200:15; % define the freq. in Hz for plotting
w = 2*pi*f;
H = tf(b,a);
[mag1,phase1] = bode(H,w);
% print to MATLAB command window
% fprintf('2 pole filter \n')
% disp('b = ');disp(b');
% disp('a = ');disp(a');
%plot versus frequency in Hz
clf
subplot(211)
mag = squeeze(mag1);%squeeze函數(shù)用來(lái)刪去大小為1的"孤維"
phase = squeeze(phase1);
plot(f,mag)
ylabel('|H| dB')
xlabel('Frequency (Hz)')
title('Example 8.24 Lowpass Filter Design')
subplot(212)
plot(f,phase)
ylabel('Angle(H), degrees')
xlabel('Frequency (Hz)')
subplot(111) %這個(gè)語(yǔ)句沒(méi)太明白在此處什么用意
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -