% Figure 9a of "Cancellation model of pitch perception" (JASA 97) global sr; sr = 8000; D = 0.1; start = 0.018; % s stop = 0.055; % s chunk = [start *sr : stop * sr] ; % s, portion to plot lag = 0.00125; % s, period of 800 Hz carrier y = synth_damp; y = hwrect(y); % half-wave rectify y = cfilt(y, lag*sr); y = hwrect(y); % half-wave rectify x = abscissa(D) * 1000; plot(x(:,chunk) - start*1000, y(:,chunk)); set(get(gca, 'XLabel'), 'String', 'time (ms)'); set(get(gca, 'title'), 'String', '"Cancellation model of pitch perception" - Fig. 9a');