Revision 21:c489ebada16e

View differences:

MAP/MAP1_14.m
623 623
        y= nonlinOutput.*(MOC* DRNLa);  % linear section.
624 624
        % compress those parts of the signal above the compression
625 625
        % threshold
626
        abs_x = abs(nonlinOutput);
626
        abs_x = abs(y);
627 627
        idx=find(abs_x>DRNLcompressionThreshold);
628 628
        if ~isempty(idx)>0
629
            y(idx)=sign(nonlinOutput(idx)).*...
629
            y(idx)=sign(y(idx)).*...
630 630
                (DRNLb*abs_x(idx).^DRNLc);
631 631
        end
632 632
        nonlinOutput=y;
multithreshold 1.46/testBM.m
19 19
% levels= 50;   nLevels=length(levels);
20 20

  
21 21
relativeFrequencies=[0.25    .5   .75  1  1.25 1.5    2];
22
% relativeFrequencies=1;
22
relativeFrequencies=1;
23 23

  
24 24
% refBMdisplacement is the displacement of the BM at threshold
25 25
% 1 nm disp at  threshold (9 kHz, Ruggero)
parameterStore/MAPparamsNormal.m
76 76

  
77 77
% DRNL nonlinear path
78 78
DRNLParams.a=3e4;     % nonlinear path gain (below compression threshold)
79
% DRNLParams.a=3e2;     % DRNL.a=0 means no OHCs (no nonlinear path)
79
DRNLParams.a=3e2;     % DRNL.a=0 means no OHCs (no nonlinear path)
80 80

  
81 81
DRNLParams.b=8e-6;    % *compression threshold raised compression
82 82
% DRNLParams.b=1;    % b=1 means no compression
......
102 102
DRNLParams.MOCdelay = efferentDelay;            % must be < segment length!
103 103
% 'spikes' model: MOC based on brainstem spiking activity (HSR)
104 104
DRNLParams.rateToAttenuationFactor = .009;  % strength of MOC
105
DRNLParams.rateToAttenuationFactor = .009;  % strength of MOC
105
DRNLParams.rateToAttenuationFactor = .004;  % strength of MOC
106 106
%      DRNLParams.rateToAttenuationFactor = 0;  % strength of MOC
107 107

  
108 108
% 'probability' model: MOC based on AN spiking activity (HSR)
109 109
DRNLParams.rateToAttenuationFactorProb = .007;  % strength of MOC
110
DRNLParams.rateToAttenuationFactorProb = .0;  % strength of MOC
110
DRNLParams.rateToAttenuationFactorProb = .002;  % strength of MOC
111
% DRNLParams.rateToAttenuationFactorProb = .0;  % strength of MOC
111 112
DRNLParams.MOCtau =.03;                         % smoothing for MOC
112 113
DRNLParams.MOCrateThreshold =50;                % set to AN rate threshold
113 114

  
testPrograms/showMAP.m
1
function showMAP (options)
1
function showMAP ()
2 2
% defaults
3 3
% options.showModelParameters=1;
4 4
% options.showModelOutput=1;
......
17 17
    CNoutput  ICoutput ICmembraneOutput ICfiberTypeRates MOCattenuation
18 18
global OMEParams DRNLParams IHC_cilia_RPParams IHCpreSynapseParams
19 19
global AN_IHCsynapseParams MacGregorParams MacGregorMultiParams
20
global showMapOptions
20 21

  
21 22

  
22 23
restorePath=path;
......
172 173
    colorbar
173 174
end
174 175

  
176
if options.surfProbability
175 177
%% surface plot of probability
176
if options.surfProbability
177 178
    figure(97), clf
178 179
    % select only HSR fibers at the bottom of the matrix
179 180
    ANprobRateOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:);
180
    [nY nX]=size(ANprobRateOutput);
181
    time=dt*(1:nX);
182
    surf(time, savedBFlist, ANprobRateOutput)
181
    PSTHbinWidth=0.001;
182
    PSTH=UTIL_PSTHmakerb(ANprobRateOutput, ANdt, PSTHbinWidth);
183
    [nY nX]=size(PSTH);
184
    PSTH=PSTH(:,200:end);
185
    [nY nX]=size(PSTH);
186
    time=PSTHbinWidth*(1:nX);
187
    surf(time, savedBFlist, PSTH)
183 188
    shading interp
184 189
    set(gca, 'yScale','log')
185
    xlim([0 max(time)]), ylim([0 max(savedBFlist)]), zlim([0 1000])
190
    xlim([0 max(time)])
191
    ylim([0 max(savedBFlist)])
192
    zlim([0 1000])
186 193
    xlabel('time (s)')
187 194
    ylabel('best frequency (Hz)')
188 195
    zlabel('spike rate')
189 196
    view([-20 60])
197
%     view([0 90])
190 198
    title ([options.fileName ':   ' num2str(signalRMSdb,'% 3.0f') ' dB'])
191 199
end
192 200

  
testPrograms/test_MAP1_14.m
47 47
signalType= 'tones';
48 48
duration=0.100;                 % seconds
49 49
% duration=0.020;                 % seconds
50
sampleRate= 64000;
50
sampleRate= 100000;
51 51
% toneFrequency= 250:250:8000;    % harmonic sequence (Hz)
52 52
toneFrequency= 2000;            % or a pure tone (Hz8
53 53

  
54 54
rampDuration=.005;              % seconds
55 55

  
56
% or
57
signalType= 'file';
58
fileName='twister_44kHz';
59
% fileName='new-da-44khz';
56
% % or
57
% signalType= 'file';
58
% fileName='twister_44kHz';
59
% % fileName='new-da-44khz';
60 60

  
61 61
% mix with an optional second file?
62 62
mixerFile=[];
63 63
%or
64
mixerFile='babble';
65
leveldBSPL2=-60;
64
% mixerFile='babble';
65
% leveldBSPL2=30;
66 66

  
67 67
%% #4 rms level
68 68
% signal details
......
93 93
%     'DRNLParams.rateToAttenuationFactorProb = 0;'};
94 94

  
95 95
%% delare showMap options
96
showMapOptions=[];  % use defaults
96
global showMapOptions
97 97

  
98 98
% or (example: show everything including an smoothed SACF output
99 99
showMapOptions.showModelParameters=1;
......
103 103
showMapOptions.showEfferent=1;
104 104
if strcmp(AN_spikesOrProbability, 'probability')
105 105
    showMapOptions.surfProbability=1;
106
else
107
    showMapOptions.surfProbability=0;
106 108
end
107 109
if strcmp(signalType, 'file')
108 110
    showMapOptions.fileName=fileName;
111
else
112
    showMapOptions.fileName=[];
109 113
end
110 114

  
111 115
%% Generate stimuli
......
126 130
        rms=(mean(inputSignal.^2))^0.5;
127 131
        amp=targetRMS/rms;
128 132
        inputSignal=inputSignal*amp;
133
        silence=zeros(10000,1);
134
        inputSignal=[silence; inputSignal];
129 135
        if ~isempty(mixerFile)
130 136
            [inputSignal2 sampleRate]=wavread(mixerFile);
131 137
            inputSignal2=inputSignal2(:,1);
......
157 163
toc
158 164

  
159 165
% the model run is now complete. Now display the results
160
showMAP(showMapOptions)
166
showMAP
161 167
for i=1:length(paramChanges)
162 168
disp(paramChanges{i})
163 169
end
utilities/UTIL_PSTHmakerb.m
1
function [PSTH ]=UTIL_PSTHmakerb(inputData, dt, PSTHbinWidth)
2
% UTIL_PSTHmakerb averages mean values into bins.
3
% No corrections are applied
4
% usage:
5
%	PSTH=UTIL_PSTHmaker(inputData, method)
6
%
7
% arguments
8
%	inputData is a channel x time matrix
9
%	PSTH is the reduced matrix, the sum of all elements in the bin
10
%
11

  
12
[numChannels numDataPoints]= size(inputData);
13

  
14
% Multiple fibers is the same as repeat trials
15
% Consolidate data into a histogram 
16
dataPointsPerBin=round(PSTHbinWidth/dt);
17
if dataPointsPerBin<=1;
18
% 	Too few data points
19
	PSTH=inputData;
20
	return
21
end
22

  
23
numBins=floor(numDataPoints/dataPointsPerBin);
24
PSTH=zeros(numChannels,numBins);
25

  
26
% take care that signal length is an integer multiple of bin size
27
%  by dropping the last unuseable values
28
useableDataLength=numBins*dataPointsPerBin;
29
inputData=inputData(:,1:useableDataLength);
30

  
31
for ch=1:numChannels
32
	% Convert each channel into a matrix where each column represents 
33
	% the content of a single PSTH bin
34
	PSTH2D=reshape (inputData(ch,:), dataPointsPerBin, numBins );
35
	% and sum within each bin (across the rows
36
	PSTH(ch,:)=mean (PSTH2D,1);
37
end

Also available in: Unified diff