Filter löschen
Filter löschen

Why and what should I do if a signal ampiltude decreased so much after it passed a low-frequency and a high-frequency butterpass filter

2 Ansichten (letzte 30 Tage)
Hello,
I was trying to remove the noise of a heartsound, then I found in a reference that I should use a butterpass filter. But when I apply it to the signal the ampiltude decreased from 0.1 to 0.000001. I was wondering whether it is correct or how can I amplify the signal?
[y,fs] = audioread(total_path);
y = y(:,1);
dt = 1/fs;
total_t = length(y)*dt;
t = (0:dt:(total_t)-dt)';
fc=40; % the cut-off frequency for low-pass filter
filter_parameters.N=10; % order of the filter
filter_parameters.type='butter';%apply type
% of filter ('Butterworth')
filter_parameters.lphp='low'; % Set the filter to low-pass
[b,a]=make_digital_filter(fc,fs,filter_parameters);% make filter parameters
D1=filter(b,a,y);% apply the low-pass filter
N_IR=fs; % set length, in samples, of impulse
% rewponse to calculate
[h,th,H,fH]=i_f_response(b,a,fs,N_IR);%calculate the impulse and frequency response
figure
plot(th,h);% plot the impulse response
title('impulse response');
xlabel('time(s)');
figure
plot(fH,abs(H));%plot the amplitude response
title('amplitude response');
xlabel('frequency(Hz)');
ylabel('gain');
% Apply the high-pass filter
filter_parameters.lphp='high'; % Set the filter to high-pass
fc=190; % the cut-off frequency for high-pass filter
filter_parameters.N=4; % order of the filter
[b,a]=make_digital_filter(fc,fs,filter_parameters);% make new filter parameters
D2=filter(b,a,D1);
figure
plot (t,D2,'c');

Akzeptierte Antwort

Star Strider
Star Strider am 13 Jul. 2022
The filtering operation removed much of the signal energy.
To amplify it, just multiply it by a constant:
D2 = D2*10;
Choose whatever value works best in your application.
.
  6 Kommentare
Jingyi Yuan
Jingyi Yuan am 14 Jul. 2022
Thank you so much for your reply, yes, I think it is the problem of the butterpass filter. The NaN result has been changed after I decrease the order of butterpass filter. Thanks again!
Star Strider
Star Strider am 14 Jul. 2022
As always, my pleasure!
I still suggest using the second-order-section implementation. See Limitations for details.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by