Kaynağa Gözat

feat: surface refinement plan in spectrum debug

master
Jan Svabenik 9 saat önce
ebeveyn
işleme
301897fb1b
2 değiştirilmiş dosya ile 11 ekleme ve 4 silme
  1. +6
    -1
      cmd/sdrd/dsp_loop.go
  2. +5
    -3
      cmd/sdrd/types.go

+ 6
- 1
cmd/sdrd/dsp_loop.go Dosyayı Görüntüle

@@ -105,7 +105,9 @@ func runDSP(ctx context.Context, srcMgr *sourceManager, cfg config.Config, det *
rec.OnEvents(evCopy)
}
var debugInfo *SpectrumDebug
if len(thresholds) > 0 || len(displaySignals) > 0 || noiseFloor != 0 {
plan := state.refinementInput.Plan
hasPlan := plan.TotalCandidates > 0 || plan.Budget > 0 || plan.DroppedBySNR > 0 || plan.DroppedByBudget > 0
if len(thresholds) > 0 || len(displaySignals) > 0 || noiseFloor != 0 || hasPlan {
scoreDebug := make([]map[string]any, 0, len(displaySignals))
for _, s := range displaySignals {
if s.Class == nil || len(s.Class.Scores) == 0 {
@@ -125,6 +127,9 @@ func runDSP(ctx context.Context, srcMgr *sourceManager, cfg config.Config, det *
})
}
debugInfo = &SpectrumDebug{Thresholds: thresholds, NoiseFloor: noiseFloor, Scores: scoreDebug}
if hasPlan {
debugInfo.RefinementPlan = &plan
}
}
h.broadcast(SpectrumFrame{Timestamp: art.now.UnixMilli(), CenterHz: rt.cfg.CenterHz, SampleHz: rt.cfg.SampleRate, FFTSize: rt.cfg.FFTSize, Spectrum: art.spectrum, Signals: displaySignals, Debug: debugInfo})
}


+ 5
- 3
cmd/sdrd/types.go Dosyayı Görüntüle

@@ -9,13 +9,15 @@ import (
"sdr-wideband-suite/internal/config"
"sdr-wideband-suite/internal/demod/gpudemod"
"sdr-wideband-suite/internal/detector"
"sdr-wideband-suite/internal/pipeline"
"sdr-wideband-suite/internal/sdr"
)

type SpectrumDebug struct {
Thresholds []float64 `json:"thresholds,omitempty"`
NoiseFloor float64 `json:"noise_floor,omitempty"`
Scores []map[string]any `json:"scores,omitempty"`
Thresholds []float64 `json:"thresholds,omitempty"`
NoiseFloor float64 `json:"noise_floor,omitempty"`
Scores []map[string]any `json:"scores,omitempty"`
RefinementPlan *pipeline.RefinementPlan `json:"refinement_plan,omitempty"`
}

type SpectrumFrame struct {


Yükleniyor…
İptal
Kaydet