From fe56b83a7ab9ca84dc6c1c6a8babb6e78bae9b3a Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Fri, 14 Sep 2012 20:07:46 -0400 Subject: simplify logic of the program with only on if --- stripeeraser.m | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'stripeeraser.m') diff --git a/stripeeraser.m b/stripeeraser.m index 417f333..cd34d50 100644 --- a/stripeeraser.m +++ b/stripeeraser.m @@ -13,15 +13,12 @@ max1=max(abs(img_fourier(:))); for x=1:Nx for y=1:Ny d=sqrt((x-Nx/2)^2+(y-Ny/2)^2); - if d>radius - % for high enough frequency components - %The filter works like a neutral density filter. - if abs(img_fourier(y,x))>max1*(10^(-threshold_power)); - % Suppress this frequency components which are mostly stripes - % but leave untouched small sharp features of the beam - % since they are spectrally weak - img_fourier(y,x)=img_fourier(y,x)*exp(-(d/radius)^2); - end; + if d>radius && abs(img_fourier(y,x))>max1*(10^(-threshold_power)) + % For high enough frequency components + % suppress this frequency components which are mostly stripes. + % But leave untouched small sharp features of the beam + % since they are spectrally weak + img_fourier(y,x)=img_fourier(y,x)*exp(-(d/radius)^2); end; end; end; -- cgit v1.2.3