segmenting a speech signal and adding noise

3 views (last 30 days)
hi! i need a matlab code to segment a speech signal to frames of 20ms each and add noise to each of them! pls help..
  2 Comments
raksha sv
raksha sv on 25 Mar 2012
i gave a 2 sec speech as input.. using wavread.. i have to segment it with overlap and add a random noise (rand(1,n)) to each segment... without using inbuilt functions .. because i need to port to later...

Sign in to comment.

Accepted Answer

Wayne King
Wayne King on 25 Mar 2012
If you have the Signal Processing Toolbox, you can use buffer(). Otherwise you can use reshape(), but buffer() allows you to easily overlap the frames.
For example, I'll assume that the sampling frequency is 40 kHz, so that in this case 800 samples is 0.020
t = 0:1/40e3:10-(1/40e3);
x = cos(2*pi*2000*t)+sin(2*pi*4000*t);
x = x(:);
Y = buffer(x,800);
The above gives you 500 frames of 800 samples each with no overlap.
Now if you want a 0.005 overlap for each frame, that is 200 samples.
Y = buffer(x,800,200);
Then you can create a matrix of noise the same size as Y and add that noise matrix to your signal matrix.
  3 Comments
Farideh Jalali
Farideh Jalali on 30 Sep 2012
How we can change SNR in speech signal while adding noise?
Image Analyst
Image Analyst on 30 Sep 2012
Simply adding noise will change the SNR, at least by some amount - it must since you have a finite quantized signal.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!