www.pudn.com > visible_light_communication.zip > visible_light_communication.m, change:2014-08-29,size:1821b


% Please refer to the paper "Improvement of data rate by using equalization  
% in an indoor visible light communication system (2008)" by Lubin Zeng, Dominic 
% O'Brien, Hoa Le-Minh, Kyungwoo Lee, Daekwang Jung, and Yunje Oh.  
 
 
clear all; clc; 
 
[length,width] = meshgrid(0.5:0.05:5); 
height = 3; 
q=1.602176487E-19; 
Aroom = length.*width; 
ARX = 50; 
d = 3; 
psi = 30; 
psic = 70; 
no_of_LEDs = 4; 
phi_half = pi/3; 
pLED = 0.02; %(单LED功率?) 
Ro = real(RO(phi_half)); %Ro:发光功率 
ptx = pLED*Ro;   %(发射功率?) 
reflectivity_of_floor = 0.15;  %地面反射 
reflectivity_of_ceiling = 0.8; %天花板反射 
reflectivity_of_wall = 0.7; %墙面反射 
floor_area = Aroom; 
ceiling_area = Aroom; 
wall_area = length*d; 
pTotalLEDs = no_of_LEDs*pLED;  
g = 1; 
TF = 1; 
noisebandwidth_factor = 0.562; 
dataRate = 10240; 
R=0.4;  
hlos = HLOS(ARX,d,psi,psic,Ro); 
pn = 3.3*5.84E-3; 
prxlos = PRXLOS(no_of_LEDs,ptx,hlos); 
amplifier_current = 0.01; 
Ba = 4.5E6; 
rhoF = floor_area .* reflectivity_of_floor; 
rhoC = ceiling_area .* reflectivity_of_ceiling; 
rhoW = wall_area .* reflectivity_of_wall; 
 
rho = (1./Aroom) .* (rhoF + rhoC + rhoW); 
Ii = rho .* (pTotalLEDs./Aroom); 
intensity = Ii./(1-rho); 
received_diffused_power = ARX*intensity; 
diffused_channel_loss = received_diffused_power/pTotalLEDs; 
prx = (prxlos+received_diffused_power)*TF*g; 
PDoutput_current = prx*R;%PD输出电流 
 
Bn = noisebandwidth_factor*dataRate; 
omegashot = 2*q*R*(prx+pn)*Bn; 
omegaamp = amplifier_current^2*Ba; 
omegatotal = omegashot + omegaamp; 
 
%Signal-to-Noise Ratio 
SNR = (R*prx)^2./omegatotal; 
SNRdb = 10*log10(SNR); 
 
% Error Function 
Q = (1/2)*erfc((omegatotal./(R*prx.^2)./sqrt(2))); 
 
% Bit Error Rate 
BER = Q*sqrt(SNR); 
 
% Plot 3D 
figure(1) 
mesh(length,width,SNRdb) 
figure(2) 
mesh(length,width,BER)