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.

Statistics Download as Zip
| Branch: | Revision:

root / multithreshold 1.46 / plotProfile.m @ 33:161913b595ae

History | View | Annotate | Download (2.29 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
subplot(2,1,2)
24 33:161913b595ae rmeddis
semilogx(foreground.BFs,foreground.LongTone,'ko-','lineWidth',2); hold on
25
semilogx(foreground.BFs,foreground.ShortTone,'bo-','lineWidth',2); hold on
26
if ~isempty(bgName)
27
    semilogx(background.BFs,background.LongTone,'ko:'); hold on
28
    semilogx(background.BFs,background.ShortTone,'bo:'); hold on
29
end
30 28:02aa9826efe0 rmeddis
ylim([0 100])
31
32
% TMC
33 33:161913b595ae rmeddis
for BFno=1:length(foreground.TMCFreq)
34 28:02aa9826efe0 rmeddis
    subplot(2,6,BFno)
35 33:161913b595ae rmeddis
    plot(foreground.Gaps,foreground.TMC(BFno,:)-foreground.LongTone(BFno),'r','lineWidth',3), hold on
36
    plot(foreground.Gaps,foreground.TMC(BFno,:),'b','lineWidth',3), hold on
37 29:b51bf546ca3f rmeddis
    ylim([-10 110])
38 28:02aa9826efe0 rmeddis
    xlim([0.01 0.1])
39 29:b51bf546ca3f rmeddis
    grid on
40 28:02aa9826efe0 rmeddis
    if BFno==1
41
        ylabel('masker dB SL')
42
        xlabel('gap')
43
    end
44 33:161913b595ae rmeddis
    title([num2str(foreground.TMCFreq(BFno)) ' Hz'])
45 29:b51bf546ca3f rmeddis
    set(gca,'XTick',[ 0.1],'xTickLabel', { '0.1'})
46 28:02aa9826efe0 rmeddis
end
47
48 33:161913b595ae rmeddis
if ~isempty(bgName)
49
    for BFno=1:length(background.TMCFreq)
50
        BF = background.TMCFreq(BFno);
51
        idx = find(BF == foreground.TMCFreq);
52
        if ~isempty(idx);
53
54
            subplot(2,6,idx)
55
            plot(background.Gaps,background.TMC(BFno,:)-background.LongTone(BFno),'k:')
56
            plot(background.Gaps,background.TMC(BFno,:),'k:')
57
            ylim([-10 110])
58
            xlim([0.01 0.1])
59
        end
60
    end
61
end
62
63 28:02aa9826efe0 rmeddis
% IFMCs
64 33:161913b595ae rmeddis
for BFno=1:length(foreground.IFMCFreq)
65
    freq=foreground.MaskerRatio'*foreground.IFMCFreq(BFno);
66 28:02aa9826efe0 rmeddis
    subplot(2,1,2)
67 33:161913b595ae rmeddis
    semilogx(freq,foreground.IFMCs(BFno,:),'r','lineWidth',3), hold on
68 28:02aa9826efe0 rmeddis
    ylim([0 100])
69
    xlim([100 12000])
70
    grid on
71
end
72
xlabel('frequency (Hz)')
73
ylabel('masker dB / probe dB')
74 33:161913b595ae rmeddis
set(gca,'XTick',foreground.IFMCFreq)
75 29:b51bf546ca3f rmeddis
76 33:161913b595ae rmeddis
if ~isempty(bgName)
77
    for BFno=1:length(background.IFMCFreq)
78
        freq=background.MaskerRatio'*background.IFMCFreq(BFno);
79
        subplot(2,1,2)
80
        semilogx(freq,background.IFMCs(BFno,:),'k:')
81
        ylim([0 100])
82
        xlim([100 12000])
83 29:b51bf546ca3f rmeddis
    end
84
end
85 32:82fb37eb430e rmeddis
mydate=datestr(now); idx=findstr(':',mydate); mydate(idx)='_';
86
87
fileName= ['savedData/' mydate ];
88
89
save (fileName)
90
set(gcf,'name', mydate)
91
disp(fileName)