clf;
m = 50;
range = 20;

w = m-range:0.05:m+range;
total = 0 * w;

for n=m-20:m+20,
total = total+N(n,n,w);
end;

plot(w,total);

title ('Ripple with only the main peaks');
fprintf (1, 'the relative variance = %f. \n', sqrt(var(total))/ mean(total))

ss = input('');

for n=m-20:m+20,
total = total-N(n,n+1,w)-N(n,n-1,w)+N(n,n+2,w)+N(n,n-2,w)-N(n,n+3,w)-N(n,n-3,w)+N(n,n+4,w)+N(n,n-4,w);
end;

plot(w,total);

title ('Ripple with the main peaks and even-distanced noise functions');

fprintf (1, 'the relative variance = %f. \n', sqrt(var(total))/ mean(total))







