Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

segmentation in matlab

Status
Not open for further replies.

1437

Computer
Oct 23, 2003
4
How to break down a speech signal into frame of 160 samples, each frame covers 20ms?
 
Replies continue below

Recommended for you

This is untested, but it should give you an ideal of what to do.
Code:
sigdata = your original signal in a row vector
spf = 160; % number of samples required per frame
sigdata_pad = [sigdata zeros(1,spf-mod(length(sigdata),spf)]; % pad the signal with zeros so that its length is a multiple of 160
framed_data = reshape(sigdata,[],spf);

M
 
I have tried the above code but there is some error, how to get rid of the error?


??? Error using ==> reshape
Product of known dimensions, 160, not divisible into total number of elements, 11412.

Error in ==> C:\MATLAB6p5\work\test.m
On line 16 ==> framed_data = reshape(sigdata,[],spf);

 
I have sloved the problem by changing it to
framed_data = reshape(data_pad,[],spf);

is that right?
also how to plot a graph of it?
I have tried before, but the graph look very strange
so is it possible to represent the framed_data in a waveform/ line graph?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor