tomwalters@0
|
1 %
|
tomwalters@0
|
2 % Asymmetric Compensation Coefficients of the IIR gammachirp
|
tomwalters@0
|
3 % Toshio Irino
|
tomwalters@0
|
4 % 14 Apr. 99
|
tomwalters@0
|
5 %
|
tomwalters@0
|
6 % Edit this file for consistensy since these values would change.
|
tomwalters@0
|
7 % MakeAsymCmpFilters.m AsymCmpFrsp.m
|
tomwalters@0
|
8 %
|
tomwalters@0
|
9 % function [coef_r, coef_th, coef_fn, coef0] = AsymCmpCoef(c,coef0,NumFilt),
|
tomwalters@0
|
10 % INPUT c: array of c values
|
tomwalters@0
|
11 % coef0: vector of 6 coefficients.
|
tomwalters@0
|
12 % NumFilt: default 4
|
tomwalters@0
|
13 % OUTPUT coef_r : coefficients for r
|
tomwalters@0
|
14 % coef_th: coefficients for th
|
tomwalters@0
|
15 % coef_fn: coefficients for fn
|
tomwalters@0
|
16 %
|
tomwalters@0
|
17 function [coef_r, coef_th, coef_fn, coef0] = AsymCmpCoef(c,coef0,NumFilt),
|
tomwalters@0
|
18
|
tomwalters@0
|
19 if nargin < 2 | length(coef0) == 0, % default
|
tomwalters@0
|
20 % coef0 = [1.35, -0.19, 0.292, -0.004, 0.058, 0.0018];
|
tomwalters@0
|
21 % coef0 = [1.35, -0.19, 0.292, -0.004, 0.058*4, 0.0018*4]; % n compensation
|
tomwalters@0
|
22 coef0 = [1.35, -0.19, 0.29, -0.0040, 0.23, 0.0072]; % n compensation
|
tomwalters@0
|
23 end;
|
tomwalters@0
|
24 if nargin < 3, NumFilt = 4; end;
|
tomwalters@0
|
25
|
tomwalters@0
|
26 c = c(:);
|
tomwalters@0
|
27 NumCh = length(c);
|
tomwalters@0
|
28 coef_r = zeros(NumCh,NumFilt);
|
tomwalters@0
|
29 coef_th = zeros(NumCh,NumFilt);
|
tomwalters@0
|
30 coef_fn = zeros(NumCh,NumFilt);
|
tomwalters@0
|
31
|
tomwalters@0
|
32 for Nfilt = 1:NumFilt,
|
tomwalters@0
|
33 coef_r(1:NumCh,Nfilt) = (coef0(1) + coef0(2)*abs(c)) * Nfilt;
|
tomwalters@0
|
34 coef_th(1:NumCh,Nfilt) = (coef0(3) + coef0(4)*abs(c)) * 2^(Nfilt-1);
|
tomwalters@0
|
35 coef_fn(1:NumCh,Nfilt) = (coef0(5) + coef0(6)*abs(c)) * Nfilt;
|
tomwalters@0
|
36 end;
|
tomwalters@0
|
37
|
tomwalters@0
|
38
|
tomwalters@0
|
39
|
tomwalters@0
|
40
|
tomwalters@0
|
41
|
tomwalters@0
|
42
|