@@ -77,12 +77,14 @@ int main(int argc,char *argv[]){
7777 int nsym = FSK_DEFAULT_NSYM ;
7878 int mask = 0 ;
7979 int tx_tone_separation = 100 ;
80+ int softinv = 0 ;
8081
8182 int o = 0 ;
8283 int opt_idx = 0 ;
8384 while ( o != -1 ){
8485 static struct option long_opts [] = {
8586 {"help" , no_argument , 0 , 'h' },
87+ {"softinv" , no_argument , 0 , 'i' },
8688 {"conv" , required_argument , 0 , 'p' },
8789 {"cs16" , no_argument , 0 , 'c' },
8890 {"cu8" , no_argument , 0 , 'd' },
@@ -96,7 +98,7 @@ int main(int argc,char *argv[]){
9698 {0 , 0 , 0 , 0 }
9799 };
98100
99- o = getopt_long (argc ,argv ,"fhlp :cdt::sb:u:m" ,long_opts ,& opt_idx );
101+ o = getopt_long (argc ,argv ,"fhilp :cdt::sb:u:m" ,long_opts ,& opt_idx );
100102
101103 switch (o ){
102104 case 'c' :
@@ -110,6 +112,9 @@ int main(int argc,char *argv[]){
110112 case 'f' :
111113 testframe_mode = 1 ;
112114 break ;
115+ case 'i' :
116+ softinv = 1 ;
117+ break ;
113118 case 't' :
114119 enable_stats = 1 ;
115120 if (optarg != NULL ){
@@ -415,6 +420,13 @@ int main(int argc,char *argv[]){
415420 }
416421
417422 if (soft_dec_mode ){
423+ // Invert soft decision polarity.
424+ if (softinv ){
425+ for (j = 0 ; j < fsk -> Nbits ; j ++ ) {
426+ sdbuf [j ] = sdbuf [j ]* -1.0 ;
427+ }
428+ }
429+
418430 fwrite (sdbuf ,sizeof (float ),fsk -> Nbits ,fout );
419431 }else {
420432 fwrite (bitbuf ,sizeof (uint8_t ),fsk -> Nbits ,fout );
0 commit comments