RC-OOK.rar

  • Arsy
    了解作者
  • matlab
    开发工具
  • 3KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 0
    下载次数
  • 2021-04-19 15:13
    上传日期
This folder provides the Matlab codes of Repetition coding based MIMO VLC system
RC-OOK.rar
  • RC-OOK
  • nlos_channel.m
    2.8KB
  • mainbody_channel.m
    3.8KB
  • los_channel.m
    2.2KB
  • mainbody.m
    1.9KB
内容介绍
clc clear; close; %% =============================================> Simulation Parameters <=================================================%% n_tx = 2; % Number of Transmitters n_rx = 1; % Number of Receivers N = 1e4; % Total Data Bits minSNR = 0; % SNR Lower Limit maxSNR = 20; % SNR Maximum Limit intval = 2; % Interval of SNR Loop SNR = minSNR:intval:maxSNR; % SNR Loop L = 4; % Length of the Wall W = 4; % Width of the Room PD_FOV = 80; % Field of View of Receiver led_sep = 0.5; % Separation between LEDs led_p1 = 1.75; % LED 1 Placement from the Left Wall led_p2 = 1.75; % LED 2 Placement from the Right Wall pd_p = 2.5; % Photo-diode placement irr1 = 10; % Irradiance angle of LED 1 irr2 = 15; % Irradiance angle of LED 2 %% =============================================> Binary Data Generation <================================================%% DataBits = randi([0 1],1,N); %% =============================================> Data for 2 Transmitters <===============================================%% s2p = reshape(DataBits,n_tx,N/n_tx); %% =============================================> Repition Coding for 2 Tx <==============================================%% RC = []; for it1 = 1:length(s2p) RC = [RC s2p(:,it1) s2p(:,it1)]; end %% =============================================> VLC Channel for 2 Tx <==================================================%% [HLOS,P_t] = los_channel(L,W,PD_FOV,led_sep,led_p1,led_p2,pd_p,irr1,irr2); P_t = 1e3*P_t; H = 1/sqrt(2)*[randn(1,n_tx)]; %% =====================================> Signal Passing Through Channel <================================ %% chann_arr = []; Tx = reshape(RC,n_tx,n_tx,N/n_tx); for it3 = 1:length(Tx) G = H * Tx(:,:,it3); chann_arr = [chann_arr G]; end W = H'; %% =============================================> Data Transmission <=====================================================%% data_tx = chann_arr; %% =============================================> Data Reception <========================================================%% data_rx = data_tx; %% =============================================> Noise Addition <========================================================%% for ss = 1:length(SNR) n = 1/sqrt(2)*[randn(n_rx,N)]; y = chann_arr + 10^(-SNR(ss)/20)*n; %% =============================================> Zero Forcing Equalizer <================================================%% Y = reshape(y,1,n_tx,N/n_tx); eq_blocks = []; for l = 1:length(Y) eq = W*Y(:,:,l); eq_blocks = [eq_blocks eq]; end %% =============================================> Repition Decoding for 2 Tx <============================================%% DRC = []; for it2 = 1:2:length(eq_blocks) DRC = [DRC eq_blocks(:,it2)]; end %% =============================================> Parallel 2 Serial <=====================================================%% p2s = reshape(DRC,1,N); p2s(p2s<0) = 0; p2s(p2s>0) = 1; RBits = p2s; %% =============================================> Bit Error Rate Calculations <===========================================%% [num_of_errors(ss),bits_in_error(ss)] = biterr(DataBits,RBits) end
评论
    相关推荐
    • hvcode.zip
      查看二进制文件的HexView的源代码
    • elvis.zip
      又一个DOS下模拟vi的程序
    • teco.zip
      teco编辑器源码
    • calvin23.zip
      一个DOS下模拟Unix下的vi的程序
    • ted2.zip
      一个很小的用汇编写的编辑器
    • ISE_chinese.rar
      Xilinx ISE中文简明教程、Xilinx术语中文.pdf、Virtex 系列 FPGA 的配置和回读、FPGA设计检查清单.pdf、设计注意.pdf、逻辑设计注意列表.pdf
    • lrc编辑器.rar
      歌词编辑器,可以用它把MiniLyric的歌词提取出来,以供打印,希望大家喜欢,主要用到正则表达式。
    • 反编译工具exe2c.zip
      可将EXE文件破解成C
    • LoDuWILEditor3.2.rar
      乐都WIL编辑器3.2版.rar 乐都WIL编辑器3.2版 乐都WIL编辑器3.2版
    • jedit322source.tar.gz
      Java写的文本编辑器