513738f29e8e4c9db5724d4b09141850390cdb7b
[4yp.git] / chromaticDispersionTest.m
1 Rsym = 2.5e10; % symbol/sec
2 sps = 4; % samples/symbol
3 fs = Rsym * sps; % sampling freq (Hz)
4 Tsamp = 1 / fs;
5
6 x = 10 * normpdf(1:30, 10, 3);
7
8 xCD = chromaticDispersion(x, 20, 1550, 30, Tsamp);
9
10 figure(10001);
11 subplot(121);
12 plot(abs(x) .^ 2);
13 axis([0 30 -Inf Inf]);
14 title('Before dispersion');
15 ylabel('Power (arb. unit)');
16 xlabel('Time (arb. unit)');
17 subplot(122);
18 plot(abs(xCD) .^ 2)
19 axis([20 50 -Inf Inf]);
20 title('After dispersion');
21 xlabel('Time (arb.~unit)');
22 ylabel('Power (arb.~unit)');
23
24 subplot(121);
25 formatFigure;
26 subplot(122)
27 formatFigure;
28 set(figure(10001), 'Units', 'centimeters', ...
29     'Position', [0 0 24 8], 'PaperPositionMode', 'auto');
30 subplot(121);
31 set(gca, 'XTick', 0:5:30);
32 subplot(122);
33 set(gca, 'XTick', 20:5:50);
34
35 %saveas(gcf, 'dispersionTest.png');