# MATLAB - ¿how do I perform the "backpropagation compensation" process on a sine signal?

#### nessatinuviel

Joined Dec 1, 2020
3
hi, i've been studying a bit the "back propagation compensation" process seen in fiber optics, and i need to try this same process but with a normal signal, for example: a sinusoidal.

but I have not managed to get the code to work with respect to a sinusoidal signal (the code performs the process with gaussian pulses and the change I want: is that it does the process with a sinusoidal). I've tried, in various ways, but it doesn't work for me.

this is the code for backpropagation compensation with gaussian pulses
Code:
%%%% Compensación de retropropagación

clc;
%%%%%%%%Input parameters%%%%%%%%
R = 10e9; % Tasa de transmisión
Tb = 1 / R; % Tiempo de bit
% sec = randint (1, n_bits); % Secuencia de "1" y "0"
seg = [0 1 0];
n_bits = longitud (seg); % Número de bits
w = 2 * pi * 1 / Tb; % Frecuencia angular
Fs = 64 / Tb; % Frecuencia de Muestreo
Ts = 1 / Fs; % Tiempo de bit
Nmpb = (Tb / Ts) +1; % Número de muestras por bit
Nmps = Nmpb * n_bits; % Número de muestras de toda la secuencia
b2 = -21,6 * (1e-12 ^ 2) / 1e3; % [ps.ps/km]
b3 = 0.117*(1e-12^3)/1e3;                       %[ps.ps.ps/km]
Dz = 10e3;

%%%%%%%%Gaussian pulse sequence%%%%%%%%
To=Tb/8;                                        %Anchura del pulso gaussiano
t=-Tb/2:Ts:Tb/2;                                %Intervalo pulso gaussiano
C=0;                                            %Chirp
for i=1:length(sec)
At=(t/To).^2;                                                               %Parte de la función del pulso gaussiano
p_gauss(i*Nmpb-Nmpb+1:i*Nmpb)=[sec(i)*exp(-(1/2)*(1+j*C)*At)];              %Función de la secuencia de pulsos gaussianos
end
t1=0:Ts:(Nmps-1)*Ts;
plot(t1,p_gauss,'r');
hold on

%%%%%%%%Fiber Function%%%%%%%%%%%%%%%%%%%
n = 0:Nmps-1;
w = 2*pi*(n-Nmps/2)*Fs/Nmps;

Hd = exp(j*0.5*b2*Dz*w.*w - j*b3*w.*w.*w*Dz/6);   % Función de la fibra en el dominio de la frecuencia
AouF = fftshift(fft(p_gauss)).*Hd;
Aou = ifft(fftshift(AouF));
plot(t1,abs(Aou),'g');
% Aou = Fiber_L_A(p_gauss,1/Ts,[b2,b3],Dz);
% plot(t1,abs(Aou),'g');
and this is for example: my continuous sine signal:
signal sen:
Fs = 10000;
T =3*(1/100);
t = 0:1/Fs:T-1/Fs;
x = 5*sin(2*pi*100*t);