% Pick a length of signal x = zeros(512,1); % Set the number of pixels to average W = 50; %Put a pulse in the middle of the signal x(length(x)/4:3*(length(x)/4)) = ones(length(length(x)/4:(3*(length(x)/4))),1); % Smooth the pulse s = zeros(1,length(x)/2); s = exp(-(([1:length(s)])/(0.2*W)).^2); S = circul(s,1); f = S * x; x = x ./max(abs(x)); f = f ./max(abs(f)); % generate the filter h h = zeros(1,length(x)/2); h = exp(-(([1:length(h)])/W).^2); % generate the white noise w w = 10*rand(512, 1);