フィルターのクリア

Manual implementation of filtfilt(b,a,x) or filter(b,a,x,zi)?

10 ビュー (過去 30 日間)
ssp
ssp 2017 年 2 月 13 日
回答済み: Jan 2017 年 2 月 13 日
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!

回答 (1 件)

Jan
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().

カテゴリ

Help Center および File ExchangeDigital Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by