behavioral-led-model
This GitHub repository contains a ready-to-use implementation of a behavioral model for LED nonlinearity in MATLAB.
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.8%) to scientific vocabulary
Repository
This GitHub repository contains a ready-to-use implementation of a behavioral model for LED nonlinearity in MATLAB.
Basic Info
- Host: GitHub
- Owner: juliusz-b
- License: other
- Language: MATLAB
- Default Branch: main
- Size: 8.79 MB
Statistics
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 4
Metadata Files
README.md
Behavioral LED model in MATLAB
This GitHub repository contains a ready-to-use implementation of a behavioral model for Light Emitting Diode (LED) nonlinearity in MATLAB. The model is based on two filters and was detailed in the paper:
Juliusz Bojarczuk, Michal Marzecki, Di Sun, Zuxin Jin, Pengfei Tian and Grzegorz Stepniak, "A Behavioral Model of the Light Emitting Diode Nonlinearity", IEEE Transactions on Communications, may 2025.
When using the behavioral LED model, please remember to support our work by citing the aforementioned paper in your article.
See more details
In the abovementioned paper, we provided a detailed description of the behavior of LED diodes used in VLC. In our paper, we have presented a simple yet accurate model of LED nonlinearity, based on the use of two filters. We believe that its features make it applicable in modeling simple VLC links, as well as optimizing the operation of more complex systems. Therefore, a part of this work is also a ready-to-use implementation of the behavioral model in the MATLAB environment, which allows for a straightforward generation of a signal at the output of the modeled LED diode. The proposed model as a block diagram:  In the model, the LED is represented as a two-arm parallel system. The H1 filter is designed as a low-pass filter, while H2 is a high-pass filter that is followed by a nonlinear operation. The implementation of the model is available as an open repository on the GitHub platform. Additionally, the repository includes example measurement data, which was used to present some of the results in our paper. By providing a publicly available function, we ensure that the presented model will be implemented by research groups in full accordance with its assumptions, thereby avoiding any potential mistakes or errors resulting from incorrect programmatic implementation of the behavioral model.Sample MATLAB Scripts (on how to use behavioral model in your code)
This repository contains three MATLAB scripts that serve as examples: - TransmitThroughModel.m - EyediagramForSampleData.m - PlotKernels.m
TransmitThroughModel
(1) Suppose that you have measured LED 3dB bandwidth ($fB$,ledBandwidth3dB) and is equal to 45 MHz.\ (2) For the same frequency, you have generated sinusoidal signal with amplitude $Ia$ and measured fundamental harmonic power at the receiver as $P{h1}(2\pi fB)$. Electrical to optical conversion factor ($\eta$, eta) is equal to exactly $\frac{2\sqrt{P{h1}(2\pi fB)}}{Ia}$. For our case it will be 0.02.\ (3a) Next, you drive the LED again with harmonic signal with amplitude $Ia$ and frequency equal to $fB$. However you calculate the power ratio of the second harmonic ($2fB$) to fundamental one ($fB$) at the receiver and treat this ratio as $P{r1}$.\ (3b) We need the second measurement point for obtaining model parameters. Thus, you drive the LED with harmonic signal with amplitude $Ia$ and frequency equal to $\frac{1}{2} fB$. Obtained power ratio of the second harmonic ($fB$) to fundamental one ($frac{1}{2}fB$) at the receiver is $P{r2}$.\ (4) Nonlinearity factor $\Gamma$ is equal to exactly $\sqrt{\frac{160}{3 Ia^2 \eta^2} \left ( P{r2}-P{r1} \right)}$, while cutoff frequency of second filter $2\pi fA$ is equal to $\sqrt{4\omegaB^2\frac{P{r2}-P{r1}}{4P{r1}-P{r2}}}$.[^1].
[^1]: Each parameter is described in detail in the main paper, and a brief overview can be found in the ledbehavioral.m.
For this case, you can set LED model parameters as follows:
Matlab
% Set parameters of LED model
ledBandwidth3dB = 45e6;
fA = 11e6;
eta = 0.02;
lengthOfLedResponse = 50;
gamma = 10;
You can use our pre-generated PAM-4 signal, which will be put into LED transmission function:
Matlab
% Load symbols
xInput = readmatrix('Sample data\example_PAM4_UF4_Alfa1_FilterSpan20.txt');
Suppose that you want to send 100 MBaud/s signal with amplitude coefficient equal to 1.2.
Matlab
% Signal parameters
baudRate = 100e6;
upsamplingFactor = 4;
samplingFrequency = baudRate*upsamplingFactor;
signalAmplitudeCoefficient = 1.2;
To pass the pregenerated PAM-4 signal through LED mode use this code:
Matlab
xOutput = ledbehavioral(xInput*signalAmplitudeCoefficient,
ledBandwidth3dB, fA, gamma, eta, samplingFrequency, lengthOfLedResponse);
EyediagramForSampleData
This script is used for plotting and comparing the output signal from the rate equation-based LED model with the proposed behavioral model.
PlotKernels
Script for plotting 2nd order Volterra kernels for OSRAM W5SN white LED for 50 and 200 mA bias estimated from 100 MBaud/s PAM-4 signal.
Measurement Data
See info about attached data
We have also provided 2 txt files containing the estimated 2nd order Volterra kernels, as well as 2 txt files containing the received data from the oscilloscope. To visualize the kernels, you can use the *PlotKernels.m* script. - [2nd Volterra kernel for white LED biased at 50 mA](./Measurement%20data/kernel_white_50mA_100M.txt) - [2nd Volterra kernel for white LED biased at 200 mA](./Measurement%20data/kernel_white_200mA_100M.txt) - [Received 300 MBaud/s PAM-4 from RC-LED biased at 20 mA with modulation amplitude equal to 1.13 Vpp](./Measurement%20data/received_rcLED_PAM4_300MBaud_10G_UF4_20mA_1.13Vpp.txt) - [Received 300 MBaud/s PAM-4 from RC-LED biased at 20 mA with modulation amplitude equal to 1.13 Vpp](./Measurement%20data/received_rcLED_PAM4_700MBaud_10G_UF4_20mA_1.13Vpp.txt)Functions
See brief functions description
The repository contains two functions written in MATLAB, including one for modeling LED transmission. - [*eyediag*](./Functions/eyediag/eyediag.m) - [*ledbehavioral*](./Functions/ledbehavioral/ledbehavioral.m) ### **eyediag** The eyediag function allows for generating an eye diagram for a given input signal. ```Matlab n = 4; x = repmat(randi(3,1,1e3)-2,1,n); y = conv(x,exp(-(0:100)/1e9*(2*pi*400e6))); yN = awgn(y,20,'measured'); figure('Color','w'); eyediag(yN,3,'PlotHistogram',true); ``` The above code will produce the following eye diagram:  More information about usage of *eyediag* can be found in the [eyediag.m](./Functions/eyediag/eyediag.m) file. >### **ledbehavioral** This function is utilized to incorporate a suggested behavioral model of nonlinearity in a communication system that is based on LEDs. A comprehensive explanation of the function can be located in [ledbehavioral.m](./Functions/ledbehavioral/ledbehavioral.m). Example usage: ```Matlab y = ledbehavioral(x, ledBandwidth3dB, fA, gamma, eta, samplingFrequency, N); ``` The output signal of the model is represented by y, while the input signal is represented by x. It's important to note that the ledbehavioral function introduces a delay to the signal, so it's recommended to trim it using, for instance, [*finddelay*](https://www.mathworks.com/help/signal/ref/finddelay.html) function.System Requirements
The functions and scripts have been tested in MATLAB R2022b.
Contact
- E-mail: grzegorz.stepniak@pw.edu.pl or juliusz.bojarczuk@pw.edu.pl
- Institute of Telecommunications, Warsaw University of Technology
Acknowledgments
This work was supported by National Centre for Research and Development under grant USVEGAN no. WPC2/20/USVEGAN/2019.
License
Original source code assets present in this repository are licensed under the GNU LGPLv3.
Owner
- Name: Juliusz Bojarczuk
- Login: juliusz-b
- Kind: user
- Location: Warsaw
- Company: FiberTeam
- Website: https://www.linkedin.com/in/juliusz-bojarczuk-863711127
- Repositories: 2
- Profile: https://github.com/juliusz-b
Currently working at WUT. Specializing in FBG and optical/fiber telecom signals. Scientific circle: https://fiberteam.me/
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: Behavioral model of the Light Emitting Diode nonlinearity
message: 'If you use this software, please cite it as below.'
type: software
authors:
- family-names: Bojarczuk
given-names: Juliusz
email: juliusz.bojarczuk@pw.edu.pl
affiliation: >-
Institute of Telecommunications, Warsaw University of
Technology
- family-names: Stepniak
given-names: Grzegorz
email: grzegorz.stepniak@pw.edu.pl
affiliation: >-
Institute of Telecommunications, Warsaw University of
Technology
identifiers:
- type: doi
value: 10.5281/zenodo.15387939
description: ZENODO
repository-code: 'https://github.com/juliusz-b/behavioral-led-model'
abstract: >-
This GitHub repository contains a ready-to-use
implementation of a behavioral model for LED nonlinearity
in MATLAB.
keywords:
- LED
- nonlinearity
- behavioral model
- MATLAB
- VLC
license: LGPL-3.0
version: 1.3.0
date-released: '2025-05-12'
preferred-citation:
type: article
authors:
- family-names: Bojarczuk
given-names: Juliusz
affiliation: 'Institute of Telecommunications and Cybersecurity, Warsaw University of Technology'
- family-names: Marzecki
given-names: Michal
affiliation: 'Institute of Telecommunications and Cybersecurity, Warsaw University of Technology'
- family-names: Sun
given-names: Di
affiliation: 'Fudan University, Institute for Electric Light Sources, School of Information Science and Technology'
- family-names: Jin
given-names: Zuxin
affiliation: 'Fudan University, Institute for Electric Light Sources, School of Information Science and Technology'
- family-names: Tian
given-names: Pengfei
affiliation: 'Fudan University, Institute for Electric Light Sources, School of Information Science and Technology'
- family-names: Stepniak
given-names: Grzegorz
affiliation: 'Institute of Telecommunications and Cybersecurity, Warsaw University of Technology'
doi: 10.1109/TCOMM.2025.3569749
journal: IEEE Transactions on Communications
month: 5
title: A Behavioral Model of the Light Emitting Diode Nonlinearity
year: 2025
GitHub Events
Total
- Release event: 1
- Watch event: 2
- Push event: 5
- Create event: 2
Last Year
- Release event: 1
- Watch event: 2
- Push event: 5
- Create event: 2