add a feature flag
This commit is contained in:
parent
664c6e049f
commit
4b61192b36
31
csdr/csdr.py
31
csdr/csdr.py
@ -76,6 +76,8 @@ class output(object):
|
|||||||
|
|
||||||
class dsp(object):
|
class dsp(object):
|
||||||
def __init__(self, output):
|
def __init__(self, output):
|
||||||
|
self.pycsdr_enabled = True
|
||||||
|
|
||||||
self.samp_rate = 250000
|
self.samp_rate = 250000
|
||||||
self.output_rate = 11025
|
self.output_rate = 11025
|
||||||
self.hd_output_rate = 44100
|
self.hd_output_rate = 44100
|
||||||
@ -756,26 +758,27 @@ class dsp(object):
|
|||||||
self.direwolf_config = None
|
self.direwolf_config = None
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
if self.demodulator == "fft":
|
if self.pycsdr_enabled:
|
||||||
with self.modification_lock:
|
if self.demodulator == "fft":
|
||||||
if self.running:
|
with self.modification_lock:
|
||||||
return
|
if self.running:
|
||||||
self.running = True
|
return
|
||||||
|
self.running = True
|
||||||
|
|
||||||
nc = SocketClient(self.nc_port)
|
nc = SocketClient(self.nc_port)
|
||||||
|
|
||||||
fft = Fft(self.fft_size, int(self.fft_block_size()))
|
fft = Fft(self.fft_size, int(self.fft_block_size()))
|
||||||
fft.setInput(nc.getBuffer())
|
fft.setInput(nc.getBuffer())
|
||||||
|
|
||||||
lap = LogAveragePower(-70, self.fft_size, self.fft_averages)
|
lap = LogAveragePower(-70, self.fft_size, self.fft_averages)
|
||||||
lap.setInput(fft.getBuffer())
|
lap.setInput(fft.getBuffer())
|
||||||
|
|
||||||
fes = FftExchangeSides(fft_size=self.fft_size)
|
fes = FftExchangeSides(fft_size=self.fft_size)
|
||||||
fes.setInput(lap.getBuffer())
|
fes.setInput(lap.getBuffer())
|
||||||
|
|
||||||
self.output.send_output("audio", fes.getBuffer().read)
|
self.output.send_output("audio", fes.getBuffer().read)
|
||||||
|
|
||||||
return
|
return
|
||||||
with self.modification_lock:
|
with self.modification_lock:
|
||||||
if self.running:
|
if self.running:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user