pro conv_ft ;Example of comparison between convolution and FFT A=findgen(5,5); create array A ;A=replicate(1.0,5,5) h=replicate(1.0/9,3,3) ;create mask Ap=zeropad(A,9,9,/center);zero pad to size NA+2*Nh-2,MA+2*Mh-2 ;first we'll convolve them g_conv=Convol(Ap,h) g_conv=g_conv(1:7,1:7) print,g_conv ;then using FFT Ap=zeropad(A,7,7,/center) Af=FFT(Ap) ;forward FFT hp=zeropad(h,7,7,/center) hf=FFT(hp) Gf=Af*hf g_inv=FFT(Gf,/inverse); calculate the inverse FFT g_real=shift(float(g_inv),4,4)*49 print print,g_real end