Updates decoder types to specify channel sample rate and pass/stop
frequencies for requested channels.  Updates tuner channel source
managers to accept a channel specification for channels that are
allocated.
This commit is contained in:
Denny
2018-09-09 09:49:05 -04:00
parent 9950e46e5a
commit b15a3e59a0
14 changed files with 177 additions and 120 deletions

View File

@@ -104,7 +104,7 @@ public class ComplexPrimeCICDecimate implements Listener<ReusableComplexBuffer>
* @throws FilterDesignException if a final low-pass cleanup filter cannot be created for the output channel rate
* and specified pass/stop frequencies.
*/
public ComplexPrimeCICDecimate(double sampleRate, int decimation, int passFrequency, int stopFrequency)
public ComplexPrimeCICDecimate(double sampleRate, int decimation, double passFrequency, double stopFrequency)
throws FilterDesignException
{
Validate.isTrue(decimation <= PRIMES[PRIMES.length - 1]);
@@ -400,7 +400,7 @@ public class ComplexPrimeCICDecimate implements Listener<ReusableComplexBuffer>
private ComplexFIRFilter2 mLowPassFilter;
private Listener<ReusableComplexBuffer> mReusableComplexBufferListener;
public Output(double outputSampleRate, int passFrequency, int stopFrequency) throws FilterDesignException
public Output(double outputSampleRate, double passFrequency, double stopFrequency) throws FilterDesignException
{
mBufferAssembler = new ReusableComplexBufferAssembler(2400, outputSampleRate);
@@ -461,7 +461,7 @@ public class ComplexPrimeCICDecimate implements Listener<ReusableComplexBuffer>
* @return a newly designed filter or a previously designed (cached) filter
* @throws FilterDesignException
*/
private float[] getLowPassFilter(double sampleRate, int passFrequency, int stopFrequency) throws FilterDesignException
private float[] getLowPassFilter(double sampleRate, double passFrequency, double stopFrequency) throws FilterDesignException
{
//Use existing filter if we've already designed one
if(sLowPassFilters.containsKey((int)sampleRate))

View File

@@ -299,8 +299,8 @@ public class FIRFilterSpecification
private int mOrder;
private Boolean mOddLength;
private int mGridDensity = 16;
private int mPassBandEndFrequency;
private int mStopBandStartFrequency;
private double mPassBandEndFrequency;
private double mStopBandStartFrequency;
private double mPassBandRipple;
private double mStopBandRipple;
private double mPassBandAmplitude = 1.0;
@@ -342,13 +342,13 @@ public class FIRFilterSpecification
return this;
}
public LowPassBuilder passBandCutoff(int frequencyHz)
public LowPassBuilder passBandCutoff(double frequencyHz)
{
mPassBandEndFrequency = frequencyHz;
return this;
}
public LowPassBuilder stopBandStart(int frequencyHz)
public LowPassBuilder stopBandStart(double frequencyHz)
{
mStopBandStartFrequency = frequencyHz;
return this;
@@ -905,7 +905,7 @@ public class FIRFilterSpecification
* @param stopBandRipple stop band ripple in dB
* @return estimated filter length
*/
public static int estimateFilterOrder(double sampleRate, int frequency1, int frequency2,
public static int estimateFilterOrder(double sampleRate, double frequency1, double frequency2,
double passBandRipple, double stopBandRipple)
{
double df = Math.abs(frequency2 - frequency1) / sampleRate;
@@ -1013,13 +1013,13 @@ public class FIRFilterSpecification
* @param amplitude of the frequency band relative to unity (0.0 - 1.0)
* @param ripple of the frequency band specified as db ripple
*/
public FrequencyBand(double sampleRate, int start, int end, double amplitude, double ripple)
public FrequencyBand(double sampleRate, double start, double end, double amplitude, double ripple)
{
this((double)start / sampleRate, (double)end / sampleRate,
this(start / sampleRate, end / sampleRate,
amplitude, ripple);
}
public FrequencyBand(double sampleRate, int start, int end, double amplitude, double ripple, double weight)
public FrequencyBand(double sampleRate, double start, double end, double amplitude, double ripple, double weight)
{
this(sampleRate, start, end, amplitude, ripple);
mWeight = weight;