赞
踩
基于特里斯坦的答案,这里有一些Octave代码可能与Matlab兼容,也可能不兼容. butter函数为您导出传递函数系数. .
hz = 8000;
x = [1:1:hz*10];
t = x./hz;
pi = 3.1415;
% Create signal with 10 hz, 200 hz and 500 hz components
raw_signal = sin(10*2*pi*t)+sin(200*2*pi*t)+sin(500*2*pi*t);
% View Raw Signal Over .1 Second Window
plot(t, raw_signal)
title('Raw Signal with 10Hz, 200Hz, 500Hz Components')
xlabel('Time (Sec)')
ylabel('Amplitude')
set(gca,'XLim', [5, 5.1]);
% Create Band Pass Butterworth Filter
[S_numer, S_denom] = butter(5, [100/hz 350/hz]);
band_passed_signal = filter(S_numer, S_denom, raw_signal);
% View Band Pass Filtered Signal Over .1 Second Window
plot(t, band_passed_signal)
title('Band Pass Filtered Signal')
xlabel('Time (Sec)')
ylabel('Amplitude')
set(gca,'XLim', [5, 5.1]);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。