Revision 33:161913b595ae testPrograms
| testPrograms/testAN.m | ||
|---|---|---|
| 136 | 136 |
hold on, bar(PSTHtime,PSTHLSR,'r') |
| 137 | 137 |
ylim([0 1000]) |
| 138 | 138 |
xlim([0 length(PSTH)*localPSTHbinwidth]) |
| 139 |
set(gcf,'name',[num2str(BFlist), ' Hz: ' num2str(leveldB) ' dB']); |
|
| 139 |
set(gcf,'name',['PSTH: ' num2str(BFlist), ' Hz: ' num2str(leveldB) ' dB']);
|
|
| 140 | 140 |
|
| 141 | 141 |
% AN - CV |
| 142 | 142 |
% CV is computed 5 times. Use the middle one (3) as most typical |
| testPrograms/testBM.m | ||
|---|---|---|
| 104 | 104 |
end % level |
| 105 | 105 |
|
| 106 | 106 |
%% analyses results and plot |
| 107 |
if length(relativeFrequencies)>2 |
|
| 108 |
maxRows=3; |
|
| 109 |
else |
|
| 110 |
maxRows=2; |
|
| 111 |
end |
|
| 107 | 112 |
|
| 108 | 113 |
% BM I/O plot (top panel) |
| 109 | 114 |
figure(3) |
| 110 |
subplot(3,nBFs,BFno), cla
|
|
| 115 |
subplot(maxRows,nBFs,BFno), cla
|
|
| 111 | 116 |
plot(levels,peakAmpBMdB, 'linewidth',2) |
| 112 | 117 |
hold on, plot(levels, repmat(refBMdisplacement,1,length(levels))) |
| 113 | 118 |
hold off |
| ... | ... | |
| 126 | 131 |
|
| 127 | 132 |
% Tuning curve |
| 128 | 133 |
if length(relativeFrequencies)>2 |
| 129 |
figure(3), subplot(3,nBFs, 2*nBFs+BFno)
|
|
| 134 |
figure(3), subplot(maxRows,nBFs, 2*nBFs+BFno)
|
|
| 130 | 135 |
% contour(stimulusFrequencies,levels,peakAmpBM,... |
| 131 | 136 |
% [refBMdisplacement refBMdisplacement],'r') |
| 132 | 137 |
contour(stimulusFrequencies,levels,peakAmpBM,... |
| ... | ... | |
| 142 | 147 |
|
| 143 | 148 |
% MOC contribution |
| 144 | 149 |
figure(3) |
| 145 |
subplot(3,nBFs,nBFs+BFno), cla
|
|
| 150 |
subplot(maxRows,nBFs,nBFs+BFno), cla
|
|
| 146 | 151 |
plot(levels,20*log10(peakEfferent), 'linewidth',2) |
| 147 | 152 |
ylabel('MOC (dB attenuation)'), xlabel('level')
|
| 148 | 153 |
title(['peak MOC: model= ' AN_spikesOrProbability]) |
| testPrograms/testFM.m | ||
|---|---|---|
| 27 | 27 |
|
| 28 | 28 |
% masker and probe levels are relative to this threshold |
| 29 | 29 |
thresholdAtCF=10; % dB SPL |
| 30 |
maskerLevels=[-80 10 20 30 40 60 ] + thresholdAtCF; |
|
| 30 | 31 |
|
| 31 | 32 |
showPSTHs=1; |
| 32 | 33 |
|
| ... | ... | |
| 36 | 37 |
% fetch BF from GUI: use only the first target frequency |
| 37 | 38 |
maskerFrequency=BFlist; |
| 38 | 39 |
maskerDuration=.1; |
| 39 |
maskerLevels=[-80 10 20 30 40 60 ] + thresholdAtCF; |
|
| 40 | 40 |
|
| 41 | 41 |
targetFrequency=maskerFrequency; |
| 42 | 42 |
probeLeveldB=20+thresholdAtCF; % H&D use 20 dB SL/ TMC uses 10 dB SL |
| ... | ... | |
| 139 | 139 |
|
| 140 | 140 |
inputSignal=... |
| 141 | 141 |
[initialSilence maskerPa gap probe finalSilence]; |
| 142 |
% time=dt:dt:length(inputSignal)*dt; |
|
| 143 |
% figure(99), plot(time,inputSignal) |
|
| 142 | 144 |
|
| 143 | 145 |
% ********************************** run MAP model |
| 144 | 146 |
% showPlotsAndDetails=0; |
| ... | ... | |
| 150 | 152 |
[nFibers c]=size(ANprobRateOutput); |
| 151 | 153 |
nLSRfibers=nFibers/length(ANtauCas); |
| 152 | 154 |
ANresponse=ANprobRateOutput(end-nLSRfibers:end,:); |
| 155 |
ANdt=dt; % no adjustment for spikes speedup |
|
| 153 | 156 |
else |
| 154 | 157 |
[nFibers c]=size(ANoutput); |
| 155 | 158 |
nLSRfibers=nFibers/length(ANtauCas); |
| ... | ... | |
| 157 | 160 |
end |
| 158 | 161 |
|
| 159 | 162 |
ANresponse=sum(ANresponse)/nLSRfibers; |
| 163 |
% ANresponseTimes=ANdt:ANdt:length(ANresponse)*ANdt; |
|
| 164 |
% figure(99), plot(ANresponseTimes,ANresponse) |
|
| 160 | 165 |
|
| 161 | 166 |
% analyse results |
| 162 | 167 |
probeStart=initialSilenceDuration+maskerDuration+gapDuration; |
| ... | ... | |
| 182 | 187 |
PSTH=PSTH*ANdt/PSTHbinWidth; |
| 183 | 188 |
PSTHplotCount=PSTHplotCount+1; |
| 184 | 189 |
subplot(nLevels,nDurations,PSTHplotCount) |
| 185 |
probeTime=PSTHbinWidth:PSTHbinWidth:...
|
|
| 190 |
PSTHtime=PSTHbinWidth:PSTHbinWidth:...
|
|
| 186 | 191 |
PSTHbinWidth*length(PSTH); |
| 187 |
bar(probeTime, PSTH)
|
|
| 192 |
bar(PSTHtime, PSTH)
|
|
| 188 | 193 |
if strcmp(AN_spikesOrProbability, 'spikes') |
| 189 | 194 |
ylim([0 500]) |
| 190 | 195 |
else |
| ... | ... | |
| 207 | 212 |
if PSTHplotCount<=nDurations |
| 208 | 213 |
title([num2str(1000*gapDurations(PSTHplotCount)) 'ms']) |
| 209 | 214 |
end |
| 215 |
|
|
| 216 |
% figure(99), bar(PSTHtime, PSTH) |
|
| 217 |
|
|
| 210 | 218 |
end % showPSTHs |
| 211 | 219 |
|
| 212 | 220 |
end % gapDurations duration |
| testPrograms/test_MAP1_14.m | ||
|---|---|---|
| 68 | 68 |
|
| 69 | 69 |
%% #4 rms level |
| 70 | 70 |
% signal details |
| 71 |
leveldBSPL= 20; % dB SPL
|
|
| 71 |
leveldBSPL= 50; % dB SPL
|
|
| 72 | 72 |
|
| 73 | 73 |
|
| 74 | 74 |
%% #5 number of channels in the model |
Also available in: Unified diff