Remove unwanted narrowband interference

18 views (last 30 days)
clement Ang
clement Ang on 17 Oct 2019
Answered: Kaashyap Pappu on 22 Oct 2019
I have this corrupted audio with the sound of a human lung, and would need to remove its interference.
I have attempted both high pass filter and passband filter, would appreciate if someone can help take a look at my code, and see where I should edit to get a clearer sound.
Corrupted Audio:
https://drive.google.com/file/d/15xrvx8pynmhCd86MY-1Zfc7EmDMv-MwP/view?usp=sharing
My current code:
[y,fs]=audioread('lungaudio.wav'); %y=samples, fs = sampling frequency
Ts=1/fs; %Sampling period
nfft=length(y);
nfft2=2^nextpow2(nfft);
ff=fft(y,nfft2);
fff=ff(1:nfft2/2);
plot(abs(fff));
xfft=fs*(0:nfft2/2-1)/nfft2;
plot(xfft,abs(fff));
xlabel('Frequency/Hz');
ylabel('Normalized Amplitude');
title('Frequency Domain Signal');
fc=550;
[b,a]=butter(6,fc/(fs/2), 'high'); %lowpass filter to only get 60hz
y_filtered=filter(b,a,y);
plot(y_filtered)
% sound(y_filtered,fs);
Graph Obtained:
  1 Comment
Daniel M
Daniel M on 17 Oct 2019
I think you mean to use 'low' in your call to butter.
See this recent question also regarding audio of a lung (perhaps a classmate?)

Sign in to comment.

Answers (1)

Kaashyap Pappu
Kaashyap Pappu on 22 Oct 2019
Increasing the order of the Butterworth filter could help improve the response. Alternatively, the buttord function can be used to get the optimal order and cutoff frequency values to give to the “butter” function.
Hope this helps!

Community Treasure Hunt

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

Start Hunting!