Compiler/TMS320F28335: How to use low pass, high pass and band pass filters block in matlab for DSP code conversion

Part Number: TMS320F28335

Tool/software: TI C/C++ Compiler

Hi,

I am working on DSP controller, generation DSP code from MATLAB Simulink design. When I am using LPF, HPF and BPF, getting an error as fixed discrete not used for the continuous block. How can I use the filters in Matlab for DSP code conversion.

5 Replies

  • Venkat,

    I've not used DSP blocks for TI MCUs so far but you can fix this problem by changing the solver of your model. go to Simulation > Model Configuration....> Solver then change the "Solver options" to "Fixed-step" and "Solver" to "discrete (no continuous state)".

    Then in your model, the sample time for each block must be a discrete value or "-1".

    Regards,

    --Kash

    If my post answered your question, please click on "Verified answer" button.

    --Kash

     

  • In reply to Khashayar olia:

    Dear Sir,

    I am using the same solver parameters, which you have shown. The error shows that the low pass filter block does not  work for fixed-step discrete, 

    For using the Low pass filter block it shows that it should be kept as continuous, not discrete. But for generating the code for DSP we should use fixed-step discrete.

  • In reply to Venkat Ram:

    Can you take a screenshot of error and your model/blocks?

    --Kash

    --Kash

     

  • In reply to Khashayar olia:

    Dear Sir,

    The below the error I am getting

  • In reply to Venkat Ram:

    Venkat, 

    Use Simulink predefined LPF designed by FIR or IIR filter, this block uses FIR or IIR filter to design your LPF so the result is a time-discrete filter:

    I just build and successfully ran your model in Simulink. 

    Regards,

    --Kash

    If my post answered your question, please press "Verified answer" button.

    --Kash