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.
root / testPrograms / testSynapse.m @ 29:b51bf546ca3f
History | View | Annotate | Download (2.31 KB)
| 1 | 29:b51bf546ca3f | rmeddis | function testSynapse(BFlist,paramsName, paramChanges) |
|---|---|---|---|
| 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 | if nargin<3 |
||
| 14 | paramChanges=[]; |
||
| 15 | end |
||
| 16 | |||
| 17 | figure(6),clf |
||
| 18 | plotColors='rbgkrbgkrbgkrbgkrbgkrbgk'; |
||
| 19 | set(gcf,'position',[5 32 264 243]) |
||
| 20 | |||
| 21 | sampleRate=5e4; dt=1/sampleRate; |
||
| 22 | |||
| 23 | maskerLevels=-0:10:100; |
||
| 24 | |||
| 25 | targetFrequency=BFlist; |
||
| 26 | |||
| 27 | silenceDuration=0.015; |
||
| 28 | maskerDuration=0.1; |
||
| 29 | recoveryDuration=0.15; |
||
| 30 | rampDuration=0.004; |
||
| 31 | |||
| 32 | maskerTime=dt:dt:maskerDuration; |
||
| 33 | |||
| 34 | rampTime=dt:dt:rampDuration; |
||
| 35 | ramp=[0.5*(1+cos(2*pi*rampTime/(2*rampDuration)+pi)) ... |
||
| 36 | ones(1,length(maskerTime)-length(rampTime))]; |
||
| 37 | ramp=ramp.*fliplr(ramp); |
||
| 38 | |||
| 39 | initialSilence=zeros(1,round(silenceDuration/dt)); |
||
| 40 | recoverySilence=zeros(1,round(recoveryDuration/dt)); |
||
| 41 | |||
| 42 | signal=sin(2*pi*targetFrequency'*maskerTime); |
||
| 43 | signal= ramp.*signal; |
||
| 44 | signal=[initialSilence signal recoverySilence]; |
||
| 45 | |||
| 46 | levelCount=0; |
||
| 47 | qtMatrix=[]; |
||
| 48 | for leveldB=maskerLevels |
||
| 49 | levelCount=levelCount+1; |
||
| 50 | |||
| 51 | amp=28e-6*10^(leveldB/20); |
||
| 52 | inputSignal=amp*signal; |
||
| 53 | |||
| 54 | AN_spikesOrProbability='probability'; |
||
| 55 | showPlotsAndDetails=0; |
||
| 56 | |||
| 57 | global savePavailable |
||
| 58 | |||
| 59 | MAP1_14(inputSignal, 1/dt, targetFrequency, ... |
||
| 60 | paramsName, AN_spikesOrProbability, paramChanges); |
||
| 61 | |||
| 62 | % ignore LSR channels (if any) at the top of the matrix |
||
| 63 | qt=savePavailable(end, :); |
||
| 64 | |||
| 65 | synapsedt=dt; |
||
| 66 | time=synapsedt:synapsedt:synapsedt*length(qt); |
||
| 67 | |||
| 68 | figure(6) |
||
| 69 | qtMatrix=[qtMatrix; qt]; |
||
| 70 | plot(time,qt, plotColors(levelCount)) |
||
| 71 | hold on |
||
| 72 | xlim([0 max(time)]) |
||
| 73 | ylim([0 AN_IHCsynapseParams.M]) |
||
| 74 | end |
||
| 75 | |||
| 76 | set(gcf,'name','pre-synaptic available transmitter') |
||
| 77 | title(['q - available vesicles:' num2str(BFlist) ' Hz']) |
||
| 78 | legend(strvcat(num2str(maskerLevels')),'location','southeast') |
||
| 79 | legend boxoff |
||
| 80 | grid on |
||
| 81 | |||
| 82 | figure(88), [c,H]=contour(time, maskerLevels,qtMatrix); clabel(c, H); |
||
| 83 | set(gcf,'position',[ 276 31 328 246]) |
||
| 84 | xlabel('time'), ylabel('maskerLevels')
|
||
| 85 | title('contour plot of available transmitter')
|
||
| 86 | |||
| 87 | path(savePath); |