% fig5a % Figure 5(a) of "Cancellation model of pitch perception" (JASA 97) global sr; % sampling rate sr = 10000; level = 90; % dB nchan = 2; % number of BM channels flo = 500; % Hz - lowest BM channel frequency (fhi = sr/2) N = 100; % number of "presentations" range = 0.0075; % s - range for ACH y = synth_complex1; % scale level = level - 30; % 30 dB corresponds to RMS=1 in M&H's model. y = rms(y, fromdB(level)); yy = bm_haircell(y, nchan, flo); x = yy(1,:); % take lowest channel x = x .* 3; % Meddis's model's output is a bit low N=100; % number of "stimulus presentations" y =[]; for i = 1:N y = [y, spike_train(x, sr)]; end % remove spikes close to onset onset= 0.02; y = y.*(y>=onset); y = nonzeros(y)'; % autocorrelation histogram z = ach1(y, range*sr, sr); plot0(z); m = max(z(2:size(z,2))); ylim = get(gca, 'ylim'); ylim(2) = m * 1.2; set(gca, 'ylim', ylim); set(get(gca, 'title'), 'String',... '"Cancellation model of pitch perception" - Fig. 5a');