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 @ 35:25d53244d5c8
History | View | Annotate | Download (2.37 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 | 33:161913b595ae | rmeddis | fgName = myFile; |
| 8 | 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 | 29:b51bf546ca3f | rmeddis | grid on |
| 42 | 28:02aa9826efe0 | rmeddis | if BFno==1 |
| 43 | ylabel('masker dB SL')
|
||
| 44 | xlabel('gap')
|
||
| 45 | end |
||
| 46 | 33:161913b595ae | rmeddis | title([num2str(foreground.TMCFreq(BFno)) ' Hz']) |
| 47 | 29:b51bf546ca3f | rmeddis | set(gca,'XTick',[ 0.1],'xTickLabel', { '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 | 28:02aa9826efe0 | rmeddis | ylim([0 100]) |
| 72 | xlim([100 12000]) |
||
| 73 | grid on |
||
| 74 | end |
||
| 75 | xlabel('frequency (Hz)')
|
||
| 76 | ylabel('masker dB / probe dB')
|
||
| 77 | 33:161913b595ae | rmeddis | set(gca,'XTick',foreground.IFMCFreq) |
| 78 | 29:b51bf546ca3f | rmeddis | |
| 79 | 33:161913b595ae | rmeddis | if ~isempty(bgName) |
| 80 | for BFno=1:length(background.IFMCFreq) |
||
| 81 | freq=background.MaskerRatio'*background.IFMCFreq(BFno); |
||
| 82 | subplot(2,1,2) |
||
| 83 | semilogx(freq,background.IFMCs(BFno,:),'k:') |
||
| 84 | ylim([0 100]) |
||
| 85 | xlim([100 12000]) |
||
| 86 | 29:b51bf546ca3f | rmeddis | end |
| 87 | end |
||
| 88 | 34:e097e9044ef6 | rmeddis | title([fgName ' / ' bgName]) |
| 89 | % mydate=datestr(now); idx=findstr(':',mydate); mydate(idx)='_';
|
||
| 90 | 32:82fb37eb430e | rmeddis | |
| 91 | 34:e097e9044ef6 | rmeddis | % fileName= ['savedData/' mydate ]; |
| 92 | % |
||
| 93 | % save (fileName) |
||
| 94 | % set(gcf,'name', mydate) |
||
| 95 | % disp(fileName) |