Mercurial > hg > map
comparison testPrograms/testPhaseLocking.m @ 29:b51bf546ca3f
physiologyProb
author | Ray Meddis <rmeddis@essex.ac.uk> |
---|---|
date | Fri, 08 Jul 2011 13:48:27 +0100 |
parents | |
children | c2204b18f4a2 |
comparison
equal
deleted
inserted
replaced
28:02aa9826efe0 | 29:b51bf546ca3f |
---|---|
1 function testPhaseLocking(paramsName, paramChanges) | |
2 | |
3 if nargin<2 | |
4 paramChanges=[]; | |
5 end | |
6 | |
7 testFrequencies=[250 500 1000 2000 4000 8000]; | |
8 levels=50:10:80; | |
9 figure(14), clf | |
10 set(gcf,'position', [980 36 383 321]) | |
11 set(gcf,'name', 'phase locking') | |
12 allStrengths=zeros(length(testFrequencies), length(levels)); | |
13 peakVectorStrength=zeros(1,length(testFrequencies)); | |
14 freqCount=0; | |
15 for targetFrequency=testFrequencies; | |
16 %single test | |
17 freqCount=freqCount+1; | |
18 vectorStrength=... | |
19 testAN(targetFrequency,targetFrequency, levels,... | |
20 paramsName, paramChanges); | |
21 allStrengths(freqCount,:)=vectorStrength'; | |
22 peakVectorStrength(freqCount)=max(vectorStrength'); | |
23 end | |
24 %% plot results | |
25 figure(14) | |
26 subplot(2,1,2) | |
27 plot(levels,allStrengths) | |
28 xlabel('levels') | |
29 ylabel('vector strength') | |
30 legend (num2str(testFrequencies'),'location','eastOutside') | |
31 | |
32 subplot(2,1,1) | |
33 semilogx(testFrequencies,peakVectorStrength) | |
34 grid on | |
35 title ('peak vector strength') | |
36 xlabel('frequency') | |
37 ylabel('vector strength') | |
38 | |
39 johnson=[250 0.79 | |
40 500 0.82 | |
41 1000 0.8 | |
42 2000 0.7 | |
43 4000 0.25 | |
44 5500 0.05 | |
45 ]; | |
46 hold on | |
47 plot(johnson(:,1),johnson(:,2),'o') | |
48 legend({'model','Johnson 80'},'location','eastOutside') | |
49 hold off | |
50 | |
51 |