Revision 24:a5e4a43c1673 testPrograms/demoTwisterProbability.m

View differences:

testPrograms/demoTwisterProbability.m
3 3
% MAPdemo runs the MATLAB auditory periphery model (MAP1_14) as far as
4 4
%  the AN (probabilities) or IC (spikes) with graphical output
5 5

  
6
% Things you might want to change; #1 - #5
6
restorePath=path;
7
addpath (['..' filesep 'MAP'],    ['..' filesep 'wavFileStore'], ...
8
    ['..' filesep 'utilities'])
7 9

  
8 10
%%  #1 parameter file name
9 11
MAPparamsName='Normal';
10 12

  
11 13

  
12
%% #2 probability (fast) or spikes (slow) representation
14
%% #2 probability (fast) 
13 15
AN_spikesOrProbability='probability';
14 16

  
15 17

  
16
%% #3 pure tone, harmonic sequence or speech file input
18
%% #3  speech file input
17 19
signalType= 'file';
18 20
fileName='twister_44kHz';
19 21

  
20 22

  
21 23
%% #4 rms level
22
leveldBSPL=60;                  % dB SPL
24
leveldBSPL=60;        % dB SPL
23 25

  
24 26

  
25 27
%% #5 number of channels in the model
26 28
%   21-channel model (log spacing)
27 29
numChannels=21;
28
lowestBF=250; 	highestBF= 8000; 
30
lowestBF=250; 	highestBF= 8000;
29 31
BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels));
30 32

  
31
%% #6 change model parameters
33
%% #6 no change to model parameters
32 34
paramChanges=[];
33 35

  
34 36

  
35 37
%% delare showMap options
36
showMapOptions=[];  % use defaults
37

  
38
% or (example: show everything including an smoothed SACF output
39
    showMapOptions.printModelParameters=1;
40
    showMapOptions.showModelOutput=1;
41
    showMapOptions.printFiringRates=1;
42
    showMapOptions.showACF=0;
43
    showMapOptions.showEfferent=0;
38
showMapOptions.printModelParameters=1;
39
showMapOptions.showModelOutput=1;
40
showMapOptions.printFiringRates=1;
41
showMapOptions.showACF=0;
42
showMapOptions.showEfferent=0;
43
showMapOptions.surfProbability=1;       % 2D plot of HSR response 
44 44

  
45 45
%% Generate stimuli
46 46

  
......
51 51
    case 'tones'
52 52
        inputSignal=createMultiTone(sampleRate, toneFrequency, ...
53 53
            leveldBSPL, duration, rampDuration);
54
        
54

  
55 55
    case 'file'
56
        [inputSignal sampleRate]=wavread(fileName);       
56
        [inputSignal sampleRate]=wavread(fileName);
57 57
        inputSignal(:,1);
58 58
        targetRMS=20e-6*10^(leveldBSPL/20);
59 59
        rms=(mean(inputSignal.^2))^0.5;
......
67 67

  
68 68
MAP1_14(inputSignal, sampleRate, BFlist, ...
69 69
    MAPparamsName, AN_spikesOrProbability, paramChanges);
70

  
70 71
toc
71 72

  
72 73
% the model run is now complete. Now display the results

Also available in: Unified diff