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
4 views (last 30 days)
Show older comments
Jingyi Yuan
on 13 Jul 2022
Commented: Star Strider
on 14 Jul 2022
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');
0 Comments
Accepted Answer
Star Strider
on 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.
.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!