1 function [xCD, kstart] = chromaticDispersion(x, D, lambda, z, Tsamp)
2 %% Simulate chromatic dispersion.
4 %% - x: input waveform (pulse-shaped)
5 %% - D: dispersion coefficient (ps / (nm km))
6 %% - lambda: wavelength (nm)
7 %% - z: length of fibre (km)
8 %% - Tsamp: sampling time (s)
10 %% - xCD: x after being dispersed. Energy of xCD is not normalized.
11 %% - kstart: starting index of the discrete signal
13 %% Convert everything to SI base units
16 lambda = lambda * 1e-9; % m
19 %% kmax: maximum k at which to sample the inpulse response.
20 %% See [1] Eq. (8), noting that the same omega (Eq. (7))
21 %% can be used for dispersion and dispersion compensation,
22 %% as phi(t) is the same in both Eqs. (5) and (6).
23 kmax = floor(abs(D) * lambda^2 * z / (2 * c * Tsamp^2));
24 k = -kmax : kmax; % index for discrete function
29 g = sqrt(c / (j * D * lambda^2 * z)) * ...
30 exp(j * pi * c / (D * lambda^2 * z) * t .^ 2);
37 %% [1]: S.J. Savory, Digital filters for coherent optical receivers, 2008.