segmenting a speech signal and adding noise
3 views (last 30 days)
Show older comments
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
Accepted Answer
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
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.
More Answers (0)
See Also
Categories
Find more on Speech Recognition in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!