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 / testPrograms / demoTwisterProbability.m @ 38:c2204b18f4a2

History | View | Annotate | Download (1.75 KB)

1 9:ecad0ea62b43 rmeddis
function demoTwisterProbability
2
3
% MAPdemo runs the MATLAB auditory periphery model (MAP1_14) as far as
4
%  the AN (probabilities) or IC (spikes) with graphical output
5
6 25:d2c4c07df02c rmeddis
dbstop if error
7 24:a5e4a43c1673 rmeddis
restorePath=path;
8
addpath (['..' filesep 'MAP'],    ['..' filesep 'wavFileStore'], ...
9
    ['..' filesep 'utilities'])
10 9:ecad0ea62b43 rmeddis
11
%%  #1 parameter file name
12
MAPparamsName='Normal';
13
14
15 24:a5e4a43c1673 rmeddis
%% #2 probability (fast)
16 9:ecad0ea62b43 rmeddis
AN_spikesOrProbability='probability';
17
18
19 24:a5e4a43c1673 rmeddis
%% #3  speech file input
20 9:ecad0ea62b43 rmeddis
fileName='twister_44kHz';
21
22
23
%% #4 rms level
24 24:a5e4a43c1673 rmeddis
leveldBSPL=60;        % dB SPL
25 9:ecad0ea62b43 rmeddis
26
27
%% #5 number of channels in the model
28
%   21-channel model (log spacing)
29
numChannels=21;
30 24:a5e4a43c1673 rmeddis
lowestBF=250; 	highestBF= 8000;
31 9:ecad0ea62b43 rmeddis
BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels));
32
33 35:25d53244d5c8 rmeddis
34 24:a5e4a43c1673 rmeddis
%% #6 no change to model parameters
35 9:ecad0ea62b43 rmeddis
paramChanges=[];
36
37
%% Generate stimuli
38 24:a5e4a43c1673 rmeddis
        [inputSignal sampleRate]=wavread(fileName);
39 9:ecad0ea62b43 rmeddis
        inputSignal(:,1);
40
        targetRMS=20e-6*10^(leveldBSPL/20);
41
        rms=(mean(inputSignal.^2))^0.5;
42
        amp=targetRMS/rms;
43
        inputSignal=inputSignal*amp;
44
45
46
%% run the model
47
tic
48
49 26:b03ef38fe497 rmeddis
fprintf('\n')
50
disp(['Signal duration= ' num2str(length(inputSignal)/sampleRate)])
51
disp([num2str(numChannels) ' channel model'])
52
disp('Computing ...')
53
54 9:ecad0ea62b43 rmeddis
MAP1_14(inputSignal, sampleRate, BFlist, ...
55
    MAPparamsName, AN_spikesOrProbability, paramChanges);
56 24:a5e4a43c1673 rmeddis
57 9:ecad0ea62b43 rmeddis
58 32:82fb37eb430e rmeddis
%% the model run is finished. Now display the results
59
60
%% delare showMap options
61
showMapOptions.printModelParameters=1;
62
showMapOptions.showModelOutput=1;
63
showMapOptions.printFiringRates=1;
64
showMapOptions.showACF=0;
65
showMapOptions.showEfferent=0;
66 38:c2204b18f4a2 rmeddis
showMapOptions.surfAN=1;       % 3D plot of HSR response
67
showMapOptions.PSTHbinwidth=0.002;      % 3D plot of HSR response
68
showMapOptions.view=[-14 76];           % 3D plot of HSR response
69 32:82fb37eb430e rmeddis
70 38:c2204b18f4a2 rmeddis
71
UTIL_showMAP(showMapOptions)
72 9:ecad0ea62b43 rmeddis
73
toc
74
path(restorePath)