new options to control filters and P25 encrypted signals

I have added the -l and -pu options.
This commit is contained in:
Alex Mirea 2013-04-10 09:05:56 +03:00
parent fa73feded2
commit 20271c6df5
6 changed files with 26 additions and 7 deletions

4
README
View File

@ -1,4 +1,4 @@
Digital Speech Decoder 1.6.0
Digital Speech Decoder 1.6.0 with P25 & DMR Filter
Copyright (C) 2010 DSD Author
GPG Key ID: 0x3F1D7FD0 (74EF 430D F7F2 0A48 FCE6 F630 FAA2 635D 3F1D 7FD0)
@ -455,10 +455,12 @@ Decoder options
-fp Decode only ProVoice*
-fr Decode only DMR/MOTOTRBO
-fx Decode only X2-TDMA
-l Disable Filters (not recommended)
-ma Auto-select modulation optimizations (default)
-mc Use only C4FM modulation optimizations
-mg Use only GFSK modulation optimizations
-mq Use only QPSK modulation optimizations
-pu Unmute Encrypted P25
-u <num> Unvoiced speech quality (default=3)
-xx Expect non-inverted X2-TDMA signal
-xr Expect inverted DMR/MOTOTRBO signal

2
dsd.h
View File

@ -93,6 +93,8 @@ typedef struct
int msize;
int playfiles;
int delay;
int disable_filters;
int unmute_encrypted_p25;
} dsd_opts;
typedef struct

View File

@ -128,6 +128,8 @@ initOpts (dsd_opts * opts)
opts->msize = 15;
opts->playfiles = 0;
opts->delay = 0;
opts->disable_filters = 0;
opts->unmute_encrypted_p25 = 0;
}
void
@ -262,10 +264,12 @@ usage ()
printf (" -fp Decode only ProVoice*\n");
printf (" -fr Decode only DMR/MOTOTRBO\n");
printf (" -fx Decode only X2-TDMA\n");
printf (" -l Disable Filters (not recommended)\n");
printf (" -ma Auto-select modulation optimizations (default)\n");
printf (" -mc Use only C4FM modulation optimizations\n");
printf (" -mg Use only GFSK modulation optimizations\n");
printf (" -mq Use only QPSK modulation optimizations\n");
printf (" -pu Unmute Encrypted P25\n");
printf (" -u <num> Unvoiced speech quality (default=3)\n");
printf (" -xx Expect non-inverted X2-TDMA signal\n");
printf (" -xr Expect inverted DMR/MOTOTRBO signal\n");
@ -335,7 +339,7 @@ main (int argc, char **argv)
char versionstr[25];
mbe_printVersion (versionstr);
printf ("Digital Speech Decoder 1.6.0\n");
printf ("Digital Speech Decoder 1.6.0 with P25 & DMR Filter\n");
printf ("mbelib version %s\n", versionstr);
initOpts (&opts);
@ -344,7 +348,7 @@ main (int argc, char **argv)
exitflag = 0;
signal (SIGINT, sigfun);
while ((c = getopt (argc, argv, "hep:qstv:z:i:o:d:g:nw:B:C:R:f:m:u:x:A:S:M:r")) != -1)
while ((c = getopt (argc, argv, "hep:qstv:z:i:o:d:g:nw:B:C:R:f:m:u:x:A:S:M:r:l")) != -1)
{
opterr = 0;
switch (c)
@ -373,6 +377,10 @@ main (int argc, char **argv)
{
opts.p25tg = 1;
}
else if (optarg[0] == 'u')
{
opts.unmute_encrypted_p25 = 1;
}
break;
case 'q':
opts.errorbars = 0;
@ -649,6 +657,10 @@ main (int argc, char **argv)
opts.datascope = 0;
state.optind = optind;
break;
case 'l':
opts.disable_filters = 1;
printf ("DMR & P25 Filter Disabled\n");
break;
default:
usage ();
exit (0);

View File

@ -80,7 +80,9 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
}
result = read (opts->audio_in_fd, &sample, 2);
{
if (opts->disable_filters == 0)
{
#define NZEROS 60
#define GAIN 7.423339364e+00
@ -117,7 +119,8 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
sum += (xcoeffs[i] * xv[i]);
sample = sum / GAIN; // filtered sample out
}
}
if ((sample > state->max) && (have_sync == 1) && (state->rf_mod == 0))
{
sample = state->max;

View File

@ -77,7 +77,7 @@ processLDU1 (dsd_opts * opts, dsd_state * state)
y++;
z++;
}
if (state->p25kid == 0)
if (state->p25kid == 0 || opts->unmute_encrypted_p25 == 1)
{
processMbeFrame (opts, state, imbe_fr, NULL, NULL);
}

View File

@ -80,7 +80,7 @@ processLDU2 (dsd_opts * opts, dsd_state * state)
y++;
z++;
}
if (state->p25kid == 0)
if (state->p25kid == 0 || opts->unmute_encrypted_p25 == 1)
{
processMbeFrame (opts, state, imbe_fr, NULL, NULL);
}