Variable frame length for frame based processing

2 ビュー (過去 30 日間)
Krishna
Krishna 2012 年 2 月 6 日
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.

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by