% Figure 11(a) of "Cancellation model of pitch perception" (JASA 97) global sr; % sampling rate sr = 10400; level = 90; % dB nchan = 2; % number of BM channels flo = 1040; % Hz - lowest BM channel frequency (fhi = sr/2) lag = 1/flo; N = 100; % number of "presentations" start = 0.018; % s stop = 0.055; % s chunk = round([start *sr : stop * sr]) ; % s, portion to plot y = synth_damp; % scale level = level - 30; % 30 dB corresponds to RMS=1 in M&H's model. y = rms(y, fromdB(level)); % synthesize & apply gammatone filter [A, B] = MakeERBFilters(sr, nchan, flo); yy = ERBFilterBank(A, B, y); yy = flipud(yy); y = yy(1,:); % take lowest channel y = hwrect(y); % half-wave rectify y = cfilt(y, lag*sr); y = hwrect(y); % half-wave rectify plot1(y(chunk)); set(get(gca, 'title'), 'String',... '"Cancellation model of pitch perception" - Fig. 11a');