fences
Junior Member level 3
I try to simulate a noisy signal and Filter it. the signal mix some low frequency signals and some random noise. my goal is to get 14.8Hz signal. my band-pass bandwidth is 14.7Hz to 14.9Hz.
my signal image is :
and filter result is :
when i try to increase Filter Order from 4096 to 32*4096 , i get this result :
why this filter do not work correct? do i chage my filtering method? what should i do to get 14.8Hz frequency signal?
thanks.
Code:
function filteringTest
Hd = KaiserFilter;
Fs = 4000; % Sampling frequency
T = 1/Fs; % Sample time
L = 40000; % Length of signal
t = (0:L-1)*T; % Time vector
r1 = 320;
r2 = 575;
y = 50*sin(2*pi*14.8*t) + r1*sin(2*pi*14.7*t) + r2*sin(2*pi*15.1*t) + 10.1*rand(size(t));
yfilter = filter(Hd.Numerator,1,y);
plot(yfilter)
function Hd = KaiserFilter
Fs = 4000; % Sampling Frequency
N = 4096; % Order
Fc1 = 14.7; % First Cutoff Frequency
Fc2 = 14.9; % Second Cutoff Frequency
flag = 'scale'; % Sampling Flag
Beta = 0.5; % Window Parameter
% Create the window vector for the design algorithm.
win = kaiser(N+1, Beta);
% Calculate the coefficients using the FIR1 function.
b = fir1(N, [Fc1 Fc2]/(Fs/2), 'bandpass', win, flag);
Hd = dfilt.dffir(b);
my signal image is :
and filter result is :
when i try to increase Filter Order from 4096 to 32*4096 , i get this result :
why this filter do not work correct? do i chage my filtering method? what should i do to get 14.8Hz frequency signal?
thanks.