Revision 16:37a379b27cff testPrograms/test_MAP1_14.m
| testPrograms/test_MAP1_14.m | ||
|---|---|---|
| 40 | 40 |
%% #2 probability (fast) or spikes (slow) representation |
| 41 | 41 |
AN_spikesOrProbability='spikes'; |
| 42 | 42 |
% or |
| 43 |
% AN_spikesOrProbability='probability';
|
|
| 43 |
AN_spikesOrProbability='probability'; |
|
| 44 | 44 |
|
| 45 | 45 |
|
| 46 | 46 |
%% #3 pure tone, harmonic sequence or speech file input |
| ... | ... | |
| 54 | 54 |
rampDuration=.005; % seconds |
| 55 | 55 |
|
| 56 | 56 |
% or |
| 57 |
% signalType= 'file';
|
|
| 58 |
% fileName='twister_44kHz';
|
|
| 57 |
signalType= 'file'; |
|
| 58 |
fileName='twister_44kHz'; |
|
| 59 | 59 |
% fileName='new-da-44khz'; |
| 60 | 60 |
|
| 61 |
% mix with an optional second file? |
|
| 62 |
mixerFile=[]; |
|
| 63 |
%or |
|
| 64 |
mixerFile='babble'; |
|
| 65 |
leveldBSPL2=-60; |
|
| 61 | 66 |
|
| 62 | 67 |
%% #4 rms level |
| 63 | 68 |
% signal details |
| 64 |
leveldBSPL= 90; % dB SPL
|
|
| 69 |
leveldBSPL= 60; % dB SPL
|
|
| 65 | 70 |
|
| 66 | 71 |
|
| 67 | 72 |
%% #5 number of channels in the model |
| ... | ... | |
| 71 | 76 |
BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels)); |
| 72 | 77 |
|
| 73 | 78 |
% or specify your own channel BFs |
| 74 |
BFlist=toneFrequency; |
|
| 79 |
% BFlist=toneFrequency;
|
|
| 75 | 80 |
|
| 76 | 81 |
|
| 77 | 82 |
%% #6 change model parameters |
| ... | ... | |
| 82 | 87 |
% *after* the MAPparams file has been read |
| 83 | 88 |
% This example declares only one fiber type with a calcium clearance time |
| 84 | 89 |
% constant of 80e-6 s (HSR fiber) when the probability option is selected. |
| 85 |
paramChanges={'AN_IHCsynapseParams.ANspeedUpFactor=5;', ...
|
|
| 86 |
'IHCpreSynapseParams.tauCa=86e-6;'}; |
|
| 90 |
% paramChanges={'AN_IHCsynapseParams.ANspeedUpFactor=5;', ...
|
|
| 91 |
% 'IHCpreSynapseParams.tauCa=86e-6;'}; |
|
| 92 |
% paramChanges={'AN_IHCsynapseParams.ANspeedUpFactor=5;', ...
|
|
| 93 |
% 'DRNLParams.rateToAttenuationFactorProb = 0;'}; |
|
| 87 | 94 |
|
| 88 | 95 |
%% delare showMap options |
| 89 | 96 |
showMapOptions=[]; % use defaults |
| 90 | 97 |
|
| 91 | 98 |
% or (example: show everything including an smoothed SACF output |
| 92 |
showMapOptions.showModelParameters=0; |
|
| 93 |
showMapOptions.showModelOutput=1; |
|
| 94 |
showMapOptions.printFiringRates=1; |
|
| 95 |
showMapOptions.showACF=0; |
|
| 96 |
showMapOptions.showEfferent=1; |
|
| 99 |
showMapOptions.showModelParameters=1; |
|
| 100 |
showMapOptions.showModelOutput=1; |
|
| 101 |
showMapOptions.printFiringRates=1; |
|
| 102 |
showMapOptions.showACF=0; |
|
| 103 |
showMapOptions.showEfferent=1; |
|
| 104 |
if strcmp(AN_spikesOrProbability, 'probability') |
|
| 105 |
showMapOptions.surfProbability=1; |
|
| 106 |
end |
|
| 107 |
if strcmp(signalType, 'file') |
|
| 108 |
showMapOptions.fileName=fileName; |
|
| 109 |
end |
|
| 97 | 110 |
|
| 98 | 111 |
%% Generate stimuli |
| 99 | 112 |
|
| ... | ... | |
| 106 | 119 |
leveldBSPL, duration, rampDuration); |
| 107 | 120 |
|
| 108 | 121 |
case 'file' |
| 122 |
%% file input simple or mixed |
|
| 109 | 123 |
[inputSignal sampleRate]=wavread(fileName); |
| 110 |
inputSignal(:,1); |
|
| 124 |
inputSignal=inputSignal(:,1);
|
|
| 111 | 125 |
targetRMS=20e-6*10^(leveldBSPL/20); |
| 112 | 126 |
rms=(mean(inputSignal.^2))^0.5; |
| 113 | 127 |
amp=targetRMS/rms; |
| 114 | 128 |
inputSignal=inputSignal*amp; |
| 129 |
if ~isempty(mixerFile) |
|
| 130 |
[inputSignal2 sampleRate]=wavread(mixerFile); |
|
| 131 |
inputSignal2=inputSignal2(:,1); |
|
| 132 |
[r c]=size(inputSignal); |
|
| 133 |
inputSignal2=inputSignal2(1:r); |
|
| 134 |
targetRMS=20e-6*10^(leveldBSPL2/20); |
|
| 135 |
rms=(mean(inputSignal2.^2))^0.5; |
|
| 136 |
amp=targetRMS/rms; |
|
| 137 |
inputSignal2=inputSignal2*amp; |
|
| 138 |
inputSignal=inputSignal+inputSignal2; |
|
| 139 |
end |
|
| 115 | 140 |
end |
| 116 | 141 |
|
| 117 | 142 |
|
Also available in: Unified diff