diff --git a/lib/soapy/soapy_sink_c.cc b/lib/soapy/soapy_sink_c.cc index dd4130e..c1f6fc1 100644 --- a/lib/soapy/soapy_sink_c.cc +++ b/lib/soapy/soapy_sink_c.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2015 Josh Blum + * Copyright 2015-2016 Josh Blum * Copyright 2013 Dimitri Stolnikov * * GNU Radio is free software; you can redistribute it and/or modify @@ -272,6 +272,9 @@ void soapy_sink_c::set_iq_balance( const std::complex &balance, size_t c double soapy_sink_c::set_bandwidth( double bandwidth, size_t chan) { + if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */ + set_bandwidth(get_sample_rate() * 0.75, chan); /* select narrower filters to prevent aliasing */ + _device->setBandwidth(SOAPY_SDR_TX, chan, bandwidth); return this->get_bandwidth(chan); } diff --git a/lib/soapy/soapy_source_c.cc b/lib/soapy/soapy_source_c.cc index ea84467..e64f34a 100644 --- a/lib/soapy/soapy_source_c.cc +++ b/lib/soapy/soapy_source_c.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2015 Josh Blum + * Copyright 2015-2016 Josh Blum * Copyright 2013 Dimitri Stolnikov * * GNU Radio is free software; you can redistribute it and/or modify @@ -292,6 +292,9 @@ void soapy_source_c::set_iq_balance( const std::complex &balance, size_t double soapy_source_c::set_bandwidth( double bandwidth, size_t chan ) { + if ( bandwidth == 0.0 ) /* bandwidth of 0 means automatic filter selection */ + set_bandwidth(get_sample_rate() * 0.75, chan); /* select narrower filters to prevent aliasing */ + _device->setBandwidth(SOAPY_SDR_RX, chan, bandwidth); return this->get_bandwidth(chan); }