converting matlab code into simulink

how to use the final conditions of filters as initial conditions in discrete FIR filter in simulink?
I make blocks and then take lpc coeffiecient so I will have different initial condition each time, how can I put them in simulink, I implement it on command window and it works correctly but in simulink there is a problem with continuity, can somebody help, plz?

回答 (1 件)

Jon Boerner
Jon Boerner 2014 年 10 月 20 日

0 投票

In the mask for the Discrete FIR Filter in Simulink, there is an option to specify the initial states:
You can use this option to set the initial states to start at nonzero values. Is this what you are looking for?

4 件のコメント

abdulqader
abdulqader 2014 年 10 月 20 日
編集済み: abdulqader 2014 年 10 月 20 日
thanks for ur respond
I know that but I filter an audio file using blocks system, so I need to make the initial condition change everytime like time varying proccessing, and this option in ur pic allow me to put one value that all blocks will have.
abdulqader
abdulqader 2014 年 10 月 20 日
I used >> set_param('lowpass_filter_block7','LoadInitialState','on', 'InitialState', ['xFinal0']) , but it gives me( One or more output arguments not assigned during call to "set_param"). how can I solve this problem.
Jon Boerner
Jon Boerner 2014 年 10 月 21 日
For the Discrete FIR Filter block I had used, you can use:
>> set_param(gcb, 'InitialStates', ['xFinal0'])
Note that InitialStates is plural, and that the LoadInitialState parameter does not need to be set.
Also, it is worth noting that for the analogous IIR block, you can have the states as an input to the block, as well as an input to reset the block to new initial states:
abdulqader
abdulqader 2014 年 10 月 29 日
what is xfinal0 that you put? because when I put xfinal0 and simulate my matlab exit automatically

サインインしてコメントする。

カテゴリ

質問済み:

2014 年 10 月 19 日

コメント済み:

2014 年 10 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by