spectral subtraction in audio file

hi everybody, can anyone give sample(reference ) code for noise cancellation using spectral subtraction in matlab ?
Thanks, Deepa.R

 Accepted Answer

OCDER
OCDER on 24 Aug 2018
Edited: OCDER on 24 Aug 2018
I see you've already seen some FEX submissions. The question you seem to have is "how to use this code instead of "nargin". nargin is a special variable that only counts how many inputs are given to a function. You don't use the code by replacing nargin.
This comment is from the 1st file exchange's submission:
% OUTPUT=SSBOLL79(S,FS,IS)
% Spectral Subtraction based on Boll 79. Amplitude spectral subtraction
% Includes Magnitude Averaging and Residual noise Reduction
% S is the noisy signal, FS is the sampling frequency and IS is the initial
% silence (noise only) length in seconds (default value is .25 sec)
%
% April-05
% Esfandiar Zavarehei
For you to use it, you have to download the codes, place the codes in a folder, add the folder to the matlab path, and then summon the code like this:
[S, FS] = wavread('c:\User\MyFile.wav'); %Replace wavread input with your file name
IS = 0.3; %replace with your value
OUTPUT = SSBoll79(S, FS, IS)

12 Comments

[S, FS] = wavread('c:\User\MyFile.wav'); %Replace wavread input with your file name IS = 0.3; %replace with your value OUTPUT = SSBOLL79(S, FS, IS) the above lines i placed in my current matlab path but it is showing error in function call. i couldn't able to call SSBOLL79(S, FS, IS) in main file. can u please clearly tell how to call this function in main file ?
SSBoll79 instead of SSBOL79.
Case-sensitive function call. I fixed the answer above.
it is showing undefined function SSBoll79... how to clear this ?
Where is SSBoll79.m saved?
addpath('c:\Folder_Where_SSBoll79_Is\')
When you do this, you should get the right path to SSBoll79.m
which SSBoll79
hii, yeah file compiled but in audiowrite('test.wav' ,here what variable to give?)
audiowrite(FileName, S, FS)
doc audiowrite
hi... still, my output is receiving noise only. but i want only speech from noisy speech input.. any suggestions ?
I'm not an expert at noise removal, but seems like you have to play around with the noise subtraction value. The "IS" variable. Make it smaller or larger and see what happens.
Is the new .wav file noisier or just as noisy? I don't think you can entirely remove noise, as noise is a subjective thing. What seems like noise to you isn't noise to me. Some static noise could be removed by using a moving average.
S = smooth(S, 10);
There are also other tools out there that are more specialized for noise removal from audio, like audacity. https://www.audacityteam.org/
thank you ocder. I will check it up..
Hello, Deepa. Are you finished removing noise from noisy speech signal? I am now facing with problems as u had. If you are already finished can you suggest me?
Can someone tell me what is the value IS ? and how can we choose the approproiate value?
It is Initial Silence

Sign in to comment.

More Answers (0)

Asked:

on 24 Aug 2018

Commented:

on 21 Apr 2020

Community Treasure Hunt

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

Start Hunting!