Why bandpass filter doesn't do what it supposed to do?

4 次查看(过去 30 天)
I created a synthetic signal in Matlab:
t = linspace(0,1,1080);
original = sin(100*2*pi*t)+1;
Then I added some noise to the signal with frequency of 5 Hz and 500 Hz.
LFnoise = sin(5*2*pi*t)+1;
HFnoise = sin(500*2*pi*t)+1;
s_noisy = original+LFnoise+HFnoise;
and the I applied the bandpass filter to remove noise and recover my original signal back as follows:
s_filtered = bandpass(s_noisy,[20 400],1080);
and what I get is not my original signal! Why is that?
I need to bandpass filter my signal with a cutoff of [20 400]. How to do that?

回答(1 个)

Star Strider
Star Strider 2021-11-8
I do not see what the problem is.
t = linspace(0,1,1080);
original = sin(100*2*pi*t)+1;
LFnoise = sin(5*2*pi*t)+1;
HFnoise = sin(500*2*pi*t)+1;
s_noisy = original+LFnoise+HFnoise;
s_filtered = bandpass(s_noisy,[20 400],1080);
figure
plot(t, s_noisy, '-b', t, s_filtered,'-r')
grid
xlim([0 0.1]) % 'Zoom' To Show Detail
legend('Noisy','Filtered', 'Location','best')
To me, it appears that the filter works as designed.
.
  2 个评论
azarang asadi
azarang asadi 2021-11-8
The original signal is way different than the filtered one. Also my original signal is positive, how do I end up with negative for filtered signal?
Star Strider
Star Strider 2021-11-8
The filter eliminated the D-C (constant) offset from the original signal, since the D-C component was beyond the low-frequency stopband of the filter. (Properly designed bandpass filters always do this.) Also, there is some heterodyning of the noise signals with the original signal, and that appears as part of the filtered signal (see the Wikipedia article section on Angle sum and difference identities). The result being that the filter cannot completely reproduce the original signal, however it comes close enough.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matched Filter and Ambiguity Function 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by