Variable frame length for frame based...

Variable frame length for frame based processing

Posted in the Mathworks Forum

Variable frame length

India

#1 Feb 6, 2012
I have an integrator processing module(simulink model). I need to give an input data frame of some sizes(200,500 etc). For simulation purposes i can give 200 and then run the algorithms. For some channels 500 samples processing is used. So i need to change the input data frame length to 500 and then run again the simulation. For simulation purposes it is okay.While all calls will be with 5 sec. worth of data, some measurements call it with a 40Hz data set (i.e. 200 samples per frame) while others call the processing with a 100Hz data set (i.e. 500 samples per frame). The individual sampling rates / frame lengths area already known at compile time and will not change during run time. Somehow the frame length needs to be configurable,since i want to generate an effcient code.

Code structure for current implementation:

void someProcessing_custom(float32_ t arg_sensorData[500], float32_t *arg_resultScalar1, float32_t *arg_resultScalar2)
{
uint16_t dataPointIdx;

// some processing on arg_sensorData
for (dataPointIdx = 0U; dataPointIdx < 500U; dataPointIdx++){
...
}


// write the return values

*arg_resultScalar1 =...
*arg_resultScalar2 =...

}

Example code structure that I could imagine:

void someProcessing_custom(float32_ t *arg_sensorData, processSetUpStruct_t *arg_processSetup, float32_t *arg_resultScalar1, float32_t *arg_resultScalar2)
{
uint16_t dataPointIdx;

// some processing on arg_sensorData
for (dataPointIdx = 0U; dataPointIdx < arg_processSetup.frameLength; dataPointIdx++){
...
}


// write the return values

*arg_resultScalar1 =...
*arg_resultScalar2 =...
}

Pointer to input data variable is required in the generated code(how to make adjustments in the model or settings to get this).

Please help me to find a solution for this issue.

Tell me when this thread is updated:

Subscribe Now Add to my Tracker

Add your comments below

Characters left: 4000

Please note by submitting this form you acknowledge that you have read the Terms of Service and the comment you are posting is in compliance with such terms. Be polite. Inappropriate posts may be removed by the moderator. Send us your feedback.

Mathworks Discussions

Title Updated Last By Comments
Learn Matlab at Udemy (Apr '15) Apr '15 samita023 1
pnn (Jul '13) Jul '13 Swati 1
environnement mathlab vers xilinks XSG (Jan '13) Jan '13 Nedia 1
Instruction Text (Oct '12) Oct '12 Rebecca 1
speech recognition (Apr '12) Apr '12 pranay 1
optimization tool box of matlab (Mar '12) Mar '12 Omer Bajwa 1
UDP connection using Simulink on Linux (Feb '12) Feb '12 Michele 1
More from around the web