Add new command line option (-f) to set simulated signal's frequency offset.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8395 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2018-01-04 17:40:33 +00:00
parent 62eabdba8e
commit 3ea288b97a

View File

@ -20,6 +20,7 @@ void usage() {
printf("Options:\n"); printf("Options:\n");
printf(" -c (print channel symbols)\n"); printf(" -c (print channel symbols)\n");
printf(" -d (print packed data with zero tail - 11 bytes)\n"); printf(" -d (print packed data with zero tail - 11 bytes)\n");
printf(" -f x (-100 Hz < f < 100 Hz)\n");
printf(" -o filename (write a c2 file with this name)\n"); printf(" -o filename (write a c2 file with this name)\n");
printf(" -s x (x is snr of signal that is written to .c2 file)\n"); printf(" -s x (x is snr of signal that is written to .c2 file)\n");
printf("\n"); printf("\n");
@ -126,6 +127,7 @@ int main(int argc, char *argv[])
extern int optind; extern int optind;
int i, c, printchannel=0, writec2=0; int i, c, printchannel=0, writec2=0;
float snr=50.0; float snr=50.0;
float f0=0.0, t0=1.0;
char *message, *c2filename, *hashtab; char *message, *c2filename, *hashtab;
c2filename=malloc(sizeof(char)*15); c2filename=malloc(sizeof(char)*15);
hashtab=malloc(sizeof(char)*32768*13); hashtab=malloc(sizeof(char)*32768*13);
@ -138,7 +140,7 @@ int main(int argc, char *argv[])
srand(getpid()); srand(getpid());
while ( (c = getopt(argc, argv, "cdo:s:")) !=-1 ) { while ( (c = getopt(argc, argv, "cdf:o:s:")) !=-1 ) {
switch (c) { switch (c) {
case 'c': case 'c':
printchannel=1; printchannel=1;
@ -146,6 +148,8 @@ int main(int argc, char *argv[])
case 'd': case 'd':
printdata=1; printdata=1;
break; break;
case 'f':
f0 = atof(optarg);
case 'o': case 'o':
c2filename = optarg; c2filename = optarg;
writec2=1; writec2=1;
@ -193,9 +197,6 @@ int main(int argc, char *argv[])
snr=1.0; snr=1.0;
} }
float f0, t0;
f0=0.0;
t0=1.0;
add_signal_vector(f0, t0, snr, channel_symbols, isig, qsig); add_signal_vector(f0, t0, snr, channel_symbols, isig, qsig);
if( writec2) { if( writec2) {
// write a .c2 file // write a .c2 file