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.

44 lines
1.3KB

  1. package classifier
  2. // SignalClass is a coarse modulation label.
  3. type SignalClass string
  4. const (
  5. ClassAM SignalClass = "AM"
  6. ClassNFM SignalClass = "NFM"
  7. ClassWFM SignalClass = "WFM"
  8. ClassSSBUSB SignalClass = "USB"
  9. ClassSSBLSB SignalClass = "LSB"
  10. ClassCW SignalClass = "CW"
  11. ClassNoise SignalClass = "NOISE"
  12. ClassUnknown SignalClass = "UNKNOWN"
  13. )
  14. // Features are lightweight spectral features derived from a signal slice.
  15. type Features struct {
  16. // Spectral
  17. BW3dB float64 `json:"bw_3db_hz"`
  18. BW90 float64 `json:"bw_90_hz"`
  19. SpectralFlat float64 `json:"spectral_flat"`
  20. PeakToAvg float64 `json:"peak_to_avg_db"`
  21. Symmetry float64 `json:"symmetry"`
  22. RolloffLeft float64 `json:"rolloff_left_db_khz"`
  23. RolloffRight float64 `json:"rolloff_right_db_khz"`
  24. }
  25. // Classification is the classifier output attached to signals/events.
  26. type Classification struct {
  27. ModType SignalClass `json:"mod_type"`
  28. Confidence float64 `json:"confidence"`
  29. BW3dB float64 `json:"bw_3db_hz"`
  30. Features Features `json:"features,omitempty"`
  31. SecondBest SignalClass `json:"second_best,omitempty"`
  32. }
  33. // SignalInput is the minimal input needed for classification.
  34. type SignalInput struct {
  35. FirstBin int
  36. LastBin int
  37. SNRDb float64
  38. }