File Exchange

image thumbnail

Wiener filter for Noise Reduction and speech enhancement

version (214 KB) by Pascal Scalart
Wiener Noise Suppressor based on Decision-Directed method with TSNR and HRNR algorithms.


Updated 23 Oct 2020

View Version History

View License

The two-step noise reduction (TSNR) technique removes the annoying reverberation effect while maintaining the benefits of the decision-directed approach. However, classic short-time noise reduction techniques, including TSNR, introduce harmonic distortion in the enhanced speech. To overcome this problem, a method called harmonic regeneration noise reduction (HRNR) is implemented in order to refine the a priori SNR used to compute a spectral gain able to preserve the speech harmonics as proposed by Plapous et al.
("Improved Signal-to-Noise Ratio Estimation for Speech Enhancement", IEEE Transactions on ASLP, Vol. 14, Issue 6, pp. 2098 - 2108, Nov. 2006).

%% example with the noisy speech file car.wav
>> [x,fs] = audioread('car.wav');
>> [out,~] = WienerNoiseReduction(x,fs,10000) % first 10000 samples are noise samples (without speech)
>> soundsc(out(1:122000),fs)

Cite As

Pascal Scalart (2021). Wiener filter for Noise Reduction and speech enhancement (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (32)

can you mail the actual executed matlab code of fir wiener filter to

Jason Ari

can you mail me the actual executed code in matlab to,

Hassan Ali Nabil

can you mail me the actual executed code in matlab to,

Pascal Scalart

A new version of the code is now available. The previous problem (i.e. data() should be changed to ns() ) has been fixed and a minimum value has been set to the gain of the noise reduction filter (in order to minimize speech distorsions).
Try the example :
[inSpeech,fs] = audioread('car.wav');
[outSpeech ,~] = WienerNoiseReduction(inSpeech,fs,10000);

Hongxing Luo

it works after changing data() to ns()

Chippy Jose

can you mail me the actual executed code in matlab to

Liang Ye

Janiel Colobong

Kiran Gidaganti

can you mail me the actual executed code in matlab to


This is a good implementation of the essay. I have a question over the gain control function. Why the first L/2 points and the last L/2 are chosen? I think it should be the first L points. And why the window is also applied to the modified time domain gain function? Moreover, how much is the aliasing error if gain control is not applied?

Zhanerke Turymtay

What is it data?

sandy s

Wendy Fernandez

Wendy Fernandez

Yu Yen Chung

david ehmig

robert nimon

what define IS?
as foreigner to english I can't explain myself the meaning of IS (Initial Silence )
Please reply me as soon as possible


Jose Alberto

Michal Tom

Michal Tom

some of the foreigners may not understand the programs which are in english.but i can see this,haha...

Priyanka Vispute

how to define IS?
please reply as soon as possible..

Shichao Hu

Jakub was right. it works after changing data() to ns()


doesnt compile - data() doesnt exist. not sure what previous comment: data() to ns() means?


the code which is provided gets stuck at this point given below.
nsum = nsum + abs(fft(nwin,NFFT)).^2;
can you please help me out regarding this.
the error showing is
"Error using ==> mpower
Matrix must be square.

Error in ==> WienerNoiseReduction at 57
nsum = nsum + abs(fft(nwin,NFFT)).^2;"

T venkata bhargav

Michael Chan

how do u set 'IS'? zeros with the same length as the noisy signal?
I get silence.

upendra agrawal

Wiener filter for Noise Reduction


Taewoo Lee

Jakub Muran

You must change data() to ns() (ns - argument noise speech)

cavko bavko

Yun Sue

Is the code with any mistakes? In the file, syntax of "nsum = data(...) " can't be executed. Can anyone tell me what is this mistake when I am reading my noise file?

Yun Sue

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!