Manual implementation of filtfilt(b,a,x) or filter(b,a,x,zi)?
10 ビュー (過去 30 日間)
古いコメントを表示
Hi!
I want to implement 'filtfilt' function in C. 'filtfilt' function has 'filter' as its subfunction.
I could implement y=filter(b,a,x) as follows:
y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb) - a(2)*y(n-1) - ... - a(na+1)*y(n-na).........equation-1
Now accept the fact that I already have "zi" , how to implement y=filter(b,a,x,zi)? where, Zi=initial condition of the delay. What would be the change in equation-1 after the application of Zi?
Or is there any other way to implement directly filtfilt(b,a,x) in C?
Thanks!
0 件のコメント
回答 (1 件)
Jan
2017 年 2 月 13 日
For an implementation of filter() in C see https://www.mathworks.com/matlabcentral/fileexchange/32261-filterm . Inside FilterM.m you find code for an M-version also. In opposite to Matlab's filter() this C-version can operate in backward direction also to save the time for the creation of a reversed signal in filtfilt().
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Digital Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!