changeset 27:d4a7675b0413

fixed MOC attenuation
author Ray Meddis <rmeddis@essex.ac.uk>
date Wed, 22 Jun 2011 12:02:45 +0100
parents b03ef38fe497
children 02aa9826efe0
files Help and reference data/MAPlog.doc MAP/MAP1_14.m testPrograms/test_MAP1_14.m utilities/UTIL_showMAP.m
diffstat 4 files changed, 29 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
Binary file Help and reference data/MAPlog.doc has changed
--- a/MAP/MAP1_14.m	Tue Jun 21 14:58:12 2011 +0100
+++ b/MAP/MAP1_14.m	Wed Jun 22 12:02:45 2011 +0100
@@ -771,14 +771,20 @@
             % within-channel HSR response only
             HSRbegins=nBFs*(nANfiberTypes-1)+1;
             rates=ANrate(HSRbegins:end,:);
-            for idx=1:nBFs
-                [smoothedRates, MOCprobBoundary{idx}] = ...
-                    filter(MOCfilt_b, MOCfilt_a, rates(idx,:), ...
-                    MOCprobBoundary{idx});
-                smoothedRates=smoothedRates-MOCrateThresholdProb;
-                smoothedRates(smoothedRates<0)=0;
-                MOCattenuation(idx,segmentStartPTR:segmentEndPTR)= ...
-                    (1- smoothedRates* rateToAttenuationFactorProb);
+            if rateToAttenuationFactorProb<0
+                % negative factor implies a fixed attenuation
+                MOCattenuation(:,segmentStartPTR:segmentEndPTR)= ...
+                    ones(size(rates))* -rateToAttenuationFactorProb;
+            else
+                for idx=1:nBFs
+                    [smoothedRates, MOCprobBoundary{idx}] = ...
+                        filter(MOCfilt_b, MOCfilt_a, rates(idx,:), ...
+                        MOCprobBoundary{idx});
+                    smoothedRates=smoothedRates-MOCrateThresholdProb;
+                    smoothedRates(smoothedRates<0)=0;
+                    MOCattenuation(idx,segmentStartPTR:segmentEndPTR)= ...
+                        (1- smoothedRates* rateToAttenuationFactorProb);
+                end
             end
             MOCattenuation(MOCattenuation<0)=0.001;
 
@@ -1134,11 +1140,11 @@
 % switch AN_spikesOrProbability
 %     case 'probability'
 %         ANprobOutput=ANprobRateOutput*dt;
-%         [r c]=size(ANprobOutput);
+%         [r nEpochs]=size(ANprobOutput);
 %         % find probability of no spikes in refractory period
 %         pNoSpikesInRefrac=ones(size(ANprobOutput));
 %         pSpike=zeros(size(ANprobOutput));
-%         for epochNo=lengthAbsRefractoryP+2:c
+%         for epochNo=lengthAbsRefractoryP+2:nEpochs
 %             pNoSpikesInRefrac(:,epochNo)=...
 %                 pNoSpikesInRefrac(:,epochNo-2)...
 %                 .*(1-pSpike(:,epochNo-1))...
--- a/testPrograms/test_MAP1_14.m	Tue Jun 21 14:58:12 2011 +0100
+++ b/testPrograms/test_MAP1_14.m	Wed Jun 22 12:02:45 2011 +0100
@@ -65,7 +65,7 @@
 
 %% #4 rms level
 % signal details
-leveldBSPL= 30;                  % dB SPL
+leveldBSPL= 90;                  % dB SPL
 
 
 %% #5 number of channels in the model
@@ -91,11 +91,13 @@
 % paramChanges={'AN_IHCsynapseParams.ANspeedUpFactor=5;', ...
 %     'IHCpreSynapseParams.tauCa=86e-6;'};
 
-paramChanges={'DRNLParams.rateToAttenuationFactorProb = 0;'};
+% paramChanges={'DRNLParams.rateToAttenuationFactorProb = 0;'};
 
 % paramChanges={'IHCpreSynapseParams.tauCa=86e-6;',
 %     'AN_IHCsynapseParams.numFibers=	1000;'};
 
+% fixed MOC attenuation(using negative factor)
+paramChanges={'DRNLParams.rateToAttenuationFactorProb=-0.005;'};
 
 %% delare 'showMap' options to control graphical output
 
--- a/utilities/UTIL_showMAP.m	Tue Jun 21 14:58:12 2011 +0100
+++ b/utilities/UTIL_showMAP.m	Wed Jun 22 12:02:45 2011 +0100
@@ -76,10 +76,10 @@
         disp(['IC: ' num2str(sum(sum(ICoutput))/duration)])
         %         disp(['IC by type: ' num2str(mean(ICfiberTypeRates,2)')])
     else
-        disp(['AN: ' num2str(mean(mean(ANprobRateOutput)))])
-        PSTH= UTIL_PSTHmakerb(ANprobRateOutput, dt, 0.001);
-        disp(['max max AN: ' num2str(max(max(...
-            PSTH )))])
+    HSRprobOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:);
+        disp(['AN(HSR): ' num2str(mean(mean(HSRprobOutput)))])
+        PSTH= UTIL_PSTHmakerb(HSRprobOutput, dt, 0.001);
+        disp(['max max AN: ' num2str(max(max(PSTH)))])
     end
 end
 
@@ -178,9 +178,9 @@
             length(savedBFlist)>2
     figure(97), clf
     % select only HSR fibers at the bottom of the matrix
-    ANprobRateOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:);
+    HSRprobOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:);
     PSTHbinWidth=0.001;
-    PSTH=UTIL_PSTHmakerb(ANprobRateOutput, ANdt, PSTHbinWidth);
+    PSTH=UTIL_PSTHmakerb(HSRprobOutput, ANdt, PSTHbinWidth);
     [nY nX]=size(PSTH);
     time=PSTHbinWidth*(1:nX);
     surf(time, savedBFlist, PSTH)
@@ -188,12 +188,14 @@
     set(gca, 'yScale','log')
     xlim([0 max(time)])
     ylim([0 max(savedBFlist)])
-    zlim([0 1000])
+    zlim([0 2000])
     xlabel('time (s)')
     ylabel('best frequency (Hz)')
     zlabel('spike rate')
     view([-20 60])
     %     view([0 90])
+            disp(['max max AN: ' num2str(max(max(PSTH)))])
+
     title ([showMapOptions.fileName ':   ' num2str(signalRMSdb,'% 3.0f') ' dB'])
     end
 end