From c2909a6f6a5ab5499e555dea1d1f7d2394e4aa5b Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 24 Jun 2024 19:05:01 -0400 Subject: [PATCH] Adding 24kHz-wide LSB-D and USB-D modes. --- csdr/chain/analog.py | 8 ++++++++ htdocs/lib/Demodulator.js | 6 ++++-- owrx/dsp.py | 3 +++ owrx/modes.py | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/csdr/chain/analog.py b/csdr/chain/analog.py index 8d9674b6..d250dc50 100644 --- a/csdr/chain/analog.py +++ b/csdr/chain/analog.py @@ -142,3 +142,11 @@ class SAm(BaseDemodulatorChain): ] super().__init__(workers) + +class SsbDigital(BaseDemodulatorChain, HdAudio): + def __init__(self): + workers = [ + RealPart(), + Agc(Format.FLOAT), + ] + super().__init__(workers) diff --git a/htdocs/lib/Demodulator.js b/htdocs/lib/Demodulator.js index 660d90f2..4408348e 100644 --- a/htdocs/lib/Demodulator.js +++ b/htdocs/lib/Demodulator.js @@ -9,6 +9,8 @@ Filter.prototype.getLimits = function() { max_bw = 12500; } else if (['dmr', 'dstar', 'nxdn', 'ysf', 'm17'].indexOf(this.demodulator.get_modulation()) >= 0) { max_bw = 6250; + } else if (['lsbd', 'usbd'].indexOf(this.demodulator.get_modulation()) >= 0) { + max_bw = 24000; } else if (this.demodulator.get_modulation() === 'wfm') { max_bw = 100000; } else if (this.demodulator.get_modulation() === 'drm') { @@ -249,8 +251,8 @@ function Demodulator(offset_frequency, modulation) { this.state = {}; this.secondary_demod = false; var mode = Modes.findByModulation(modulation); - this.low_cut = mode && mode.bandpass && mode.bandpass.low_cut || null; - this.high_cut = mode && mode.bandpass && mode.bandpass.high_cut || null; + this.low_cut = mode && mode.bandpass? mode.bandpass.low_cut : null; + this.high_cut = mode && mode.bandpass? mode.bandpass.high_cut : null; this.ifRate = mode && mode.ifRate; this.listeners = { "frequencychange": [], diff --git a/owrx/dsp.py b/owrx/dsp.py index 8927b3a2..41a7bb81 100644 --- a/owrx/dsp.py +++ b/owrx/dsp.py @@ -619,6 +619,9 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient) elif demod == "empty": from csdr.chain.analog import Empty return Empty() + elif demod in ["usbd", "lsbd"]: + from csdr.chain.analog import SsbDigital + return SsbDigital() def setDemodulator(self, mod): # this kills both primary and secondary demodulators diff --git a/owrx/modes.py b/owrx/modes.py index e4ba2934..8371ea5d 100644 --- a/owrx/modes.py +++ b/owrx/modes.py @@ -124,6 +124,8 @@ class Modes(object): AnalogMode("usb", "USB", bandpass=Bandpass(300, 3000)), AnalogMode("cw", "CW", bandpass=Bandpass(700, 900)), AnalogMode("sam", "SAM", bandpass=Bandpass(-4000, 4000)), + AnalogMode("lsbd", "LSB-D", bandpass=Bandpass(-24000, 0)), + AnalogMode("usbd", "USB-D", bandpass=Bandpass(0, 24000)), AnalogMode("dmr", "DMR", bandpass=Bandpass(-6250, 6250), requirements=["digital_voice_digiham"], squelch=False), AnalogMode( "dstar", "D-Star", bandpass=Bandpass(-3250, 3250), requirements=["digital_voice_digiham"], squelch=False