资源简介
实现用matelb编程的三维形貌图程序,利用傅里叶变换自动生成频谱图
代码片段和文件信息
clear
%function f=roughs3(NrLsigmalc);
%M=N %total number of sample points %为了作fft,N取2的n次方个值
f=roughs3(6420.20.1);%64为取得全部数据点,2为rl-粗糙长度,0.2为方均根的高度-rms height0.1为相关长度lc;rl=lc*20;
Skl=zeros(64);%Skl=zeros(M)产生M*M的矩阵
for m=0:64/2-1;%for m=0:N/2-1
kx = m*2*pi/2;%kx = m*2*pi/rL;
ky=(0:64/2-1)*2*pi/2;%ky=(0:M/2-1)*2*pi/rL;
Skl(m+1(0:64/2-1)+1)=(0.2^2*0.1^2/(4*pi))*exp(-(kx^2+ky.^2)*(0.1/2)^2);%Skl(m+1(0:M/2-1)+1)=(sigma^2*lc^2/(4*pi))*exp(-(kx^2+ky.^2)*(lc/2)^2);%2D-GAUSS谱密度;
end;
Skl(64-(1:64/2-1)+164-(1:64/2-1)+1)=Skl((1:64/2-1)+1(1:64/2-1)+1);%Skl(N-(1:N/2-1)+1M-(1:M/2-1)+1)=Skl((1:N/2-1)+1(1:M/2-1)+1);
Skl((0:64/2)+164-(1:64/2-1)+1)=Skl((0:64/2)+1(1:64/2-1)+1);% Skl((0:N/2)+1M-(1:M/2-1)+1)=Skl((0:N/2)+1(1:M/2-1)+1);
Skl(64-(1:64/2-1)+1(0:64/2)+1)=Skl((1:64/2-1)+1(0:64/2)+1);%Skl(N-(1:N/2-1)+1(0:M/2)+1)=Skl((1:N/2-1
- 上一篇:LT码的编译码程序MATLAB
- 下一篇:CNN特征图可视化
评论
共有 条评论