close all % ORIGINAL t = 0:.1:10; x = sawtooth(t); subplot(2, 2, 1); plot(x); title('original'); % NOISY subplot(2, 2, 2); plot(noisy_y); title('noisy'); noisy_y = x + 0.1 * rand(1, length(x)); % SMOOTHED % Convolution with smoothing kernel kernel = [0.5, 1, 0.5]; smooth = conv(noisy_y, kernel); subplot(2, 2, 3); plot(smooth); title('smoothed'); % DETECTOR kernel = [-1, 0, 1]; dx = conv(smooth, kernel); subplot(2, 2, 4); plot(dx); title('detector');