Basic conditions
The difference to the electrical QPSK is that an adder is used instead of a multiplier!
The basic brightness is the reason that an offset occurs in the photodiode!
This simulation shows how an optical QPSK with an external modulator and a direct conversion receiver works. A 10 GBit/s connection is established at 1500 nm.
The optical transmission consists of an electrical signal that, with the help of a modulator, is converted into an optical signal.
Afterwards the signal is sent through an optical fiber to the receiver, where it's demodulated and reverted into an electrical signal by using a photodiode.
The carrier signal of the direct conversion receiver and the received signal should be synchronized in frequency and phase.
In real life optical QPSK requires a subsequent phase correction.
To simplify and to help with a better understanding of the simulation the following points will be ignored:
 the phase shift of all the different components
 the influence of temperature
 nonideal lasers (they will have an exact wavelength and phase)
Modulation
It consists of a modulation symbol mapper, an I/Q splitter, a pulse shaper for the I and Q path, a local laser and a 'MachZehnderInterferometer'.
For further information refer to MachZehnderInterferometer.
$LiNb{O}_{3}$
, Lithium niobate a synthetic salt, is used as a phase shifter.
(At this point there is no use to get into the chemical componets of the synthetic salt, just know that it helps with shifting the phase.)
The signal goes to the I/Q splitter, there it gets separated into the I and Q path.
Afterwards the pulse shaper on both paths of the 'MachZehnderInterferometer' feeds the signal into the local laser.
The phase shift can be calculated with the formula below:
$$\phi =\frac{{\omega}_{0}L\Delta {n}_{eff}}{c}$$
$$\phi $$  Phase shift 
$${\omega}_{0}$$  Laser frequency 
$$L$$  Length 
$$\u2206{n}_{eff}$$  Shift of the refractive index 
$$c$$  Speed of light 
The phase shift in the Q path can be either 90° or 270°, in the I path 0° or 180°.
At the end of the 'MachZehnderInterferometer' both paths are added resulting in four phase shifts (±45° and ±135°).
The following signal goes to the optical fiber.
TRANSMISSION ATTENUATION
The transmission attenuation of the optical fiber is calculated from the length and the attenuation per kilometer.
Moreover an additional attenuation can be added, for example as a bend.
A further requirement is the addition of AWGN.
$${S}_{r}={S}_{t}\xb7{a}^{2}=\frac{{\hat{r}}^{2}}{2}\Rightarrow \hat{r}=\sqrt{2{S}_{t}}\xb7a$$
DEMODULATION
To demodulate the signal it has to be split into two paths.
Both paths add a local laser, one of them getting a 90°, the other a 0° phase shift.
Afterwards the signals are sent to two photodiodes, where they are converted into electrical signals.
Subsequently there is an electrical Q and Isignal. Both will be combined to form a constellation point.
>
For a better understanding regarding how the signals get processed and how the formulas get derived, read the first part of the tab: illustration.
OFFSET CORRECTION
The photodiode is a power detector and since light can't have a negative amplitude it produces only positive output values.
As a consequence, the constellation is shifted to the fist quadrant.
Zero, as the lowest point, exists only if the local laser and the received signal eliminate each other completely.
But keep in mind that the offset is the same for Inphase as in Quadrature!
Therefore offset correction is used to center the constellation.
Offset correction, explained in short terms, can be seen as the mean of the signal.
To get a better grip on the finer details, read the relevant part of the tab: illustration.


Experiment
As part of the experiment, the frequency is kept low so that it can be displayed.
In order to show how optical QPSK works, the following experiment will be performed.
PART 1
The aim is to have the received signals have the same value, and the constellation points are on $\frac{\sqrt{2}}{2}$.
Explore the signal values at all points mentioned in the tutorial to get acquainted with the process.
Try to understand how the offset correction, set in the application, results from the calculation explained in the illustration.
After having read the tutorial, and understand the formulas and change the length of the optical fiber to 120 km and the attenuation to 0.3 dB/km.
For simplicity reasons change the noise setting to 'OFF'.
The default settings are shown in the folder 'Manual'.
Calculate the new values of the offset correction and check your result with the constellation diagram.
PART 2
As soon as the previous steps have been understood, the second part can start.
Switch back to the 30dBchannel (optical fiber length: 150km, attention: 0,2dB).
Alter the noise setting to 'ON' and change the SNR bit by bit in favor to get the same BER values as in the table below.
Tip: Changing the SNR results in another offset. So itÂ´s recommended to make an Excelsheet for the calculation.
Are these the exact same values? If not, how and why do they differ?
For further understanding compare the optical to the electrical QPSK.
$$\frac{{E}_{b}}{{N}_{0}}$$
[dB] 
QPSK theoretical
${p}_{b}$ 
QPSK
${p}_{b}$ 

2  1,306E01  
0  7,865E02  
2  3,751E02  
4  1,250E02  
6  2,388E03  
8  1,909E04  
10  3,872E06 
Simulation Settings
The simulation starts with the following default settings.
Those can be changed by pressing the respective icons.
Simulation settings:
Demodulation  Formulas explained
The local laser has the following characteristics:
$\hat{c}=1V;\frac{{{\displaystyle \hat{c}}}^{2}}{2}0.5{V}^{2}\Rightarrow dBm=dBm{V}^{2}$
Optical demodulation differs from the electrical one in that, that the carrier signal is added instead of multiplied.
Below the formulas are explained, which will be used to calculate the signals
$d$_{1}
The signal after the optical coupler:
$d$_{1}
The signal after the photodiode:
$d$_{2}

First the mean of r(t) has to be calculated, since the signal splits into two paths (as shown in the graphic).
In the next step the photodiode squares
$d$_{1}
The first binomial formula can be used to simplify the term.
The pulse shaper generates the average, which results in the detected signal
$d$_{3}
Going forward, the cosineparts of the formula can be discarded. The blue part causes an offset, while the red part equals to $\u2206d\phantom{\rule{0ex}{0ex}}$
For clarification: ${d}_{3}\left(t\right)=\frac{N}{2}{+}\frac{{\hat{r}}^{2}}{4}{+}\frac{{\hat{c}}^{2}}{2}+\frac{2\hat{r}\hat{c}}{\sqrt{2}}{*}\frac{\sqrt{2}}{4}$ 
Detected signal after the adder  
Detected signal after photodiode  
Detected signal after pulse shaper  
$$\widehat{r}$$  Amplitude received signal 
$$\widehat{c}$$  Amplitude carrier signal 
$${S}_{t}$$  Transmission power 
$${S}_{r}$$  Received power 
$$a$$  Transmission / Damping factor 
Noise 
Offset Correction  Formulas explained
Offset correction is based on the mathematical formula of the detected power.
Below the two components of the formula
$d$_{3}
${O}{f}{f}{s}{e}{t}{=}\frac{Na\xb2}{2}{+}\frac{{\hat{r}}^{2}}{4}{+}\frac{{\hat{c}}^{2}}{2}{=}\frac{({S}_{t}+N){a}^{2}}{2}{+}\frac{{\hat{c}}^{2}}{2}$
a is the damping factor and has to be multiplied to the noise.
r is the received amplitude and can be expressed with the transmission power.
$r=\sqrt{2{S}_{t}}a$
Furthermore r has to be squared to fit into the formula.
$\frac{2N{a}^{2}}{4}+\frac{2{S}_{t}{a}^{2}}{4}=\frac{2(N+{S}_{t}){a}^{2}}{4}$
The last step, to get to the finished Offset formula, is to shorten the four with the two.
${\u2206}{d}{=}\frac{2\hat{r}\hat{c}}{\sqrt{2}}\frac{\sqrt{2}}{4}{=}\frac{\hat{r}\hat{c}}{2}{=}\frac{\sqrt{2{S}_{t}}a\hat{c}}{2}$
Here
$\u25b3d$ only requires shortening and replacing the r with the formula mentioned above.
The final step requires a factor v, which describes multiplied with $\u25b3d$ the corrected position of the constellation points in the diagramm, as shown below.


The desired position in the constellation diagram is at 45° from zero, so both values multiplied should result in $\frac{1}{2}\sqrt{2}$, which is also the value of $\mathrm{cos}(45\xb0)$.
$v\xb7\u2206d=\frac{\sqrt{2}}{2}\Rightarrow v\xb7\frac{\sqrt{2{S}_{t}}a\hat{c}}{2}=\frac{\sqrt{2}}{2}\Rightarrow v=\frac{2}{\sqrt{{S}_{t}}2a\hat{c}}$