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(1); subplot(211); plot(abs(x) .^ 2); axis([0 30 -Inf Inf]); title('Before dispersion'); ylabel('Power (arb. unit)'); subplot(212); plot(abs(xCD) .^ 2) axis([20 50 -Inf Inf]); title('After dispersion'); xlabel('Time (arb. unit)'); ylabel('Power (arb. unit)'); %saveas(gcf, 'dispersionTest.png');