|
|
|
@@ -8,25 +8,33 @@ import ( |
|
|
|
// Candidate is the coarse output of the surveillance detector. |
|
|
|
// It intentionally stays lightweight and cheap to produce. |
|
|
|
type Candidate struct { |
|
|
|
ID int64 `json:"id"` |
|
|
|
CenterHz float64 `json:"center_hz"` |
|
|
|
BandwidthHz float64 `json:"bandwidth_hz"` |
|
|
|
PeakDb float64 `json:"peak_db"` |
|
|
|
SNRDb float64 `json:"snr_db"` |
|
|
|
FirstBin int `json:"first_bin"` |
|
|
|
LastBin int `json:"last_bin"` |
|
|
|
NoiseDb float64 `json:"noise_db,omitempty"` |
|
|
|
Source string `json:"source,omitempty"` |
|
|
|
Hint string `json:"hint,omitempty"` |
|
|
|
ID int64 `json:"id"` |
|
|
|
CenterHz float64 `json:"center_hz"` |
|
|
|
BandwidthHz float64 `json:"bandwidth_hz"` |
|
|
|
PeakDb float64 `json:"peak_db"` |
|
|
|
SNRDb float64 `json:"snr_db"` |
|
|
|
FirstBin int `json:"first_bin"` |
|
|
|
LastBin int `json:"last_bin"` |
|
|
|
NoiseDb float64 `json:"noise_db,omitempty"` |
|
|
|
Source string `json:"source,omitempty"` |
|
|
|
Hint string `json:"hint,omitempty"` |
|
|
|
} |
|
|
|
|
|
|
|
// RefinementWindow describes the local analysis span that refinement should use. |
|
|
|
type RefinementWindow struct { |
|
|
|
CenterHz float64 `json:"center_hz"` |
|
|
|
SpanHz float64 `json:"span_hz"` |
|
|
|
Source string `json:"source,omitempty"` |
|
|
|
} |
|
|
|
|
|
|
|
// Refinement contains higher-cost local analysis derived from a candidate. |
|
|
|
type Refinement struct { |
|
|
|
Candidate Candidate `json:"candidate"` |
|
|
|
Signal detector.Signal `json:"signal"` |
|
|
|
SnippetRate int `json:"snippet_rate"` |
|
|
|
Class *classifier.Classification `json:"class,omitempty"` |
|
|
|
Stage string `json:"stage,omitempty"` |
|
|
|
Candidate Candidate `json:"candidate"` |
|
|
|
Window RefinementWindow `json:"window"` |
|
|
|
Signal detector.Signal `json:"signal"` |
|
|
|
SnippetRate int `json:"snippet_rate"` |
|
|
|
Class *classifier.Classification `json:"class,omitempty"` |
|
|
|
Stage string `json:"stage,omitempty"` |
|
|
|
} |
|
|
|
|
|
|
|
func CandidatesFromSignals(signals []detector.Signal, source string) []Candidate { |
|
|
|
|