%
% Demo5
%
% Level-dependent excitation patterns for narrowband noise
%

close all;
clear model;

model.fs=44100;
% Signal 
model.cochlea.fb.file='gt3.mat'; % a gammatone filter
sig=AudMod(noise(10000),model);
sig=sig(:,2); % This is a narrowband noise signal centered to 3 kHz.

model.cochlea.fb.file='gt64';% 64-channel gammatone filterbank
model.cochlea.asymmcomp=1; % Activate asymmetric compensation filterbank
model.haircell.rcf.r='half';% Half-wingave rectification
model.haircell.rcf.c=0.7;   % Compression by c^0.7
model.haircell.rcf.f='1kHz';% Low-pass filter
model.neural.function='mean';% Mean within channel
model.pp.mapping='decibel'; % Mapping to decibel scale

A=[];
for L=20:10:80,
  sig=Pascalize(sig,L);
  A=[A ;AudMod(sig,model)];
end

load gt64;
plot(CentFreqs/1000,A'), axis([0 10 0 45]); xlabel('Frequency [kHz]');
ylabel('Excitation [dB]');
title('Shape of an excitation pattern for narrowband noise at different SPLs')

