mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
#39 WIP polyphase channelizers.
This commit is contained in:
@@ -567,7 +567,7 @@ public class FilterFactory
|
||||
* For 40db attenuation, calculate the number of symbols based on the following formula:
|
||||
* Symbols = -44 * alpha + 33
|
||||
*
|
||||
* Polyphase TunerChannelizer notes:
|
||||
* Polyphase Channelizer notes:
|
||||
* -Set samples Per Symbol at 2 (or more) * number of channels
|
||||
* -Set symbolCount to sufficient size to produce required attenuation
|
||||
* -Set symbol rate in hertz
|
||||
@@ -725,7 +725,7 @@ public class FilterFactory
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a windowed-sync (Nyquist) M/2 prototype FIR filter for use with a Polyphase TunerChannelizer/Synthesizer.
|
||||
* Creates a windowed-sync (Nyquist) M/2 prototype FIR filter for use with a Polyphase Channelizer/Synthesizer.
|
||||
* The filter is designed for x2 oversampling of each channel and the filter cutoff frequency is incrementally
|
||||
* adjusted to achieve a -6.02 dB attenuation at the channel band edge to enable perfect reconstruction of adjacent
|
||||
* channels.
|
||||
@@ -833,14 +833,16 @@ public class FilterFactory
|
||||
|
||||
if(logResults)
|
||||
{
|
||||
mLog.debug("Polyphase TunerChannelizer Filter Design Summary");
|
||||
mLog.debug("Polyphase Channelizer Filter Design Summary");
|
||||
mLog.debug("-----------------------------------------------------");
|
||||
mLog.debug("Window Type: " + windowType.name());
|
||||
mLog.debug("Input Sample Rate: " + sampleRate);
|
||||
mLog.debug("Channel Bandwidth: " + channelBandwidth);
|
||||
mLog.debug("Channels: " + channels);
|
||||
mLog.debug("Window Type: " + windowType.name());
|
||||
mLog.debug("Taps Per Channel: " + tapsPerChannel + " (Requested:" + tapsPerChannel + ")");
|
||||
mLog.debug("Filter Length: " + (taps.length + 1));
|
||||
mLog.debug("Channel Bandwidth: " + channelBandwidth);
|
||||
mLog.debug("Cutoff Frequency: " + (sampleRate * cutoffFrequency));
|
||||
mLog.debug("Requested Cutoff Frequency: " + (sampleRate * bandEdge));
|
||||
mLog.debug("Actual Cutoff Frequency: " + (sampleRate * cutoffFrequency));
|
||||
mLog.debug("Attenuation at 1.00 OBJECTIVE: " + PERFECT_RECONSTRUCTION_GAIN_AT_BAND_EDGE);
|
||||
mLog.debug("Attenuation at 1.00 Channels: " + evaluate(taps, bandEdge * 1.00));
|
||||
mLog.debug("Attenuation at 1.25 Channels: " + evaluate(taps, bandEdge * 1.25));
|
||||
|
||||
@@ -32,7 +32,6 @@ import source.tuner.TunerChannel;
|
||||
import source.tuner.configuration.TunerConfigurationModel;
|
||||
import source.tuner.test.TestTuner;
|
||||
import spectrum.DFTProcessor;
|
||||
import spectrum.DFTResultsListener;
|
||||
import spectrum.DFTSize;
|
||||
import spectrum.SpectrumPanel;
|
||||
import spectrum.converter.ComplexDecibelConverter;
|
||||
@@ -168,12 +167,6 @@ public class ChannelizerViewer extends JFrame
|
||||
return mChannelPanel;
|
||||
}
|
||||
|
||||
// private float[] getFilter() throws FilterDesignException
|
||||
// {
|
||||
// return FilterFactory.getSincChannelizer(CHANNEL_BANDWIDTH, mChannelCount, mFilterTapsPerChannel,
|
||||
// Window.WindowType.BLACKMAN_HARRIS_7, true);
|
||||
// }
|
||||
|
||||
public class ChannelArrayPanel extends JPanel
|
||||
{
|
||||
public ChannelArrayPanel()
|
||||
|
||||
@@ -57,6 +57,7 @@ public class SampleGenerator
|
||||
throw new IllegalArgumentException("Sweep update rate cannot be greater than sample rate");
|
||||
}
|
||||
|
||||
mLog.debug("Sample Generator - Sample Rate:" + sampleRate + " Frequency:" + frequency);
|
||||
mOscillator = new LowPhaseNoiseOscillator(sampleRate, frequency);
|
||||
mInterval = interval;
|
||||
mSweepUpdateInterval = sweepUpdateRate;
|
||||
@@ -85,7 +86,7 @@ public class SampleGenerator
|
||||
{
|
||||
mSamplesPerInterval = (int)((double)mOscillator.getSampleRate() * ((double)mInterval / 1000.0));
|
||||
|
||||
mLog.debug("Sample Generator: " + mSamplesPerInterval + " samples every " + mInterval + " ms.");
|
||||
mLog.debug("Sample Generator - " + mSamplesPerInterval + " samples every " + mInterval + "ms");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,12 +32,15 @@ public class TestTunerController extends TunerController
|
||||
|
||||
public static final long MINIMUM_FREQUENCY = 1000000l; //1 MHz
|
||||
public static final long MAXIMUM_FREQUENCY = 10000000000l; //10 GHz
|
||||
public static final long DEFAULT_FREQUENCY = 100000000; //100 MHz
|
||||
public static final long DEFAULT_CENTER_FREQUENCY = 100000000; //100 MHz
|
||||
public static final int DEFAULT_SAMPLE_RATE = 50000; //25 kHz
|
||||
public static final int DC_NOISE_BANDWIDTH = 5000; // +/-5 kHz
|
||||
public static final double USABLE_BANDWIDTH = 0.90; //90% usable bandwidth - 5% unusable on either end
|
||||
public static final int SPECTRAL_FRAME_RATE = 20;
|
||||
public static final long SAMPLE_GENERATION_INTERVAL = 1000 / SPECTRAL_FRAME_RATE;
|
||||
|
||||
private SampleGenerator mSampleGenerator;
|
||||
private long mReferenceFrequency = DEFAULT_CENTER_FREQUENCY;
|
||||
|
||||
/**
|
||||
* Tuner controller testing implementation.
|
||||
@@ -48,12 +51,12 @@ public class TestTunerController extends TunerController
|
||||
|
||||
int sweepRate = 0; //Hz per interval
|
||||
|
||||
mSampleGenerator = new SampleGenerator(DEFAULT_SAMPLE_RATE, DEFAULT_FREQUENCY, 100, sweepRate);
|
||||
mSampleGenerator = new SampleGenerator(DEFAULT_SAMPLE_RATE, 5000, SAMPLE_GENERATION_INTERVAL, sweepRate);
|
||||
|
||||
try
|
||||
{
|
||||
mLog.debug("Setting frequency ...");
|
||||
mFrequencyController.setFrequency(DEFAULT_FREQUENCY);
|
||||
mFrequencyController.setFrequency(DEFAULT_CENTER_FREQUENCY);
|
||||
mLog.debug("Setting sample rate of freq controller to: " + DEFAULT_SAMPLE_RATE);
|
||||
mFrequencyController.setSampleRate(DEFAULT_SAMPLE_RATE);
|
||||
}
|
||||
@@ -94,7 +97,7 @@ public class TestTunerController extends TunerController
|
||||
@Override
|
||||
public long getTunedFrequency() throws SourceException
|
||||
{
|
||||
return mSampleGenerator.getFrequency();
|
||||
return mReferenceFrequency;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +108,7 @@ public class TestTunerController extends TunerController
|
||||
@Override
|
||||
public void setTunedFrequency(long frequency) throws SourceException
|
||||
{
|
||||
mSampleGenerator.setFrequency(frequency);
|
||||
mReferenceFrequency = frequency;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +117,8 @@ public class TestTunerController extends TunerController
|
||||
*/
|
||||
public void setToneFrequency(long toneFrequency)
|
||||
{
|
||||
mSampleGenerator.setFrequency(toneFrequency - getFrequency());
|
||||
long frequency = toneFrequency - mReferenceFrequency;
|
||||
mSampleGenerator.setFrequency(frequency);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -123,7 +127,7 @@ public class TestTunerController extends TunerController
|
||||
*/
|
||||
public long getToneFrequency()
|
||||
{
|
||||
return getFrequency() + mSampleGenerator.getFrequency();
|
||||
return mReferenceFrequency + mSampleGenerator.getFrequency();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user