activate fft averaging on the secondary fft

This commit is contained in:
Jakob Ketterl 2020-09-17 22:43:39 +02:00
parent 6a6d4a3c9b
commit b9e19421c1
3 changed files with 10 additions and 4 deletions

View File

@ -83,7 +83,7 @@ audio_compression = "adpcm" # valid values: "adpcm", "none"
fft_compression = "adpcm" # valid values: "adpcm", "none" fft_compression = "adpcm" # valid values: "adpcm", "none"
digimodes_enable = True # Decoding digimodes come with higher CPU usage. digimodes_enable = True # Decoding digimodes come with higher CPU usage.
digimodes_fft_size = 1024 digimodes_fft_size = 2048
# determines the quality, and thus the cpu usage, for the ambe codec used by digital voice modes # determines the quality, and thus the cpu usage, for the ambe codec used by digital voice modes
# if you're running on a Raspi (up to 3B+) you'll want to leave this on 1 # if you're running on a Raspi (up to 3B+) you'll want to leave this on 1

View File

@ -279,7 +279,9 @@ class dsp(object):
if which == "fft": if which == "fft":
chain += [ chain += [
"csdr fft_cc {secondary_fft_input_size} {secondary_fft_block_size}", "csdr fft_cc {secondary_fft_input_size} {secondary_fft_block_size}",
"csdr logpower_cf -70", "csdr logpower_cf -70"
if self.fft_averages == 0
else "csdr logaveragepower_cf -70 {secondary_fft_size} {fft_averages}",
"csdr fft_exchange_sides_ff {secondary_fft_input_size}", "csdr fft_exchange_sides_ff {secondary_fft_input_size}",
] ]
if self.fft_compression == "adpcm": if self.fft_compression == "adpcm":
@ -318,7 +320,10 @@ class dsp(object):
self.restart() self.restart()
def secondary_fft_block_size(self): def secondary_fft_block_size(self):
if self.fft_averages == 0:
return (self.samp_rate / self.decimation) / self.fft_fps return (self.samp_rate / self.decimation) / self.fft_fps
else:
return (self.samp_rate / self.decimation) / self.fft_fps / self.fft_averages
def secondary_decimation(self): def secondary_decimation(self):
return 1 # currently unused return 1 # currently unused
@ -383,6 +388,7 @@ class dsp(object):
secondary_fft_input_size=self.secondary_fft_size, secondary_fft_input_size=self.secondary_fft_size,
secondary_fft_size=self.secondary_fft_size, secondary_fft_size=self.secondary_fft_size,
secondary_fft_block_size=self.secondary_fft_block_size(), secondary_fft_block_size=self.secondary_fft_block_size(),
fft_averages=self.fft_averages,
) )
logger.debug("secondary command (fft) = %s", secondary_command_fft) logger.debug("secondary command (fft) = %s", secondary_command_fft)

View File

@ -1519,7 +1519,7 @@ function initPanels() {
|___/ |___/
*/ */
var secondary_demod_fft_offset_db = 30; //need to calculate that later var secondary_demod_fft_offset_db = 18; //need to calculate that later
var secondary_demod_canvases_initialized = false; var secondary_demod_canvases_initialized = false;
var secondary_demod_listbox_updating = false; var secondary_demod_listbox_updating = false;
var secondary_demod_channel_freq = 1000; var secondary_demod_channel_freq = 1000;