From 8dab6e53b1828c1e9a9e5a989e73a6435bab2164 Mon Sep 17 00:00:00 2001
From: Michael Ossmann <mike@ossmann.com>
Date: Sat, 24 Sep 2022 06:48:48 -0400
Subject: [PATCH 1/4] fix automatic filter bandwidth selection

---
 HackRF_Settings.cpp | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/HackRF_Settings.cpp b/HackRF_Settings.cpp
index d50d98d..8ef5696 100644
--- a/HackRF_Settings.cpp
+++ b/HackRF_Settings.cpp
@@ -557,23 +557,6 @@ void SoapyHackRF::setSampleRate( const int direction, const size_t channel, cons
 	{
 		int ret = hackrf_set_sample_rate( _dev, _current_samplerate );
 
-		if(_auto_bandwidth){
-
-			_current_bandwidth=hackrf_compute_baseband_filter_bw_round_down_lt(_current_samplerate);
-
-
-			if(direction==SOAPY_SDR_RX){
-
-				_rx_stream.bandwidth=_current_bandwidth;
-			}
-			if(direction==SOAPY_SDR_TX){
-
-				_tx_stream.bandwidth=_current_bandwidth;
-			}
-
-			ret|=hackrf_set_baseband_filter_bandwidth(_dev,_current_bandwidth);
-		}
-
 		if ( ret != HACKRF_SUCCESS )
 		{
 			SoapySDR::logf( SOAPY_SDR_ERROR, "hackrf_set_sample_rate(%f) returned %s", _current_samplerate, hackrf_error_name( (hackrf_error) ret ) );
@@ -614,7 +597,7 @@ std::vector<double> SoapyHackRF::listSampleRates( const int direction, const siz
 void SoapyHackRF::setBandwidth( const int direction, const size_t channel, const double bw )
 {
 	std::lock_guard<std::mutex> lock(_device_mutex);
-	_current_bandwidth = hackrf_compute_baseband_filter_bw(bw);
+	_current_bandwidth = bw;
 
 	if(direction==SOAPY_SDR_RX){
 
-- 
2.47.3

