To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at git://github.com/rmeddis/MAP.git .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Revision:

root / parameterStore / MAPparamsNormal.m @ 38:c2204b18f4a2

History | View | Annotate | Download (13.7 KB)

1 0:f233164f4c86 rmeddis
function method=MAPparamsNormal ...
2 26:b03ef38fe497 rmeddis
    (BFlist, sampleRate, showParams, paramChanges)
3 0:f233164f4c86 rmeddis
% MAPparams<> establishes a complete set of MAP parameters
4 35:25d53244d5c8 rmeddis
% Parameter file names must be of the form <MAPparams><name>
5 0:f233164f4c86 rmeddis
%
6 35:25d53244d5c8 rmeddis
% Input arguments
7 0:f233164f4c86 rmeddis
%  BFlist     (optional) specifies the desired list of channel BFs
8
%    otherwise defaults set below
9
%  sampleRate (optional), default is 50000.
10
%  showParams (optional) =1 prints out the complete set of parameters
11 35:25d53244d5c8 rmeddis
% Output argument
12 0:f233164f4c86 rmeddis
%  method passes a miscelleny of values
13 35:25d53244d5c8 rmeddis
%  the use of 'method' is being phased out. use globals
14 0:f233164f4c86 rmeddis
15 26:b03ef38fe497 rmeddis
global inputStimulusParams OMEParams DRNLParams IHC_cilia_RPParams
16 35:25d53244d5c8 rmeddis
global IHCpreSynapseParams  AN_IHCsynapseParams
17 0:f233164f4c86 rmeddis
global MacGregorParams MacGregorMultiParams  filteredSACFParams
18 35:25d53244d5c8 rmeddis
global experiment % used only by calls from multiThreshold
19
% global IHC_VResp_VivoParams
20 0:f233164f4c86 rmeddis
21
currentFile=mfilename;                      % i.e. the name of this mfile
22
method.parameterSource=currentFile(10:end); % for the record
23
24
efferentDelay=0.010;
25
method.segmentDuration=efferentDelay;
26
27
if nargin<3, showParams=0; end
28 38:c2204b18f4a2 rmeddis
if nargin<2, sampleRate=44100; end
29 0:f233164f4c86 rmeddis
if nargin<1 || BFlist(1)<0 % if BFlist= -1, set BFlist to default
30
    lowestBF=250; 	highestBF= 8000; 	numChannels=21;
31
    % 21 chs (250-8k)includes BFs at 250 500 1000 2000 4000 8000
32
    BFlist=round(logspace(log10(lowestBF),log10(highestBF),numChannels));
33
end
34 35:25d53244d5c8 rmeddis
% BFlist=1000;  % single channel option
35 0:f233164f4c86 rmeddis
36
% preserve for backward campatibility
37
method.nonlinCF=BFlist;
38
method.dt=1/sampleRate;
39
40
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41
% set  model parameters
42
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
44
%%  #1 inputStimulus
45
inputStimulusParams=[];
46
inputStimulusParams.sampleRate= sampleRate;
47
48
%%  #2 outerMiddleEar
49
OMEParams=[];  % clear the structure first
50
% outer ear resonances band pass filter  [gain lp order  hp]
51
OMEParams.externalResonanceFilters=      [ 10 1 1000 4000];
52
53
% highpass stapes filter
54
%  Huber gives 2e-9 m at 80 dB and 1 kHz (2e-13 at 0 dB SPL)
55 38:c2204b18f4a2 rmeddis
OMEParams.OMEstapesHPcutoff= 1000;
56 0:f233164f4c86 rmeddis
OMEParams.stapesScalar=	     45e-9;
57
58 35:25d53244d5c8 rmeddis
% Acoustic reflex: maximum attenuation should be around 25 dB (Price, 1966)
59 0:f233164f4c86 rmeddis
% i.e. a minimum ratio of 0.056.
60 16:37a379b27cff rmeddis
% 'spikes' model: AR based on brainstem spiking activity (LSR)
61 38:c2204b18f4a2 rmeddis
OMEParams.rateToAttenuationFactor=0.05; % * N(all ICspikes)
62 16:37a379b27cff rmeddis
% 'probability model': Ar based on AN firing probabilities (LSR)
63 38:c2204b18f4a2 rmeddis
OMEParams.rateToAttenuationFactorProb=0.02;    % * N(all ANrates)
64 16:37a379b27cff rmeddis
65 0:f233164f4c86 rmeddis
% asymptote should be around 100-200 ms
66 35:25d53244d5c8 rmeddis
OMEParams.ARtau=.250; % AR smoothing function 250 ms fits Hung and Dallos
67 0:f233164f4c86 rmeddis
% delay must be longer than the segment length
68
OMEParams.ARdelay=efferentDelay;  %Moss gives 8.5 ms latency
69 34:e097e9044ef6 rmeddis
OMEParams.ARrateThreshold=40;
70 0:f233164f4c86 rmeddis
71
%%  #3 DRNL
72
DRNLParams=[];  % clear the structure first
73 35:25d53244d5c8 rmeddis
% DRNLParams.BFlist=BFlist;
74 0:f233164f4c86 rmeddis
75 35:25d53244d5c8 rmeddis
%   *** DRNL nonlinear path
76
% broken stick compression
77 38:c2204b18f4a2 rmeddis
DRNLParams.a=2e4;       % DRNL.a=0 means no OHCs (no nonlinear path)
78 35:25d53244d5c8 rmeddis
DRNLParams.c=.2;        % compression exponent
79 38:c2204b18f4a2 rmeddis
DRNLParams.ctBMdB = 10; %Compression threshold dB re 10e-9 m displacement
80 0:f233164f4c86 rmeddis
81 35:25d53244d5c8 rmeddis
% filters
82
DRNLParams.nonlinOrder=	3;  % order of nonlinear gammatone filters
83 0:f233164f4c86 rmeddis
DRNLParams.nonlinCFs=BFlist;
84 38:c2204b18f4a2 rmeddis
DRNLParams.p=0.2895;   DRNLParams.q=250;   % save p and q for printing only
85
% p=0.2895;   q=250;      % human  (% p=0.14;   q=366;  % cat)
86
DRNLParams.nlBWs=  DRNLParams.p * BFlist + DRNLParams.q;
87 0:f233164f4c86 rmeddis
88 35:25d53244d5c8 rmeddis
%   *** DRNL linear path:
89 38:c2204b18f4a2 rmeddis
DRNLParams.g=100;       % linear path gain factor
90 35:25d53244d5c8 rmeddis
DRNLParams.linOrder=3;  % order of linear gammatone filters
91 0:f233164f4c86 rmeddis
% linCF is not necessarily the same as nonlinCF
92
minLinCF=153.13; coeffLinCF=0.7341;   % linCF>nonlinBF for BF < 1 kHz
93
DRNLParams.linCFs=minLinCF+coeffLinCF*BFlist;
94 35:25d53244d5c8 rmeddis
% bandwidths (linear)
95 0:f233164f4c86 rmeddis
minLinBW=100; coeffLinBW=0.6531;
96
DRNLParams.linBWs=minLinBW + coeffLinBW*BFlist; % bandwidths of linear  filters
97
98 35:25d53244d5c8 rmeddis
%   *** DRNL MOC efferents
99 0:f233164f4c86 rmeddis
DRNLParams.MOCdelay = efferentDelay;            % must be < segment length!
100 38:c2204b18f4a2 rmeddis
DRNLParams.minMOCattenuationdB=-35;
101 23:6cce421531e2 rmeddis
102 16:37a379b27cff rmeddis
% 'spikes' model: MOC based on brainstem spiking activity (HSR)
103 38:c2204b18f4a2 rmeddis
DRNLParams.MOCtau =.0285;                         % smoothing for MOC
104
DRNLParams.rateToAttenuationFactor = .03;  % strength of MOC
105
DRNLParams.rateToAttenuationFactor = .0055;  % strength of MOC
106 35:25d53244d5c8 rmeddis
107 38:c2204b18f4a2 rmeddis
% 'probability' model: MOC based on AN probability (HSR)
108 35:25d53244d5c8 rmeddis
DRNLParams.MOCtauProb =.285;                         % smoothing for MOC
109 38:c2204b18f4a2 rmeddis
DRNLParams.rateToAttenuationFactorProb = 0.007;  % strength of MOC
110
DRNLParams.MOCrateThresholdProb =67;                % spikes/s probability only
111 0:f233164f4c86 rmeddis
112
113
%% #4 IHC_cilia_RPParams
114 38:c2204b18f4a2 rmeddis
IHC_cilia_RPParams.tc=	0.00012;   % 0.0003 Shamma
115
IHC_cilia_RPParams.C=	0.08;       % 0.1 scalar (C_cilia )
116 0:f233164f4c86 rmeddis
IHC_cilia_RPParams.u0=	5e-9;
117
IHC_cilia_RPParams.s0=	30e-9;
118
IHC_cilia_RPParams.u1=	1e-9;
119
IHC_cilia_RPParams.s1=	1e-9;
120
121 28:02aa9826efe0 rmeddis
IHC_cilia_RPParams.Gmax= 6e-9;    % 2.5e-9 maximum conductance (Siemens)
122 8:eafe11c86f44 rmeddis
IHC_cilia_RPParams.Ga=	1e-9;  % 4.3e-9 fixed apical membrane conductance
123 28:02aa9826efe0 rmeddis
IHC_cilia_RPParams.Ga=	.8e-9;  % 4.3e-9 fixed apical membrane conductance
124 0:f233164f4c86 rmeddis
125
%  #5 IHC_RP
126
IHC_cilia_RPParams.Cab=	4e-012;         % IHC capacitance (F)
127 28:02aa9826efe0 rmeddis
% IHC_cilia_RPParams.Cab=	1e-012;         % IHC capacitance (F)
128 0:f233164f4c86 rmeddis
IHC_cilia_RPParams.Et=	0.100;          % endocochlear potential (V)
129
130
IHC_cilia_RPParams.Gk=	2e-008;         % 1e-8 potassium conductance (S)
131
IHC_cilia_RPParams.Ek=	-0.08;          % -0.084 K equilibrium potential
132
IHC_cilia_RPParams.Rpc=	0.04;           % combined resistances
133
134
135
%%  #5 IHCpreSynapse
136
IHCpreSynapseParams=[];
137
IHCpreSynapseParams.GmaxCa=	14e-9;% maximum calcium conductance
138 35:25d53244d5c8 rmeddis
% IHCpreSynapseParams.GmaxCa=	12e-9;% maximum calcium conductance
139 0:f233164f4c86 rmeddis
IHCpreSynapseParams.ECa=	0.066;  % calcium equilibrium potential
140
IHCpreSynapseParams.beta=	400;	% determine Ca channel opening
141
IHCpreSynapseParams.gamma=	100;	% determine Ca channel opening
142
IHCpreSynapseParams.tauM=	0.00005;	% membrane time constant ?0.1ms
143
IHCpreSynapseParams.power=	3;
144
% reminder: changing z has a strong effect on HF thresholds (like Et)
145
IHCpreSynapseParams.z=	    2e42;   % scalar Ca -> vesicle release rate
146
147 38:c2204b18f4a2 rmeddis
LSRtauCa=30e-6;            HSRtauCa=80e-6;            % seconds
148
% LSRtauCa=40e-6;            HSRtauCa=90e-6;            % seconds
149 35:25d53244d5c8 rmeddis
% IHCpreSynapseParams.tauCa= [15e-6 80e-6]; %LSR and HSR fiber
150 0:f233164f4c86 rmeddis
IHCpreSynapseParams.tauCa= [LSRtauCa HSRtauCa]; %LSR and HSR fiber
151
152
%%  #6 AN_IHCsynapse
153 35:25d53244d5c8 rmeddis
AN_IHCsynapseParams=[];             % clear the structure first
154
% number of AN fibers at each BF (used only for spike generation)
155
AN_IHCsynapseParams.numFibers=	100;
156
% absolute refractory period. Relative refractory period is the same.
157
AN_IHCsynapseParams.refractory_period=	0.00075;
158
AN_IHCsynapseParams.TWdelay=0.004;  % ?delay before stimulus first spike
159 38:c2204b18f4a2 rmeddis
AN_IHCsynapseParams.spikesTargetSampleRate=10000;
160
% AN_IHCsynapseParams.ANspeedUpFactor=5; % longer epochs for computing spikes.
161 35:25d53244d5c8 rmeddis
162 0:f233164f4c86 rmeddis
% c=kym/(y(l+r)+kl)	(spontaneous rate)
163
% c=(approx)  ym/l  (saturated rate)
164
AN_IHCsynapseParams.M=	12;         % maximum vesicles at synapse
165
AN_IHCsynapseParams.y=	4;          % depleted vesicle replacement rate
166
AN_IHCsynapseParams.y=	6;          % depleted vesicle replacement rate
167
168
AN_IHCsynapseParams.x=	30;         % replenishment from re-uptake store
169
AN_IHCsynapseParams.x=	60;         % replenishment from re-uptake store
170
171
% reduce l to increase saturated rate
172
AN_IHCsynapseParams.l=	100; % *loss rate of vesicles from the cleft
173
AN_IHCsynapseParams.l=	250; % *loss rate of vesicles from the cleft
174
175
AN_IHCsynapseParams.r=	500; % *reuptake rate from cleft into cell
176
% AN_IHCsynapseParams.r=	300; % *reuptake rate from cleft into cell
177
178 15:35af36fe0a35 rmeddis
179 0:f233164f4c86 rmeddis
%%  #7 MacGregorMulti (first order brainstem neurons)
180
MacGregorMultiParams=[];
181
MacGregorMultiType='chopper'; % MacGregorMultiType='primary-like'; %choose
182
switch MacGregorMultiType
183
    case 'primary-like'
184
        MacGregorMultiParams.nNeuronsPerBF=	10;   % N neurons per BF
185
        MacGregorMultiParams.type = 'primary-like cell';
186
        MacGregorMultiParams.fibersPerNeuron=4;   % N input fibers
187
        MacGregorMultiParams.dendriteLPfreq=200;  % dendritic filter
188
        MacGregorMultiParams.currentPerSpike=0.11e-6; % (A) per spike
189
        MacGregorMultiParams.Cap=4.55e-9;   % cell capacitance (Siemens)
190
        MacGregorMultiParams.tauM=5e-4;     % membrane time constant (s)
191
        MacGregorMultiParams.Ek=-0.01;      % K+ eq. potential (V)
192
        MacGregorMultiParams.dGkSpike=3.64e-5; % K+ cond.shift on spike,S
193
        MacGregorMultiParams.tauGk=	0.0012; % K+ conductance tau (s)
194
        MacGregorMultiParams.Th0=	0.01;   % equilibrium threshold (V)
195
        MacGregorMultiParams.c=	0.01;       % threshold shift on spike, (V)
196
        MacGregorMultiParams.tauTh=	0.015;  % variable threshold tau
197
        MacGregorMultiParams.Er=-0.06;      % resting potential (V)
198
        MacGregorMultiParams.Eb=0.06;       % spike height (V)
199
200
    case 'chopper'
201
        MacGregorMultiParams.nNeuronsPerBF=	10;   % N neurons per BF
202
        MacGregorMultiParams.type = 'chopper cell';
203
        MacGregorMultiParams.fibersPerNeuron=10;  % N input fibers
204
205
        MacGregorMultiParams.dendriteLPfreq=50;   % dendritic filter
206 38:c2204b18f4a2 rmeddis
        MacGregorMultiParams.currentPerSpike=28e-9; % *per spike
207 28:02aa9826efe0 rmeddis
%         MacGregorMultiParams.currentPerSpike=30e-9; % *per spike
208 0:f233164f4c86 rmeddis
209
        MacGregorMultiParams.Cap=1.67e-8; % ??cell capacitance (Siemens)
210
        MacGregorMultiParams.tauM=0.002;  % membrane time constant (s)
211
        MacGregorMultiParams.Ek=-0.01;    % K+ eq. potential (V)
212
        MacGregorMultiParams.dGkSpike=1.33e-4; % K+ cond.shift on spike,S
213 15:35af36fe0a35 rmeddis
        MacGregorMultiParams.tauGk=	0.0005;% K+ conductance tau (s)
214 0:f233164f4c86 rmeddis
        MacGregorMultiParams.Th0=	0.01; % equilibrium threshold (V)
215
        MacGregorMultiParams.c=	0;        % threshold shift on spike, (V)
216
        MacGregorMultiParams.tauTh=	0.02; % variable threshold tau
217
        MacGregorMultiParams.Er=-0.06;    % resting potential (V)
218
        MacGregorMultiParams.Eb=0.06;     % spike height (V)
219
        MacGregorMultiParams.PSTHbinWidth=	1e-4;
220
end
221
222
%%  #8 MacGregor (second-order neuron). Only one per channel
223
MacGregorParams=[];                 % clear the structure first
224
MacGregorParams.type = 'chopper cell';
225
MacGregorParams.fibersPerNeuron=10; % N input fibers
226
MacGregorParams.dendriteLPfreq=100; % dendritic filter
227 28:02aa9826efe0 rmeddis
MacGregorParams.currentPerSpike=40e-9;% *(A) per spike
228 0:f233164f4c86 rmeddis
229
MacGregorParams.Cap=16.7e-9;        % cell capacitance (Siemens)
230
MacGregorParams.tauM=0.002;         % membrane time constant (s)
231
MacGregorParams.Ek=-0.01;           % K+ eq. potential (V)
232
MacGregorParams.dGkSpike=1.33e-4;   % K+ cond.shift on spike,S
233 35:25d53244d5c8 rmeddis
MacGregorParams.tauGk=	0.0012;     % K+ conductance tau (s)
234 0:f233164f4c86 rmeddis
MacGregorParams.Th0=	0.01;       % equilibrium threshold (V)
235
MacGregorParams.c=	0;              % threshold shift on spike, (V)
236
MacGregorParams.tauTh=	0.02;       % variable threshold tau
237
MacGregorParams.Er=-0.06;           % resting potential (V)
238
MacGregorParams.Eb=0.06;            % spike height (V)
239
MacGregorParams.debugging=0;        % (special)
240
% wideband accepts input from all channels (of same fiber type)
241
% use wideband to create inhibitory units
242
MacGregorParams.wideband=0;         % special for wideband units
243
% MacGregorParams.saveAllData=0;
244
245
%%  #9 filteredSACF
246 38:c2204b18f4a2 rmeddis
% identify periodicities to be logged
247
    minPitch=	80; maxPitch=	500; numPitches=50;
248
    maxLag=1/minPitch; minLag=1/maxPitch;
249
    lags= linspace(minLag, maxLag, numPitches);
250
    pitches=10.^ linspace(log10(minPitch), log10(maxPitch),numPitches);
251
    pitches=fliplr(pitches);
252
    % convert to lags for ACF
253
    filteredSACFParams.lags=lags;     % autocorrelation lags vector
254
    filteredSACFParams.acfTau=	.003;       % time constant of running ACF
255
    filteredSACFParams.lambda=	0.12;       % slower filter to smooth ACF
256
    % request plot of within-channel ACFs at fixed intervals in time
257
    filteredSACFParams.plotACFs=1;
258
    filteredSACFParams.plotACFsInterval=0.002;
259
    filteredSACFParams.plotMoviePauses=.1;
260
261
    filteredSACFParams.usePressnitzer=0; % attenuates ACF at  long lags
262
    filteredSACFParams.lagsProcedure=  'useAllLags';
263
    %  'useAllLags' or 'omitShortLags'
264
    filteredSACFParams.criterionForOmittingLags=3;
265
266 0:f233164f4c86 rmeddis
267
% checks
268
if AN_IHCsynapseParams.numFibers<MacGregorMultiParams.fibersPerNeuron
269
    error('MacGregorMulti: too few input fibers for input to MacG unit')
270
end
271
272
273 26:b03ef38fe497 rmeddis
%% now accept last minute parameter changes required by the calling program
274
% paramChanges
275
if nargin>3 && ~isempty(paramChanges)
276 35:25d53244d5c8 rmeddis
    if ~iscellstr(paramChanges)
277 38:c2204b18f4a2 rmeddis
        error('paramChanges error: paramChanges not a cell array')
278 35:25d53244d5c8 rmeddis
    end
279
280 26:b03ef38fe497 rmeddis
    nChanges=length(paramChanges);
281
    for idx=1:nChanges
282 35:25d53244d5c8 rmeddis
        x=paramChanges{idx};
283
        x=deblank(x);
284
        if ~isempty(x)
285
            if ~strcmp(x(end),';')
286
                error(['paramChanges error (terminate with semicolon) ' x])
287
            end
288
            st=strtrim(x(1:strfind(x,'.')-1));
289
            fld=strtrim(x(strfind(x,'.')+1:strfind(x,'=')-1));
290
            value=x(strfind(x,'=')+1:end);
291
            if isempty(st) || isempty(fld) || isempty(value)
292
                error(['paramChanges error:' x])
293
            end
294
295
            x1=eval(['isstruct(' st ')']);
296
            cmd=['isfield(' st ',''' fld ''')'];
297
            x2=eval(cmd);
298
            if ~(x1*x2)
299
                error(['paramChanges error:' x])
300
            end
301
        end
302
303
        % no problems so go ahead
304 26:b03ef38fe497 rmeddis
        eval(paramChanges{idx})
305
    end
306
end
307
308
309 0:f233164f4c86 rmeddis
%% write all parameters to the command window
310
% showParams is currently set at the top of htis function
311
if showParams
312
    fprintf('\n %%%%%%%%\n')
313
    fprintf('\n%s\n', method.parameterSource)
314
    fprintf('\n')
315
    nm=UTIL_paramsList(whos);
316
    for i=1:length(nm)
317
        %         eval(['UTIL_showStruct(' nm{i} ', ''' nm{i} ''')'])
318
        if ~strcmp(nm(i), 'method')
319
            eval(['UTIL_showStructureSummary(' nm{i} ', ''' nm{i} ''', 10)'])
320
        end
321
    end
322
323 26:b03ef38fe497 rmeddis
    % highlight parameter changes made locally
324
    if nargin>3 && ~isempty(paramChanges)
325
        fprintf('\n Local parameter changes:\n')
326
        for i=1:length(paramChanges)
327
            disp(paramChanges{i})
328
        end
329 0:f233164f4c86 rmeddis
    end
330
end
331
332 26:b03ef38fe497 rmeddis
% for backward compatibility
333
experiment.comparisonData=[];