首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在下面的代码中,如何考虑cos(phi)和cos(psi)来计算VLC LED系统接收到的光功率?

在下面的代码中,如何考虑cos(phi)和cos(psi)来计算VLC LED系统接收到的光功率?
EN

Stack Overflow用户
提问于 2022-07-12 18:23:38
回答 1查看 105关注 0票数 0

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

在下面的行代码中:

代码语言:javascript
复制
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)

代码语言:javascript
复制
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代码:

代码语言:javascript
复制
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))]);
EN

回答 1

Stack Overflow用户

发布于 2022-07-13 11:16:59

您可以将phi定义为向量,但是由于维数不匹配对每个角度都存在问题,唯一的图,我们不能为向量中给定的所有角度值绘制一个图。防扩散安全倡议也受到这一影响。

我们可能收到了作为向量的幂,因为cos是公式中的一个向量,但是不可能为这个向量绘制网格,每个接收到的幂值都有一个唯一的网格图。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72956823

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档