Could someone please explain me this line in the code. This is used to calculate the number of silence segments in the degraded speech signal. The code is a part of boll spectral subtraction method. I have attached the whole code below.
NIS=fix((IS*fs-W)/(SP*W) +1); %number of initial silence segments
Why do we need to find the number of silence segments if we can work on the number of samples?
I guess there is because of function 'segment'.
Look at the help:
segment builds models .... assuming that the model parameters are piecewise constant over time. It results in a model that has split the data record into segments over which the model remains constant.
Maybe there is no fundamental difference, but for estimating noise using a function 'mean' over several initial windows W just takes less computations than working on samples.
fix= means close to zero for example 1.9 becomes 1.0 .
NIS means the number of segments of initial noise you will assume that there are in the beginning of the signal usually 250ms are store and if u are recording in a 10khz and shiftrate of the overlapping segements of sound is 0.4= meanning 40% overlap between each segment of 256 samples you will get 23 segments of initial noise.
later on spectral subtraction will use this to do the average noise
fix= means close to zero for example 1.9 becomes 1.0 .
NIS means the number of segments of initial noise you will assume that there are in the beginning of the signal usually 250ms are store and if u are recording in a 10khz and shiftrate of the overlapping segements of sound is 0.4= meanning 40% overlap between each segment of 256 samples you will get 23 segments of initial noise.
later on spectral subtraction will use this to do the average noise
ok so you have defined IS as 0.25 meaning 250 ms of recording without doing anything ( no subtraction just noise)
you need to find out how many samples are there is 0.25 of the second so you multiply it in the fs= 10khz ( meanning 10000 samples of noise in a second)
from that, take the number and divide it into the number of windows u are creating (sp*W) which means = how much overlapping samples are between each window.
let's say the first window is 200 samples. so u will have samples 0 to 200 , the second window will have 80 =sp*200 so it will start from 80 to 280.
in this way u can calculate how many overlapping windows you will have in the 250 ms of noise.
when u know this number NIS = 23
u will use it in line 44 in SSBoll79.m
N=mean(Y,1:NIS)')'; %initial Noise Power Spectrum mean
which basically says : do an average Magnitude for all the overlapping segments of the initial 250 ms of noise.