annotate arrows/dsp/afilter.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
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
|