可见光通信
实验报告
题 目 LED 限制带宽和光信道 DCO-OFDM
专 业 电子信息类
学 号
姓 名
日 期
1.1 QPSK 可见光信道的仿真
Matlab 代码:
clc;clear;
M=64;N=64;Lcp=16;K1=2.6;K2=3.2;
EbN0= 1:20;
SNR = 10.^(EbN0./10);
OFDM_block = 256;
h_los = 3.065774782638313e-06;
bit_rate = 1e9;
fb = 80e6;
t = 0:1/bit_rate:13/bit_rate;
hkk =h_los.*exp(-2*pi*fb*t);
Light = hkk./sum(hkk);
for i = 1:length(SNR)
ernum =0;
for kk = 1:OFDM_block
X1 = randi([0 3],1,N);
X1=X1';
QPSK = pskmod(X1,4);
signal =QPSK;
signal(1)=0;
signal(N/2+1)= 0;
for j =N/2+2:N
signal(j)=conj(signal(N+2-j));
end
signal_ifft =sqrt(N)*ifft(signal,N);
%4
x2 =signal_ifft.*signal_ifft;
signal_K=signal_ifft + K1*sqrt(mean(x2(:)));
%5
for j =1:N
if signal_K(j)<0
signal_K(j)=0;
end
end
%6
Tx_signal =[signal_K(N-Lcp+1:N)' signal_K'];
Tx_signal = Tx_signal';
%7
N0=1/SNR(i);
sgma(i) = sqrt(N0);
% Y = Tx_signal+ sgma(i).*randn(1,length(Tx_signal))';
Y = cconv(Light,Tx_signal,80)+