资源简介
可见光通信中,用来计算室内光强分布情况的代码,测试没问题。
代码片段和文件信息
%%
theta = 70;
% semi-angle at half power
ml=-log10(2)/log10(cosd(theta));
%Lambertian order of emission
P_LED=20;
%transmitted optical power by individual LED
nLED=60;
% number of LED array nLED*nLED
P_total=nLED*nLED*P_LED;
%Total transmitted power
Adet=1e-4;
%detector physical area of a PD
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=70;
%FOV of a receiver
G_Con=(index^2)/(sind(FOV).^2);
%gain of an optical concentrator; ignore if no lens is used
%%
lx=5; ly=5; lz=3;
% room dimension in meter
h=2.15;
%the distance between source and receiver plane
[XTYT]=meshgrid([-lx/4 lx/4][-ly/4 ly/4]);
% position of LED; it is assumed all LEDs are located at same point for
% faster simulation
% for one LED simulation located at the central of the room use XT=0 and YT=0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Nx=lx*5; Ny=ly*5;
% number of grid in the receiver plane
x=linspace(-lx/2lx/2Nx);
y=linspace(-ly/2ly/2Ny);
[XRYR]=meshgrid(xy);
D1=sqrt((XR-XT(11)).^2+(YR-YT(11)).^2+h^2);
% distance vector from source 1
cosphi_A1=h./D1;
% angle vector
receiver_angle=acosd(cosphi_A1);
% alternative methods to calculate angle more accurate if the
angle are
% negatives
% nr=[0 0 1];
% RT=[1.25 1.25]; % transmitter location
% for r=1:length(x)
% for c=1:length(y)
%
% angleA12=atan(sqrt((x(r)-1.25).^2+(y(c)-1.25).^2)./h);
% costheta(rc)=cos(angleA12);
% end
% end
%
%%
% D2=fliplr(D1);
% % due to symmetry
% D3=flipud(D1);
% D4=fliplr(D3);
H_A1=(ml+1)*Adet.*cosphi_A1.^(ml+1)./(2*pi.*D1.^2);
% channel DC gain for source 1
P_rec_A1=P_total.*H_A1.*Ts.*G_Con;
% received power from source 1;
P_rec_A1(find(abs(receiver_angle)>FOV))=0;
% if the anlge of arrival is greater than FOV no current is generated at
% the photodiode.
P_rec_A2=fliplr(P_rec_A1);
% received power from source 2 due to symmetry no need separate
% calculations
P_rec_A3=flipud(P_rec_A1);
P_rec_A4=fliplr(P_rec_A3);
P_rec_total=P_rec_A1+P_rec_A2+P_rec_A3+P_rec_A4;
P_rec_dBm=10*log10(P_rec_total);
%% Fig.
surfc(xyP_rec_dBm);
% contour(xyP_rec_dBm);hold on
% mesh(xyP_rec_dBm);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2245 2020-09-20 14:51 OpticalPowerDistribution.m
相关资源
- Simulate BER of OOKNRZ 可见光通信中
- matlab一维条形码识别程序
- Spatial Econometrics MATLAB 软件包是将New
- jpg 2 rgb565 matlab code 实现将jpg格式的图
- matlab S-function 编写的离散状态空间表
- matlab重现 正弦信号 重复控制器
-
matlab radar simuli
nk system matlab雷达系统 - matlab图像质心提取
- 基于博弈论的认知无线电无线资源分
- surf算法的matlab代码
- RBF and svm matlab code matlab回归预测的源
- msd CPM多符号检测算法调制解调
- BP神经网络进行多分类matlab代码 (c
- matlab遗传算法 决车辆路径最优化问题
- matlab频域自适应滤波器(FDAF)演示
- reliefF算法的matlab源代码
- ECG心电信号matlab仿真画图
- matlab变色龙聚类算法(chameleon-cluste
- Haar-like特征提取功能
- EOF分解
- matlab叠前反演的代码
- 基于svm dtc 的船舶电力推进系统仿真模
- 各种决策树(tree)分类的代码
- RSSI的无线定位matlab代码
- 解决含有运动力学约束的路径规划问
- 基于人工势场法做的matlab路径规划算
- 无线传感器网络分簇路由算法的matl
- matlab求解图像灰度梯度
- Dollar的人体行为识别的代码(cuboids
- libsvm SVM分类器
评论
共有 条评论