forked from sdr/gr-osmosdr
hackrf: don't set automatic bandwidth on samplerate change
automatic bandwidth selection may be triggered by calling set_bandwidth(0) after changing the sample rate
This commit is contained in:
parent
a0b534d118
commit
911f916b3b
|
@ -159,7 +159,8 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
|
|||
_freq_corr(0),
|
||||
_auto_gain(false),
|
||||
_amp_gain(0),
|
||||
_vga_gain(0)
|
||||
_vga_gain(0),
|
||||
_bandwidth(0)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -208,8 +209,8 @@ hackrf_sink_c::hackrf_sink_c (const std::string &args)
|
|||
<< std::endl;
|
||||
}
|
||||
|
||||
// set_sample_rate( get_sample_rates().start() );
|
||||
set_sample_rate( 10e6 );
|
||||
set_sample_rate( get_sample_rates().start() );
|
||||
set_bandwidth( 0 );
|
||||
|
||||
set_gain( 0 ); /* disable AMP gain stage by default */
|
||||
|
||||
|
@ -495,7 +496,7 @@ double hackrf_sink_c::set_sample_rate( double rate )
|
|||
ret = hackrf_set_sample_rate( _dev, rate );
|
||||
if ( HACKRF_SUCCESS == ret ) {
|
||||
_sample_rate = rate;
|
||||
set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
|
||||
//set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
|
||||
} else {
|
||||
HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_sample_rate", rate ) )
|
||||
}
|
||||
|
|
|
@ -93,7 +93,8 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
|
|||
_auto_gain(false),
|
||||
_amp_gain(0),
|
||||
_lna_gain(0),
|
||||
_vga_gain(0)
|
||||
_vga_gain(0),
|
||||
_bandwidth(0)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -162,8 +163,8 @@ hackrf_source_c::hackrf_source_c (const std::string &args)
|
|||
<< std::endl;
|
||||
}
|
||||
|
||||
// set_sample_rate( get_sample_rates().start() );
|
||||
set_sample_rate( 10e6 );
|
||||
set_sample_rate( get_sample_rates().start() );
|
||||
set_bandwidth( 0 );
|
||||
|
||||
set_gain( 0 ); /* disable AMP gain stage by default */
|
||||
|
||||
|
@ -387,7 +388,7 @@ double hackrf_source_c::set_sample_rate( double rate )
|
|||
ret = hackrf_set_sample_rate( _dev, rate );
|
||||
if ( HACKRF_SUCCESS == ret ) {
|
||||
_sample_rate = rate;
|
||||
set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
|
||||
//set_bandwidth( 0.0 ); /* bandwidth of 0 means automatic filter selection */
|
||||
} else {
|
||||
HACKRF_THROW_ON_ERROR( ret, HACKRF_FUNC_STR( "hackrf_set_sample_rate", rate ) )
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue