├── Config.mlx ├── ParityCheckMatrices ├── H_1_2_H.mat ├── H_1_2_L.mat ├── H_1_2_S.mat ├── H_2_3_L.mat ├── H_2_3_S.mat ├── H_5_6_L.mat └── H_5_6_S.mat ├── README.md ├── Systeme.slx ├── matExpand.m └── rxPreprocess.m /Config.mlx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/Config.mlx -------------------------------------------------------------------------------- /ParityCheckMatrices/H_1_2_H.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/ParityCheckMatrices/H_1_2_H.mat -------------------------------------------------------------------------------- /ParityCheckMatrices/H_1_2_L.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/ParityCheckMatrices/H_1_2_L.mat -------------------------------------------------------------------------------- /ParityCheckMatrices/H_1_2_S.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/ParityCheckMatrices/H_1_2_S.mat -------------------------------------------------------------------------------- /ParityCheckMatrices/H_2_3_L.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/ParityCheckMatrices/H_2_3_L.mat -------------------------------------------------------------------------------- /ParityCheckMatrices/H_2_3_S.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/ParityCheckMatrices/H_2_3_S.mat -------------------------------------------------------------------------------- /ParityCheckMatrices/H_5_6_L.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/ParityCheckMatrices/H_5_6_L.mat -------------------------------------------------------------------------------- /ParityCheckMatrices/H_5_6_S.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/ParityCheckMatrices/H_5_6_S.mat -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Matlab-LiFi 2 | Ce code Matlab / Simulink implémente une modulation QAM DCO-OFDM selon les spécifications de la norme LiFi IEEE802.11bb 3 | (http://www.ieee802.org/11/Reports/tgbb_update.htm doc. 11-19/1791r2). 4 | 5 | ## Fichiers 6 | ``` 7 | Config.m : Script Matlab contenant la configuration de la modulation (nombre de porteuses, espacement...) 8 | Systeme.slx : Script Simulink contenant les blocs fonctionnels de la modulation 9 | ``` 10 | 11 | ## Utilisation 12 | 1. Ouvrir avec Matlab, modifier si besoin et exécuter `Config.m` 13 | 2. Ouvrir avec Simulink et exécuter `Systeme.slx` 14 | 15 | ## Captures d'écran 16 | |![Fichier `ofdm.slx`](https://puu.sh/FNPpU/93f28702d7.png)| 17 | |:--:| 18 | |*Fichier `ofdm.slx`*| 19 | 20 | |![Signal de sortie `RF_IN`](https://puu.sh/FNPoF/7a452550ae.png)| 21 | |:--:| 22 | |*Signal de sortie `RF_IN`*| 23 | 24 | |![Signal de sortie `RF_IN`](https://puu.sh/FNNRj/15c17cb032.png)| 25 | |:--:| 26 | |*Spectre du signal de sortie `RF_IN`*| -------------------------------------------------------------------------------- /Systeme.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jsinn-dev/Matlab-LiFi/a34dbf979ac66287ed7575d1695ab6a202cd8738/Systeme.slx -------------------------------------------------------------------------------- /matExpand.m: -------------------------------------------------------------------------------- 1 | function H = matExpand(Hc, M) 2 | %MATEXPAND performs parity-check matrix expansion by the following process 3 | %https://www.youtube.com/watch?v=piDWLauBJ-8 4 | % Hc : Compact parity-check matrix 5 | % M : Expansion factor 6 | 7 | [c, t] = size(Hc); % Get number of rows and columns 8 | H = zeros(M*c,M*t); % Expanded parity-check matrix initialization 9 | 10 | for i=0:c-1 11 | for j=0:t-1 12 | if Hc(1+i,1+j)==-1 13 | % If Hc(i,j)==-1, fill with zeros 14 | H(1+(M*i:M*(i+1)-1),1+(M*j:M*(j+1)-1)) = zeros(M,M); 15 | else 16 | % Else fill with identity matrix rotated Hc(i,j) times 17 | H(1+(M*i:M*(i+1)-1),1+(M*j:M*(j+1)-1)) = circshift(eye(M),-Hc(1+i,1+j)); 18 | end 19 | end 20 | end 21 | H = sparse(H); 22 | 23 | end 24 | 25 | -------------------------------------------------------------------------------- /rxPreprocess.m: -------------------------------------------------------------------------------- 1 | %% Modifiy Tx and Rx data for test purposes 2 | RxData = [zeros(1,213) reshape(Rx.Data(1,1,:),[1 length(Rx.Data)])]; 3 | timepad = linspace(0,Rx.Time(213,1),213); 4 | RxTime = [timepad reshape(Rx.Time+Rx.Time(213,1),[1 length(Rx.Time)])]; 5 | Rx = timeseries(RxData, RxTime); 6 | 7 | TxDataDownsampled(:) = downsample(Tx.Data(1,1,:),2); 8 | TxTimeDownsampled(:) = downsample(Tx.Time(:,1),2); 9 | Tx = timeseries(TxDataDownsampled, TxTimeDownsampled); 10 | 11 | %% Plot initial TX data 12 | figure(1); 13 | subplot(611); 14 | plot(Tx.Time, reshape(Tx.Data(1,1,:),[1 length(Tx.Data)])); 15 | title('Raw TX data'); 16 | xlabel('time (s)'); 17 | 18 | %% Read received file from oscilloscope 19 | %Rx = timeseries(a,b); 20 | 21 | subplot(612); 22 | plot(Rx.Time, reshape(Rx.Data(1,1,:),[1 length(Rx.Data)])); 23 | title('Raw RX data'); 24 | xlabel('time (s)'); 25 | 26 | %% Find and compensate for the delay between TX and RX 27 | % Upsample the TX data to match RX sampling rate 28 | TxUpsampled = resample(Tx,Rx.Time); 29 | 30 | subplot(613); 31 | plot(TxUpsampled.Time, reshape(TxUpsampled.Data(1,1,:),[1 length(TxUpsampled.Data)])); 32 | title('Upsampled TX data'); 33 | xlabel('time (s)'); 34 | 35 | % Retrieve preamble from TX data 36 | PreambleIndices = find(TxUpsampled.Time