生成系數
截止頻率:65Hz
SOS Matrix:
1 2 1 1 -1.9483812279206605 0.95235504547143668
1 2 1 1 -1.8848795046449112 0.88872380736622714
Scale Values:
0.0009934543876940359
0.00096107568032897277
截止頻率:75Hz
SOS Matrix:
1 2 1 1 -1.9399670771829454 0.94523778322684693
1 2 1 1 -1.867646689657416 0.8727209080865993
Scale Values:
0.0013176765109754376
0.0012685546072958092
截止頻率:85Hz
SOS Matrix:
1 2 1 1 -1.9314328304904613 0.93817732047303393
1 2 1 1 -1.8505362037561721 0.85699820579506891
Scale Values:
0.001686122495643158
0.0016155005097241886
截止頻率:95Hz
SOS Matrix:
1 2 1 1 -1.9227805373301849 0.93117365861042944
1 2 1 1 -1.8335462899281088 0.84154989516829737
Scale Values:
0.002098280320061078
0.0020009013100471622
截止頻率:105Hz
SOS Matrix:
1 2 1 1 -1.9140122208955201 0.92422678970950123
1 2 1 1 -1.8166752155117512 0.82637032288824241
Scale Values:
0.0025536422034952134
0.0024237768441227759
生成IIR濾波器調用函數
function Hd = iir_designer
%IIR_DESIGNER Returns a discrete-time filter object.
% MATLAB Code
% Generated by MATLAB(R) 9.1 and the DSP System Toolbox 9.3.
% Generated on: 19-Aug-2023 21:26:11
% Butterworth Lowpass filter designed using FDESIGN.LOWPASS.
% All frequency values are in Hz.
Fs = 6400; % Sampling Frequency
N = 4; % Order
Fc = 65; % Cutoff Frequency
% Construct an FDESIGN object and call its BUTTER method.
h = fdesign.lowpass('N,F3dB', N, Fc, Fs);
Hd = design(h, 'butter');
% [EOF]
濾波器驗證比較
%%
close all;
clc;
clear;
f = 50;
fs = 6400; %采樣頻率
time = 1 / fs;
t = 0:time:0.1;
y1 = sin(2 * pi * f * t) + sin(2 * pi * 13 * f * t);
figure('color',[1,1,1]);
subplot(3,1,1);
plot(t,y1);
title('濾波前波形(基波50Hz+13次諧波)');
%%
y2 = filter(fir_designer,y1); % 直接使用設計好的濾波器進行濾波,fir_designer函數是濾波
函數
subplot(3,1,2);
plot(t,y2);
title('FIR濾波后波形');
%%
y3 = filter(iir_designer,y1); % 直接使用設計好的濾波器進行濾波,iir_designer函數是濾波
函數
subplot(3,1,3);
plot(t,y3);
title('IIR濾波后波形');
-
MATLAB仿真
+關注
關注
4文章
176瀏覽量
19922 -
fir濾波器
+關注
關注
1文章
95瀏覽量
19037 -
IIR濾波器
+關注
關注
0文章
31瀏覽量
11506
發布評論請先 登錄
相關推薦
評論