Procházet zdrojové kódy

feat: add analysis level metadata

master
Jan Svabenik před 8 hodinami
rodič
revize
07a92a0b6a
3 změnil soubory, kde provedl 30 přidání a 0 odebrání
  1. +18
    -0
      cmd/sdrd/pipeline_runtime.go
  2. +11
    -0
      internal/pipeline/phases.go
  3. +1
    -0
      internal/pipeline/phases_test.go

+ 18
- 0
cmd/sdrd/pipeline_runtime.go Zobrazit soubor

@@ -219,7 +219,16 @@ func (rt *dspRuntime) buildSurveillanceResult(art *spectrumArtifacts) pipeline.S
policy := pipeline.PolicyFromConfig(rt.cfg)
candidates := pipeline.CandidatesFromSignals(art.detected, "surveillance-detector")
scheduled := pipeline.ScheduleCandidates(candidates, policy)
level := pipeline.AnalysisLevel{
Name: "surveillance",
SampleRate: rt.cfg.SampleRate,
FFTSize: rt.cfg.Surveillance.AnalysisFFTSize,
CenterHz: rt.cfg.CenterHz,
SpanHz: float64(rt.cfg.SampleRate),
Source: "baseband",
}
return pipeline.SurveillanceResult{
Level: level,
Candidates: candidates,
Scheduled: scheduled,
Finished: art.finished,
@@ -262,7 +271,16 @@ func (rt *dspRuntime) buildRefinementInput(surv pipeline.SurveillanceResult) pip
Source: windowSource,
})
}
level := pipeline.AnalysisLevel{
Name: "refinement",
SampleRate: rt.cfg.SampleRate,
FFTSize: rt.cfg.FFTSize,
CenterHz: rt.cfg.CenterHz,
SpanHz: float64(rt.cfg.SampleRate),
Source: "refinement-window",
}
input := pipeline.RefinementInput{
Level: level,
Candidates: append([]pipeline.Candidate(nil), surv.Candidates...),
Scheduled: scheduled,
Plan: plan,


+ 11
- 0
internal/pipeline/phases.go Zobrazit soubor

@@ -2,7 +2,17 @@ package pipeline

import "sdr-wideband-suite/internal/detector"

type AnalysisLevel struct {
Name string `json:"name"`
SampleRate int `json:"sample_rate"`
FFTSize int `json:"fft_size"`
CenterHz float64 `json:"center_hz"`
SpanHz float64 `json:"span_hz"`
Source string `json:"source,omitempty"`
}

type SurveillanceResult struct {
Level AnalysisLevel `json:"level"`
Candidates []Candidate `json:"candidates"`
Scheduled []ScheduledCandidate `json:"scheduled,omitempty"`
Finished []detector.Event `json:"finished"`
@@ -21,6 +31,7 @@ type RefinementPlan struct {
}

type RefinementInput struct {
Level AnalysisLevel `json:"level"`
Candidates []Candidate `json:"candidates,omitempty"`
Scheduled []ScheduledCandidate `json:"scheduled,omitempty"`
Plan RefinementPlan `json:"plan,omitempty"`


+ 1
- 0
internal/pipeline/phases_test.go Zobrazit soubor

@@ -29,6 +29,7 @@ func TestSurveillanceResultCarriesScheduledCandidates(t *testing.T) {

func TestRefinementInputCarriesScheduledCandidates(t *testing.T) {
res := RefinementInput{
Level: AnalysisLevel{Name: "refinement"},
Candidates: []Candidate{{ID: 2}},
Scheduled: []ScheduledCandidate{{Candidate: Candidate{ID: 2}, Priority: 4}},
Plan: RefinementPlan{


Načítá se…
Zrušit
Uložit