To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at git://github.com/rmeddis/MAP.git .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Revision:

root / multithreshold 1.46 / testSynapse.m @ 29:b51bf546ca3f

History | View | Annotate | Download (2.35 KB)

1
function testSynapse(BFlist,paramsName)
2
% testSynapse tracks the quantity of available transmitter vesicles
3
%  the computations are single channel using the first frequency
4
%  in the targetFrequency box of the expGUI.
5
% For, speed this function uses only probability and HSR fibers.
6
% This cannot be changed because of the way AN_IHCsynapse is coded.This).
7

    
8
global experiment  method IHCpreSynapseParams
9
global  AN_IHCsynapseParams  stimulusParameters
10
savePath=path;
11
addpath (['..' filesep 'utilities'],['..' filesep 'MAP'])
12

    
13
figure(6),clf
14
plotColors='rbgkrbgkrbgkrbgkrbgkrbgk';
15
set(gcf,'position',[5    32   264   243])
16

    
17
sampleRate=5e4; dt=1/sampleRate;
18

    
19
maskerLevels=-0:10:100;
20

    
21
targetFrequency=stimulusParameters.targetFrequency;
22
targetFrequency=targetFrequency(1); % only one frequency used
23

    
24
showParams=0;
25
useEfferent=0;  % no efferent
26

    
27
silenceDuration=0.005;
28
silenceDuration=0.015;
29
maskerDuration=0.1;
30
recoveryDuration=0.15;
31
rampDuration=0.004;
32

    
33
maskerTime=dt:dt:maskerDuration;
34

    
35
rampTime=dt:dt:rampDuration;
36
ramp=[0.5*(1+cos(2*pi*rampTime/(2*rampDuration)+pi)) ...
37
    ones(1,length(maskerTime)-length(rampTime))];
38
ramp=ramp.*fliplr(ramp);
39

    
40
initialSilence=zeros(1,round(silenceDuration/dt));
41
recoverySilence=zeros(1,round(recoveryDuration/dt));
42

    
43
signal=sin(2*pi*targetFrequency'*maskerTime);
44
signal= ramp.*signal;
45
signal=[initialSilence signal  recoverySilence];
46

    
47
levelCount=0;
48
qtMatrix=[];
49
for leveldB=maskerLevels
50
    levelCount=levelCount+1;
51

    
52
    amp=28e-6*10^(leveldB/20);
53
    inputSignal=amp*signal;
54

    
55
    AN_spikesOrProbability='probability';
56
    showPlotsAndDetails=0;
57

    
58
    global savePavailable
59
   
60
        MAP1_14(inputSignal, 1/dt, targetFrequency, ...
61
            paramsName, AN_spikesOrProbability);
62

    
63
    % ignore LSR channels (if any) at the top of the matrix
64
    qt=savePavailable(end, :);
65

    
66
    synapsedt=dt;
67
    time=synapsedt:synapsedt:synapsedt*length(qt);
68

    
69
    figure(6)
70
    qtMatrix=[qtMatrix; qt];
71
    plot(time,qt,  plotColors(levelCount))
72
    hold on
73
    xlim([0 max(time)])
74
    ylim([0 AN_IHCsynapseParams.M])
75
end
76

    
77
set(gcf,'name','pre-synaptic available transmitter')
78
title(['q - available vesicles:' num2str(BFlist) ' Hz'])
79
legend(strvcat(num2str(maskerLevels')),'location','southeast')
80
legend boxoff
81
grid on
82

    
83
figure(88), [c,H]=contour(time, maskerLevels,qtMatrix); clabel(c, H);
84
set(gcf,'position',[ 276    31   328   246])
85
xlabel('time'), ylabel('maskerLevels')
86

    
87
path(savePath);