跪求多缝夫琅禾费衍射现象仿真实现及分析的matlab仿真程序

跪求多缝夫琅禾费衍射现象仿真实现及分析的matlab仿真程序,第1张

%矩孔衍射的凯谨森解析计算

clear

R=0.1

lambda=1.064e-3

k=2*pi/晌码lambda

z=1.0e3

xmax=8*1.22*lambda/2/R*z

x=linspace(-xmax,xmax,200)

y=x

[x,y]=meshgrid(x,y)

IF=sin(k*x*R/z).ˆ2.*sin(k*y*R/z).ˆ2./(k*x/盯亩2/z).ˆ2./(k*y/2/z).ˆ2/lambdaˆ2/zˆ2

surf(x,y,IF.ˆ(1/2))

colormap(’hot’)

axis equal

shading interp

% RLS 算法

<br>randn('seed', 0)

<br>rand('seed', 0)

<br>

<br>NoOfData = 8000 % Set no of data points used for training

<br>Order = 32 % Set the adaptive filter order

<br>

<br>Lambda = 0.98 % Set the forgetting factor

<br>Delta = 0.001 % R initialized to Delta*I

<br>

<br>x = randn(NoOfData, 1) % Input assumed to be white

<br>h = rand(Order, 1) % System picked randomly

<br>d = filter(h, 1, x) % Generate output (desired signal)

<br>

<br>% Initialize RLS

<br>

<br>P = Delta * eye ( Order, Order )

<br>w = zeros ( Order, 1 )

<br>

<br>% RLS Adaptation

<br>

<br>for n = Order : NoOfData

<绝数br>

<br>u = x(n:-1:n-Order+1)

<br>pi_ = u' * P

<br>k = Lambda + pi_ * u

<br>K = pi_'/k

<br>e(n) = d(n) - w' * u

<br>w = w + K * e(n)

<br>PPrime = K * pi_

<br>P = ( P - PPrime ) / Lambda

<br>w_err(n) = norm(h - w)

<br>

<br>end

<br>

<br>% Plot results

<br>

<br>figure

<br>plot(20*log10(abs(e)))

<br>陵饥title('Learning Curve')

<br>xlabel('Iteration Number')

<br>ylabel('Output Estimation Error in dB')

<br>

<br>figure

<br>semilogy(w_err)

<br>title('Weight Estimation Error')

<br>xlabel('Iteration Number')

<br>ylabel('Weight Error in dB')

<并汪首br>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8197322.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-14
下一篇 2023-04-14

发表评论

登录后才能评论

评论列表(0条)

保存