From 9e7fa7618d4a90c1b5a08601edb3062753a53427 Mon Sep 17 00:00:00 2001 From: Denny Date: Wed, 4 Jul 2018 06:05:15 -0400 Subject: [PATCH] Logging cleanup. --- .../dsheirer/dsp/afsk/AFSK1200Decoder.java | 54 +++---------------- .../channelizer/PolyphaseChannelManager.java | 1 + .../module/decode/p25/P25DecoderC4FM.java | 1 - 3 files changed, 9 insertions(+), 47 deletions(-) diff --git a/src/main/java/io/github/dsheirer/dsp/afsk/AFSK1200Decoder.java b/src/main/java/io/github/dsheirer/dsp/afsk/AFSK1200Decoder.java index ca72ac66..fb673981 100644 --- a/src/main/java/io/github/dsheirer/dsp/afsk/AFSK1200Decoder.java +++ b/src/main/java/io/github/dsheirer/dsp/afsk/AFSK1200Decoder.java @@ -17,10 +17,6 @@ package io.github.dsheirer.dsp.afsk; import io.github.dsheirer.bits.IBinarySymbolProcessor; import io.github.dsheirer.buffer.FloatAveragingBuffer; -import io.github.dsheirer.dsp.filter.design.FilterDesignException; -import io.github.dsheirer.dsp.filter.fir.FIRFilterSpecification; -import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter2; -import io.github.dsheirer.dsp.filter.fir.remez.RemezFIRFilterDesigner; import io.github.dsheirer.dsp.filter.resample.RealResampler; import io.github.dsheirer.dsp.mixer.IOscillator; import io.github.dsheirer.dsp.mixer.Oscillator; @@ -57,45 +53,15 @@ public class AFSK1200Decoder implements Listener public static final double SPACE = 1800.0; public static final float TIMING_ERROR_GAIN = 1.0f / 3.0f; //Timing error adjustments over 3 symbol periods - private static float[] sBandPassFilterCoefficients; - - static - { - FIRFilterSpecification specification = FIRFilterSpecification.bandPassBuilder() - .sampleRate(8000) - .stopFrequency1(1000) - .passFrequencyBegin(1100) - .passFrequencyEnd(1900) - .stopFrequency2(2000) - .stopRipple(0.000001) - .passRipple(0.00001) - .build(); - - try - { - RemezFIRFilterDesigner designer = new RemezFIRFilterDesigner(specification); - - if(designer.isValid()) - { - sBandPassFilterCoefficients = designer.getImpulseResponse(); - } - } - catch(FilterDesignException fde) - { - mLog.error("Filter design error", fde); - } - } - - private Correlator mCorrelator1200 = new Correlator(SAMPLE_RATE, MARK, AVERAGING_PERIOD, CORRELATION_PERIOD); - private Correlator mCorrelator1800 = new Correlator(SAMPLE_RATE, SPACE, AVERAGING_PERIOD, CORRELATION_PERIOD); - private float[] mCorrelationValues1200; - private float[] mCorrelationValues1800; + private Correlator mCorrelatorMark = new Correlator(SAMPLE_RATE, MARK, AVERAGING_PERIOD, CORRELATION_PERIOD); + private Correlator mCorrelatorSpace = new Correlator(SAMPLE_RATE, SPACE, AVERAGING_PERIOD, CORRELATION_PERIOD); + private float[] mCorrelationValuesMark; + private float[] mCorrelationValuesSpace; protected boolean mNormalOutput; protected float mSymbolTimingGain = TIMING_ERROR_GAIN; protected AFSKSampleBuffer mSampleBuffer; protected AFSKTimingErrorDetector mTimingErrorDetector = new AFSKTimingErrorDetector(SAMPLES_PER_SYMBOL); - private RealFIRFilter2 mBandPassFilter = new RealFIRFilter2(sBandPassFilterCoefficients); protected IBinarySymbolProcessor mBinarySymbolProcessor; private boolean mSampleDecision; @@ -146,10 +112,6 @@ public class AFSK1200Decoder implements Listener @Override public void receive(ReusableBuffer buffer) { -//TODO: remove the passband filter ... the correlators should be able to deal with the noise and the filters may be -//TODO: introducing noise anyway -// ReusableBuffer bandPassFiltered = mBandPassFilter.filter(buffer); -// mResampler.resample(bandPassFiltered); mResampler.resample(buffer); } @@ -186,15 +148,15 @@ public class AFSK1200Decoder implements Listener public void receive(ReusableBuffer buffer) { //Calculate correlation values against each 1200/1800 reference signal - mCorrelationValues1200 = mCorrelator1200.process(buffer); - mCorrelationValues1800 = mCorrelator1800.process(buffer); + mCorrelationValuesMark = mCorrelatorMark.process(buffer); + mCorrelationValuesSpace = mCorrelatorSpace.process(buffer); buffer.decrementUserCount(); - for(int x = 0; x < mCorrelationValues1200.length; x++) + for(int x = 0; x < mCorrelationValuesMark.length; x++) { //1200 = Mark (1) and 1800 = Space (0) - mSampleDecision = mCorrelationValues1200[x] > mCorrelationValues1800[x]; + mSampleDecision = mCorrelationValuesMark[x] > mCorrelationValuesSpace[x]; mSampleBuffer.receive(mSampleDecision); mTimingErrorDetector.receive(mSampleDecision); diff --git a/src/main/java/io/github/dsheirer/dsp/filter/channelizer/PolyphaseChannelManager.java b/src/main/java/io/github/dsheirer/dsp/filter/channelizer/PolyphaseChannelManager.java index ed5bf2d8..d621aa41 100644 --- a/src/main/java/io/github/dsheirer/dsp/filter/channelizer/PolyphaseChannelManager.java +++ b/src/main/java/io/github/dsheirer/dsp/filter/channelizer/PolyphaseChannelManager.java @@ -319,6 +319,7 @@ public class PolyphaseChannelManager implements ISourceEventProcessor break; case NOTIFICATION_FREQUENCY_AND_SAMPLE_RATE_LOCKED: case NOTIFICATION_FREQUENCY_AND_SAMPLE_RATE_UNLOCKED: + case NOTIFICATION_FREQUENCY_CORRECTION_CHANGE: //no-op break; default: diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderC4FM.java b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderC4FM.java index d2af6a7a..62e3d42b 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderC4FM.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/P25DecoderC4FM.java @@ -164,7 +164,6 @@ public class P25DecoderC4FM extends P25Decoder case NOTIFICATION_FREQUENCY_CHANGE: case NOTIFICATION_FREQUENCY_CORRECTION_CHANGE: case NOTIFICATION_CHANNEL_FREQUENCY_CORRECTION_CHANGE: - mLog.debug("Resetting COSTAS loop for: " + sourceEvent.getEvent().name()); mCostasLoop.reset(); break; case NOTIFICATION_SAMPLE_RATE_CHANGE: