In the paper, The averaging method for finding exactly periodic dispersion-managed solitons , there is an expression for the chirp $C$ of a signal given by-
$C = \frac{\text{Im}\int_{-\infty}^{\infty} u^2u_t^2 dt}{|u|^4dt}$
I am writing a program to calculate the chirp on MATLAB. The chirp function I have written so far is-
function c = chirp(signal)
u = signal;
ut = gradient(signal);
utc = conj(ut);
numval = imag(sum(u.^2 .* utc.^2));
denval = sum(abs(u).^4);
c = numval/denval;
end
However, this is giving incorrect answers. Any help pointing me in the right direction would be much appreciated.