Revision 26:b03ef38fe497
| MAP/MAP1_14.m | ||
|---|---|---|
| 52 | 52 |
% AR is computed using across channel activity |
| 53 | 53 |
% MOC is computed on a within-channel basis. |
| 54 | 54 |
|
| 55 |
if nargin<1 |
|
| 56 |
error(' MAP1_14 is not a script but a function that must be called')
|
|
| 57 |
end |
|
| 58 |
|
|
| 59 |
if nargin<6 |
|
| 60 |
paramChanges=[]; |
|
| 61 |
end |
|
| 62 |
% Read parameters from MAPparams<***> file in 'parameterStore' folder |
|
| 63 |
cmd=['method=MAPparams' MAPparamsName ... |
|
| 64 |
'(BFlist, sampleRate, 0, paramChanges);']; |
|
| 65 |
eval(cmd); |
|
| 66 |
% Beware, 'BFlist=-1' is a legitimate argument for MAPparams<> |
|
| 67 |
% if the calling program allows MAPparams to specify the list |
|
| 68 |
BFlist=DRNLParams.nonlinCFs; |
|
| 55 | 69 |
|
| 56 | 70 |
% save as global for later plotting if required |
| 57 | 71 |
savedBFlist=BFlist; |
| 58 | 72 |
saveAN_spikesOrProbability=AN_spikesOrProbability; |
| 59 | 73 |
saveMAPparamsName=MAPparamsName; |
| 60 | 74 |
|
| 61 |
% Read parameters from MAPparams<***> file in 'parameterStore' folder |
|
| 62 |
cmd=['method=MAPparams' MAPparamsName ... |
|
| 63 |
'(BFlist, sampleRate, 0);']; |
|
| 64 |
eval(cmd); |
|
| 65 |
|
|
| 66 |
% Beware, 'BFlist=-1' is a legitimate argument for MAPparams<> |
|
| 67 |
% if the calling program allows MAPparams to specify the list |
|
| 68 |
BFlist=DRNLParams.nonlinCFs; |
|
| 69 |
|
|
| 70 |
% now accept last mintue parameter changes required by the calling program |
|
| 71 |
if nargin>5 && ~isempty(paramChanges) |
|
| 72 |
nChanges=length(paramChanges); |
|
| 73 |
for idx=1:nChanges |
|
| 74 |
eval(paramChanges{idx})
|
|
| 75 |
end |
|
| 76 |
end |
|
| 77 |
|
|
| 78 | 75 |
dt=1/sampleRate; |
| 79 | 76 |
duration=length(inputSignal)/sampleRate; |
| 80 | 77 |
% segmentDuration is specified in parameter file (must be >efferent delay) |
| ... | ... | |
| 190 | 187 |
|
| 191 | 188 |
MOCrateToAttenuationFactor=DRNLParams.rateToAttenuationFactor; |
| 192 | 189 |
rateToAttenuationFactorProb=DRNLParams.rateToAttenuationFactorProb; |
| 193 |
MOCrateThreshold=DRNLParams.MOCrateThreshold;
|
|
| 190 |
MOCrateThresholdProb=DRNLParams.MOCrateThresholdProb;
|
|
| 194 | 191 |
|
| 195 | 192 |
% smoothing filter for MOC |
| 196 | 193 |
a1=dt/DRNLParams.MOCtau-1; a0=1; |
| ... | ... | |
| 355 | 352 |
% Spikes are necessary if CN and IC are to be computed |
| 356 | 353 |
nFibersPerChannel= AN_IHCsynapseParams.numFibers; |
| 357 | 354 |
nANfibers= nChannels*nFibersPerChannel; |
| 355 |
AN_refractory_period= AN_IHCsynapseParams.refractory_period; |
|
| 358 | 356 |
|
| 359 | 357 |
y=AN_IHCsynapseParams.y; |
| 360 | 358 |
l=AN_IHCsynapseParams.l; |
| ... | ... | |
| 377 | 375 |
|
| 378 | 376 |
ANprobability=zeros(nChannels,segmentLength); |
| 379 | 377 |
ANprobRateOutput=zeros(nChannels,signalLength); |
| 378 |
lengthAbsRefractoryP= round(AN_refractory_period/dt); |
|
| 380 | 379 |
% special variables for monitoring synaptic cleft (specialists only) |
| 381 | 380 |
savePavailableSeg=zeros(nChannels,segmentLength); |
| 382 | 381 |
savePavailable=zeros(nChannels,signalLength); |
| 383 | 382 |
|
| 384 | 383 |
% spikes % ! ! ! ! ! ! ! ! |
| 385 |
AN_refractory_period= AN_IHCsynapseParams.refractory_period; |
|
| 386 | 384 |
lengthAbsRefractory= round(AN_refractory_period/ANdt); |
| 387 | 385 |
|
| 388 | 386 |
AN_ydt= repmat(AN_IHCsynapseParams.y*ANdt, nANfibers,1); |
| ... | ... | |
| 777 | 775 |
[smoothedRates, MOCprobBoundary{idx}] = ...
|
| 778 | 776 |
filter(MOCfilt_b, MOCfilt_a, rates(idx,:), ... |
| 779 | 777 |
MOCprobBoundary{idx});
|
| 780 |
smoothedRates=smoothedRates-MOCrateThreshold; |
|
| 778 |
smoothedRates=smoothedRates-MOCrateThresholdProb;
|
|
| 781 | 779 |
smoothedRates(smoothedRates<0)=0; |
| 782 | 780 |
MOCattenuation(idx,segmentStartPTR:segmentEndPTR)= ... |
| 783 | 781 |
(1- smoothedRates* rateToAttenuationFactorProb); |
| ... | ... | |
| 1131 | 1129 |
|
| 1132 | 1130 |
end % segment |
| 1133 | 1131 |
|
| 1132 |
%% apply refractory correction to spike probabilities |
|
| 1133 |
|
|
| 1134 |
% switch AN_spikesOrProbability |
|
| 1135 |
% case 'probability' |
|
| 1136 |
% ANprobOutput=ANprobRateOutput*dt; |
|
| 1137 |
% [r c]=size(ANprobOutput); |
|
| 1138 |
% % find probability of no spikes in refractory period |
|
| 1139 |
% pNoSpikesInRefrac=ones(size(ANprobOutput)); |
|
| 1140 |
% pSpike=zeros(size(ANprobOutput)); |
|
| 1141 |
% for epochNo=lengthAbsRefractoryP+2:c |
|
| 1142 |
% pNoSpikesInRefrac(:,epochNo)=... |
|
| 1143 |
% pNoSpikesInRefrac(:,epochNo-2)... |
|
| 1144 |
% .*(1-pSpike(:,epochNo-1))... |
|
| 1145 |
% ./(1-pSpike(:,epochNo-lengthAbsRefractoryP-1)); |
|
| 1146 |
% pSpike(:,epochNo)= ANprobOutput(:,epochNo)... |
|
| 1147 |
% .*pNoSpikesInRefrac(:,epochNo); |
|
| 1148 |
% end |
|
| 1149 |
% ANprobRateOutput=pSpike/dt; |
|
| 1150 |
% end |
|
| 1151 |
|
|
| 1134 | 1152 |
path(restorePath) |
| MAP/MAP1_14parallel.m | ||
|---|---|---|
| 192 | 192 |
|
| 193 | 193 |
MOCrateToAttenuationFactor=DRNLParams.rateToAttenuationFactor; |
| 194 | 194 |
rateToAttenuationFactorProb=DRNLParams.rateToAttenuationFactorProb; |
| 195 |
MOCrateThreshold=DRNLParams.MOCrateThreshold;
|
|
| 195 |
MOCrateThresholdProb=DRNLParams.MOCrateThresholdProb;
|
|
| 196 | 196 |
|
| 197 | 197 |
% smoothing filter for MOC |
| 198 | 198 |
% Nyquist=(1/ANdt)/2; |
| ... | ... | |
| 819 | 819 |
[smoothedRates, MOCprobBoundary{idx}] = ...
|
| 820 | 820 |
filter(MOCfilt_b, MOCfilt_a, rates(idx,:), ... |
| 821 | 821 |
MOCprobBoundary{idx});
|
| 822 |
smoothedRates=smoothedRates-MOCrateThreshold; |
|
| 822 |
smoothedRates=smoothedRates-MOCrateThresholdProb;
|
|
| 823 | 823 |
smoothedRates(smoothedRates<0)=0; |
| 824 | 824 |
MOCattenuation(idx,segmentStartPTR:segmentEndPTR)= ... |
| 825 | 825 |
(1- smoothedRates* rateToAttenuationFactorProb); |
| multithreshold 1.46/old files/MAPmodel.m | ||
|---|---|---|
| 30 | 30 |
options.printFiringRates=1; |
| 31 | 31 |
options.showACF=0; |
| 32 | 32 |
options.showEfferent=1; |
| 33 |
UTIL_showMAP(options) |
|
| 33 |
UTIL_showMAP(options, paramChanges)
|
|
| 34 | 34 |
end |
| 35 | 35 |
|
| 36 | 36 |
% No response, probably caused by hitting 'stop' button |
| multithreshold 1.46/testAN.m | ||
|---|---|---|
| 108 | 108 |
numHSRfibers=numLSRfibers; |
| 109 | 109 |
|
| 110 | 110 |
LSRspikes=ANoutput(1:numLSRfibers,:); |
| 111 |
PSTH=UTIL_makePSTH(LSRspikes, ANdt, localPSTHbinwidth);
|
|
| 111 |
PSTH=UTIL_PSTHmaker(LSRspikes, ANdt, localPSTHbinwidth);
|
|
| 112 | 112 |
PSTHLSR=mean(PSTH,1)/localPSTHbinwidth; % across fibers rates |
| 113 | 113 |
PSTHtime=localPSTHbinwidth:localPSTHbinwidth:... |
| 114 | 114 |
localPSTHbinwidth*length(PSTH); |
| ... | ... | |
| 117 | 117 |
|
| 118 | 118 |
% HSR |
| 119 | 119 |
HSRspikes= ANoutput(end- numHSRfibers+1:end, :); |
| 120 |
PSTH=UTIL_makePSTH(HSRspikes, ANdt, localPSTHbinwidth);
|
|
| 120 |
PSTH=UTIL_PSTHmaker(HSRspikes, ANdt, localPSTHbinwidth);
|
|
| 121 | 121 |
PSTH=mean(PSTH,1)/localPSTHbinwidth; % sum across fibers (HSR only) |
| 122 | 122 |
AN_HSRonset(levelNo)= max(PSTH); |
| 123 | 123 |
AN_HSRsaturated(levelNo)= mean(PSTH(round(length(PSTH)/2): end)); |
| ... | ... | |
| 150 | 150 |
[nCNneurons c]=size(CNoutput); |
| 151 | 151 |
nLSRneurons=round(nCNneurons/nTaus); |
| 152 | 152 |
CNLSRspikes=CNoutput(1:nLSRneurons,:); |
| 153 |
PSTH=UTIL_makePSTH(CNLSRspikes, ANdt, localPSTHbinwidth);
|
|
| 153 |
PSTH=UTIL_PSTHmaker(CNLSRspikes, ANdt, localPSTHbinwidth);
|
|
| 154 | 154 |
PSTH=sum(PSTH)/nLSRneurons; |
| 155 | 155 |
CNLSRrate(levelNo)=mean(PSTH(round(length(PSTH)/2):end))/localPSTHbinwidth; |
| 156 | 156 |
|
| 157 | 157 |
%CN HSR |
| 158 | 158 |
MacGregorMultiHSRspikes=... |
| 159 | 159 |
CNoutput(end-nLSRneurons:end,:); |
| 160 |
PSTH=UTIL_makePSTH(MacGregorMultiHSRspikes, ANdt, localPSTHbinwidth);
|
|
| 160 |
PSTH=UTIL_PSTHmaker(MacGregorMultiHSRspikes, ANdt, localPSTHbinwidth);
|
|
| 161 | 161 |
PSTH=sum(PSTH)/nLSRneurons; |
| 162 | 162 |
PSTH=mean(PSTH,1)/localPSTHbinwidth; % sum across fibers (HSR only) |
| 163 | 163 |
|
| ... | ... | |
| 174 | 174 |
[nICneurons c]=size(ICoutput); |
| 175 | 175 |
nLSRneurons=round(nICneurons/nTaus); |
| 176 | 176 |
ICLSRspikes=ICoutput(1:nLSRneurons,:); |
| 177 |
PSTH=UTIL_makePSTH(ICLSRspikes, ANdt, localPSTHbinwidth);
|
|
| 177 |
PSTH=UTIL_PSTHmaker(ICLSRspikes, ANdt, localPSTHbinwidth);
|
|
| 178 | 178 |
ICLSRsaturated(levelNo)=mean(PSTH(round(length(PSTH)/2):end))/localPSTHbinwidth; |
| 179 | 179 |
|
| 180 | 180 |
%IC HSR |
| 181 | 181 |
MacGregorMultiHSRspikes=... |
| 182 | 182 |
ICoutput(end-nLSRneurons:end,:); |
| 183 |
PSTH=UTIL_makePSTH(MacGregorMultiHSRspikes, ANdt, localPSTHbinwidth);
|
|
| 183 |
PSTH=UTIL_PSTHmaker(MacGregorMultiHSRspikes, ANdt, localPSTHbinwidth);
|
|
| 184 | 184 |
PSTH=sum(PSTH)/nLSRneurons; |
| 185 | 185 |
PSTH=mean(PSTH,1)/localPSTHbinwidth; % sum across fibers (HSR only) |
| 186 | 186 |
|
| multithreshold 1.46/testBM.m | ||
|---|---|---|
| 19 | 19 |
% levels= 50; nLevels=length(levels); |
| 20 | 20 |
|
| 21 | 21 |
relativeFrequencies=[0.25 .5 .75 1 1.25 1.5 2]; |
| 22 |
% relativeFrequencies=1;
|
|
| 22 |
relativeFrequencies=1; |
|
| 23 | 23 |
|
| 24 | 24 |
% refBMdisplacement is the displacement of the BM at threshold |
| 25 | 25 |
% 1 nm disp at threshold (9 kHz, Ruggero) |
| multithreshold 1.46/testSynapse.m | ||
|---|---|---|
| 26 | 26 |
useEfferent=0; % no efferent |
| 27 | 27 |
|
| 28 | 28 |
silenceDuration=0.005; |
| 29 |
silenceDuration=0.015; |
|
| 29 | 30 |
maskerDuration=0.1; |
| 30 | 31 |
recoveryDuration=0.15; |
| 31 | 32 |
rampDuration=0.004; |
| parameterStore/MAPparamsEndo.m | ||
|---|---|---|
| 1 | 1 |
function method=MAPparamsEndo ... |
| 2 |
(BFlist, sampleRate, showParams) |
|
| 2 |
(BFlist, sampleRate, showParams, paramChanges)
|
|
| 3 | 3 |
% MAPparams<> establishes a complete set of MAP parameters |
| 4 | 4 |
% Parameter file names must be of the form <MAPparams> <name> |
| 5 | 5 |
% |
| ... | ... | |
| 58 | 58 |
% i.e. a minimum ratio of 0.056. |
| 59 | 59 |
% 'spikes' model: AR based on brainstem spiking activity (LSR) |
| 60 | 60 |
OMEParams.rateToAttenuationFactor=0.006; % * N(all ICspikes) |
| 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes)
|
|
| 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes) |
|
| 62 | 62 |
|
| 63 | 63 |
% 'probability model': Ar based on AN firing probabilities (LSR) |
| 64 | 64 |
OMEParams.rateToAttenuationFactorProb=0.01;% * N(all ANrates) |
| 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates)
|
|
| 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates) |
|
| 66 | 66 |
|
| 67 | 67 |
% asymptote should be around 100-200 ms |
| 68 | 68 |
OMEParams.ARtau=.05; % AR smoothing function |
| ... | ... | |
| 104 | 104 |
DRNLParams.rateToAttenuationFactor = .01; % strength of MOC |
| 105 | 105 |
% DRNLParams.rateToAttenuationFactor = 0; % strength of MOC |
| 106 | 106 |
% 'probability' model: MOC based on AN spiking activity (HSR) |
| 107 |
DRNLParams.rateToAttenuationFactorProb = .005; % strength of MOC |
|
| 107 |
DRNLParams.rateToAttenuationFactorProb = .0055; % strength of MOC
|
|
| 108 | 108 |
% DRNLParams.rateToAttenuationFactorProb = .0; % strength of MOC |
| 109 |
DRNLParams.MOCrateThreshold =70; % spikes/s probability only |
|
| 109 |
DRNLParams.MOCrateThresholdProb =70; % spikes/s probability only
|
|
| 110 | 110 |
|
| 111 | 111 |
DRNLParams.MOCtau =.1; % smoothing for MOC |
| 112 | 112 |
|
| ... | ... | |
| 263 | 263 |
end |
| 264 | 264 |
|
| 265 | 265 |
|
| 266 |
%% now accept last minute parameter changes required by the calling program |
|
| 267 |
% paramChanges |
|
| 268 |
if nargin>3 && ~isempty(paramChanges) |
|
| 269 |
nChanges=length(paramChanges); |
|
| 270 |
for idx=1:nChanges |
|
| 271 |
eval(paramChanges{idx})
|
|
| 272 |
end |
|
| 273 |
end |
|
| 274 |
|
|
| 275 |
|
|
| 266 | 276 |
%% write all parameters to the command window |
| 267 | 277 |
% showParams is currently set at the top of htis function |
| 268 | 278 |
if showParams |
| ... | ... | |
| 276 | 286 |
eval(['UTIL_showStructureSummary(' nm{i} ', ''' nm{i} ''', 10)'])
|
| 277 | 287 |
end |
| 278 | 288 |
end |
| 289 |
|
|
| 290 |
% highlight parameter changes made locally |
|
| 291 |
if nargin>3 && ~isempty(paramChanges) |
|
| 292 |
fprintf('\n Local parameter changes:\n')
|
|
| 293 |
for i=1:length(paramChanges) |
|
| 294 |
disp(paramChanges{i})
|
|
| 295 |
end |
|
| 296 |
end |
|
| 279 | 297 |
end |
| 280 | 298 |
|
| 281 | 299 |
|
| parameterStore/MAPparamsNormal.m | ||
|---|---|---|
| 1 | 1 |
function method=MAPparamsNormal ... |
| 2 |
(BFlist, sampleRate, showParams) |
|
| 2 |
(BFlist, sampleRate, showParams, paramChanges)
|
|
| 3 | 3 |
% MAPparams<> establishes a complete set of MAP parameters |
| 4 | 4 |
% Parameter file names must be of the form <MAPparams> <name> |
| 5 | 5 |
% |
| ... | ... | |
| 11 | 11 |
% output argument |
| 12 | 12 |
% method passes a miscelleny of values |
| 13 | 13 |
|
| 14 |
global inputStimulusParams OMEParams DRNLParams |
|
| 14 |
global inputStimulusParams OMEParams DRNLParams IHC_cilia_RPParams
|
|
| 15 | 15 |
global IHC_VResp_VivoParams IHCpreSynapseParams AN_IHCsynapseParams |
| 16 | 16 |
global MacGregorParams MacGregorMultiParams filteredSACFParams |
| 17 | 17 |
global experiment % used by calls from multiThreshold only |
| 18 |
global IHC_cilia_RPParams |
|
| 18 |
|
|
| 19 | 19 |
|
| 20 | 20 |
currentFile=mfilename; % i.e. the name of this mfile |
| 21 | 21 |
method.parameterSource=currentFile(10:end); % for the record |
| ... | ... | |
| 58 | 58 |
% i.e. a minimum ratio of 0.056. |
| 59 | 59 |
% 'spikes' model: AR based on brainstem spiking activity (LSR) |
| 60 | 60 |
OMEParams.rateToAttenuationFactor=0.006; % * N(all ICspikes) |
| 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes)
|
|
| 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes) |
|
| 62 | 62 |
|
| 63 | 63 |
% 'probability model': Ar based on AN firing probabilities (LSR) |
| 64 | 64 |
OMEParams.rateToAttenuationFactorProb=0.01;% * N(all ANrates) |
| 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates)
|
|
| 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates) |
|
| 66 | 66 |
|
| 67 | 67 |
% asymptote should be around 100-200 ms |
| 68 | 68 |
OMEParams.ARtau=.05; % AR smoothing function |
| ... | ... | |
| 104 | 104 |
DRNLParams.rateToAttenuationFactor = .01; % strength of MOC |
| 105 | 105 |
% DRNLParams.rateToAttenuationFactor = 0; % strength of MOC |
| 106 | 106 |
% 'probability' model: MOC based on AN spiking activity (HSR) |
| 107 |
DRNLParams.rateToAttenuationFactorProb = .005; % strength of MOC |
|
| 107 |
DRNLParams.rateToAttenuationFactorProb = .0055; % strength of MOC
|
|
| 108 | 108 |
% DRNLParams.rateToAttenuationFactorProb = .0; % strength of MOC |
| 109 |
DRNLParams.MOCrateThreshold =70; % spikes/s probability only |
|
| 109 |
DRNLParams.MOCrateThresholdProb =70; % spikes/s probability only
|
|
| 110 | 110 |
|
| 111 | 111 |
DRNLParams.MOCtau =.1; % smoothing for MOC |
| 112 | 112 |
|
| ... | ... | |
| 263 | 263 |
end |
| 264 | 264 |
|
| 265 | 265 |
|
| 266 |
%% now accept last minute parameter changes required by the calling program |
|
| 267 |
% paramChanges |
|
| 268 |
if nargin>3 && ~isempty(paramChanges) |
|
| 269 |
nChanges=length(paramChanges); |
|
| 270 |
for idx=1:nChanges |
|
| 271 |
eval(paramChanges{idx})
|
|
| 272 |
end |
|
| 273 |
end |
|
| 274 |
|
|
| 275 |
|
|
| 266 | 276 |
%% write all parameters to the command window |
| 267 | 277 |
% showParams is currently set at the top of htis function |
| 268 | 278 |
if showParams |
| ... | ... | |
| 276 | 286 |
eval(['UTIL_showStructureSummary(' nm{i} ', ''' nm{i} ''', 10)'])
|
| 277 | 287 |
end |
| 278 | 288 |
end |
| 279 |
end |
|
| 280 | 289 |
|
| 281 |
|
|
| 282 |
|
|
| 283 |
% ********************************************************************** comparison data |
|
| 284 |
% store individual data here for display on the multiThreshold GUI (if used) |
|
| 285 |
% the final value in each vector is an identifier (BF or duration)) |
|
| 286 |
if isstruct(experiment) |
|
| 287 |
switch experiment.paradigm |
|
| 288 |
case {'IFMC','IFMC_8ms'}
|
|
| 289 |
% based on MPa |
|
| 290 |
comparisonData=[ |
|
| 291 |
66 51 49 48 46 45 54 250; |
|
| 292 |
60 54 46 42 39 49 65 500; |
|
| 293 |
64 51 38 32 33 59 75 1000; |
|
| 294 |
59 51 36 30 41 81 93 2000; |
|
| 295 |
71 63 53 44 36 76 95 4000; |
|
| 296 |
70 64 43 35 35 66 88 6000; |
|
| 297 |
110 110 110 110 110 110 110 8000; |
|
| 298 |
]; |
|
| 299 |
if length(BFlist)==1 && ~isempty(comparisonData) |
|
| 300 |
availableFrequencies=comparisonData(:,end)'; |
|
| 301 |
findRow= find(BFlist==availableFrequencies); |
|
| 302 |
if ~isempty (findRow) |
|
| 303 |
experiment.comparisonData=comparisonData(findRow,:); |
|
| 304 |
end |
|
| 305 |
end |
|
| 306 |
|
|
| 307 |
case {'TMC','TMC_8ms'}
|
|
| 308 |
% based on MPa |
|
| 309 |
comparisonData=[ |
|
| 310 |
48 58 63 68 75 80 85 92 99 250; |
|
| 311 |
33 39 40 49 52 61 64 77 79 500; |
|
| 312 |
39 42 50 81 83 92 96 97 110 1000; |
|
| 313 |
24 26 32 37 46 51 59 71 78 2000; |
|
| 314 |
65 68 77 85 91 93 110 110 110 4000; |
|
| 315 |
20 19 26 44 80 95 96 110 110 6000; |
|
| 316 |
]; |
|
| 317 |
if length(BFlist)==1 && ~isempty(comparisonData) |
|
| 318 |
availableFrequencies=comparisonData(:,end)'; |
|
| 319 |
findRow= find(BFlist==availableFrequencies); |
|
| 320 |
if ~isempty (findRow) |
|
| 321 |
experiment.comparisonData=comparisonData(findRow,:); |
|
| 322 |
end |
|
| 323 |
end |
|
| 324 |
|
|
| 325 |
case { 'absThreshold', 'absThreshold_8'}
|
|
| 326 |
% MPa thresholds |
|
| 327 |
experiment.comparisonData=[ |
|
| 328 |
32 26 16 18 22 22 0.008; |
|
| 329 |
16 13 6 9 15 11 0.500 |
|
| 330 |
]; |
|
| 331 |
|
|
| 332 |
|
|
| 333 |
otherwise |
|
| 334 |
experiment.comparisonData=[]; |
|
| 290 |
% highlight parameter changes made locally |
|
| 291 |
if nargin>3 && ~isempty(paramChanges) |
|
| 292 |
fprintf('\n Local parameter changes:\n')
|
|
| 293 |
for i=1:length(paramChanges) |
|
| 294 |
disp(paramChanges{i})
|
|
| 295 |
end |
|
| 335 | 296 |
end |
| 336 | 297 |
end |
| 337 | 298 |
|
| 338 |
|
|
| 299 |
% for backward compatibility |
|
| 300 |
experiment.comparisonData=[]; |
|
| parameterStore/MAPparamsNormalTest.m | ||
|---|---|---|
| 1 |
function method=MAPparamsNormalTest ... |
|
| 2 |
(BFlist, sampleRate, showParams) |
|
| 3 |
% MAPparams<> establishes a complete set of MAP parameters |
|
| 4 |
% Parameter file names must be of the form <MAPparams> <name> |
|
| 5 |
% |
|
| 6 |
% input arguments |
|
| 7 |
% 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 |
% output argument |
|
| 12 |
% method passes a miscelleny of values |
|
| 13 |
|
|
| 14 |
global inputStimulusParams OMEParams DRNLParams |
|
| 15 |
global IHC_VResp_VivoParams IHCpreSynapseParams AN_IHCsynapseParams |
|
| 16 |
global MacGregorParams MacGregorMultiParams filteredSACFParams |
|
| 17 |
global experiment % used by calls from multiThreshold only |
|
| 18 |
global IHC_cilia_RPParams |
|
| 19 |
|
|
| 20 |
currentFile=mfilename; % i.e. the name of this mfile |
|
| 21 |
method.parameterSource=currentFile(10:end); % for the record |
|
| 22 |
|
|
| 23 |
efferentDelay=0.010; |
|
| 24 |
method.segmentDuration=efferentDelay; |
|
| 25 |
|
|
| 26 |
if nargin<3, showParams=0; end |
|
| 27 |
if nargin<2, sampleRate=50000; end |
|
| 28 |
if nargin<1 || BFlist(1)<0 % if BFlist= -1, set BFlist to default |
|
| 29 |
lowestBF=250; highestBF= 8000; numChannels=21; |
|
| 30 |
% 21 chs (250-8k)includes BFs at 250 500 1000 2000 4000 8000 |
|
| 31 |
BFlist=round(logspace(log10(lowestBF),log10(highestBF),numChannels)); |
|
| 32 |
end |
|
| 33 |
% BFlist=1000; |
|
| 34 |
|
|
| 35 |
% preserve for backward campatibility |
|
| 36 |
method.nonlinCF=BFlist; |
|
| 37 |
method.dt=1/sampleRate; |
|
| 38 |
|
|
| 39 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
| 40 |
% set model parameters |
|
| 41 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
| 42 |
|
|
| 43 |
%% #1 inputStimulus |
|
| 44 |
inputStimulusParams=[]; |
|
| 45 |
inputStimulusParams.sampleRate= sampleRate; |
|
| 46 |
|
|
| 47 |
%% #2 outerMiddleEar |
|
| 48 |
OMEParams=[]; % clear the structure first |
|
| 49 |
% outer ear resonances band pass filter [gain lp order hp] |
|
| 50 |
OMEParams.externalResonanceFilters= [ 10 1 1000 4000]; |
|
| 51 |
|
|
| 52 |
% highpass stapes filter |
|
| 53 |
% Huber gives 2e-9 m at 80 dB and 1 kHz (2e-13 at 0 dB SPL) |
|
| 54 |
OMEParams.OMEstapesLPcutoff= 1000; |
|
| 55 |
OMEParams.stapesScalar= 45e-9; |
|
| 56 |
|
|
| 57 |
% Acoustic reflex: maximum attenuation should be around 25 dB Price (1966) |
|
| 58 |
% i.e. a minimum ratio of 0.056. |
|
| 59 |
% 'spikes' model: AR based on brainstem spiking activity (LSR) |
|
| 60 |
OMEParams.rateToAttenuationFactor=0.006; % * N(all ICspikes) |
|
| 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes) |
|
| 62 |
|
|
| 63 |
% 'probability model': Ar based on AN firing probabilities (LSR) |
|
| 64 |
OMEParams.rateToAttenuationFactorProb=0.01;% * N(all ANrates) |
|
| 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates) |
|
| 66 |
|
|
| 67 |
% asymptote should be around 100-200 ms |
|
| 68 |
OMEParams.ARtau=.05; % AR smoothing function |
|
| 69 |
% delay must be longer than the segment length |
|
| 70 |
OMEParams.ARdelay=efferentDelay; %Moss gives 8.5 ms latency |
|
| 71 |
OMEParams.ARrateThreshold=0; |
|
| 72 |
|
|
| 73 |
%% #3 DRNL |
|
| 74 |
DRNLParams=[]; % clear the structure first |
|
| 75 |
DRNLParams.BFlist=BFlist; |
|
| 76 |
|
|
| 77 |
% DRNL nonlinear path |
|
| 78 |
DRNLParams.a=5e4; % DRNL.a=0 means no OHCs (no nonlinear path) |
|
| 79 |
DRNLParams.a=0e4; % DRNL.a=0 means no OHCs (no nonlinear path) |
|
| 80 |
|
|
| 81 |
DRNLParams.b=8e-6; % *compression threshold raised compression |
|
| 82 |
% DRNLParams.b=12e-6; % *compression threshold raised compression |
|
| 83 |
% DRNLParams.b=1; % b=1 means no compression |
|
| 84 |
|
|
| 85 |
DRNLParams.c=0.2; % compression exponent |
|
| 86 |
% nonlinear filters |
|
| 87 |
DRNLParams.nonlinCFs=BFlist; |
|
| 88 |
DRNLParams.nonlinOrder= 3; % order of nonlinear gammatone filters |
|
| 89 |
p=0.2895; q=170; % human (% p=0.14; q=366; % cat) |
|
| 90 |
DRNLParams.nlBWs= p * BFlist + q; |
|
| 91 |
DRNLParams.p=p; DRNLParams.q=q; % save p and q for printing only |
|
| 92 |
|
|
| 93 |
% DRNL linear path: |
|
| 94 |
DRNLParams.g=1000; % linear path gain factor |
|
| 95 |
% linCF is not necessarily the same as nonlinCF |
|
| 96 |
minLinCF=153.13; coeffLinCF=0.7341; % linCF>nonlinBF for BF < 1 kHz |
|
| 97 |
DRNLParams.linCFs=minLinCF+coeffLinCF*BFlist; |
|
| 98 |
DRNLParams.linOrder= 3; % order of linear gammatone filters |
|
| 99 |
minLinBW=100; coeffLinBW=0.6531; |
|
| 100 |
DRNLParams.linBWs=minLinBW + coeffLinBW*BFlist; % bandwidths of linear filters |
|
| 101 |
|
|
| 102 |
% DRNL MOC efferents |
|
| 103 |
DRNLParams.MOCdelay = efferentDelay; % must be < segment length! |
|
| 104 |
|
|
| 105 |
% 'spikes' model: MOC based on brainstem spiking activity (HSR) |
|
| 106 |
DRNLParams.rateToAttenuationFactor = .01; % strength of MOC |
|
| 107 |
% DRNLParams.rateToAttenuationFactor = 0; % strength of MOC |
|
| 108 |
% 'probability' model: MOC based on AN spiking activity (HSR) |
|
| 109 |
DRNLParams.rateToAttenuationFactorProb = .005; % strength of MOC |
|
| 110 |
% DRNLParams.rateToAttenuationFactorProb = .0; % strength of MOC |
|
| 111 |
DRNLParams.MOCrateThresholdProb =70; % spikes/s probability only |
|
| 112 |
|
|
| 113 |
DRNLParams.MOCtau =.1; % smoothing for MOC |
|
| 114 |
|
|
| 115 |
|
|
| 116 |
%% #4 IHC_cilia_RPParams |
|
| 117 |
|
|
| 118 |
IHC_cilia_RPParams.tc= 0.0003; % 0.0003 filter time simulates viscocity |
|
| 119 |
% IHC_cilia_RPParams.tc= 0.0005; % 0.0003 filter time simulates viscocity |
|
| 120 |
IHC_cilia_RPParams.C= 0.01; % 0.1 scalar (C_cilia ) |
|
| 121 |
IHC_cilia_RPParams.u0= 5e-10; |
|
| 122 |
IHC_cilia_RPParams.s0= 10e-10; |
|
| 123 |
IHC_cilia_RPParams.u1= 5e-10; |
|
| 124 |
IHC_cilia_RPParams.s1= 5e-10; |
|
| 125 |
|
|
| 126 |
IHC_cilia_RPParams.Gmax= 4e-9; % 2.5e-9 maximum conductance (Siemens) |
|
| 127 |
IHC_cilia_RPParams.Ga= 1.5e-9; % 4.3e-9 fixed apical membrane conductance |
|
| 128 |
|
|
| 129 |
% #5 IHC_RP |
|
| 130 |
IHC_cilia_RPParams.Cab= 4e-012; % IHC capacitance (F) |
|
| 131 |
IHC_cilia_RPParams.Cab= 2e-012; % IHC capacitance (F) |
|
| 132 |
IHC_cilia_RPParams.Et= 0.100; % endocochlear potential (V) |
|
| 133 |
|
|
| 134 |
IHC_cilia_RPParams.Gk= 2e-008; % 1e-8 potassium conductance (S) |
|
| 135 |
IHC_cilia_RPParams.Ek= -0.08; % -0.084 K equilibrium potential |
|
| 136 |
IHC_cilia_RPParams.Rpc= 0.04; % combined resistances |
|
| 137 |
|
|
| 138 |
|
|
| 139 |
%% #5 IHCpreSynapse |
|
| 140 |
IHCpreSynapseParams=[]; |
|
| 141 |
IHCpreSynapseParams.GmaxCa= 14e-9;% maximum calcium conductance |
|
| 142 |
IHCpreSynapseParams.GmaxCa= 12e-9;% maximum calcium conductance |
|
| 143 |
IHCpreSynapseParams.ECa= 0.066; % calcium equilibrium potential |
|
| 144 |
IHCpreSynapseParams.beta= 400; % determine Ca channel opening |
|
| 145 |
IHCpreSynapseParams.gamma= 100; % determine Ca channel opening |
|
| 146 |
IHCpreSynapseParams.tauM= 0.00005; % membrane time constant ?0.1ms |
|
| 147 |
IHCpreSynapseParams.power= 3; |
|
| 148 |
% reminder: changing z has a strong effect on HF thresholds (like Et) |
|
| 149 |
IHCpreSynapseParams.z= 1e42; % scalar Ca -> vesicle release rate |
|
| 150 |
|
|
| 151 |
LSRtauCa=35e-6; HSRtauCa=85e-6; % seconds |
|
| 152 |
% LSRtauCa=35e-6; HSRtauCa=70e-6; % seconds |
|
| 153 |
IHCpreSynapseParams.tauCa= [LSRtauCa HSRtauCa]; %LSR and HSR fiber |
|
| 154 |
|
|
| 155 |
%% #6 AN_IHCsynapse |
|
| 156 |
% c=kym/(y(l+r)+kl) (spontaneous rate) |
|
| 157 |
% c=(approx) ym/l (saturated rate) |
|
| 158 |
AN_IHCsynapseParams=[]; % clear the structure first |
|
| 159 |
AN_IHCsynapseParams.M= 12; % maximum vesicles at synapse |
|
| 160 |
AN_IHCsynapseParams.y= 4; % depleted vesicle replacement rate |
|
| 161 |
% AN_IHCsynapseParams.y= 6; % depleted vesicle replacement rate |
|
| 162 |
|
|
| 163 |
AN_IHCsynapseParams.x= 10; % replenishment from re-uptake store |
|
| 164 |
AN_IHCsynapseParams.x= 60; % replenishment from re-uptake store |
|
| 165 |
|
|
| 166 |
% reduce l to increase saturated rate |
|
| 167 |
AN_IHCsynapseParams.l= 150; % *loss rate of vesicles from the cleft |
|
| 168 |
% AN_IHCsynapseParams.l= 250; % *loss rate of vesicles from the cleft |
|
| 169 |
|
|
| 170 |
AN_IHCsynapseParams.r= 500; % *reuptake rate from cleft into cell |
|
| 171 |
% AN_IHCsynapseParams.r= 300; % *reuptake rate from cleft into cell |
|
| 172 |
|
|
| 173 |
AN_IHCsynapseParams.refractory_period= 0.00075; |
|
| 174 |
% number of AN fibers at each BF (used only for spike generation) |
|
| 175 |
AN_IHCsynapseParams.numFibers= 100; |
|
| 176 |
AN_IHCsynapseParams.TWdelay=0.004; % ?delay before stimulus first spike |
|
| 177 |
|
|
| 178 |
AN_IHCsynapseParams.ANspeedUpFactor=5; % longer epochs for computing spikes. |
|
| 179 |
|
|
| 180 |
%% #7 MacGregorMulti (first order brainstem neurons) |
|
| 181 |
MacGregorMultiParams=[]; |
|
| 182 |
MacGregorMultiType='chopper'; % MacGregorMultiType='primary-like'; %choose |
|
| 183 |
switch MacGregorMultiType |
|
| 184 |
case 'primary-like' |
|
| 185 |
MacGregorMultiParams.nNeuronsPerBF= 10; % N neurons per BF |
|
| 186 |
MacGregorMultiParams.type = 'primary-like cell'; |
|
| 187 |
MacGregorMultiParams.fibersPerNeuron=4; % N input fibers |
|
| 188 |
MacGregorMultiParams.dendriteLPfreq=200; % dendritic filter |
|
| 189 |
MacGregorMultiParams.currentPerSpike=0.11e-6; % (A) per spike |
|
| 190 |
MacGregorMultiParams.Cap=4.55e-9; % cell capacitance (Siemens) |
|
| 191 |
MacGregorMultiParams.tauM=5e-4; % membrane time constant (s) |
|
| 192 |
MacGregorMultiParams.Ek=-0.01; % K+ eq. potential (V) |
|
| 193 |
MacGregorMultiParams.dGkSpike=3.64e-5; % K+ cond.shift on spike,S |
|
| 194 |
MacGregorMultiParams.tauGk= 0.0012; % K+ conductance tau (s) |
|
| 195 |
MacGregorMultiParams.Th0= 0.01; % equilibrium threshold (V) |
|
| 196 |
MacGregorMultiParams.c= 0.01; % threshold shift on spike, (V) |
|
| 197 |
MacGregorMultiParams.tauTh= 0.015; % variable threshold tau |
|
| 198 |
MacGregorMultiParams.Er=-0.06; % resting potential (V) |
|
| 199 |
MacGregorMultiParams.Eb=0.06; % spike height (V) |
|
| 200 |
|
|
| 201 |
case 'chopper' |
|
| 202 |
MacGregorMultiParams.nNeuronsPerBF= 10; % N neurons per BF |
|
| 203 |
MacGregorMultiParams.type = 'chopper cell'; |
|
| 204 |
MacGregorMultiParams.fibersPerNeuron=10; % N input fibers |
|
| 205 |
% MacGregorMultiParams.fibersPerNeuron=6; % N input fibers |
|
| 206 |
|
|
| 207 |
MacGregorMultiParams.dendriteLPfreq=50; % dendritic filter |
|
| 208 |
MacGregorMultiParams.currentPerSpike=35e-9; % *per spike |
|
| 209 |
MacGregorMultiParams.currentPerSpike=30e-9; % *per spike |
|
| 210 |
|
|
| 211 |
MacGregorMultiParams.Cap=1.67e-8; % ??cell capacitance (Siemens) |
|
| 212 |
MacGregorMultiParams.tauM=0.002; % membrane time constant (s) |
|
| 213 |
MacGregorMultiParams.Ek=-0.01; % K+ eq. potential (V) |
|
| 214 |
MacGregorMultiParams.dGkSpike=1.33e-4; % K+ cond.shift on spike,S |
|
| 215 |
MacGregorMultiParams.tauGk= 0.0005;% K+ conductance tau (s) |
|
| 216 |
MacGregorMultiParams.Th0= 0.01; % equilibrium threshold (V) |
|
| 217 |
MacGregorMultiParams.c= 0; % threshold shift on spike, (V) |
|
| 218 |
MacGregorMultiParams.tauTh= 0.02; % variable threshold tau |
|
| 219 |
MacGregorMultiParams.Er=-0.06; % resting potential (V) |
|
| 220 |
MacGregorMultiParams.Eb=0.06; % spike height (V) |
|
| 221 |
MacGregorMultiParams.PSTHbinWidth= 1e-4; |
|
| 222 |
end |
|
| 223 |
|
|
| 224 |
%% #8 MacGregor (second-order neuron). Only one per channel |
|
| 225 |
MacGregorParams=[]; % clear the structure first |
|
| 226 |
MacGregorParams.type = 'chopper cell'; |
|
| 227 |
MacGregorParams.fibersPerNeuron=10; % N input fibers |
|
| 228 |
MacGregorParams.dendriteLPfreq=100; % dendritic filter |
|
| 229 |
MacGregorParams.currentPerSpike=120e-9;% *(A) per spike |
|
| 230 |
MacGregorParams.currentPerSpike=30e-9;% *(A) per spike |
|
| 231 |
|
|
| 232 |
MacGregorParams.Cap=16.7e-9; % cell capacitance (Siemens) |
|
| 233 |
MacGregorParams.tauM=0.002; % membrane time constant (s) |
|
| 234 |
MacGregorParams.Ek=-0.01; % K+ eq. potential (V) |
|
| 235 |
MacGregorParams.dGkSpike=1.33e-4; % K+ cond.shift on spike,S |
|
| 236 |
MacGregorParams.tauGk= 0.0005; % K+ conductance tau (s) |
|
| 237 |
MacGregorParams.Th0= 0.01; % equilibrium threshold (V) |
|
| 238 |
MacGregorParams.c= 0; % threshold shift on spike, (V) |
|
| 239 |
MacGregorParams.tauTh= 0.02; % variable threshold tau |
|
| 240 |
MacGregorParams.Er=-0.06; % resting potential (V) |
|
| 241 |
MacGregorParams.Eb=0.06; % spike height (V) |
|
| 242 |
MacGregorParams.debugging=0; % (special) |
|
| 243 |
% wideband accepts input from all channels (of same fiber type) |
|
| 244 |
% use wideband to create inhibitory units |
|
| 245 |
MacGregorParams.wideband=0; % special for wideband units |
|
| 246 |
% MacGregorParams.saveAllData=0; |
|
| 247 |
|
|
| 248 |
%% #9 filteredSACF |
|
| 249 |
minPitch= 300; maxPitch= 3000; numPitches=60; % specify lags |
|
| 250 |
pitches=100*log10(logspace(minPitch/100, maxPitch/100, numPitches)); |
|
| 251 |
filteredSACFParams.lags=1./pitches; % autocorrelation lags vector |
|
| 252 |
filteredSACFParams.acfTau= .003; % time constant of running ACF |
|
| 253 |
filteredSACFParams.lambda= 0.12; % slower filter to smooth ACF |
|
| 254 |
filteredSACFParams.plotFilteredSACF=1; % 0 plots unfiltered ACFs |
|
| 255 |
filteredSACFParams.plotACFs=0; % special plot (see code) |
|
| 256 |
% filteredSACFParams.usePressnitzer=0; % attenuates ACF at long lags |
|
| 257 |
filteredSACFParams.lagsProcedure= 'useAllLags'; |
|
| 258 |
% filteredSACFParams.lagsProcedure= 'useBernsteinLagWeights'; |
|
| 259 |
% filteredSACFParams.lagsProcedure= 'omitShortLags'; |
|
| 260 |
filteredSACFParams.criterionForOmittingLags=3; |
|
| 261 |
|
|
| 262 |
% checks |
|
| 263 |
if AN_IHCsynapseParams.numFibers<MacGregorMultiParams.fibersPerNeuron |
|
| 264 |
error('MacGregorMulti: too few input fibers for input to MacG unit')
|
|
| 265 |
end |
|
| 266 |
|
|
| 267 |
|
|
| 268 |
%% write all parameters to the command window |
|
| 269 |
% showParams is currently set at the top of htis function |
|
| 270 |
if showParams |
|
| 271 |
fprintf('\n %%%%%%%%\n')
|
|
| 272 |
fprintf('\n%s\n', method.parameterSource)
|
|
| 273 |
fprintf('\n')
|
|
| 274 |
nm=UTIL_paramsList(whos); |
|
| 275 |
for i=1:length(nm) |
|
| 276 |
% eval(['UTIL_showStruct(' nm{i} ', ''' nm{i} ''')'])
|
|
| 277 |
if ~strcmp(nm(i), 'method') |
|
| 278 |
eval(['UTIL_showStructureSummary(' nm{i} ', ''' nm{i} ''', 10)'])
|
|
| 279 |
end |
|
| 280 |
end |
|
| 281 |
end |
|
| 282 |
|
|
| 283 |
|
|
| 284 |
|
|
| 285 |
% ********************************************************************** comparison data |
|
| 286 |
% store individual data here for display on the multiThreshold GUI (if used) |
|
| 287 |
% the final value in each vector is an identifier (BF or duration)) |
|
| 288 |
if isstruct(experiment) |
|
| 289 |
switch experiment.paradigm |
|
| 290 |
case {'IFMC','IFMC_8ms'}
|
|
| 291 |
% based on MPa |
|
| 292 |
comparisonData=[ |
|
| 293 |
66 51 49 48 46 45 54 250; |
|
| 294 |
60 54 46 42 39 49 65 500; |
|
| 295 |
64 51 38 32 33 59 75 1000; |
|
| 296 |
59 51 36 30 41 81 93 2000; |
|
| 297 |
71 63 53 44 36 76 95 4000; |
|
| 298 |
70 64 43 35 35 66 88 6000; |
|
| 299 |
110 110 110 110 110 110 110 8000; |
|
| 300 |
]; |
|
| 301 |
if length(BFlist)==1 && ~isempty(comparisonData) |
|
| 302 |
availableFrequencies=comparisonData(:,end)'; |
|
| 303 |
findRow= find(BFlist==availableFrequencies); |
|
| 304 |
if ~isempty (findRow) |
|
| 305 |
experiment.comparisonData=comparisonData(findRow,:); |
|
| 306 |
end |
|
| 307 |
end |
|
| 308 |
|
|
| 309 |
case {'TMC','TMC_8ms'}
|
|
| 310 |
% based on MPa |
|
| 311 |
comparisonData=[ |
|
| 312 |
48 58 63 68 75 80 85 92 99 250; |
|
| 313 |
33 39 40 49 52 61 64 77 79 500; |
|
| 314 |
39 42 50 81 83 92 96 97 110 1000; |
|
| 315 |
24 26 32 37 46 51 59 71 78 2000; |
|
| 316 |
65 68 77 85 91 93 110 110 110 4000; |
|
| 317 |
20 19 26 44 80 95 96 110 110 6000; |
|
| 318 |
]; |
|
| 319 |
if length(BFlist)==1 && ~isempty(comparisonData) |
|
| 320 |
availableFrequencies=comparisonData(:,end)'; |
|
| 321 |
findRow= find(BFlist==availableFrequencies); |
|
| 322 |
if ~isempty (findRow) |
|
| 323 |
experiment.comparisonData=comparisonData(findRow,:); |
|
| 324 |
end |
|
| 325 |
end |
|
| 326 |
|
|
| 327 |
case { 'absThreshold', 'absThreshold_8'}
|
|
| 328 |
% MPa thresholds |
|
| 329 |
experiment.comparisonData=[ |
|
| 330 |
32 26 16 18 22 22 0.008; |
|
| 331 |
16 13 6 9 15 11 0.500 |
|
| 332 |
]; |
|
| 333 |
|
|
| 334 |
|
|
| 335 |
otherwise |
|
| 336 |
experiment.comparisonData=[]; |
|
| 337 |
end |
|
| 338 |
end |
|
| 339 |
|
|
| 340 |
|
|
| parameterStore/MAPparamsOHC.m | ||
|---|---|---|
| 1 | 1 |
function method=MAPparamsOHC ... |
| 2 |
(BFlist, sampleRate, showParams) |
|
| 2 |
(BFlist, sampleRate, showParams, paramChanges)
|
|
| 3 | 3 |
% MAPparams<> establishes a complete set of MAP parameters |
| 4 | 4 |
% Parameter file names must be of the form <MAPparams> <name> |
| 5 | 5 |
% |
| ... | ... | |
| 58 | 58 |
% i.e. a minimum ratio of 0.056. |
| 59 | 59 |
% 'spikes' model: AR based on brainstem spiking activity (LSR) |
| 60 | 60 |
OMEParams.rateToAttenuationFactor=0.006; % * N(all ICspikes) |
| 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes)
|
|
| 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes) |
|
| 62 | 62 |
|
| 63 | 63 |
% 'probability model': Ar based on AN firing probabilities (LSR) |
| 64 | 64 |
OMEParams.rateToAttenuationFactorProb=0.01;% * N(all ANrates) |
| 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates)
|
|
| 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates) |
|
| 66 | 66 |
|
| 67 | 67 |
% asymptote should be around 100-200 ms |
| 68 | 68 |
OMEParams.ARtau=.05; % AR smoothing function |
| ... | ... | |
| 104 | 104 |
DRNLParams.rateToAttenuationFactor = .01; % strength of MOC |
| 105 | 105 |
% DRNLParams.rateToAttenuationFactor = 0; % strength of MOC |
| 106 | 106 |
% 'probability' model: MOC based on AN spiking activity (HSR) |
| 107 |
DRNLParams.rateToAttenuationFactorProb = .005; % strength of MOC |
|
| 107 |
DRNLParams.rateToAttenuationFactorProb = .0055; % strength of MOC
|
|
| 108 | 108 |
% DRNLParams.rateToAttenuationFactorProb = .0; % strength of MOC |
| 109 |
DRNLParams.MOCrateThreshold =70; % spikes/s probability only |
|
| 109 |
DRNLParams.MOCrateThresholdProb =70; % spikes/s probability only
|
|
| 110 | 110 |
|
| 111 | 111 |
DRNLParams.MOCtau =.1; % smoothing for MOC |
| 112 | 112 |
|
| ... | ... | |
| 263 | 263 |
end |
| 264 | 264 |
|
| 265 | 265 |
|
| 266 |
%% now accept last minute parameter changes required by the calling program |
|
| 267 |
% paramChanges |
|
| 268 |
if nargin>3 && ~isempty(paramChanges) |
|
| 269 |
nChanges=length(paramChanges); |
|
| 270 |
for idx=1:nChanges |
|
| 271 |
eval(paramChanges{idx})
|
|
| 272 |
end |
|
| 273 |
end |
|
| 274 |
|
|
| 275 |
|
|
| 266 | 276 |
%% write all parameters to the command window |
| 267 | 277 |
% showParams is currently set at the top of htis function |
| 268 | 278 |
if showParams |
| ... | ... | |
| 276 | 286 |
eval(['UTIL_showStructureSummary(' nm{i} ', ''' nm{i} ''', 10)'])
|
| 277 | 287 |
end |
| 278 | 288 |
end |
| 289 |
|
|
| 290 |
% highlight parameter changes made locally |
|
| 291 |
if nargin>3 && ~isempty(paramChanges) |
|
| 292 |
fprintf('\n Local parameter changes:\n')
|
|
| 293 |
for i=1:length(paramChanges) |
|
| 294 |
disp(paramChanges{i})
|
|
| 295 |
end |
|
| 296 |
end |
|
| 279 | 297 |
end |
| 280 | 298 |
|
| 281 | 299 |
|
| parameterStore/MAPparamsStd.m | ||
|---|---|---|
| 117 | 117 |
DRNLParams.rateToAttenuationFactorProb = 0; % 0 = MOC off (spikes) |
| 118 | 118 |
end |
| 119 | 119 |
DRNLParams.MOCtau =.03; % smoothing for MOC |
| 120 |
DRNLParams.MOCrateThreshold =50; % set to AN rate threshold |
|
| 120 |
DRNLParams.MOCrateThresholdProb =50; % set to AN rate threshold
|
|
| 121 | 121 |
|
| 122 | 122 |
|
| 123 | 123 |
%% #4 IHC_cilia_RPParams |
| testPrograms/demoTwisterProbability.m | ||
|---|---|---|
| 63 | 63 |
%% run the model |
| 64 | 64 |
tic |
| 65 | 65 |
|
| 66 |
fprintf('\n')
|
|
| 67 |
disp(['Signal duration= ' num2str(length(inputSignal)/sampleRate)]) |
|
| 68 |
disp([num2str(numChannels) ' channel model']) |
|
| 69 |
disp('Computing ...')
|
|
| 70 |
|
|
| 66 | 71 |
MAP1_14(inputSignal, sampleRate, BFlist, ... |
| 67 | 72 |
MAPparamsName, AN_spikesOrProbability, paramChanges); |
| 68 | 73 |
|
| 69 |
toc |
|
| 70 | 74 |
|
| 71 | 75 |
% the model run is now complete. Now display the results |
| 72 |
UTIL_showMAP(showMapOptions) |
|
| 76 |
UTIL_showMAP(showMapOptions, paramChanges)
|
|
| 73 | 77 |
|
| 74 | 78 |
toc |
| 75 | 79 |
path(restorePath) |
| 76 | 80 |
|
| 77 | 81 |
|
| 82 |
|
|
| 78 | 83 |
function inputSignal=createMultiTone(sampleRate, toneFrequency, ... |
| 79 | 84 |
leveldBSPL, duration, rampDuration) |
| 80 | 85 |
% Create pure tone stimulus |
| testPrograms/demoTwisterSpikes.m | ||
|---|---|---|
| 45 | 45 |
showMapOptions.printFiringRates=1; |
| 46 | 46 |
showMapOptions.showACF=0; |
| 47 | 47 |
showMapOptions.showEfferent=0; |
| 48 |
|
|
| 48 |
showMapOptions.surfSpikes=1; |
|
| 49 |
|
|
| 49 | 50 |
%% Generate stimuli |
| 50 |
|
|
| 51 | 51 |
switch signalType |
| 52 | 52 |
case 'tones' |
| 53 | 53 |
inputSignal=createMultiTone(sampleRate, toneFrequency, ... |
| ... | ... | |
| 70 | 70 |
disp(['Signal duration= ' num2str(length(inputSignal)/sampleRate)]) |
| 71 | 71 |
disp([num2str(numChannels) ' channel model']) |
| 72 | 72 |
disp('Computing ...')
|
| 73 |
|
|
| 73 | 74 |
MAP1_14(inputSignal, sampleRate, BFlist, ... |
| 74 | 75 |
MAPparamsName, AN_spikesOrProbability, paramChanges); |
| 75 |
toc |
|
| 76 |
|
|
| 76 | 77 |
|
| 77 | 78 |
% the model run is now complete. Now display the results |
| 78 |
UTIL_showMAP(showMapOptions) |
|
| 79 |
UTIL_showMAP(showMapOptions, paramChanges)
|
|
| 79 | 80 |
|
| 80 | 81 |
toc |
| 81 | 82 |
path(restorePath) |
| 82 | 83 |
|
| 83 |
|
|
| 84 | 84 |
function inputSignal=createMultiTone(sampleRate, toneFrequency, ... |
| 85 | 85 |
leveldBSPL, duration, rampDuration) |
| 86 | 86 |
% Create pure tone stimulus |
| testPrograms/test_MAP1_14.m | ||
|---|---|---|
| 42 | 42 |
|
| 43 | 43 |
|
| 44 | 44 |
%% #2 probability (fast) or spikes (slow) representation |
| 45 |
AN_spikesOrProbability='spikes'; |
|
| 45 |
% AN_spikesOrProbability='spikes';
|
|
| 46 | 46 |
|
| 47 | 47 |
% or |
| 48 | 48 |
% NB probabilities are not corrected for refractory effects |
| 49 |
% AN_spikesOrProbability='probability';
|
|
| 49 |
AN_spikesOrProbability='probability'; |
|
| 50 | 50 |
|
| 51 | 51 |
|
| 52 | 52 |
%% #3 pure tone, harmonic sequence or speech file input |
| 53 | 53 |
signalType= 'tones'; |
| 54 |
sampleRate= 100000;
|
|
| 55 |
duration=0.050; % seconds
|
|
| 54 |
sampleRate= 50000;
|
|
| 55 |
duration=0.250; % seconds
|
|
| 56 | 56 |
% toneFrequency= 250:250:8000; % harmonic sequence (Hz) |
| 57 | 57 |
toneFrequency= 1000; % or a pure tone (Hz8 |
| 58 | 58 |
rampDuration=.005; % seconds |
| 59 | 59 |
|
| 60 | 60 |
% or |
| 61 |
|
|
| 61 | 62 |
% signalType= 'file'; |
| 62 | 63 |
% fileName='twister_44kHz'; |
| 63 | 64 |
|
| 64 | 65 |
|
| 65 | 66 |
%% #4 rms level |
| 66 | 67 |
% signal details |
| 67 |
leveldBSPL= 70; % dB SPL
|
|
| 68 |
leveldBSPL= 30; % dB SPL
|
|
| 68 | 69 |
|
| 69 | 70 |
|
| 70 | 71 |
%% #5 number of channels in the model |
| ... | ... | |
| 90 | 91 |
% paramChanges={'AN_IHCsynapseParams.ANspeedUpFactor=5;', ...
|
| 91 | 92 |
% 'IHCpreSynapseParams.tauCa=86e-6;'}; |
| 92 | 93 |
|
| 93 |
% paramChanges={'DRNLParams.rateToAttenuationFactorProb = 0;'};
|
|
| 94 |
paramChanges={'DRNLParams.rateToAttenuationFactorProb = 0;'};
|
|
| 94 | 95 |
|
| 95 | 96 |
% paramChanges={'IHCpreSynapseParams.tauCa=86e-6;',
|
| 96 |
% 'AN_IHCsynapseParams.numFibers= 100;'}; |
|
| 97 |
% 'AN_IHCsynapseParams.numFibers= 1000;'};
|
|
| 97 | 98 |
|
| 98 | 99 |
|
| 99 | 100 |
%% delare 'showMap' options to control graphical output |
| ... | ... | |
| 152 | 153 |
|
| 153 | 154 |
MAP1_14(inputSignal, sampleRate, BFlist, ... |
| 154 | 155 |
MAPparamsName, AN_spikesOrProbability, paramChanges); |
| 155 |
toc |
|
| 156 |
|
|
| 156 | 157 |
|
| 157 | 158 |
% the model run is now complete. Now display the results |
| 158 |
disp(' param changes to list of parameters below')
|
|
| 159 |
for i=1:length(paramChanges) |
|
| 160 |
disp(paramChanges{i})
|
|
| 161 |
end |
|
| 162 |
UTIL_showMAP(showMapOptions) |
|
| 163 |
|
|
| 159 |
UTIL_showMAP(showMapOptions, paramChanges) |
|
| 164 | 160 |
|
| 165 | 161 |
toc |
| 166 | 162 |
path(restorePath) |
| ... | ... | |
| 187 | 183 |
|
| 188 | 184 |
% add 10 ms silence |
| 189 | 185 |
silence= zeros(1,round(0.05/dt)); |
| 190 |
silence= zeros(1,round(0.05/dt)); |
|
| 191 | 186 |
inputSignal= [silence inputSignal silence]; |
| 192 | 187 |
|
| utilities/UTIL_PSTHmaker.m | ||
|---|---|---|
| 8 | 8 |
% inputData is a channel x time matrix |
| 9 | 9 |
% PSTH is the reduced matrix, the sum of all elements in the bin |
| 10 | 10 |
% |
| 11 |
% mandatory fileds: |
|
| 12 |
% method.dt |
|
| 13 |
% method.PSTHbinWidth |
|
| 11 |
|
|
| 14 | 12 |
[numChannels numDataPoints]= size(inputData); |
| 15 | 13 |
|
| 16 | 14 |
% Multiple fibers is the same as repeat trials |
| utilities/UTIL_showMAP.m | ||
|---|---|---|
| 1 |
function UTIL_showMAP (showMapOptions) |
|
| 1 |
function UTIL_showMAP (showMapOptions, paramChanges)
|
|
| 2 | 2 |
% UTIL_showMAP produces summaries of the output from MAP's mmost recent run |
| 3 | 3 |
% All MAP outputs are stored in global variables and UTIL_showMAP |
| 4 | 4 |
% simply assumes that they are in place. |
| ... | ... | |
| 40 | 40 |
if ~isfield(showMapOptions,'fileName'),showMapOptions.fileName=[];end |
| 41 | 41 |
if ~isfield(showMapOptions,'surfSpikes'),showMapOptions.surfSpikes=0;end |
| 42 | 42 |
|
| 43 |
|
|
| 43 |
%% send all model parameters to command window |
|
| 44 | 44 |
if showMapOptions.printModelParameters |
| 45 | 45 |
% Read parameters from MAPparams<***> file in 'parameterStore' folder |
| 46 | 46 |
% and print out all parameters |
| 47 |
cmd=['MAPparams' saveMAPparamsName ... |
|
| 48 |
'(-1, 1/dt, 1);']; |
|
| 49 |
eval(cmd); |
|
| 47 |
if nargin>1 |
|
| 48 |
cmd=['MAPparams' saveMAPparamsName '(-1, 1/dt, 1, paramChanges);']; |
|
| 49 |
eval(cmd); |
|
| 50 |
else |
|
| 51 |
cmd=['MAPparams' saveMAPparamsName '(-1, 1/dt, 1);']; |
|
| 52 |
eval(cmd); |
|
| 53 |
disp(' no parameter changes found')
|
|
| 54 |
end |
|
| 50 | 55 |
end |
| 51 | 56 |
|
| 57 |
%% summarise firing rates in command window |
|
| 52 | 58 |
if showMapOptions.printFiringRates |
| 53 | 59 |
%% print summary firing rates |
| 54 | 60 |
fprintf('\n\n')
|
| ... | ... | |
| 71 | 77 |
% disp(['IC by type: ' num2str(mean(ICfiberTypeRates,2)')]) |
| 72 | 78 |
else |
| 73 | 79 |
disp(['AN: ' num2str(mean(mean(ANprobRateOutput)))]) |
| 74 |
[PSTH pointsPerBin]= UTIL_makePSTH(ANprobRateOutput, dt, 0.001);
|
|
| 80 |
PSTH= UTIL_PSTHmakerb(ANprobRateOutput, dt, 0.001);
|
|
| 75 | 81 |
disp(['max max AN: ' num2str(max(max(... |
| 76 |
PSTH/pointsPerBin )))])
|
|
| 82 |
PSTH )))]) |
|
| 77 | 83 |
end |
| 78 | 84 |
end |
| 79 | 85 |
|
| 80 | 86 |
|
| 81 |
%% figure (99) summarises main model output
|
|
| 87 |
%% figure (99): display output from all model stages
|
|
| 82 | 88 |
if showMapOptions.showModelOutput |
| 83 | 89 |
plotInstructions.figureNo=99; |
| 84 | 90 |
signalRMS=mean(savedInputSignal.^2)^0.5; |
| ... | ... | |
| 150 | 156 |
UTIL_plotMatrix(ICmembraneOutput, plotInstructions); |
| 151 | 157 |
end |
| 152 | 158 |
|
| 153 |
otherwise % probability (4-6) |
|
| 154 |
plotInstructions.displaydt=dt; |
|
| 159 |
otherwise % AN rate based on probability of firing |
|
| 160 |
PSTHbinWidth=0.001; |
|
| 161 |
PSTH= UTIL_PSTHmakerb(ANprobRateOutput, dt, PSTHbinWidth); |
|
| 162 |
plotInstructions.displaydt=PSTHbinWidth; |
|
| 155 | 163 |
plotInstructions.numPlots=2; |
| 156 | 164 |
plotInstructions.subPlotNo=2; |
| 157 | 165 |
plotInstructions.yLabel='BF'; |
| ... | ... | |
| 159 | 167 |
plotInstructions.yLabel='LSR HSR'; |
| 160 | 168 |
plotInstructions.plotDivider=1; |
| 161 | 169 |
end |
| 162 |
plotInstructions.title='AN - spike probability';
|
|
| 163 |
UTIL_plotMatrix(ANprobRateOutput, plotInstructions);
|
|
| 170 |
plotInstructions.title='AN - spike rate';
|
|
| 171 |
UTIL_plotMatrix(PSTH, plotInstructions);
|
|
| 164 | 172 |
end |
| 165 | 173 |
end |
| 166 | 174 |
|
| 167 | 175 |
if showMapOptions.surfProbability |
| 168 | 176 |
%% surface plot of probability |
| 177 |
if strcmp(saveAN_spikesOrProbability,'probability') && ... |
|
| 178 |
length(savedBFlist)>2 |
|
| 169 | 179 |
figure(97), clf |
| 170 | 180 |
% select only HSR fibers at the bottom of the matrix |
| 171 | 181 |
ANprobRateOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:); |
| ... | ... | |
| 185 | 195 |
view([-20 60]) |
| 186 | 196 |
% view([0 90]) |
| 187 | 197 |
title ([showMapOptions.fileName ': ' num2str(signalRMSdb,'% 3.0f') ' dB']) |
| 198 |
end |
|
| 188 | 199 |
end |
| 189 | 200 |
|
| 190 | 201 |
if showMapOptions.surfSpikes |
| 191 |
%% surface plot of probability
|
|
| 202 |
%% surface plot of AN spikes
|
|
| 192 | 203 |
figure(97), clf |
| 193 | 204 |
% select only HSR fibers at the bottom of the matrix |
| 194 | 205 |
ANoutput= ANoutput(end-length(savedBFlist)+1:end,:); |
| 195 |
PSTHbinWidth=0.001; % 1 ms bins
|
|
| 196 |
PSTH=UTIL_PSTHmakerb(ANoutput, ANdt, PSTHbinWidth);
|
|
| 206 |
PSTHbinWidth=0.005; % 1 ms bins
|
|
| 207 |
PSTH=UTIL_makePSTH(ANoutput, ANdt, PSTHbinWidth);
|
|
| 197 | 208 |
[nY nX]=size(PSTH); |
| 198 | 209 |
time=PSTHbinWidth*(1:nX); |
| 199 | 210 |
surf(time, savedBFlist, PSTH) |
| ... | ... | |
| 211 | 222 |
end |
| 212 | 223 |
|
| 213 | 224 |
|
| 214 |
%% plot efferent control values as dB |
|
| 225 |
%% figure(98) plot efferent control values as dB
|
|
| 215 | 226 |
if showMapOptions.showEfferent |
| 216 | 227 |
plotInstructions=[]; |
| 217 | 228 |
plotInstructions.figureNo=98; |
Also available in: Unified diff