亲爱的。我试图实现Matlab的室内可见光通信系统来计算光接收功率。并根据以下公式成功地计算了光源LED与接收机PD之间的功率线,

在下面的行代码中:
H_A1 = (m+1)*Adet.*cosphi_A1.^(m+1)./(2*pi.*D1.^2); % Channel DC gain for source如上图所示,将忽略cos(phi)和cos(psi),Tf & Gc。在下面的代码中,由于视线规则,cos(phi)和cos(psi)被忽略,并被认为是1。
我在这里试图做的是,在上面的代码行中考虑cos( phi )和cos(psi),方法是假设psi =0和phi=0:5:30。
我想根据上面的图片在下面的一行中添加cos(phi)和cos(psi)
H_A1 = (m+1)*Adet.*cosphi_A1.^(m+1)./(2*pi.*D1.^2); % Channel DC gain for source给phi=0,psi= 0到30,增加5。
在psi的每个新值中,我都要计算H_A1,以便计算接收到的功率P_rec。
有什么帮助吗?
Matlab代码:
close all;
clear all;
clc;
%% LED/PD Parameters
theta = 70; % Semi-angle at half power
m = -log10(2)/log10(cosd(theta)); % Lambertian order of emission
P_total = 20; % Transmitted optical power by individual LED
Adet = 1e-4; % Detector physical area of a PD
%% Optical elements parameters
Ts = 1; % Gain of an optical filter; ignore if no filter is used
index = 1.5; % Refractive index of a lens at a PD; ignore if no lens is used
FOV = 60*pi/180; % FOV of a receiver
G_Con = (index^2)/sin(FOV); % Gain of an optical concentrator; ignore if no lens is used
%% Room parameters
lx = 5; ly = 5; lz = 3; % Room dimensions in meter
h = 2.15; % The distance between the source and receiver plane
%% Mesh setup
% 2 dimensional setup
XT = 0; YT = 0; % The Position of the LED
Nx = lx*10; Ny = ly*10; % Number of grids in the receiver plane
x = -lx/2 : lx/Nx : lx/2;
y = -ly/2 : ly/Ny : ly/2;
[XR, YR] = meshgrid(x,y); % Receiver plane grid
%% Computation based on LOS channel equations
D1 = sqrt((XR-XT(1,1)).^2 + (YR-YT(1,1)).^2 + h^2); % Distance vector from source
cosphi_A1 = h./D1; % Angle vector
H_A1 = (m+1)*Adet.*cosphi_A1.^(m+1)./(2*pi.*D1.^2); % Channel DC gain for source
P_rec = P_total.*H_A1.*Ts.*G_Con; % Received power from source
P_rec_dB = 10*log10(P_rec);
%% Plotting
meshc(x,y,P_rec_dBm);
colorbar
xlabel('X (m)');
ylabel('Y (m)');
zlabel('Received power (dBm)');
axis([-lx/2 lx/2 -ly/2 ly/2 min(min(P_rec_dBm)) max(max(P_rec_dBm))]);发布于 2022-07-13 11:16:59
您可以将phi定义为向量,但是由于维数不匹配对每个角度都存在问题,唯一的图,我们不能为向量中给定的所有角度值绘制一个图。防扩散安全倡议也受到这一影响。
我们可能收到了作为向量的幂,因为cos是公式中的一个向量,但是不可能为这个向量绘制网格,每个接收到的幂值都有一个唯一的网格图。
https://stackoverflow.com/questions/72956823
复制相似问题