% fig7b % Figure 7(b) of "Cancellation model of pitch perception" (JASA 97) global sr; % sampling rate sr = 40000; 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 window_size = 0.0001; % s - coincidence window size 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 % fold repetitions into single spike train y = sort(y); % remove spikes close to onset onset= 0.02; y = y.*(y>=onset); y = nonzeros(y)'; % autocorrelation histogram z = ad_pattern(y, window_size*sr, range*sr); plot0(z); set(get(gca, 'title'), 'String',... '"Cancellation model of pitch perception" - Fig. 7b');