@@ -965,6 +965,13 @@ it can also result in the detection of SDR artifacts such as reflections of stro
as weak stations. Future versions may be better able to separate weak stations from artifacts
looking like weak stations.
+@item fm_multiple
+Multiple of frequency in hz at which to search for stations.
+you can set this to 100000 to probe stations at 0.1MHz increments
+Most SDR artifacts are not at exact multiplies, this is thus an effective
+way to eliminate these artifacts.
+disabled by default.
+
@item am_mode
AM Demodulation method. Several different methods are supported.
@table @samp
@@ -159,6 +159,7 @@ typedef struct SDRContext {
float am_threshold;
float fm_threshold;
+ float fm_multiple;
pthread_t hw_thread;
int thread_started;
@@ -915,6 +915,14 @@ static int probe_fm(SDRContext *sdr)
if (fabs(f2 - f) > 1000)
continue;
+
+ if (sdr->fm_multiple) {
+ double f3 = lrint(f2 / sdr->fm_multiple) * sdr->fm_multiple;
+ if (fabs(f2 - f3) > FM_FREQ_TOLERANCE)
+ continue;
+ f2 = f3;
+ }
+
create_candidate_station(sdr, FM, f2, bandwidth_f, bandwidth_p2, score);
}
}
@@ -2169,6 +2177,7 @@ const AVOption avpriv_sdr_options[] = {
{ "am_threshold" , "AM detection threshold", OFFSET(am_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 20}, 0, FLT_MAX, DEC},
{ "fm_threshold" , "FM detection threshold", OFFSET(fm_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 50}, 0, FLT_MAX, DEC},
+ { "fm_multiple" , "FM frequency mutiple", OFFSET(fm_multiple ), AV_OPT_TYPE_FLOAT, {.dbl = 0}, 0, FLT_MAX, DEC},
{ NULL },
};
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- doc/demuxers.texi | 7 +++++++ libavradio/sdr.h | 1 + libavradio/sdrdemux.c | 9 +++++++++ 3 files changed, 17 insertions(+)