- sdr.coherent_gain_loss(time: ArrayLike, freq: ArrayLike) NDArray[float64]
Computes the coherent gain loss (CGL) given a time or frequency offset.
Notes
Coherent gain loss is the reduction in SNR due to time or frequency offsets during coherent integration. These losses are similar to scalloping loss.
The coherent gain loss of a signal integrated for \(T_c\) seconds with a frequency offset of \(\Delta f\) Hz is
\[\text{CGL} = -10 \log_{10} \left( \text{sinc}^2 \left( T_c \Delta f \right) \right) ,\]where the sinc function is defined as
\[\text{sinc}(x) = \frac{\sin(\pi x)}{\pi x} .\]The coherent gain loss of a signal with bandwidth \(B_c\) Hz with a detection time offset of \(\Delta t\) seconds is
\[\text{CGL} = -10 \log_{10} \left( \text{sinc}^2 \left( \Delta t B_c \right) \right) .\]Examples
Compute the coherent gain loss for an integration time of 1 ms and a frequency offset of 235 Hz.
In [1]: sdr.coherent_gain_loss(1e-3, 235) Out[1]: 0.8038919141626675
Compute the coherent gain loss for a signal with 1 MHz of bandwidth and a detection time offset of 0.25 μs.
In [2]: sdr.coherent_gain_loss(0.25e-6, 1e6) Out[2]: 0.9120975839632417
Compute the coherent gain loss of a signal detected between two DFT bins. This is commonly referred as the DFT scalloping loss. Suppose the DFT is 1 ms long, then the bin spacing is 1 kHz. The worst case scalloping loss occurs at 1/2 bin spacing, or 500 Hz in this example. Scalloping loss of 3.9 dB for an unwindowed DFT is a well-known figure.
In [3]: t_c = 1e-3 # s In [4]: sdr.coherent_gain_loss(t_c, 1 / t_c / 2) Out[4]: 3.9223975406030527
If the DFT is zero-padded to twice the length, the scalloping loss is reduced to 0.9 dB.
In [5]: t_c = 1e-3 # s In [6]: sdr.coherent_gain_loss(t_c, 1 / (2 * t_c) / 2) Out[6]: 0.9120975839632417
Compute the coherent gain loss for an integration time of 1 ms and an array of frequency offsets.
In [7]: sdr.coherent_gain_loss(1e-3, [0, 100, 200, 300, 400, 500]) Out[7]: array([-0. , 0.14335017, 0.57922366, 1.32626966, 2.42007077, 3.92239754])
Plot coherent gain loss as a function of frequency offset.
In [8]: f = np.linspace(0, 2e3, 1001) In [9]: plt.figure(); \ ...: plt.plot(f, sdr.coherent_gain_loss(0.5e-3, f), label="0.5 ms"); \ ...: plt.plot(f, sdr.coherent_gain_loss(1e-3, f), label="1 ms"); \ ...: plt.plot(f, sdr.coherent_gain_loss(2e-3, f), label="2 ms"); \ ...: plt.legend(title="Integration time"); \ ...: plt.ylim(-5, 55); \ ...: plt.xlabel("Frequency offset (Hz)"); \ ...: plt.ylabel("Coherent gain loss (dB)"); \ ...: plt.title("Coherent gain loss for various integration times"); ...:
Plot coherent gain loss as a function of integration time.
In [10]: t = np.linspace(0, 1e-2, 1001) In [11]: plt.figure(); \ ....: plt.plot(t * 1e3, sdr.coherent_gain_loss(t, 100), label="100 Hz"); \ ....: plt.plot(t * 1e3, sdr.coherent_gain_loss(t, 200), label="200 Hz"); \ ....: plt.plot(t * 1e3, sdr.coherent_gain_loss(t, 400), label="400 Hz"); \ ....: plt.legend(title="Frequency offset"); \ ....: plt.ylim(-5, 55); \ ....: plt.xlabel("Integration time (ms)"); \ ....: plt.ylabel("Coherent gain loss (dB)"); \ ....: plt.title("Coherent gain loss for various frequency offsets"); ....: