Revision 24:a5e4a43c1673
| multithreshold 1.46/MAPmodel.m | ||
|---|---|---|
| 4 | 4 |
global outerMiddleEarParams DRNLParams AN_IHCsynapseParams |
| 5 | 5 |
|
| 6 | 6 |
savePath=path; |
| 7 |
addpath('..\MAP')
|
|
| 7 |
addpath(['..' filesep 'MAP'], ['..' filesep 'utilities'])
|
|
| 8 | 8 |
modelResponse=[]; |
| 9 | 9 |
MacGregorResponse=[]; |
| 10 | 10 |
|
| multithreshold 1.46/subjGUI_MT.m | ||
|---|---|---|
| 1554 | 1554 |
global outerMiddleEarParams DRNLParams AN_IHCsynapseParams |
| 1555 | 1555 |
|
| 1556 | 1556 |
savePath=path; |
| 1557 |
addpath('..\MAP')
|
|
| 1557 |
addpath(['..' filesep 'MAP'], ['..' filesep 'utilities'])
|
|
| 1558 | 1558 |
modelResponse=[]; |
| 1559 | 1559 |
MacGregorResponse=[]; |
| 1560 | 1560 |
|
| multithreshold 1.46/testBM.m | ||
|---|---|---|
| 33 | 33 |
|
| 34 | 34 |
dbstop if error |
| 35 | 35 |
figure(3), clf |
| 36 |
% set(gcf,'position',[276 33 331 645])
|
|
| 36 |
set(gcf,'position',[280 350 327 326])
|
|
| 37 | 37 |
set(gcf,'name','DRNL - BM') |
| 38 | 38 |
|
| 39 | 39 |
finalSummary=[]; |
| multithreshold 1.46/testPhaseLocking.m | ||
|---|---|---|
| 1 | 1 |
function testPhaseLocking |
| 2 | 2 |
|
| 3 | 3 |
testFrequencies=[250 500 1000 2000 4000 8000]; |
| 4 |
levels=-20:10:80;
|
|
| 4 |
levels=50:10:80;
|
|
| 5 | 5 |
figure(14), clf |
| 6 |
set(gcf,'position', [980 36 383 321]) |
|
| 7 |
set(gcf,'name', 'phase locking') |
|
| 6 | 8 |
allStrengths=zeros(length(testFrequencies), length(levels)); |
| 7 | 9 |
peakVectorStrength=zeros(1,length(testFrequencies)); |
| 8 | 10 |
freqCount=0; |
| parameterStore/MAPparamsNormal.m | ||
|---|---|---|
| 61 | 61 |
% OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes) |
| 62 | 62 |
|
| 63 | 63 |
% 'probability model': Ar based on AN firing probabilities (LSR) |
| 64 |
OMEParams.rateToAttenuationFactorProb=0.003;% * N(all ANrates)
|
|
| 64 |
OMEParams.rateToAttenuationFactorProb=0.01;% * N(all ANrates)
|
|
| 65 | 65 |
% OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates) |
| 66 | 66 |
|
| 67 | 67 |
% asymptote should be around 100-200 ms |
| testPrograms/demoTwisterProbability.m | ||
|---|---|---|
| 3 | 3 |
% MAPdemo runs the MATLAB auditory periphery model (MAP1_14) as far as |
| 4 | 4 |
% the AN (probabilities) or IC (spikes) with graphical output |
| 5 | 5 |
|
| 6 |
% Things you might want to change; #1 - #5 |
|
| 6 |
restorePath=path; |
|
| 7 |
addpath (['..' filesep 'MAP'], ['..' filesep 'wavFileStore'], ... |
|
| 8 |
['..' filesep 'utilities']) |
|
| 7 | 9 |
|
| 8 | 10 |
%% #1 parameter file name |
| 9 | 11 |
MAPparamsName='Normal'; |
| 10 | 12 |
|
| 11 | 13 |
|
| 12 |
%% #2 probability (fast) or spikes (slow) representation
|
|
| 14 |
%% #2 probability (fast) |
|
| 13 | 15 |
AN_spikesOrProbability='probability'; |
| 14 | 16 |
|
| 15 | 17 |
|
| 16 |
%% #3 pure tone, harmonic sequence or speech file input
|
|
| 18 |
%% #3 speech file input |
|
| 17 | 19 |
signalType= 'file'; |
| 18 | 20 |
fileName='twister_44kHz'; |
| 19 | 21 |
|
| 20 | 22 |
|
| 21 | 23 |
%% #4 rms level |
| 22 |
leveldBSPL=60; % dB SPL
|
|
| 24 |
leveldBSPL=60; % dB SPL |
|
| 23 | 25 |
|
| 24 | 26 |
|
| 25 | 27 |
%% #5 number of channels in the model |
| 26 | 28 |
% 21-channel model (log spacing) |
| 27 | 29 |
numChannels=21; |
| 28 |
lowestBF=250; highestBF= 8000;
|
|
| 30 |
lowestBF=250; highestBF= 8000; |
|
| 29 | 31 |
BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels)); |
| 30 | 32 |
|
| 31 |
%% #6 change model parameters
|
|
| 33 |
%% #6 no change to model parameters
|
|
| 32 | 34 |
paramChanges=[]; |
| 33 | 35 |
|
| 34 | 36 |
|
| 35 | 37 |
%% delare showMap options |
| 36 |
showMapOptions=[]; % use defaults |
|
| 37 |
|
|
| 38 |
% or (example: show everything including an smoothed SACF output |
|
| 39 |
showMapOptions.printModelParameters=1; |
|
| 40 |
showMapOptions.showModelOutput=1; |
|
| 41 |
showMapOptions.printFiringRates=1; |
|
| 42 |
showMapOptions.showACF=0; |
|
| 43 |
showMapOptions.showEfferent=0; |
|
| 38 |
showMapOptions.printModelParameters=1; |
|
| 39 |
showMapOptions.showModelOutput=1; |
|
| 40 |
showMapOptions.printFiringRates=1; |
|
| 41 |
showMapOptions.showACF=0; |
|
| 42 |
showMapOptions.showEfferent=0; |
|
| 43 |
showMapOptions.surfProbability=1; % 2D plot of HSR response |
|
| 44 | 44 |
|
| 45 | 45 |
%% Generate stimuli |
| 46 | 46 |
|
| ... | ... | |
| 51 | 51 |
case 'tones' |
| 52 | 52 |
inputSignal=createMultiTone(sampleRate, toneFrequency, ... |
| 53 | 53 |
leveldBSPL, duration, rampDuration); |
| 54 |
|
|
| 54 |
|
|
| 55 | 55 |
case 'file' |
| 56 |
[inputSignal sampleRate]=wavread(fileName);
|
|
| 56 |
[inputSignal sampleRate]=wavread(fileName); |
|
| 57 | 57 |
inputSignal(:,1); |
| 58 | 58 |
targetRMS=20e-6*10^(leveldBSPL/20); |
| 59 | 59 |
rms=(mean(inputSignal.^2))^0.5; |
| ... | ... | |
| 67 | 67 |
|
| 68 | 68 |
MAP1_14(inputSignal, sampleRate, BFlist, ... |
| 69 | 69 |
MAPparamsName, AN_spikesOrProbability, paramChanges); |
| 70 |
|
|
| 70 | 71 |
toc |
| 71 | 72 |
|
| 72 | 73 |
% the model run is now complete. Now display the results |
| testPrograms/demoTwisterSpikes.m | ||
|---|---|---|
| 3 | 3 |
% MAPdemo runs the MATLAB auditory periphery model (MAP1_14) as far as |
| 4 | 4 |
% IC (spikes) with graphical output |
| 5 | 5 |
|
| 6 |
restorePath=path; |
|
| 7 |
addpath (['..' filesep 'MAP'], ['..' filesep 'wavFileStore'], ... |
|
| 8 |
['..' filesep 'utilities']) |
|
| 9 |
|
|
| 6 | 10 |
|
| 7 | 11 |
%% #1 parameter file name |
| 8 | 12 |
MAPparamsName='Normal'; |
| 9 | 13 |
|
| 10 | 14 |
|
| 11 |
%% #2 probability (fast) or spikes (slow) representation
|
|
| 15 |
%% #2 spikes (slow) representation |
|
| 12 | 16 |
AN_spikesOrProbability='spikes'; |
| 13 | 17 |
|
| 14 | 18 |
|
| 15 |
%% #3 pure tone, harmonic sequence or speech file input
|
|
| 19 |
%% #3 speech file input |
|
| 16 | 20 |
signalType= 'file'; |
| 17 | 21 |
fileName='twister_44kHz'; |
| 18 | 22 |
|
| ... | ... | |
| 45 | 49 |
%% Generate stimuli |
| 46 | 50 |
|
| 47 | 51 |
dbstop if error |
| 48 |
restorePath=path; |
|
| 49 |
addpath (['..' filesep 'MAP'], ['..' filesep 'wavFileStore']) |
|
| 50 | 52 |
switch signalType |
| 51 | 53 |
case 'tones' |
| 52 | 54 |
inputSignal=createMultiTone(sampleRate, toneFrequency, ... |
| testPrograms/test_MAP1_14.m | ||
|---|---|---|
| 32 | 32 |
% |
| 33 | 33 |
% When the demonstration is satisfactory, freeze it by renaming it <demoxx> |
| 34 | 34 |
|
| 35 |
restorePath=path; |
|
| 36 |
addpath (['..' filesep 'MAP'], ['..' filesep 'wavFileStore'], ... |
|
| 37 |
['..' filesep 'utilities']) |
|
| 35 | 38 |
|
| 36 | 39 |
%% #1 parameter file name |
| 37 | 40 |
MAPparamsName='Normal'; |
| ... | ... | |
| 48 | 51 |
%% #3 pure tone, harmonic sequence or speech file input |
| 49 | 52 |
signalType= 'tones'; |
| 50 | 53 |
sampleRate= 100000; |
| 51 |
duration=0.010; % seconds
|
|
| 54 |
duration=0.50; % seconds
|
|
| 52 | 55 |
% toneFrequency= 250:250:8000; % harmonic sequence (Hz) |
| 53 |
toneFrequency= 4000; % or a pure tone (Hz8
|
|
| 56 |
toneFrequency= 500; % or a pure tone (Hz8
|
|
| 54 | 57 |
rampDuration=.005; % seconds |
| 55 | 58 |
|
| 56 | 59 |
% or |
| ... | ... | |
| 60 | 63 |
|
| 61 | 64 |
%% #4 rms level |
| 62 | 65 |
% signal details |
| 63 |
leveldBSPL= 70; % dB SPL
|
|
| 66 |
leveldBSPL= 90; % dB SPL
|
|
| 64 | 67 |
|
| 65 | 68 |
|
| 66 | 69 |
%% #5 number of channels in the model |
| ... | ... | |
| 140 | 143 |
disp([num2str(numChannels) ' channel model']) |
| 141 | 144 |
disp('Computing ...')
|
| 142 | 145 |
|
| 143 |
restorePath=path; |
|
| 144 |
addpath (['..' filesep 'MAP']) |
|
| 145 |
addpath (['..' filesep 'utilities']) |
|
| 146 |
|
|
| 147 | 146 |
MAP1_14(inputSignal, sampleRate, BFlist, ... |
| 148 | 147 |
MAPparamsName, AN_spikesOrProbability, paramChanges); |
| 149 | 148 |
toc |
| userPrograms/Pavel_MAP1_14.m | ||
|---|---|---|
| 32 | 32 |
% |
| 33 | 33 |
% When the demonstration is satisfactory, freeze it by renaming it <demoxx> |
| 34 | 34 |
|
| 35 |
restorePath=path; |
|
| 36 |
addpath (['..' filesep 'MAP'], ['..' filesep 'wavFileStore'], ... |
|
| 37 |
['..' filesep 'utilities']) |
|
| 35 | 38 |
|
| 36 | 39 |
%% #1 parameter file name |
| 37 | 40 |
MAPparamsName='Normal'; |
| ... | ... | |
| 144 | 147 |
disp([num2str(numChannels) ' channel model']) |
| 145 | 148 |
disp('Computing ...')
|
| 146 | 149 |
|
| 147 |
restorePath=path; |
|
| 148 |
addpath (['..' filesep 'MAP']) |
|
| 149 | 150 |
|
| 150 | 151 |
MAP1_14(inputSignal, sampleRate, BFlist, ... |
| 151 | 152 |
MAPparamsName, AN_spikesOrProbability, paramChanges); |
| 152 |
path(restorePath) |
|
| 153 | 153 |
toc |
| 154 | 154 |
|
| 155 | 155 |
% the model run is now complete. Now display the results |
| utilities/UTIL_showMAP.m | ||
|---|---|---|
| 1 | 1 |
function UTIL_showMAP (options) |
| 2 |
% UTIL_showMAP produces summaries of the output from MAP's mmost recent run |
|
| 3 |
% All MAP outputs are stored in global variables and UTIL_showMAP |
|
| 4 |
% simply assumes that they are in place. |
|
| 5 |
% |
|
| 2 | 6 |
% options |
| 3 |
% options.printModelParameters=1; |
|
| 4 |
% options.showModelOutput=1; |
|
| 5 |
% options.printFiringRates=1; |
|
| 6 |
% options.showACF=1; |
|
| 7 |
% options.showEfferent=1; |
|
| 8 |
% options.surfProbability=0; |
|
| 9 |
% options.fileName=[]; |
|
| 10 |
% options.surfProbability=0; |
|
| 7 |
% options.printModelParameters=1; % print model parameters |
|
| 8 |
% options.showModelOutput=1; % plot all stages output |
|
| 9 |
% options.printFiringRates=1; % mean activity at all stages |
|
| 10 |
% options.showACF=1; % SACF (probabilities only) |
|
| 11 |
% options.showEfferent=1; % plot of efferent activity |
|
| 12 |
% options.surfProbability=0; % HSR (probability) surf plot |
|
| 13 |
% options.fileName=[]; % parameter filename for plot title |
|
| 11 | 14 |
|
| 12 | 15 |
dbstop if warning |
| 13 | 16 |
|
| ... | ... | |
| 27 | 30 |
options=[]; |
| 28 | 31 |
end |
| 29 | 32 |
% defaults (plot staged outputs and print rates only) |
| 30 |
if ~isfield(options,'printModelParameters'),options.printModelParameters=0;end |
|
| 33 |
if ~isfield(options,'printModelParameters') |
|
| 34 |
options.printModelParameters=0; end |
|
| 31 | 35 |
if ~isfield(options,'showModelOutput'),options.showModelOutput=1;end |
| 32 | 36 |
if ~isfield(options,'printFiringRates'),options.printFiringRates=1;end |
| 33 | 37 |
if ~isfield(options,'showACF'),options.showACF=0;end |
Also available in: Unified diff