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 / multithreshold 1.46 / plotProfile.m
History | View | Annotate | Download (2.5 KB)
| 1 | 33:161913b595ae | rmeddis | function plotProfile(fgName, bgName) |
|---|---|---|---|
| 2 | |||
| 3 | addpath (['..' filesep 'profiles']) |
||
| 4 | 28:02aa9826efe0 | rmeddis | |
| 5 | %% plot profile |
||
| 6 | if nargin<1 |
||
| 7 | 38:c2204b18f4a2 | rmeddis | fgName = 'profile_JSAN_R'; |
| 8 | 33:161913b595ae | rmeddis | bgName = ''; |
| 9 | 28:02aa9826efe0 | rmeddis | end |
| 10 | |||
| 11 | 33:161913b595ae | rmeddis | cmd=['foreground = ' fgName ';']; |
| 12 | eval(cmd) |
||
| 13 | 28:02aa9826efe0 | rmeddis | |
| 14 | 33:161913b595ae | rmeddis | if nargin==2 |
| 15 | cmd=['background = ' bgName ';']; |
||
| 16 | eval(cmd) |
||
| 17 | else |
||
| 18 | bgName=''; |
||
| 19 | end |
||
| 20 | 28:02aa9826efe0 | rmeddis | |
| 21 | % absolute thresholds |
||
| 22 | figure(90), clf |
||
| 23 | 35:25d53244d5c8 | rmeddis | set(gcf, 'name', 'Profile') |
| 24 | 28:02aa9826efe0 | rmeddis | subplot(2,1,2) |
| 25 | 33:161913b595ae | rmeddis | semilogx(foreground.BFs,foreground.LongTone,'ko-','lineWidth',2); hold on |
| 26 | semilogx(foreground.BFs,foreground.ShortTone,'bo-','lineWidth',2); hold on |
||
| 27 | if ~isempty(bgName) |
||
| 28 | semilogx(background.BFs,background.LongTone,'ko:'); hold on |
||
| 29 | semilogx(background.BFs,background.ShortTone,'bo:'); hold on |
||
| 30 | end |
||
| 31 | 28:02aa9826efe0 | rmeddis | ylim([0 100]) |
| 32 | |||
| 33 | % TMC |
||
| 34 | 33:161913b595ae | rmeddis | for BFno=1:length(foreground.TMCFreq) |
| 35 | 28:02aa9826efe0 | rmeddis | subplot(2,6,BFno) |
| 36 | 34:e097e9044ef6 | rmeddis | % SL |
| 37 | % plot(foreground.Gaps,foreground.TMC(BFno,:)-foreground.LongTone(BFno),'r','lineWidth',3), hold on |
||
| 38 | 33:161913b595ae | rmeddis | plot(foreground.Gaps,foreground.TMC(BFno,:),'b','lineWidth',3), hold on |
| 39 | 29:b51bf546ca3f | rmeddis | ylim([-10 110]) |
| 40 | 28:02aa9826efe0 | rmeddis | xlim([0.01 0.1]) |
| 41 | 36:3ea506487b3b | rmeddis | % grid on |
| 42 | 28:02aa9826efe0 | rmeddis | if BFno==1 |
| 43 | ylabel('masker dB SL')
|
||
| 44 | 36:3ea506487b3b | rmeddis | xlabel(' gap (s)')
|
| 45 | 28:02aa9826efe0 | rmeddis | end |
| 46 | 33:161913b595ae | rmeddis | title([num2str(foreground.TMCFreq(BFno)) ' Hz']) |
| 47 | 36:3ea506487b3b | rmeddis | set(gca,'XTick',[ 0.02:0.02:0.1],'xTickLabel', { '', '0.04', '', '', '0.1'})
|
| 48 | 28:02aa9826efe0 | rmeddis | end |
| 49 | |||
| 50 | 33:161913b595ae | rmeddis | if ~isempty(bgName) |
| 51 | for BFno=1:length(background.TMCFreq) |
||
| 52 | BF = background.TMCFreq(BFno); |
||
| 53 | idx = find(BF == foreground.TMCFreq); |
||
| 54 | if ~isempty(idx); |
||
| 55 | |||
| 56 | subplot(2,6,idx) |
||
| 57 | 34:e097e9044ef6 | rmeddis | % SL |
| 58 | % plot(background.Gaps,background.TMC(BFno,:)-background.LongTone(BFno),'k:') |
||
| 59 | 33:161913b595ae | rmeddis | plot(background.Gaps,background.TMC(BFno,:),'k:') |
| 60 | ylim([-10 110]) |
||
| 61 | xlim([0.01 0.1]) |
||
| 62 | end |
||
| 63 | end |
||
| 64 | end |
||
| 65 | |||
| 66 | 28:02aa9826efe0 | rmeddis | % IFMCs |
| 67 | 33:161913b595ae | rmeddis | for BFno=1:length(foreground.IFMCFreq) |
| 68 | freq=foreground.MaskerRatio'*foreground.IFMCFreq(BFno); |
||
| 69 | 28:02aa9826efe0 | rmeddis | subplot(2,1,2) |
| 70 | 33:161913b595ae | rmeddis | semilogx(freq,foreground.IFMCs(BFno,:),'r','lineWidth',3), hold on |
| 71 | 38:c2204b18f4a2 | rmeddis | ylim([-20 100]) |
| 72 | 28:02aa9826efe0 | rmeddis | xlim([100 12000]) |
| 73 | 36:3ea506487b3b | rmeddis | % grid on |
| 74 | 28:02aa9826efe0 | rmeddis | end |
| 75 | xlabel('frequency (Hz)')
|
||
| 76 | ylabel('masker dB / probe dB')
|
||
| 77 | 33:161913b595ae | rmeddis | set(gca,'XTick',foreground.IFMCFreq) |
| 78 | 38:c2204b18f4a2 | rmeddis | set(gca,'Ytick', [-20 0 50 100]) |
| 79 | 29:b51bf546ca3f | rmeddis | |
| 80 | 33:161913b595ae | rmeddis | if ~isempty(bgName) |
| 81 | for BFno=1:length(background.IFMCFreq) |
||
| 82 | freq=background.MaskerRatio'*background.IFMCFreq(BFno); |
||
| 83 | subplot(2,1,2) |
||
| 84 | semilogx(freq,background.IFMCs(BFno,:),'k:') |
||
| 85 | ylim([0 100]) |
||
| 86 | xlim([100 12000]) |
||
| 87 | 29:b51bf546ca3f | rmeddis | end |
| 88 | end |
||
| 89 | 36:3ea506487b3b | rmeddis | set(get(gca,'title'),'interpreter','None') |
| 90 | |||
| 91 | 34:e097e9044ef6 | rmeddis | title([fgName ' / ' bgName]) |
| 92 | % mydate=datestr(now); idx=findstr(':',mydate); mydate(idx)='_';
|
||
| 93 | 32:82fb37eb430e | rmeddis | |
| 94 | 34:e097e9044ef6 | rmeddis | % fileName= ['savedData/' mydate ]; |
| 95 | % |
||
| 96 | % save (fileName) |
||
| 97 | % set(gcf,'name', mydate) |
||
| 98 | % disp(fileName) |