Skip to content

Commit

Permalink
Merge pull request #892 from darksidelemm/testing
Browse files Browse the repository at this point in the history
Workaround for DFM detection issue.
  • Loading branch information
darksidelemm authored Jun 17, 2024
2 parents 8a23b2d + 0e82fd8 commit 1023c06
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion auto_rx/autorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
# PATCH - Small changes, or minor feature additions.

__version__ = "1.7.3"
__version__ = "1.7.4-beta1"

# Global Variables

Expand Down
3 changes: 2 additions & 1 deletion auto_rx/autorx/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,8 @@ def generate_decoder_command_experimental(self):
if self.save_decode_iq:
demod_cmd += f" tee {self.save_decode_iq_path} |"

demod_cmd += "./fsk_demod --cs16 -b %d -u %d -s --stats=%d 2 %d %d - -" % (
# NOTE - Using inverted soft decision outputs, so DFM type detection works correctly.
demod_cmd += "./fsk_demod --cs16 -b %d -u %d -s -i --stats=%d 2 %d %d - -" % (
_lower,
_upper,
_stats_rate,
Expand Down
14 changes: 13 additions & 1 deletion utils/fsk_demod.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ int main(int argc,char *argv[]){
int nsym = FSK_DEFAULT_NSYM;
int mask = 0;
int tx_tone_separation = 100;
int softinv = 0;

int o = 0;
int opt_idx = 0;
while( o != -1 ){
static struct option long_opts[] = {
{"help", no_argument, 0, 'h'},
{"softinv", no_argument, 0, 'i'},
{"conv", required_argument, 0, 'p'},
{"cs16", no_argument, 0, 'c'},
{"cu8", no_argument, 0, 'd'},
Expand All @@ -96,7 +98,7 @@ int main(int argc,char *argv[]){
{0, 0, 0, 0}
};

o = getopt_long(argc,argv,"fhlp:cdt::sb:u:m",long_opts,&opt_idx);
o = getopt_long(argc,argv,"fhilp:cdt::sb:u:m",long_opts,&opt_idx);

switch(o){
case 'c':
Expand All @@ -110,6 +112,9 @@ int main(int argc,char *argv[]){
case 'f':
testframe_mode = 1;
break;
case 'i':
softinv = 1;
break;
case 't':
enable_stats = 1;
if(optarg != NULL){
Expand Down Expand Up @@ -415,6 +420,13 @@ int main(int argc,char *argv[]){
}

if(soft_dec_mode){
// Invert soft decision polarity.
if(softinv){
for(j=0; j<fsk->Nbits; j++) {
sdbuf[j] = sdbuf[j]*-1.0;
}
}

fwrite(sdbuf,sizeof(float),fsk->Nbits,fout);
}else{
fwrite(bitbuf,sizeof(uint8_t),fsk->Nbits,fout);
Expand Down

0 comments on commit 1023c06

Please sign in to comment.