I have a measurement of the complex part of the refractive index $k$ (where the refractive index is $m = n + i\,k$) measured at a nonlinear grid of wavelengths or frequencies that span several orders of magnitude.
Given $k$, $n$ should be derived from the Kramers-Kronig relations.
However, using a test data set where $n$ is known, I do not recover the correct solution. Any idea what I'm doing wrong (
nu = frequency array)?
import scipy.fftpack as ft plt.loglog(nu, n, label='n') plt.loglog(nu, k, label='k') plt.loglog(nu, 1.0 + ft.hilbert(k) / np.pi, label='n from k (orig. grid)') plt.xlabel('frequency [Hz]') plt.legend()