Rsym = 2.5e10; % symbol/sec sps = 4; % samples/symbol fs = Rsym * sps; % sampling freq (Hz) Tsamp = 1 / fs; x = 10 * normpdf(1:30, 10, 3); xCD = chromaticDispersion(x, 20, 1550, 30, Tsamp); figure(10001); subplot(121); plot(abs(x) .^ 2); axis([0 30 -Inf Inf]); title('Before dispersion'); ylabel('Power (arb. unit)'); xlabel('Time (arb. unit)'); subplot(122); plot(abs(xCD) .^ 2) axis([20 50 -Inf Inf]); title('After dispersion'); xlabel('Time (arb.~unit)'); ylabel('Power (arb.~unit)'); subplot(121); formatFigure; subplot(122) formatFigure; set(figure(10001), 'Units', 'centimeters', ... 'Position', [0 0 24 8], 'PaperPositionMode', 'auto'); subplot(121); set(gca, 'XTick', 0:5:30); subplot(122); set(gca, 'XTick', 20:5:50); %saveas(gcf, 'dispersionTest.png');