Simple Code for VLC (Visible Light Communications)

75 ビュー (過去 30 日間)
Muso
Muso 2017 年 4 月 17 日
編集済み: Désiré_RM 2024 年 4 月 15 日 15:57
how can i write simple code for SNR distribution for indoor VLC
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 11 月 7 日
Which meaning of VLC is intended for this question?
Désiré_RM
Désiré_RM 2024 年 2 月 26 日
Hello everybody. Hope all of you're doing well? I'm working on VLC combinate with NOMA. Can you help me with Matlab code for to estimate the indoor coverage with VLC and allocate ressources with NOMA?

サインインしてコメントする。

採用された回答

pratik panchal
pratik panchal 2017 年 5 月 10 日
編集済み: Walter Roberson 2017 年 5 月 10 日
I hope it is useful for you.
clear all;
clc;
close all;
% SNR Performance For VLC SYSTEM %
% Coded BY Er. PANCHAL PRATIK
% pattu310@gmail.com
% Easy USe Consider Following Example
%
%
% BASIC PARAMETER REQUIRED %
Incidence = 70*pi/180;
TX_FOV = 70; % Transmitter Field Of View
RX_FOV = 90; % Receivers Field Of View
Tx = [2,2,2]; % Transmitter Location
%Rxp = [2,2]; % Receiver Location
W_Room = 4; % Width of Room
L_Room = 4; % Length of Room
H_Room = 2; % Height Between Transmitter and Receiver
R = 1; % Responsivity of Photodiode
Apd = 1e-4; % Area of PhotoDetector
Rb = 1e6; % Data rate of system
Iamp = 5e-12; % Amplifier Current
q = 1.6e-19; % Electron Charge
Bn = 50e6; % Noise Bandwidth
I2 = 0.562; % Noise Bandwidth Factor
PLED = 1; % Power Emitted by LED
index =1;
HLED = 1;
[W L] = meshgrid(-(W_Room/2) : 0.50 : (W_Room/2)); % Consideer Length of BLock for Room
xydist = sqrt((W).^2 + (L).^2);
hdist = sqrt(xydist.^2 + HLED.^2);
%D = Tx - Rx;
%d = norm(D);
%Incidence = acos()
A_Irradiance = ((Tx(3)-HLED)./hdist);
%I(index) = Irradiance*180/pi;
%if abs(Incidence <= RX_FOV)
p = TX_FOV ;
Tx_FOV = (TX_FOV*pi)/180;
% BASIC CALCULATION IN VLC SYSTEM %
% Lambertian Pattern
m = real(-log(2)/log(cos(Tx_FOV)));
% Radiation Intensity at particular point
Ro = real(((m+1)/(2*pi)).*A_Irradiance^m);
% Transmitted power By LED
Ptx = PLED .* Ro;
% Channel Gain ( Channel Coefficient Of LOS Channel )
%Theta=atand(sqrt(sum((Tx-Rx).^2))/H_Room);
HLOS = (Apd./hdist.^2).*cos(Incidence).*Ro;
% Received Power By PhotoDetector
Prx = HLOS.*Ptx;
% Calculate Noise in System
Bs = Rb*I2;
Pn = Iamp/Rb;
Ptotal = Prx+Pn;
new_shot = 2*q*Ptotal*Bs;
new_amp = Iamp^2*Bn;
% Calculate SNR
new_total = new_shot + new_amp;
SNRl = (R.*Prx).^2./ new_total;
SNRdb = 10*log10(SNRl);
% else
% SNRl = 0;
% SNRdb = 0;
% end
index = index + 1;
% Plot Graph %
figure;
mesh(W,L,SNRdb);
%mesh(SNRdb);
%ylim([0 30]);
title('SNR Distribution in Room');
xlabel('Length of Room');
ylabel('Width of Room');
zlabel('SNR in dB');
  17 件のコメント
Alessandro Petroni
Alessandro Petroni 2023 年 5 月 17 日
編集済み: Alessandro Petroni 2023 年 5 月 17 日
@Walter Roberson yes, the applied formula and calculations for the SNR are correct and already checked.
the problem remains the plot of that SNR, being a 41x41x31 three-dimensional matrix. How can I model this matrix to be able to display correctly with the mesh function?
Walter Roberson
Walter Roberson 2023 年 5 月 18 日
That is, in order to plot 3 independent variables and one dependent variable, you are probably getting into volume viewing techniques, unless you want to draw isosurface

サインインしてコメントする。

その他の回答 (1 件)

Désiré_RM
Désiré_RM 2024 年 4 月 15 日 15:55
編集済み: Désiré_RM 2024 年 4 月 15 日 15:57
Hello dears. I sincerely need your help on NOMA-VLC code for power allocation and number of users considered to complete my work.
Sincerely!

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by