diff --git a/internal/demod/fm.go b/internal/demod/fm.go index 577291e..b3e1222 100644 --- a/internal/demod/fm.go +++ b/internal/demod/fm.go @@ -109,6 +109,20 @@ func RDSBaseband(iq []complex64, sampleRate int) []float32 { return dsp.ApplyFIRReal(out, lp) } +func deemphasis(x []float32, sampleRate int, tau float64) []float32 { + if len(x) == 0 || sampleRate <= 0 { + return x + } + alpha := math.Exp(-1.0 / (float64(sampleRate) * tau)) + out := make([]float32, len(x)) + var y float64 + for i, v := range x { + y = alpha*y + (1-alpha)*float64(v) + out[i] = float32(y) + } + return out +} + func init() { Register(NFM{}) Register(WFM{}) diff --git a/web/app.js b/web/app.js index fed6582..41a3aae 100644 --- a/web/app.js +++ b/web/app.js @@ -92,6 +92,7 @@ const liveListenBtn = qs('liveListenBtn'); let latest = null; let currentConfig = null; +let liveAudio = null; let stats = { buffer_samples: 0, dropped: 0, resets: 0, last_sample_ago_ms: -1 }; let gpuInfo = { available: false, active: false, error: '' }; @@ -1327,3 +1328,5 @@ setInterval(loadGPU, 1000); setInterval(() => fetchEvents(false), 2000); setInterval(fetchRecordings, 5000); setInterval(loadSignals, 1500); +ordings, 5000); +setInterval(loadSignals, 1500);