本文基于光学理论,用Matlab实现了二维卷积定理验证的仿真。
Project Code %作者: ZQJ%日期: 2021.2.10星期三%***************卷积定理验证* * * * * * * * * * * * * * * * * * * * * * *。 mask_row=Zeros(200; forn=1:10 mask _ column (:20 * n-9:20 * n ) 1; mask_row(20*n-9:20*n, )=1; ENDF_mask_column=ABS(FFTshift ) FFT2 ) mask_column ); f_mask_row=ABS(FFTshift ) FFT2 ) mask_row ); 根据% figure,* * * * * * * * * * * * * * * * * * * * * * * * * * * * subplot (2,1 ) ) ) ) ) ) colormap gray; axis square; 垂直光栅; subplot(2、2、2 ); imagesc(mask_row; colormap gray; axis square; title (水平光栅); subplot(2、2、3 ); imagesc(f_mask_column ); colormap gray; axis square; title (垂直光栅FFT ); subplot(2、2、4 ); imagesc(f_mask_row; colormap gray; axis square; title (水平光栅FFT ); %卷积定理验证* * * * * * f _ mask _ column _ row=ABS (FFT shift f _ convolution=con v2 (f _ mask _ column,f _ mask _ colu n ) % figure为* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * figure; subplot(1、2、1 ); imagesc(f_mask_column_row; colormap gray; axis square; title ()时域相乘的FFT ); subplot(1、2、2 ); imagesc(f_convolution; colormap gray; axis square; title(FFT频域卷积); 模拟结果图:
专栏内容供作者本人或大家学习使用。 请多关照~