Matlab Enframe function C + + implementation

Source: Internet
Author: User

MATLAB uses the enframe to deal with the speech signal in the speech processing.

I looked over the internet for some information about Enframe:

Y=enframe (X,framelength,step);

X is the signal vector, which can be a heading or a column vector,

Framelength is the length of each frame,

Step refers to the number of samples moved between a frame and a frame, some of which are called non-overlapping lengths,

The number of frames divided is: NF = fix ((nx-framelength+step)/step),

Where NX is the length of x, Y is an array of framelength*nf or nf*framelength, depending on whether X is a row vector or a column vector.

//c++ Implementation of enframe frame function
Input:
float* x: Signal source (line vector)
int Framelength: The length of each frame
int step: The number of samples moved between a frame and a frame, some of which are called non-overlapping lengths
//
Output:
A number of frames * Two-dimensional array of each frame length



Static float* * Enframe (Const floatX[],intSrclength,intFramelength,intStep) { intNF = Floor ((srclength-framelength + Step)/step);//figure out the number of frames float* * YENFRAME;//used to store the resultsYenframe =New float*[NF]; for(inti =0; I < NF; i++) {Yenframe[i]=New float[Framelength]; } intCount =0; intStartno =0; while(Count <NF) { for(inti =0; i < framelength; i++) {Yenframe[count][i]= X[startno +i]; } Count++; Startno+=step; } returnYenframe;}

Matlab Enframe function C + + implementation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.