这个例子展示了如何使用DSP系统对象™为ARM使用代码替换库(CRL)。该模型使用MATLAB功能块它包含一个dsp。冷杉Filter System object to filter two sine waves of different frequencies.
1.打开模型,其中包含MATLAB函数块和dsp。FIRFilter系统对象。MATLAB函数内部firfundsp。冷杉Filter System object is created just once and is declared to be持续的.这消除了每次调用函数时创建System对象的新实例的开销。它还允许用户执行dsp的阶跃功能。冷杉Filter object multiple times with a persistent state by simply running the model with the MATLAB Function block in multiple time steps.
2.在MATLAB®中更改当前文件夹为可写文件夹。
3.为。模拟和设置模型手臂Cortex-M的任务1和任务2进行代码替换在ARM Cortex-M处理器上验证FIR滤波器的例子。
1.打开MATLAB函数块内冷杉子系统。
2.验证dsp。冷杉Filter System object has the following settings for its properties:
结构:直接的形式(默认)
NumeratorSource:财产(默认)
InitialConditions:0(默认)
1.为冷杉的任务3在ARM Cortex-M处理器上验证FIR滤波器的例子。
2.在代码生成报告中,单击FIR.c文件。注意模型中的CMSIS函数arm_fir_init_f32和arm_fir_f32阶跃函数, FIR_step。
要使用PIL执行上述步骤,您必须有ARM Cortex-M处理器的嵌入式编码器支持包和ARM Cortex-M处理器的DST支持包。金宝app下面的例子告诉你如何使用PIL与ARM Cortex-M:
代码验证和验证与PIL和外部模式的例子。