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 @ 0:f233164f4c86

History | View | Annotate | Download (2.39 KB)

1
function testSynapse
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
BFlist=stimulusParameters.targetFrequency(1);
22
targetFrequency=stimulusParameters.targetFrequency;
23
targetFrequency=targetFrequency(1); % only one frequency used
24

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

    
28
silenceDuration=0.005;
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
    MAPparamsName=experiment.name;
57
    showPlotsAndDetails=0;
58

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

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

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

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

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

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

    
88
path(savePath);