Skip to content

Commit

Permalink
Return 0 for non_coherent_gain(1)
Browse files Browse the repository at this point in the history
Fixes #323
  • Loading branch information
mhostetter committed Mar 15, 2024
1 parent 16560da commit f0b7196
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sdr/_detection/_non_coherent_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def _non_coherent_gain_in(n_nc: float, snr: float, p_fa: float) -> float:
"""
Solves for the non-coherent gain when the SNR is referenced at the input of the non-coherent integrator.
"""
if n_nc == 1:
return 0.0

sigma2 = 1 # Noise variance (power), sigma^2
A2 = linear(snr) * sigma2 # Signal power, A^2

Expand Down Expand Up @@ -176,6 +179,9 @@ def _non_coherent_gain_out(n_nc: float, snr: float, p_fa: float) -> float:
"""
Solves for the non-coherent gain when the SNR is referenced at the output of the non-coherent integrator.
"""
if n_nc == 1:
return 0.0

sigma2 = 1 # Noise variance (power), sigma^2
A2 = linear(snr) * sigma2 # Signal power, A^2

Expand Down

0 comments on commit f0b7196

Please sign in to comment.