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 @ 29:b51bf546ca3f

History | View | Annotate | Download (2.78 KB)

1
function testOME(paramsName)
2

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

    
6
sampleRate=50000;
7

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

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

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

    
27
%% Generate test stimulus .................................................................
28

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

    
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
        paramsName, AN_spikesOrProbability, paramChanges);
46

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

    
50
    peakTMpressure=[peakTMpressure max(OMEextEarPressure)];
51
    disp([' AR attenuation (dB):   ' num2str(20*log10(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
set(gca,'xScale','log')
63
% ylim([1e-11 1e-8])
64
xlim([100 10000]), ylim([0 30])
65
grid on
66
title(['stapes at ' num2str(leveldBSPL) ' (NB deaf)'])
67
ylabel('disp: dB re 1e-10m')
68
xlabel('stimulus frequency (Hz)')
69
legend({'Huber et al','model'},'location','southWest')
70
set(gcf,'name','OME')
71

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

    
86
path(savePath);