forked from sdr/gr-osmosdr
bladerf: implement automatic bandwidth selection
This commit is contained in:
parent
5d5dc04371
commit
681e3b7d4a
|
@ -632,6 +632,9 @@ double bladerf_sink_c::set_bandwidth( double bandwidth, size_t chan )
|
|||
int ret;
|
||||
uint32_t actual;
|
||||
|
||||
if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */
|
||||
bandwidth = get_sample_rate() * 0.75; /* select narrower filters to prevent aliasing */
|
||||
|
||||
ret = bladerf_set_bandwidth( _dev, BLADERF_MODULE_TX, (uint32_t)bandwidth, &actual );
|
||||
if( ret ) {
|
||||
throw std::runtime_error( std::string(__FUNCTION__) + " " +
|
||||
|
|
|
@ -600,6 +600,9 @@ double bladerf_source_c::set_bandwidth( double bandwidth, size_t chan )
|
|||
int ret;
|
||||
uint32_t actual;
|
||||
|
||||
if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */
|
||||
bandwidth = get_sample_rate() * 0.75; /* select narrower filters to prevent aliasing */
|
||||
|
||||
ret = bladerf_set_bandwidth( _dev, BLADERF_MODULE_RX, (uint32_t)bandwidth, &actual );
|
||||
if( ret ) {
|
||||
throw std::runtime_error( std::string(__FUNCTION__) + " " +
|
||||
|
|
Loading…
Reference in New Issue