Professional Documents
Culture Documents
MATLAB Answers
Naser Je
on 11 May 2018 Vote 0
Commented: zina shalchi
on 27 Oct 2020
DSP.zip
I have a corrupted audio file which contains a message with very loud noise, and I should filter the noise as
much as possible. I tried couple of filters, and I could eliminate some of the noises but it's not enough. P.S.
The expected audio file is also there, which I plotted it to compare the filtered one with it. Both audio files
and the code are provided in the zip file.
clc;
close all;
clear;
https://www.mathworks.com/matlabcentral/answers/400244-filtering-noise-from-an-audio-file 1/4
6/14/2021 Filtering noise from an audio file - MATLAB Answers - MATLAB Central
%_______________________________________________________________________________%
Fs = sample_rate; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = 1000/Fn; % Passband Frequency (Normalised)
Ws = 1010/Fn; % Stopband Frequency (Normalised)
Rp = 1; % Passband Ripple (dB)
Rs = 150; % Stopband Ripple (dB)
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = cheby2(n,Rs,Ws,'low'); % Filter Design
[soslp,glp] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
fs2_d = [filtered_sound2,filtered_sound2];
sound(fs2_d, sample_rate)
subplot(4,1,1);
plot(sample_data); % Original Signal
title('Original Signal');
xlabel('Time (s)'); ylabel ('Amplitude');
subplot(4,1,2);
plot(filtered_sound2); % Filtered output
title('Filtered Signal Double');
xlabel('Time (s)'); ylabel ('Amplitude');
subplot(4,1,3);
plot(fs2_d); % Filtered output
title('Filtered Signal Double');
xlabel('Time (s)'); ylabel ('Amplitude');
subplot(4,1,4);
plot(Clean); % Expected output
title('Expected Signal');
xlabel('Time (s)'); ylabel ('Amplitude');
zina shalchi
on 27 Oct 2020
https://www.mathworks.com/matlabcentral/answers/400244-filtering-noise-from-an-audio-file 2/4
6/14/2021 Filtering noise from an audio file - MATLAB Answers - MATLAB Central
sound(fs2_d, sample_rate)
@Naser Je
Sign in to comment.
Answers (0)
Sign in to answer this question.
See Also
MATLAB Answers
matlab code for digital filter design to remove gaussian noise from a speech signal ?
2 Answers
Can you help remove the noise from this audio file?
1 Answer
Entire Website
Filter_Signal
File Exchange
audio
File Exchange
Audio Filter
File Exchange
Categories
Signal Processing
> Signal Processing Toolbox
> Digital and Analog Filters
> Digital Filtering
Tags
filter dsp digital signal pro... audio file noise cancellation
Products
MATLAB
https://www.mathworks.com/matlabcentral/answers/400244-filtering-noise-from-an-audio-file 3/4
6/14/2021 Filtering noise from an audio file - MATLAB Answers - MATLAB Central
Release
R2016b
mathworks.com
© 1994-2021 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See mathworks.com/trademarks for a list of additional
trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.
https://www.mathworks.com/matlabcentral/answers/400244-filtering-noise-from-an-audio-file 4/4