n = 1000;
delta = 1;
x = linspace(0, 1, n);
F = exp(-100*(x-1/5).^2) + exp(-500*(x-2/5).^2) + exp(-2500*(x-3/5).^2) + ...
    exp(-125000*(x-4/5).^2);

f = F + delta*randn(size(x));
subplot(1,2,1)
plot(x, f)
subplot(1,2,2)
f2 = SG_filter(f,100,100,3);
plot(x, f2(1:n))