how to generate a filter code including coefficients?
2 ビュー (過去 30 日間)
古いコメントを表示
I would like to generate custom Matlab codes with Zero phase filter (filtfilt) like generateFilteringCode(FC). How can I do it? With generateFilteringCode(FC), a matlab function is generated with the filter coefficients. I would like to generate or program a matlab function for Zero phase filter, however, I have no idea how to including into the filter coefficients like a function generated from generateFilteringCode(FC). Any advice? Many thanks
Qingshan
0 件のコメント
回答 (1 件)
Meade
2017 年 3 月 2 日
Qingshan,
Based on you question, it seems like you really have 2 needs:
#1) Calculate the filter coefficients for a particular scenario & filter type (e.g. fir, iir, etc etc)
#2) Apply the coefficients to a signal such that you will see no phase-shift in the output.
For question 1, check out designfilt. This will help you calculate the necessary coefficients. I have also written a wrapper function for the old SAE-J211 low pass filters . It might give you an idea of how to do it.
For question 2, once you have your coefficients, you can use filtfilt if you have the "Signal Processing Toolbox". If you do not, check out the excellent function FilterM by Jan Simon. It works with lots for lots of applications and doesn't need any toolboxes.
参考
カテゴリ
Help Center および File Exchange で Statistics and Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!