Skip to content

Commit

Permalink
added passthrough driver option 'inc=' for impulse noise cancellation
Browse files Browse the repository at this point in the history
* passthrough from environment variable 'LIBRTLSDR_OPT'
* should/could be beneficial for ads-b

Signed-off-by: hayati ayguen <[email protected]>
  • Loading branch information
hayguen committed Nov 5, 2023
1 parent 6117bb4 commit 213b2bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 3 additions & 7 deletions README_improvements.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,18 @@ against librtlsdr's development branch (initially same date, but updated 2020-10
* **tp=** set pin for bias tee
* **ds=** set direct sampling (HF mode) for RTL-SDR V3 or compatible, see https://www.rtl-sdr.com/rtl-sdr-blog-v-3-dongles-user-guide/
* **dm=** set direct sampling mode
* **inc=** set impulse noise cancellation (default is on), might be useful to deactivate for ADS-B

* many of the options are R820T/2-tuner specific:

* **bc=** set the the reception bands' center in Hz

* **sb=** set tuner sideband

* **ifm=** set IF mode (AGC, fixed gain, ..) for VGA (variable gain amplifier)

* **harm=** set n-th harmonic reception

* **vcocmin=** set minimum VCO current

* **vcocmax=** set maximum VCO current

* **vcoalgo=** set VCO algorithm


* probably some more: it's highly probable, that this list is incomplete

Expand Down Expand Up @@ -114,6 +108,8 @@ new alternative: environment variable **LIBRTLSDR_OPT**
* added rtlsdr_set_center_freq64(), to set frequencies above ~4.29 GHz, the 32-bit limit
* added rtlsdr_get_center_freq64()
* added rtlsdr_set_harmonic_rx() to activate/change harmonic reception
* added rtlsdr_set_impulse_nc(), rtlsdr_get_impulse_nc()
* added rtlsdr_set_aagc(), rtlsdr_set_aagc_gain_distrib() and getters


## Added Tools
Expand Down
9 changes: 8 additions & 1 deletion src/librtlsdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4670,6 +4670,7 @@ const char * rtlsdr_get_opt_help(int longInfo)
"\t\t default port number: 32323\n"
#endif
"\t\tstandby=<on> 1 activates standby after close, 0 deactivates to keep heated-up\n"
"\t\tinc=<on> 1 activates the impulse noise cancellation (=default), 0 deactivates it\n"
;
else
return
Expand All @@ -4685,7 +4686,7 @@ const char * rtlsdr_get_opt_help(int longInfo)
#else
"\t\tds=<direct_sampling>:dm=<ds_mode_thresh>:T=<bias_tee>"
#endif
":standby=<en>\n"
":standby=<en>:inc=<en>\n"
#ifdef WITH_UDP_SERVER
"\t\tport=<udp_port default with 1>\n"
#endif
Expand Down Expand Up @@ -4913,6 +4914,12 @@ int rtlsdr_set_opt_string(rtlsdr_dev_t *dev, const char *opts, int verbose)
fprintf(stderr, "\nrtlsdr_set_opt_string(): parsed standby %d\n", on);
ret = rtlsdr_standby_after_close(dev, on);
}
else if (!strncmp(optPart, "inc=", 4)) {
int on = atoi(optPart +4);
if (verbose)
fprintf(stderr, "\nrtlsdr_set_opt_string(): parsed impulse noise cancellation %d\n", on);
ret = rtlsdr_set_impulse_nc(dev, on, 1);
}
else if (*optPart) {
if (verbose)
fprintf(stderr, "\nrtlsdr_set_opt_string(): parsed unknown option '%s'\n", optPart);
Expand Down

0 comments on commit 213b2bc

Please sign in to comment.