Mercurial > hg > map
comparison testPrograms/testSynapse.m @ 38:c2204b18f4a2 tip
End nov big change
author | Ray Meddis <rmeddis@essex.ac.uk> |
---|---|
date | Mon, 28 Nov 2011 13:34:28 +0000 |
parents | 3ea506487b3b |
children |
comparison
equal
deleted
inserted
replaced
37:771a643d5c29 | 38:c2204b18f4a2 |
---|---|
1 function testSynapse(BFlist,paramsName, paramChanges) | 1 function testSynapse(BF,paramsName, AN_spikesOrProbability, paramChanges) |
2 % testSynapse tracks the quantity of available transmitter vesicles | 2 % testSynapse tracks the quantity of available transmitter vesicles |
3 % the computations are single channel using the first frequency | 3 % the computations are single channel using the first frequency |
4 % in the targetFrequency box of the expGUI. | 4 % in the targetFrequency box of the expGUI. |
5 % For, speed this function uses only probability and HSR fibers. | 5 % This function uses only probability and HSR fibers. |
6 % This cannot be changed because of the way AN_IHCsynapse is coded.This). | 6 % testSynapse(1000,'Normal',[]) |
7 | 7 |
8 global experiment method IHCpreSynapseParams | 8 global experiment IHCpreSynapseParams |
9 global AN_IHCsynapseParams stimulusParameters | 9 global AN_IHCsynapseParams stimulusParameters |
10 global savePavailable saveNavailable | |
11 | |
10 savePath=path; | 12 savePath=path; |
11 addpath (['..' filesep 'utilities'],['..' filesep 'MAP']) | 13 addpath (['..' filesep 'utilities'],['..' filesep 'MAP']) |
12 | 14 |
13 if nargin<3 | 15 if nargin<3 |
14 paramChanges=[]; | 16 paramChanges=[]; |
15 end | 17 end |
16 | 18 |
19 if length(BF)>1 | |
20 error('Only one value allowed for BF') | |
21 end | |
22 % AN_spikesOrProbability='probability'; | |
23 % AN_spikesOrProbability='spikes'; | |
24 % showPlotsAndDetails=0; | |
25 | |
17 figure(6),clf | 26 figure(6),clf |
18 plotColors='rbgkrbgkrbgkrbgkrbgkrbgk'; | 27 plotColors='rbgkrbgkrbgkrbgkrbgkrbgk'; |
19 set(gcf,'position',[5 32 264 243]) | 28 set(gcf,'position',[5 32 264 243]) |
20 | 29 |
21 sampleRate=5e4; dt=1/sampleRate; | 30 sampleRate=5e4; dt=1/sampleRate; |
22 | 31 |
23 maskerLevels=-0:10:100; | 32 switch AN_spikesOrProbability |
33 case 'probability' | |
34 maskerLevels=-0:20:100; | |
35 case 'spikes' | |
36 maskerLevels=80; | |
37 end | |
24 | 38 |
25 targetFrequency=BFlist; | 39 targetFrequency=BF; |
26 | 40 |
27 silenceDuration=0.015; | 41 silenceDuration=0.015; |
28 maskerDuration=0.1; | 42 maskerDuration=0.1; |
29 recoveryDuration=0.15; | 43 recoveryDuration=0.15; |
30 rampDuration=0.004; | 44 rampDuration=0.004; |
49 levelCount=levelCount+1; | 63 levelCount=levelCount+1; |
50 | 64 |
51 amp=28e-6*10^(leveldB/20); | 65 amp=28e-6*10^(leveldB/20); |
52 inputSignal=amp*signal; | 66 inputSignal=amp*signal; |
53 | 67 |
54 AN_spikesOrProbability='probability'; | 68 MAP1_14(inputSignal, 1/dt, targetFrequency, ... |
55 showPlotsAndDetails=0; | 69 paramsName, AN_spikesOrProbability, paramChanges); |
56 | |
57 global savePavailable | |
58 | |
59 MAP1_14(inputSignal, 1/dt, targetFrequency, ... | |
60 paramsName, AN_spikesOrProbability, paramChanges); | |
61 | 70 |
62 % ignore LSR channels (if any) at the top of the matrix | 71 % ignore LSR channels (if any) at the top of the matrix |
63 qt=savePavailable(end, :); | 72 switch AN_spikesOrProbability |
64 | 73 case 'probability' |
74 qt=savePavailable(end, :); | |
75 case 'spikes' | |
76 qt=saveNavailable; | |
77 end | |
65 synapsedt=dt; | 78 synapsedt=dt; |
66 time=synapsedt:synapsedt:synapsedt*length(qt); | 79 time=synapsedt:synapsedt:synapsedt*length(qt); |
67 | 80 |
68 figure(6) | 81 figure(6) |
69 qtMatrix=[qtMatrix; qt]; | 82 qtMatrix=[qtMatrix; qt]; |
70 plot(time,qt, plotColors(levelCount)) | 83 plot(time,qt, plotColors(levelCount)) |
71 hold on | 84 hold on |
72 xlim([0 max(time)]) | 85 xlim([0 max(time)]) |
73 ylim([0 AN_IHCsynapseParams.M]) | 86 ylim([0 AN_IHCsynapseParams.M]) |
87 xlabel ('time') | |
74 end | 88 end |
75 | 89 |
76 set(gcf,'name','pre-synaptic available transmitter') | 90 set(gcf,'name','pre-synaptic available transmitter') |
77 title(['q - available vesicles:' num2str(BFlist) ' Hz']) | 91 title(['pre-synaptic transmitter:' num2str(BF) ' Hz']) |
92 ylabel(['q - available vesicles']) | |
78 legend(strvcat(num2str(maskerLevels')),'location','southeast') | 93 legend(strvcat(num2str(maskerLevels')),'location','southeast') |
79 legend boxoff | 94 legend boxoff |
80 grid on | 95 grid on |
81 | 96 |
82 figure(88), [c,H]=contour(time, maskerLevels,qtMatrix,1:12); clabel(c, H); | 97 switch AN_spikesOrProbability |
83 set(gcf,'position',[ 276 31 328 246]) | 98 case 'probability' |
84 xlabel('time'), ylabel('maskerLevels') | 99 figure(88), [c,H]=contour(time, maskerLevels,qtMatrix,1:12); clabel(c, H); |
85 title('contour plot of available transmitter') | 100 set(gcf,'position',[ 276 31 328 246]) |
86 grid on | 101 xlabel('time'), ylabel('maskerLevels') |
102 title('contour plot of available transmitter') | |
103 grid on | |
104 end | |
87 path(savePath); | 105 path(savePath); |