Problems with a Band Pass Filter
조회 수: 3(최근 30일)
I am having a problem with bandpass filtering can somebody please assist me.
Sampling Rate 50
Number samples 3000
Sig Gen 0.2 Hertz
function y = doFilter(x)
%DOFILTER Filters input x and returns output y.
% MATLAB Code
% Generated by MATLAB(R) 9.8 and DSP System Toolbox 9.10.
% Generated on: 18-Nov-2020 10:12:16
Fstop1 = 0.05; % First Stopband Frequency
Fpass1 = 0.15; % First Passband Frequency
Fpass2 = 0.35; % Second Passband Frequency
Fstop2 = 0.45; % Second Stopband Frequency
Astop1 = 60; % First Stopband Attenuation (dB)
Apass = 1; % Passband Ripple (dB)
Astop2 = 60; % Second Stopband Attenuation (dB)
Fs = 50; % Sampling Frequency
h = fdesign.bandpass('fst1,fp1,fp2,fst2,ast1,ap,ast2', Fstop1, Fpass1, ...
Fpass2, Fstop2, Astop1, Apass, Astop2, Fs);
Hd = design(h, 'butter', ...
'MatchExactly', 'stopband', ...
y = filter(Hd,x);
I have attached a jpeg of my results from Matlab. The first trace is the signal after being sampled, the second is the magnitude fft, and the last trace is the filter results but as you can see I have a strange wobble just after the star and when it recovers the amplitude varies. Can you please tell me where I am going wrong.