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 / testOME.m @ 0:f233164f4c86

History | View | Annotate | Download (2.79 KB)

1
function testOME
2

    
3
global experiment
4
savePath=path;
5
addpath (['..' filesep 'utilities'],['..' filesep 'MAP'])
6

    
7
sampleRate=50000;
8

    
9
dt=1/sampleRate;
10
leveldBSPL=80; 		% dB SPL as used by Huber (may trigger AR)
11
amp=10^(leveldBSPL/20)*28e-6;
12
duration=.05;
13
time=dt: dt: duration;
14

    
15
%% Comparison data (human)
16
% These data are taken directly from Huber 2001 (Fig. 4)
17
HuberFrequencies=[600	  800	 1000	 2000	 3000	4000 6000 8000];
18
HuberDisplacementAt80dBSPL=[1.5E-9	1.5E-09	1.5E-09	1.0E-09	7.0E-10	...
19
    3.0E-10	2.0E-10	1.0E-10]; % m;
20
% HuberVelocityAt80dBSPL= 2*pi*HuberFrequencies.*HuberDisplacementAt80dBSPL;
21

    
22
figure(2), clf, subplot(2,1,1)
23
set(2,'position',[5   349   268   327])
24
semilogx(HuberFrequencies, 20*log10(HuberDisplacementAt80dBSPL/1e-10),...
25
    'ko', 'MarkerFaceColor','k', 'Marker','o', 'markerSize',6)
26
% Generate test stimulus .................................................................
27

    
28
%% independent test using discrete frequencies
29
peakResponses=[];
30
peakTMpressure=[];
31
frequencies=[200 400 HuberFrequencies 10000];
32
for toneFrequency=frequencies
33
    inputSignal=amp*sin(2*pi*toneFrequency*time);
34

    
35
    MAPparamsName=experiment.name;
36
    showPlotsAndDetails=0;
37
    AN_spikesOrProbability='probability';
38
    % switch off AR & MOC (Huber's patients were deaf)
39
    paramChanges{1}='OMEParams.rateToAttenuationFactorProb=0;';
40
    paramChanges{2}='DRNLParams.rateToAttenuationFactorProb = 0;';
41

    
42
    global OMEoutput  OMEextEarPressure TMoutput ARAttenuation
43
    % BF is irrelevant
44
    MAP1_14(inputSignal, sampleRate, -1, ...
45
        MAPparamsName, AN_spikesOrProbability, paramChanges);
46

    
47
    peakDisplacement=max(OMEoutput(floor(end/2):end));
48
    peakResponses=[peakResponses peakDisplacement];
49

    
50
    peakTMpressure=[peakTMpressure max(OMEextEarPressure)];
51
    disp([' greatest AR attenuation:   ' num2str(min(ARAttenuation))])
52
end
53

    
54
%% Report
55
disp('frequency displacement(m)')
56
% disp(num2str([frequencies' peakResponses']))
57
fprintf('%6.0f \t%10.3e\n',[frequencies' peakResponses']')
58

    
59
% stapes peak displacement
60
figure(2), subplot(2,1,1), hold on
61
semilogx(frequencies, 20*log10(peakResponses/1e-10), 'r', 'linewidth',4)
62
% ylim([1e-11 1e-8])
63
xlim([100 10000]), ylim([0 30])
64
grid on
65
title(['stapes at ' num2str(leveldBSPL) ' (NB deaf)'])
66
ylabel('disp: dB re 1e-10m')
67
xlabel('stimulus frequency (Hz)')
68
legend({'Huber et al','model'},'location','southWest')
69
set(gcf,'name','OME')
70

    
71
% external ear resonance
72
figure(2), subplot(2,1,2),hold off
73
semilogx(frequencies, 20*log10(peakTMpressure/28e-6)-leveldBSPL,...
74
    'k', 'linewidth',2)
75
xlim([100 10000]) %, ylim([-10 30])
76
grid on
77
title(['External ear resonances' ])
78
ylabel('dB')
79
xlabel('frequency')
80
set(gcf,'name','OME: external resonances')
81
% ---------------------------------------------------------- display parameters
82
disp(['parameter file was: ' experiment.name])
83
fprintf('\n')
84

    
85
path(savePath);