mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
This commit is contained in:
@@ -275,6 +275,14 @@ public abstract class TunerController implements Tunable, ISourceEventProcessor,
|
||||
return (int)(getBandwidth() * mUsableBandwidthPercentage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the usable bandwidth percentage -- this can change based on samplerate for some tuners
|
||||
*/
|
||||
public void setUsableBandwidthPercentage(double usableBandwidthPercentage)
|
||||
{
|
||||
mUsableBandwidthPercentage = usableBandwidthPercentage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Usable half bandwidth - total bandwidth minus unusable space at either end of the spectrum.
|
||||
*
|
||||
|
||||
@@ -406,6 +406,25 @@ public class AirspyTunerController extends USBTunerController
|
||||
{
|
||||
mSampleRate = rate.getRate();
|
||||
mFrequencyController.setSampleRate(mSampleRate);
|
||||
|
||||
// Update the Usable Bandwidth Percentage, as the usable range varies with the sample rate.
|
||||
// Values below are from https://github.com/DSheirer/sdrtrunk/issues/815#issuecomment-699859590
|
||||
switch(mSampleRate)
|
||||
{
|
||||
default:
|
||||
case 10000000:
|
||||
super.setUsableBandwidthPercentage(0.90);
|
||||
break;
|
||||
case 6000000:
|
||||
super.setUsableBandwidthPercentage(0.83);
|
||||
break;
|
||||
case 3000000:
|
||||
super.setUsableBandwidthPercentage(0.66);
|
||||
break;
|
||||
case 2500000:
|
||||
super.setUsableBandwidthPercentage(0.60);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user