From 3ea288b97a8e781a440789abf2e5f1a4bca5abb2 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Thu, 4 Jan 2018 17:40:33 +0000 Subject: [PATCH] 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 --- lib/wsprd/wsprsim.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/wsprd/wsprsim.c b/lib/wsprd/wsprsim.c index e1a63613e..b3af99809 100644 --- a/lib/wsprd/wsprsim.c +++ b/lib/wsprd/wsprsim.c @@ -20,6 +20,7 @@ void usage() { printf("Options:\n"); printf(" -c (print channel symbols)\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(" -s x (x is snr of signal that is written to .c2 file)\n"); printf("\n"); @@ -126,6 +127,7 @@ int main(int argc, char *argv[]) extern int optind; int i, c, printchannel=0, writec2=0; float snr=50.0; + float f0=0.0, t0=1.0; char *message, *c2filename, *hashtab; c2filename=malloc(sizeof(char)*15); hashtab=malloc(sizeof(char)*32768*13); @@ -138,7 +140,7 @@ int main(int argc, char *argv[]) srand(getpid()); - while ( (c = getopt(argc, argv, "cdo:s:")) !=-1 ) { + while ( (c = getopt(argc, argv, "cdf:o:s:")) !=-1 ) { switch (c) { case 'c': printchannel=1; @@ -146,6 +148,8 @@ int main(int argc, char *argv[]) case 'd': printdata=1; break; + case 'f': + f0 = atof(optarg); case 'o': c2filename = optarg; writec2=1; @@ -193,9 +197,6 @@ int main(int argc, char *argv[]) snr=1.0; } - float f0, t0; - f0=0.0; - t0=1.0; add_signal_vector(f0, t0, snr, channel_symbols, isig, qsig); if( writec2) { // write a .c2 file