• 大小: 8KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-21
  • 语言: Matlab
  • 标签:

资源简介

二元傅立叶全息图在matlab上的实现。体现了其五个实现步骤。结果为生成啁啾光纤光栅的程序

资源截图

代码片段和文件信息

clear;
N=1800;
y=linspace(-10.810.8N);
fy=0.5*(1+cos(11.8372*y));
A=fy
B=ones(381);
C=B*A;
figure;
imshow(C);
a=fft2(C38180);
b=fftshift(a);
figure;
imshow(b);
A1=abs(b);
B1=angle(b);
Amax=max(max(A1));
A2=A1/Amax;
B2=B1/(2*pi);
m=10/38;
n=21.6/180;
W=m/2;
figure;
axis([0 10 0 21.6]);
hold on;
for J=1:38
    x0=m/2+(J-1)*m;
    for I=1:180
        y0=n/2+(I-1)*n;
        H=A2(JI)*n;
        F=B2(JI)*m;
        if abs(F)<=m/4
            x2=x0-W/2;x3=x0+W/2;
            y2=y0-H/2;y3=y0+H/2;
            fill([x2x2x3x3][y2y3y3y2]‘k‘);
        elseif F>m/4
            x22=x0+F-W/2;x33=x0+m/2;
            y22=y0-H/2;y33=y0+H/2;
            fill([x22x22x33x33][y22y33y33y22]‘k‘);
            x222=x0-m/2;x333=x0+F+W/2-m;
            fill([x222x222x333x333][y22y33y33y22]‘k‘);
        else x22=x0-m/2;x33=x0+F+W/2;
            y2=y0-H/2;y3=y0+H/2;
            fill([x22x22x33x33][y2y3y3y2]‘k‘);
            x222=x0+F-W/2+m;x333=x0+m/2;
            fill([x222x222x333x333][y2y3y3y2]‘k‘);
        end
    end
end
axis(‘equal‘);
axis off;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      17146  2008-05-15 20:08  F=0\hs_err_pid2876.log

     文件       1118  2008-05-15 21:43  F=0\M.asv

     文件       1132  2008-05-15 21:43  F=0\M.m

     文件        316  2008-05-15 19:54  F=0\m1.asv

     文件        311  2008-05-15 21:17  F=0\m1.m

     文件        308  2008-05-14 20:50  F=0\m2.m

     文件        994  2008-05-15 21:48  F=0\m3.asv

     文件        984  2008-05-14 21:24  F=0\m3.m

     文件         48  2008-05-15 21:48  F=0\NN.asv

     文件        151  2008-05-15 21:11  F=0\NN.m

     目录          0  2008-05-15 21:48  F=0

----------- ---------  ---------- -----  ----

                22726                    12


评论

共有 条评论

相关资源