tomwalters@0
|
1 %
|
tomwalters@0
|
2 % Setting Default Parameter for GCFBv2
|
tomwalters@0
|
3 % Version 2.05
|
tomwalters@0
|
4 % Toshio IRINO
|
tomwalters@0
|
5 % Created: 31 Aug 2004
|
tomwalters@0
|
6 % Modified: 9 Nov 2004
|
tomwalters@0
|
7 % Modified: 31 May 2005
|
tomwalters@0
|
8 % Modified: 1 July 2005
|
tomwalters@0
|
9 % Modified: 8 July 2005 (bug fix in b2)
|
tomwalters@0
|
10 % Modified: 13 July 2005 ( GCparam.LvlEst.frat = 1.08)
|
tomwalters@0
|
11 % Modified: 14 July 2005 ( adding GCparam.LvlEst.RefdB, Pwr, Weight)
|
tomwalters@0
|
12 % Modified: 16 July 2005 ( GCparam.LvlEst.LctERB = 1.5)
|
tomwalters@0
|
13 %
|
tomwalters@0
|
14 % function GCparam = GCFBv2_SetParam(GCparam)
|
tomwalters@0
|
15 % INPUT: GCparam: Your preset gammachirp parameters
|
tomwalters@0
|
16 % GCparam.fs: Sampling rate (48000)
|
tomwalters@0
|
17 % GCparam.NumCh: Number of Channels (75)
|
tomwalters@0
|
18 % GCparam.FRange: Frequency Range of GCFB [100 6000]
|
tomwalters@0
|
19 % specifying asymptotic freq. of passive GC (Fr1)
|
tomwalters@0
|
20 %
|
tomwalters@0
|
21 % OUTPUT: GCparam: GCparam values
|
tomwalters@0
|
22 %
|
tomwalters@0
|
23 % Patterson, R.D., Unoki, M. and Irino, T. : JASA, Vol.114,pp.1529-1542,2003.
|
tomwalters@0
|
24 %
|
tomwalters@0
|
25 function GCparam = GCFBv2_SetParam(GCparam)
|
tomwalters@0
|
26
|
tomwalters@0
|
27 %%%% Handling Input Parameters %%%%%
|
tomwalters@0
|
28 if isfield(GCparam,'fs') == 0, GCparam.fs = []; end;
|
tomwalters@0
|
29 if length(GCparam.fs) == 0,
|
tomwalters@0
|
30 GCparam.fs = 48000;
|
tomwalters@0
|
31 end;
|
tomwalters@0
|
32 % if isfield(GCparam,'OutMidCrct') == 0, GCparam.OutMidCrct = []; end;
|
tomwalters@0
|
33 % if length(GCparam.OutMidCrct) == 0,
|
tomwalters@0
|
34 % GCparam.OutMidCrct = 'ELC';
|
tomwalters@0
|
35 % end;
|
tomwalters@0
|
36 GCparam.OutMidCrct = [];
|
tomwalters@0
|
37 %%% if no OutMidCrct is not necessary, specify GCparam.OutMidCrct = 'no';
|
tomwalters@0
|
38 %%
|
tomwalters@0
|
39 if isfield(GCparam,'NumCh') == 0, GCparam.NumCh = []; end;
|
tomwalters@0
|
40 if length(GCparam.NumCh) == 0,
|
tomwalters@0
|
41 GCparam.NumCh = 75;
|
tomwalters@0
|
42 end;
|
tomwalters@0
|
43 if isfield(GCparam,'FRange') == 0, GCparam.FRange = []; end;
|
tomwalters@0
|
44 if length(GCparam.FRange) == 0,
|
tomwalters@0
|
45 GCparam.FRange = [100 6000];
|
tomwalters@0
|
46 end;
|
tomwalters@0
|
47
|
tomwalters@0
|
48 %%%%% Gammachirp parameters %%%
|
tomwalters@0
|
49 if isfield(GCparam,'n') == 0, GCparam.n = []; end;
|
tomwalters@0
|
50 if length(GCparam.n) == 0,
|
tomwalters@0
|
51 GCparam.n = 4; % default gammatone & gammachirp
|
tomwalters@0
|
52 end;
|
tomwalters@0
|
53
|
tomwalters@0
|
54 %%% convention
|
tomwalters@0
|
55
|
tomwalters@0
|
56 if isfield(GCparam,'b1') == 0, GCparam.b1 = []; end;
|
tomwalters@0
|
57 if length(GCparam.b1) == 0,
|
tomwalters@0
|
58 GCparam.b1 = [1.81]; % scalar: frequency independent
|
tomwalters@0
|
59 end;
|
tomwalters@0
|
60 if isfield(GCparam,'c1') == 0, GCparam.c1 = []; end;
|
tomwalters@0
|
61 if length(GCparam.c1) == 0,
|
tomwalters@0
|
62 GCparam.c1 = [-2.96]; % scalar: frequency independet
|
tomwalters@0
|
63 end;
|
tomwalters@0
|
64
|
tomwalters@0
|
65 if isfield(GCparam,'frat') == 0, GCparam.frat = []; end;
|
tomwalters@0
|
66 if length(GCparam.frat) == 0,
|
tomwalters@0
|
67 GCparam.frat = [0.233, 0; 0.0050, 0];
|
tomwalters@0
|
68 end;
|
tomwalters@0
|
69
|
tomwalters@0
|
70 if isfield(GCparam,'b2') == 0, GCparam.b2 = []; end;
|
tomwalters@0
|
71 if length(GCparam.b2) == 0,
|
tomwalters@0
|
72 % GCparam.b2 = [2.01, 0; 0,0]; % no level-dependency bug
|
tomwalters@0
|
73 GCparam.b2 = [2.17, 0; 0,0]; % no level-dependency (8 Jul 05)
|
tomwalters@0
|
74 end;
|
tomwalters@0
|
75 if isfield(GCparam,'c2') == 0, GCparam.c2 = []; end;
|
tomwalters@0
|
76 if length(GCparam.c2) == 0,
|
tomwalters@0
|
77 % GCparam.c2 = [2.20, 0; 0,0]; %v203: no level-dependency; no freq-dependency
|
tomwalters@0
|
78 % GCparam.c2 = [1.98, 0; 0.0088, 0]; % == v203
|
tomwalters@0
|
79 % GCparam.c2 = [2.0, 0; 0.010, 0]; % no freq-dependecy: level-dependent
|
tomwalters@0
|
80 % for simplicity v204
|
tomwalters@0
|
81 % GCparam.c2 = [2.0, 0; 0.030, 0]; % 26 May 05 (NG! since Pc == mean value)
|
tomwalters@0
|
82 % GCparam.c2 = [2.1, 0; 0.010, 0]; % 27 May 05 (1 dB worse than 2.0 0.010 )
|
tomwalters@0
|
83 % GCparam.c2 = [2.0, 0; 0.015, 0]; % 31 May 05 (much worse than 2.0 0.010 )
|
tomwalters@0
|
84 % GCparam.c2 = [2.0, 0; 0.007, 0]; % 1 Jun 05 (OK! almost the same as 1st draft)
|
tomwalters@0
|
85 GCparam.c2 = [2.20, 0; 0, 0]; % 3 Jun 05 . It is good!
|
tomwalters@0
|
86 end;
|
tomwalters@0
|
87 if isfield(GCparam,'Ctrl') == 0, GCparam.Ctrl = []; end;
|
tomwalters@0
|
88 if length(GCparam.Ctrl) == 0,
|
tomwalters@0
|
89 GCparam.Ctrl = 'fix';
|
tomwalters@0
|
90 end;
|
tomwalters@0
|
91
|
tomwalters@0
|
92 if isfield(GCparam,'GainCmpnstdB') == 0, GCparam.GainCmpnstdB = []; end;
|
tomwalters@0
|
93 if length(GCparam.GainCmpnstdB) == 0,
|
tomwalters@0
|
94 GCparam.GainCmpnstdB = -1; % in dB. when LvlEst.c2==2.2, 1 July 2005
|
tomwalters@0
|
95 end;
|
tomwalters@0
|
96
|
tomwalters@0
|
97
|
tomwalters@0
|
98 %%%%%%% Parameters for level estimation %%%%%%%%%
|
tomwalters@0
|
99
|
tomwalters@0
|
100 if exist('GCparam.PpgcRef') == 1,
|
tomwalters@0
|
101 disp('The parameter "GCparam.PpgcRef" is obsolete.');
|
tomwalters@0
|
102 error('Please change it to GCparam.LvlRefdB.');
|
tomwalters@0
|
103 end;
|
tomwalters@0
|
104
|
tomwalters@0
|
105 if isfield(GCparam,'LvlRefdB') == 0, GCparam.LvlRefdB = []; end;
|
tomwalters@0
|
106 if length(GCparam.LvlRefdB) == 0,
|
tomwalters@0
|
107 GCparam.LvlRefdB = 50; % reference Ppgc level for normalization
|
tomwalters@0
|
108 end;
|
tomwalters@0
|
109
|
tomwalters@0
|
110 if isfield(GCparam,'LvlEst') == 0, GCparam.LvlEst = []; end;
|
tomwalters@0
|
111
|
tomwalters@0
|
112 if isfield(GCparam.LvlEst,'LctERB') == 0, GCparam.LvlEst.LctERB = []; end;
|
tomwalters@0
|
113 if length(GCparam.LvlEst.LctERB) == 0,
|
tomwalters@0
|
114 GCparam.LvlEst.LctERB = 1.0;
|
tomwalters@0
|
115 % Location of Level Estimation pGC relative to the signal pGC in ERB
|
tomwalters@0
|
116 % see testGC_LctERB.m for fitting result. 10 Sept 2004
|
tomwalters@0
|
117 GCparam.LvlEst.LctERB = 1.5; % 16 July 05
|
tomwalters@0
|
118 end;
|
tomwalters@0
|
119
|
tomwalters@0
|
120
|
tomwalters@0
|
121 if isfield(GCparam.LvlEst,'DecayHL') == 0, GCparam.LvlEst.DecayHL=[]; end;
|
tomwalters@0
|
122 if length(GCparam.LvlEst.DecayHL) == 0,
|
tomwalters@0
|
123 %%% GCparam.LvlEst.DecayHL = 1; % half life in ms, Mar 2005
|
tomwalters@0
|
124 GCparam.LvlEst.DecayHL = 0.5; % 18 July 2005
|
tomwalters@0
|
125 %%% Original name was PpgcEstExpHL
|
tomwalters@0
|
126 %%% Interesting findings on 12 Jul 04
|
tomwalters@0
|
127 %%% GCparam.PpgcEstExpHL = 2; % seems to produce distortion product
|
tomwalters@0
|
128 %%% GCparam.PpgcEstExpHL = 5; % original value without any info.
|
tomwalters@0
|
129 %%% Resonable value:
|
tomwalters@0
|
130 %%% GCparam.LvlEst.DecayHL = 1; % It is the best in the forward masking
|
tomwalters@0
|
131 end;
|
tomwalters@0
|
132
|
tomwalters@0
|
133 if isfield(GCparam.LvlEst,'b2') == 0, GCparam.LvlEst.b2=[]; end;
|
tomwalters@0
|
134 if length(GCparam.LvlEst.b2) == 0,
|
tomwalters@0
|
135 % GCparam.LvlEst.b2 = 1.5;
|
tomwalters@0
|
136 % GCparam.LvlEst.b2 = 2.01; % = b2 bug!
|
tomwalters@0
|
137 GCparam.LvlEst.b2 = GCparam.b2(1,1); % = b2 8 July 2005
|
tomwalters@0
|
138 end;
|
tomwalters@0
|
139
|
tomwalters@0
|
140 if isfield(GCparam.LvlEst,'c2') == 0, GCparam.LvlEst.c2=[]; end;
|
tomwalters@0
|
141 if length(GCparam.LvlEst.c2) == 0,
|
tomwalters@0
|
142 % GCparam.LvlEst.c2 = 2.7;
|
tomwalters@0
|
143 % GCparam.LvlEst.c2 = 2.20; % = c2
|
tomwalters@0
|
144 GCparam.LvlEst.c2 = GCparam.c2(1,1); % = c2
|
tomwalters@0
|
145 end;
|
tomwalters@0
|
146
|
tomwalters@0
|
147 if isfield(GCparam.LvlEst,'frat') == 0, GCparam.LvlEst.frat=[]; end;
|
tomwalters@0
|
148 if length(GCparam.LvlEst.frat) == 0,
|
tomwalters@0
|
149 % GCparam.LvlEst.frat = 1.1; % when b=2.01 & c=2.20
|
tomwalters@0
|
150 GCparam.LvlEst.frat = 1.08; % peak of cGC ~= 0 dB (b2=2.17 & c2=2.20)
|
tomwalters@0
|
151 end;
|
tomwalters@0
|
152
|
tomwalters@0
|
153 if isfield(GCparam.LvlEst,'RMStoSPLdB')==0, GCparam.LvlEst.RMStoSPLdB=[]; end;
|
tomwalters@0
|
154 if length(GCparam.LvlEst.RMStoSPLdB) == 0,
|
tomwalters@0
|
155 GCparam.LvlEst.RMStoSPLdB = 30; % 1 rms == 30 dB SPL for Meddis IHC
|
tomwalters@0
|
156 end;
|
tomwalters@0
|
157
|
tomwalters@0
|
158 if isfield(GCparam.LvlEst,'Weight')==0, GCparam.LvlEst.Weight=[]; end;
|
tomwalters@0
|
159 if length(GCparam.LvlEst.Weight) ==0,
|
tomwalters@0
|
160 GCparam.LvlEst.Weight = 0.5;
|
tomwalters@0
|
161 end;
|
tomwalters@0
|
162
|
tomwalters@0
|
163 if isfield(GCparam.LvlEst,'RefdB')==0, GCparam.LvlEst.RefdB=[]; end;
|
tomwalters@0
|
164 if length(GCparam.LvlEst.RefdB) < 2,
|
tomwalters@0
|
165 GCparam.LvlEst.RefdB = 50; % 50 dB SPL
|
tomwalters@0
|
166 end;
|
tomwalters@0
|
167
|
tomwalters@0
|
168 if isfield(GCparam.LvlEst,'Pwr')==0, GCparam.LvlEst.Pwr=[]; end;
|
tomwalters@0
|
169 if length(GCparam.LvlEst.Pwr) < 2,
|
tomwalters@0
|
170 GCparam.LvlEst.Pwr = [ 1.5, 0.5 ]; % Weight for pGC & cGC
|
tomwalters@0
|
171 end;
|
tomwalters@0
|
172
|
tomwalters@0
|
173 %%%%%%%%%%%
|
tomwalters@0
|
174
|