Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
azarang asadi
azarang asadi el 8 de Nov. de 2021
Comentada: Star Strider el 8 de Nov. de 2021
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?
  2 comentarios
Dave B
Dave B el 8 de Nov. de 2021
Your original signal was at 1Hz...so it's not in the pass band?
azarang asadi
azarang asadi el 8 de Nov. de 2021
fixed it but still I have the same problem

Iniciar sesión para comentar.

Respuestas (1)

Star Strider
Star Strider el 8 de Nov. de 2021
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 comentarios
azarang asadi
azarang asadi el 8 de Nov. de 2021
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 el 8 de Nov. de 2021
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by