annotate arrows/dsp/afilter.m @ 6:0ce3c2070089
Removed duplicate code and fixed doc in timed_action.
author |
samer |
date |
Mon, 14 Jan 2013 14:33:37 +0000 |
parents |
672052bd81f8 |
children |
|
rev |
line source |
samer@0
|
1 % afilter - Linear filter arrow
|
samer@0
|
2 %
|
samer@0
|
3 % afilter ::
|
samer@0
|
4 % [[P]] ~'filter B coefficients',
|
samer@0
|
5 % [[Q]] ~'filter A coefficients',
|
samer@0
|
6 % -> arrow({[[N]]},{[[N]]},[[O]]).
|
samer@0
|
7 %
|
samer@0
|
8 % The arrow afilter(B,A) is equivalent to using filter(B,A,X)
|
samer@0
|
9 % on a signal in an array.
|
samer@0
|
10
|
samer@0
|
11 function o=afilter(b,a,zi)
|
samer@0
|
12
|
samer@0
|
13 if nargin<3, zi=[]; end
|
samer@0
|
14 o = loop(@filt,@(s)zi);
|
samer@0
|
15 function [y,z]=filt(x,z)
|
samer@0
|
16 [y,z]=filter(b,a,x,z);
|
samer@0
|
17 end
|
samer@0
|
18 end
|