changeset 25:d2c4c07df02c

path problem solved
author Ray Meddis <rmeddis@essex.ac.uk>
date Fri, 17 Jun 2011 14:30:28 +0100
parents a5e4a43c1673
children b03ef38fe497
files Help and reference data/MAPlog.doc multithreshold 1.46/savedData/mostRecentResults.mat multithreshold 1.46/subjGUI_MT.m parameterStore/MAPparamsEndo.m parameterStore/MAPparamsOHC.m testPrograms/demoTwisterProbability.m testPrograms/demoTwisterSpikes.m testPrograms/test_MAP1_14.m utilities/UTIL_showMAP.m
diffstat 9 files changed, 100 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
Binary file Help and reference data/MAPlog.doc has changed
Binary file multithreshold 1.46/savedData/mostRecentResults.mat has changed
--- a/multithreshold 1.46/subjGUI_MT.m	Thu Jun 16 16:43:49 2011 +0100
+++ b/multithreshold 1.46/subjGUI_MT.m	Fri Jun 17 14:30:28 2011 +0100
@@ -1581,6 +1581,7 @@
     options.showACF=0;
     options.showEfferent=1;
     options.surfProbability=0;
+    showMapOptions.surfSpikes=0;
     UTIL_showMAP(options)
 end
 
--- a/parameterStore/MAPparamsEndo.m	Thu Jun 16 16:43:49 2011 +0100
+++ b/parameterStore/MAPparamsEndo.m	Fri Jun 17 14:30:28 2011 +0100
@@ -20,7 +20,6 @@
 currentFile=mfilename;                      % i.e. the name of this mfile
 method.parameterSource=currentFile(10:end); % for the record
 
-switchOffEfferent=0;
 efferentDelay=0.010;
 method.segmentDuration=efferentDelay;
 
@@ -57,17 +56,14 @@
 
 % Acoustic reflex: maximum attenuation should be around 25 dB Price (1966)
 % i.e. a minimum ratio of 0.056.
-if ~switchOffEfferent
-    % 'spikes' model: AR based on brainstem spiking activity (LSR)
-    OMEParams.rateToAttenuationFactor=0.003;   % * N(all ICspikes)
+% 'spikes' model: AR based on brainstem spiking activity (LSR)
+OMEParams.rateToAttenuationFactor=0.006;   % * N(all ICspikes)
 %     OMEParams.rateToAttenuationFactor=0;   % * N(all ICspikes)
-    % 'probability model': Ar based on An firing probabilities (LSR)
-    OMEParams.rateToAttenuationFactorProb=0.005;% * N(all ANrates)
+
+% 'probability model': Ar based on AN firing probabilities (LSR)
+OMEParams.rateToAttenuationFactorProb=0.01;% * N(all ANrates)
 %     OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates)
-else
-    OMEParams.rateToAttenuationFactor=0;        % 0= off
-    OMEParams.rateToAttenuationFactorProb=0;    % 0= off
-end
+
 % asymptote should be around 100-200 ms
 OMEParams.ARtau=.05; % AR smoothing function
 % delay must be longer than the segment length
@@ -79,8 +75,7 @@
 DRNLParams.BFlist=BFlist;
 
 % DRNL nonlinear path
-DRNLParams.a=3e4;     % nonlinear path gain (below compression threshold)
-% DRNLParams.a=3e2;     % DRNL.a=0 means no OHCs (no nonlinear path)
+DRNLParams.a=5e4;     % DRNL.a=0 means no OHCs (no nonlinear path)
 
 DRNLParams.b=8e-6;    % *compression threshold raised compression
 % DRNLParams.b=1;    % b=1 means no compression
@@ -104,20 +99,16 @@
 
 % DRNL MOC efferents
 DRNLParams.MOCdelay = efferentDelay;            % must be < segment length!
-if ~switchOffEfferent
-    % 'spikes' model: MOC based on brainstem spiking activity (HSR)
-    DRNLParams.rateToAttenuationFactor = .009;  % strength of MOC
-    DRNLParams.rateToAttenuationFactor = .009;  % strength of MOC
+
+% 'spikes' model: MOC based on brainstem spiking activity (HSR)
+DRNLParams.rateToAttenuationFactor = .01;  % strength of MOC
 %      DRNLParams.rateToAttenuationFactor = 0;  % strength of MOC
+% 'probability' model: MOC based on AN spiking activity (HSR)
+DRNLParams.rateToAttenuationFactorProb = .005;  % strength of MOC
+% DRNLParams.rateToAttenuationFactorProb = .0;  % strength of MOC
+DRNLParams.MOCrateThreshold =70;                % spikes/s probability only
 
-    % 'spikes' model: MOC based on brainstem spiking activity (HSR)
-    DRNLParams.rateToAttenuationFactorProb = .002;  % strength of MOC
-else
-    DRNLParams.rateToAttenuationFactor = 0;     % 0 = MOC off (probability)
-    DRNLParams.rateToAttenuationFactorProb = 0; % 0 = MOC off (spikes)
-end
-DRNLParams.MOCtau =.03;                         % smoothing for MOC
-DRNLParams.MOCrateThreshold =50;                % set to AN rate threshold
+DRNLParams.MOCtau =.1;                         % smoothing for MOC
 
 
 %% #4 IHC_cilia_RPParams
@@ -130,14 +121,13 @@
 IHC_cilia_RPParams.u1=	1e-9;
 IHC_cilia_RPParams.s1=	1e-9;
 
-IHC_cilia_RPParams.Gmax= 5e-9;      % 2.5e-9 maximum conductance (Siemens)
-IHC_cilia_RPParams.Ga=	1e-9;       % 4.3e-9 fixed apical membrane conductance
+IHC_cilia_RPParams.Gmax= 5e-9;    % 2.5e-9 maximum conductance (Siemens)
+IHC_cilia_RPParams.Ga=	1e-9;  % 4.3e-9 fixed apical membrane conductance
 
 %  #5 IHC_RP
 IHC_cilia_RPParams.Cab=	4e-012;         % IHC capacitance (F)
 IHC_cilia_RPParams.Cab=	1e-012;         % IHC capacitance (F)
-IHC_cilia_RPParams.Et=	0.100;          % endocochlear potential (V)
-IHC_cilia_RPParams.Et=	0.065;          % endocochlear potential (V)
+IHC_cilia_RPParams.Et=	0.07;          % endocochlear potential (V)
 
 IHC_cilia_RPParams.Gk=	2e-008;         % 1e-8 potassium conductance (S)
 IHC_cilia_RPParams.Ek=	-0.08;          % -0.084 K equilibrium potential
@@ -156,7 +146,7 @@
 % reminder: changing z has a strong effect on HF thresholds (like Et)
 IHCpreSynapseParams.z=	    2e42;   % scalar Ca -> vesicle release rate
 
-LSRtauCa=50e-6;            HSRtauCa=85e-6;            % seconds
+LSRtauCa=35e-6;            HSRtauCa=85e-6;            % seconds
 % LSRtauCa=35e-6;            HSRtauCa=70e-6;            % seconds
 IHCpreSynapseParams.tauCa= [LSRtauCa HSRtauCa]; %LSR and HSR fiber
 
--- a/parameterStore/MAPparamsOHC.m	Thu Jun 16 16:43:49 2011 +0100
+++ b/parameterStore/MAPparamsOHC.m	Fri Jun 17 14:30:28 2011 +0100
@@ -57,11 +57,11 @@
 % Acoustic reflex: maximum attenuation should be around 25 dB Price (1966)
 % i.e. a minimum ratio of 0.056.
 % 'spikes' model: AR based on brainstem spiking activity (LSR)
-OMEParams.rateToAttenuationFactor=0.003;   % * N(all ICspikes)
+OMEParams.rateToAttenuationFactor=0.006;   % * N(all ICspikes)
 %     OMEParams.rateToAttenuationFactor=0;   % * N(all ICspikes)
 
 % 'probability model': Ar based on AN firing probabilities (LSR)
-OMEParams.rateToAttenuationFactorProb=0.005;% * N(all ANrates)
+OMEParams.rateToAttenuationFactorProb=0.01;% * N(all ANrates)
 %     OMEParams.rateToAttenuationFactorProb=0;% * N(all ANrates)
 
 % asymptote should be around 100-200 ms
@@ -75,7 +75,6 @@
 DRNLParams.BFlist=BFlist;
 
 % DRNL nonlinear path
-DRNLParams.a=3e4;     % nonlinear path gain (below compression threshold)
 DRNLParams.a=0;     % DRNL.a=0 means no OHCs (no nonlinear path)
 
 DRNLParams.b=8e-6;    % *compression threshold raised compression
@@ -100,15 +99,16 @@
 
 % DRNL MOC efferents
 DRNLParams.MOCdelay = efferentDelay;            % must be < segment length!
+
 % 'spikes' model: MOC based on brainstem spiking activity (HSR)
-DRNLParams.rateToAttenuationFactor = .009;  % strength of MOC
-DRNLParams.rateToAttenuationFactor = .009;  % strength of MOC
+DRNLParams.rateToAttenuationFactor = .01;  % strength of MOC
 %      DRNLParams.rateToAttenuationFactor = 0;  % strength of MOC
+% 'probability' model: MOC based on AN spiking activity (HSR)
+DRNLParams.rateToAttenuationFactorProb = .005;  % strength of MOC
+% DRNLParams.rateToAttenuationFactorProb = .0;  % strength of MOC
+DRNLParams.MOCrateThreshold =70;                % spikes/s probability only
 
-% 'probability' model: MOC based on AN spiking activity (HSR)
-DRNLParams.rateToAttenuationFactorProb = .002;  % strength of MOC
-DRNLParams.MOCtau =.03;                         % smoothing for MOC
-DRNLParams.MOCrateThreshold =50;                % set to AN rate threshold
+DRNLParams.MOCtau =.1;                         % smoothing for MOC
 
 
 %% #4 IHC_cilia_RPParams
@@ -127,7 +127,7 @@
 %  #5 IHC_RP
 IHC_cilia_RPParams.Cab=	4e-012;         % IHC capacitance (F)
 IHC_cilia_RPParams.Cab=	1e-012;         % IHC capacitance (F)
-IHC_cilia_RPParams.Et=	0.100;          % endocochlear potential (V)
+IHC_cilia_RPParams.Et=	0.1;          % endocochlear potential (V)
 
 IHC_cilia_RPParams.Gk=	2e-008;         % 1e-8 potassium conductance (S)
 IHC_cilia_RPParams.Ek=	-0.08;          % -0.084 K equilibrium potential
@@ -146,7 +146,7 @@
 % reminder: changing z has a strong effect on HF thresholds (like Et)
 IHCpreSynapseParams.z=	    2e42;   % scalar Ca -> vesicle release rate
 
-LSRtauCa=50e-6;            HSRtauCa=85e-6;            % seconds
+LSRtauCa=35e-6;            HSRtauCa=85e-6;            % seconds
 % LSRtauCa=35e-6;            HSRtauCa=70e-6;            % seconds
 IHCpreSynapseParams.tauCa= [LSRtauCa HSRtauCa]; %LSR and HSR fiber
 
--- a/testPrograms/demoTwisterProbability.m	Thu Jun 16 16:43:49 2011 +0100
+++ b/testPrograms/demoTwisterProbability.m	Fri Jun 17 14:30:28 2011 +0100
@@ -3,6 +3,7 @@
 % MAPdemo runs the MATLAB auditory periphery model (MAP1_14) as far as
 %  the AN (probabilities) or IC (spikes) with graphical output
 
+dbstop if error
 restorePath=path;
 addpath (['..' filesep 'MAP'],    ['..' filesep 'wavFileStore'], ...
     ['..' filesep 'utilities'])
@@ -44,9 +45,6 @@
 
 %% Generate stimuli
 
-dbstop if error
-restorePath=path;
-addpath (['..' filesep 'MAP'],    ['..' filesep 'wavFileStore'])
 switch signalType
     case 'tones'
         inputSignal=createMultiTone(sampleRate, toneFrequency, ...
--- a/testPrograms/demoTwisterSpikes.m	Thu Jun 16 16:43:49 2011 +0100
+++ b/testPrograms/demoTwisterSpikes.m	Fri Jun 17 14:30:28 2011 +0100
@@ -48,7 +48,6 @@
 
 %% Generate stimuli
 
-dbstop if error
 switch signalType
     case 'tones'
         inputSignal=createMultiTone(sampleRate, toneFrequency, ...
--- a/testPrograms/test_MAP1_14.m	Thu Jun 16 16:43:49 2011 +0100
+++ b/testPrograms/test_MAP1_14.m	Fri Jun 17 14:30:28 2011 +0100
@@ -32,6 +32,7 @@
 %
 % When the demonstration is satisfactory, freeze it by renaming it <demoxx>
 
+dbstop if error
 restorePath=path;
 addpath (['..' filesep 'MAP'],    ['..' filesep 'wavFileStore'], ...
     ['..' filesep 'utilities'])
@@ -45,15 +46,15 @@
 
 % or
 % NB probabilities are not corrected for refractory effects
-AN_spikesOrProbability='probability';
+% AN_spikesOrProbability='probability';
 
 
 %% #3 pure tone, harmonic sequence or speech file input
 signalType= 'tones';
 sampleRate= 100000;
-duration=0.50;                 % seconds
+duration=0.050;                 % seconds
 % toneFrequency= 250:250:8000;    % harmonic sequence (Hz)
-toneFrequency= 500;            % or a pure tone (Hz8
+toneFrequency= 1000;            % or a pure tone (Hz8
 rampDuration=.005;              % seconds
 
 % or
@@ -63,7 +64,7 @@
 
 %% #4 rms level
 % signal details
-leveldBSPL= 90;                  % dB SPL
+leveldBSPL= 70;                  % dB SPL
 
 
 %% #5 number of channels in the model
@@ -73,6 +74,7 @@
 BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels));
 
 %   or specify your own channel BFs
+% numChannels=1;
 % BFlist=toneFrequency;
 
 
@@ -84,25 +86,33 @@
 %  *after* the MAPparams file has been read
 % This example declares only one fiber type with a calcium clearance time
 % constant of 80e-6 s (HSR fiber) when the probability option is selected.
+
 % paramChanges={'AN_IHCsynapseParams.ANspeedUpFactor=5;', ...
 %     'IHCpreSynapseParams.tauCa=86e-6;'};
+
 % paramChanges={'DRNLParams.rateToAttenuationFactorProb = 0;'};
 
+% paramChanges={'IHCpreSynapseParams.tauCa=86e-6;',
+%     'AN_IHCsynapseParams.numFibers=	100;'};
+
 
 %% delare 'showMap' options to control graphical output
-global showMapOptions
 
-% or (example: show everything including an smoothed SACF output
 showMapOptions.printModelParameters=1;   % prints all parameters
 showMapOptions.showModelOutput=1;       % plot of all stages
 showMapOptions.printFiringRates=1;      % prints stage activity levels
 showMapOptions.showACF=0;               % shows SACF (probability only)
 showMapOptions.showEfferent=1;          % tracks of AR and MOC
 showMapOptions.surfProbability=1;       % 2D plot of HSR response 
+showMapOptions.surfSpikes=1;            % 2D plot of spikes histogram
+
+% disable certain silly options
 if strcmp(AN_spikesOrProbability, 'spikes')
     % avoid nonsensical options
     showMapOptions.surfProbability=0;
     showMapOptions.showACF=0;
+else
+    showMapOptions.surfSpikes=0;
 end
 if strcmp(signalType, 'file')
     % needed for labeling plot
@@ -113,9 +123,6 @@
 
 %% Generate stimuli
 
-dbstop if error
-restorePath=path;
-addpath (['..' filesep 'MAP'],    ['..' filesep 'wavFileStore'])
 switch signalType
     case 'tones'
         inputSignal=createMultiTone(sampleRate, toneFrequency, ...
@@ -179,7 +186,7 @@
 inputSignal=inputSignal.*ramp;
 
 % add 10 ms silence
-silence= zeros(1,round(0.03/dt));
-silence= zeros(1,round(0.01/dt));
+silence= zeros(1,round(0.05/dt));
+silence= zeros(1,round(0.05/dt));
 inputSignal= [silence inputSignal silence];
 
--- a/utilities/UTIL_showMAP.m	Thu Jun 16 16:43:49 2011 +0100
+++ b/utilities/UTIL_showMAP.m	Fri Jun 17 14:30:28 2011 +0100
@@ -1,16 +1,16 @@
-function UTIL_showMAP (options)
+function UTIL_showMAP (showMapOptions)
 % UTIL_showMAP produces summaries of the output from MAP's mmost recent run
 %  All MAP outputs are stored in global variables and UTIL_showMAP
 %  simply assumes that they are in place.
 %
-% options
-% options.printModelParameters=1; % print model parameters 
-% options.showModelOutput=1;      % plot all stages output
-% options.printFiringRates=1;     % mean activity at all stages
-% options.showACF=1;              % SACF (probabilities only)
-% options.showEfferent=1;         % plot of efferent activity
-% options.surfProbability=0;      % HSR (probability) surf plot
-% options.fileName=[];            % parameter filename for plot title
+% showMapOptions
+% showMapOptions.printModelParameters=1; % print model parameters 
+% showMapOptions.showModelOutput=1;      % plot all stages output
+% showMapOptions.printFiringRates=1;     % mean activity at all stages
+% showMapOptions.showACF=1;              % SACF (probabilities only)
+% showMapOptions.showEfferent=1;         % plot of efferent activity
+% showMapOptions.surfProbability=0;      % HSR (probability) surf plot
+% showMapOptions.fileName=[];            % parameter filename for plot title
 
 dbstop if warning
 
@@ -27,20 +27,21 @@
 addpath ( ['..' filesep 'utilities'], ['..' filesep 'parameterStore'])
 
 if nargin<1
-    options=[];
+    showMapOptions=[];
 end
-% defaults (plot staged outputs and print rates only)
-if ~isfield(options,'printModelParameters')
-        options.printModelParameters=0; end
-if ~isfield(options,'showModelOutput'),options.showModelOutput=1;end
-if ~isfield(options,'printFiringRates'),options.printFiringRates=1;end
-if ~isfield(options,'showACF'),options.showACF=0;end
-if ~isfield(options,'showEfferent'),options.showEfferent=0;end
-if ~isfield(options,'surfProbability'),options.surfProbability=0;end
-if ~isfield(options,'fileName'),options.fileName=[];end
+% defaults (plot staged outputs and print rates only) if options omitted
+if ~isfield(showMapOptions,'printModelParameters')
+        showMapOptions.printModelParameters=0; end
+if ~isfield(showMapOptions,'showModelOutput'),showMapOptions.showModelOutput=1;end
+if ~isfield(showMapOptions,'printFiringRates'),showMapOptions.printFiringRates=1;end
+if ~isfield(showMapOptions,'showACF'),showMapOptions.showACF=0;end
+if ~isfield(showMapOptions,'showEfferent'),showMapOptions.showEfferent=0;end
+if ~isfield(showMapOptions,'surfProbability'),showMapOptions.surfProbability=0;end
+if ~isfield(showMapOptions,'fileName'),showMapOptions.fileName=[];end
+if ~isfield(showMapOptions,'surfSpikes'),showMapOptions.surfSpikes=0;end
 
 
-if options.printModelParameters
+if showMapOptions.printModelParameters
     % Read parameters from MAPparams<***> file in 'parameterStore' folder
     %  and print out all parameters
     cmd=['MAPparams' saveMAPparamsName ...
@@ -48,7 +49,7 @@
     eval(cmd);
 end
 
-if options.printFiringRates
+if showMapOptions.printFiringRates
     %% print summary firing rates
     fprintf('\n\n')
     disp('summary')
@@ -78,7 +79,7 @@
 
 
 %% figure (99) summarises main model output
-if options.showModelOutput
+if showMapOptions.showModelOutput
     plotInstructions.figureNo=99;
     signalRMS=mean(savedInputSignal.^2)^0.5;
     signalRMSdb=20*log10(signalRMS/20e-6);
@@ -163,7 +164,7 @@
     end
 end
 
-if options.surfProbability
+if showMapOptions.surfProbability
     %% surface plot of probability
     figure(97), clf
     % select only HSR fibers at the bottom of the matrix
@@ -183,12 +184,35 @@
     zlabel('spike rate')
     view([-20 60])
     %     view([0 90])
-    title ([options.fileName ':   ' num2str(signalRMSdb,'% 3.0f') ' dB'])
+    title ([showMapOptions.fileName ':   ' num2str(signalRMSdb,'% 3.0f') ' dB'])
 end
 
+if showMapOptions.surfSpikes
+    %% surface plot of probability
+    figure(97), clf
+    % select only HSR fibers at the bottom of the matrix
+    ANoutput= ANoutput(end-length(savedBFlist)+1:end,:);
+    PSTHbinWidth=0.001; % 1 ms bins
+    PSTH=UTIL_PSTHmakerb(ANoutput, ANdt, PSTHbinWidth);
+    [nY nX]=size(PSTH);
+    time=PSTHbinWidth*(1:nX);
+    surf(time, savedBFlist, PSTH)
+    shading interp
+    set(gca, 'yScale','log')
+    xlim([0 max(time)])
+    ylim([0 max(savedBFlist)])
+%     zlim([0 1000])
+    xlabel('time (s)')
+    ylabel('best frequency (Hz)')
+    zlabel('spike rate')
+    view([-20 60])
+    %     view([0 90])
+    title ([showMapOptions.fileName ':   ' num2str(signalRMSdb,'% 3.0f') ' dB'])
+end
+
 
 %% plot efferent control values as dB
-if options.showEfferent
+if showMapOptions.showEfferent
     plotInstructions=[];
     plotInstructions.figureNo=98;
     figure(98), clf
@@ -212,7 +236,7 @@
 end
 
 %% ACF plot if required
-if options.showACF
+if showMapOptions.showACF
     tic
     method.dt=dt;
     method.segmentNo=1;