?? gaotong.m
字號:
%z平面的簡單零極點法設計高通濾波器
clear all;
load data.txt;
syms rad z hz hrad angle;
t=1:length(data);
data1=0.2*sin(0.25/pi*t)'+data;
Wh=0.8*pi;
a=cos(Wh)/(1+sin(Wh));
hz=(2/(1-a)*((1-1/z)/(1+a/z)));%數字濾波器的系統函數
% rad=0:0.1:3.3;
hrad=subs(hz,exp(i*rad/0.32));
subplot(211);
ezplot(abs(hrad));
axis([0 2 0 2]);
title('幅度特性曲線')
grid on;
subplot(212);
angle=atan(imag(hrad)/real(hrad));
ezplot(angle);
axis([0 2 -2 2]);
title('相位特性曲線');
grid on;
b=1;
a=0.9752;
y=filter(b,a,data);
figure(2)
subplot(311)
plot(data);grid on
axis([0 1000 -1 1 ])
title('干凈的原信號')
subplot(312)
plot(data1);grid on
axis([0 1000 -1 1 ])
title('加基線漂移后的原信號')
subplot(313)
plot(y);grid on
axis([0 1000 -1 1 ])
title('濾波后的信號')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -