-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathOpticalFilter.m~
More file actions
25 lines (23 loc) · 787 Bytes
/
OpticalFilter.m~
File metadata and controls
25 lines (23 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function SignalVector= OpticalFilter(SignalVector, SignalVectorSize)
% /* Digital filter designed by mkfilter/mkshape/gencode A.J. Fisher
% Command line: /www/usr/fisher/helpers/mkfilter -Bu -Lp -o 2 -a 1.5625000000e-02 0.0000000000e+00 -l
%
% filtertype = Butterworth
% passtype = Lowpass
% order = 2
% samplerate = 6.4E11 = 2^6/ bit slot
% corner1 = 25E9
% */
NZEROS= 2;
NPOLES= 2;
oGAIN= 7.820233128e+01;
xv= zeros(NZEROS+ 1);
yv= zeros(NPOLES+1);
for i=1: SignalVectorSize
xv(1)= xv(2); xv(2) = xv(3);
xv(3)= SignalVector(i)/ oGAIN;
yv(1)= yv(2); yv(2) = yv(3);
yv(3)= (xv[0] + xv[2]) + 2 * xv[1]
+ ( -0.7067570632 * yv[0]) + ( 1.6556076929 * yv[1]);
SignalVector[i] = yv[2];
end