Wideband autonomous SDR analysis engine forked from sdr-visual-suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 line
642B

  1. package cfar
  2. // Mode selects the CFAR algorithm variant.
  3. type Mode string
  4. const (
  5. ModeOff Mode = "OFF"
  6. ModeCA Mode = "CA"
  7. ModeOS Mode = "OS"
  8. ModeGOSCA Mode = "GOSCA"
  9. ModeCASO Mode = "CASO"
  10. )
  11. // Config holds all CFAR parameters.
  12. type Config struct {
  13. Mode Mode
  14. GuardCells int
  15. TrainCells int
  16. Rank int
  17. ScaleDb float64
  18. WrapAround bool
  19. }
  20. // CFAR computes adaptive thresholds for a spectrum.
  21. type CFAR interface {
  22. // Thresholds returns per-bin detection thresholds in dB.
  23. // spectrum is power in dB, length n.
  24. // Returned slice has length n. No NaN values.
  25. Thresholds(spectrum []float64) []float64
  26. }