Add ppm_error option

This commit is contained in:
Jared Szechy 2021-01-21 23:14:04 -05:00
parent 5324d53c47
commit f383d165fd
3 changed files with 10 additions and 1 deletions

View File

@ -89,6 +89,7 @@ typedef struct
PaStream* audio_in_pa_stream;
#endif
uint32_t rtlsdr_center_freq;
int rtlsdr_ppm_error;
int audio_in_type; // 0 for device, 1 for file, 2 for portaudio, 3 for rtlsdr
char audio_out_dev[1024];
int audio_out_fd;

View File

@ -275,6 +275,7 @@ usage ()
printf (" -w <file> Output synthesized speech to a .wav file\n");
printf (" -a Display port audio devices\n");
printf (" -c <hertz> RTL-SDR center frequency\n");
printf (" -P <num> RTL-SDR ppm error (default = 0)\n");
printf ("\n");
printf ("Scanner control options:\n");
printf (" -B <num> Serial port baud rate (default=115200)\n");
@ -513,7 +514,7 @@ main (int argc, char **argv)
exitflag = 0;
signal (SIGINT, sigfun);
while ((c = getopt (argc, argv, "haep:qstv:z:i:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:rl")) != -1)
while ((c = getopt (argc, argv, "haep:P:qstv:z:i:o:d:c:g:nw:B:C:R:f:m:u:x:A:S:M:rl")) != -1)
{
opterr = 0;
switch (c)
@ -550,6 +551,9 @@ main (int argc, char **argv)
opts.unmute_encrypted_p25 = 1;
}
break;
case 'P':
sscanf (optarg, "%i", &opts.rtlsdr_ppm_error);
break;
case 'q':
opts.errorbars = 0;
opts.verbose = 0;

View File

@ -901,6 +901,10 @@ void open_rtlsdr_stream(dsd_opts *opts)
controller.freq_len++;
}
if (opts->rtlsdr_ppm_error > 0) {
dongle.ppm_error = opts->rtlsdr_ppm_error;
}
/* quadruple sample_rate to limit to Δθ to ±π/2 */
demod.rate_in *= demod.post_downsample;