CSK Project.rar

  • Arsy
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 10 积分
    下载积分
  • 0
    下载次数
  • 2021-04-19 14:59
    上传日期
This folder provides the CSK-CDMA based Visible Light Communication System
CSK Project.rar
  • CSK Project
  • main.m
    1.9KB
  • Hlos.m
    1.2KB
内容介绍
clc clear all close all format short g % data bit stream for each sender D = randi([0,1],1,10000); % representing 0 by -1 BPSK_MOD = (2.*D)-1; Br = reshape(BPSK_MOD,[2,length(D)/2]); % unique code for each sender (determined using hadamard command) code = hadamard(4) ; C1 = code(2,:); B1 = repmat(C1,1,length(D)/(2*4)); %D/2 -> answer/4 C2 = code(3,:); B2 = repmat(C2,1,length(D)/(2*4)); a = Br(1,:).*B1; b = Br(2,:).*B2; ab = [a;b]; abr = reshape(ab,2,2,length(ab)/2); % angle of incidence, denoted by Psi and is < FOV % angle of irradiance,denoted by Phi angle_incdidence_11 = 15*pi/180; angle_irradiance_11 = 15*pi/180; angle_incdidence_12 = 20*pi/180; angle_irradiance_12 = 20*pi/180; angle_incdidence_21 = 15*pi/180; angle_irradiance_21 = 15*pi/180; angle_incdidence_22 = 20*pi/180; angle_irradiance_22 = 20*pi/180; [h_11,h_12,h_21,h_22] = Hlos(angle_incdidence_11,angle_irradiance_11,angle_incdidence_12,angle_irradiance_12,angle_incdidence_21,angle_irradiance_21,angle_incdidence_22,angle_irradiance_22); H = [h_11 h_12 ; h_21 h_22]; H_inv = inv(H); M = zeros(2,2,length(ab)/2); G = []; for cc = 1:length(ab)/2 M(:,:,cc) = H*abr(:,:,cc); G = [G M(:,:,cc)]; end snr = 0:15; for ii = 1:length(snr) y = zeros(size(G)); y = G + awgn(G,snr(ii),'measured'); yr = reshape(y,2,2,length(y)/2); W = zeros(2,2,length(y)/2); R = []; for cc = 1:length(y)/2 W(:,:,cc) = H_inv * yr(:,:,cc); R = [R W(:,:,cc)]; R(R>1) = 1; R(R<0) = -1; end R1 = R(1,:).*B1; R2 = R(2,:).*B2; rx = [R1 ; R2]; Rcv = reshape(rx,[1,length(D)]); for count = 1:length(D) if Rcv(count)==-1; Rcv(count)=0; end end [num(ii) err(ii)] = biterr(Rcv,D); end semilogy(snr,err) grid; xlabel('SNR'); ylabel('BER');
评论
    相关推荐
    • 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写的文本编辑器