Variable frame length for frame based processing
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!