Mercurial > hg > map
comparison Copy_of_multithreshold 1.46/testSynapse.m @ 28:02aa9826efe0
mainly multiThreshold
author | Ray Meddis <rmeddis@essex.ac.uk> |
---|---|
date | Fri, 01 Jul 2011 12:59:47 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
27:d4a7675b0413 | 28:02aa9826efe0 |
---|---|
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 silenceDuration=0.015; | |
30 maskerDuration=0.1; | |
31 recoveryDuration=0.15; | |
32 rampDuration=0.004; | |
33 | |
34 maskerTime=dt:dt:maskerDuration; | |
35 | |
36 rampTime=dt:dt:rampDuration; | |
37 ramp=[0.5*(1+cos(2*pi*rampTime/(2*rampDuration)+pi)) ... | |
38 ones(1,length(maskerTime)-length(rampTime))]; | |
39 ramp=ramp.*fliplr(ramp); | |
40 | |
41 initialSilence=zeros(1,round(silenceDuration/dt)); | |
42 recoverySilence=zeros(1,round(recoveryDuration/dt)); | |
43 | |
44 signal=sin(2*pi*targetFrequency'*maskerTime); | |
45 signal= ramp.*signal; | |
46 signal=[initialSilence signal recoverySilence]; | |
47 | |
48 levelCount=0; | |
49 qtMatrix=[]; | |
50 for leveldB=maskerLevels | |
51 levelCount=levelCount+1; | |
52 | |
53 amp=28e-6*10^(leveldB/20); | |
54 inputSignal=amp*signal; | |
55 | |
56 AN_spikesOrProbability='probability'; | |
57 MAPparamsName=experiment.name; | |
58 showPlotsAndDetails=0; | |
59 | |
60 global savePavailable | |
61 | |
62 MAP1_14(inputSignal, 1/dt, targetFrequency, ... | |
63 MAPparamsName, AN_spikesOrProbability); | |
64 | |
65 % ignore LSR channels (if any) at the top of the matrix | |
66 qt=savePavailable(end, :); | |
67 | |
68 synapsedt=dt; | |
69 time=synapsedt:synapsedt:synapsedt*length(qt); | |
70 | |
71 figure(6) | |
72 qtMatrix=[qtMatrix; qt]; | |
73 plot(time,qt, plotColors(levelCount)) | |
74 hold on | |
75 xlim([0 max(time)]) | |
76 ylim([0 AN_IHCsynapseParams.M]) | |
77 end | |
78 | |
79 set(gcf,'name','pre-synaptic available transmitter') | |
80 title(['q - available vesicles:' num2str(BFlist) ' Hz']) | |
81 legend(strvcat(num2str(maskerLevels')),'location','southeast') | |
82 legend boxoff | |
83 grid on | |
84 | |
85 figure(88), [c,H]=contour(time, maskerLevels,qtMatrix); clabel(c, H); | |
86 set(gcf,'position',[ 276 31 328 246]) | |
87 xlabel('time'), ylabel('maskerLevels') | |
88 | |
89 path(savePath); |