mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
[WIP] Creates a new AFSK-1200 correlation decoder and updates the
Fleetsync II decoder to use it. Adds instrumented version of the decoder and a new Fleetsync2 FX pane to the DemodulatorViewerFX tool. Note: the remaining AFSK-1200 based decoders will all be ported to use this new AFSK1200 decoder (MDC1200, Tait1200, LowJack1200).
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
/*******************************************************************************
|
||||
* sdr-trunk
|
||||
* Copyright (C) 2014-2018 Dennis Sheirer
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with this program.
|
||||
* If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.module.decode.afsk;
|
||||
|
||||
import io.github.dsheirer.dsp.afsk.AFSK1200Decoder;
|
||||
import io.github.dsheirer.module.decode.Decoder;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.sample.buffer.IReusableBufferListener;
|
||||
import io.github.dsheirer.sample.buffer.ReusableBuffer;
|
||||
|
||||
/**
|
||||
* Abstract class for Audio Frequency Shift Keying (AFSK) 1200-baud decoder based decoder modules.
|
||||
*
|
||||
* This class handles the AFSK 1200 decoder and incoming sample stream buffer management.
|
||||
*
|
||||
* Sub-class implementations should invoke getDecoder().setListener() to receive decoded symbol stream.
|
||||
*/
|
||||
public abstract class AbstractAFSKDecoder extends Decoder implements IReusableBufferListener, Listener<ReusableBuffer>
|
||||
{
|
||||
private AFSK1200Decoder mAFSK1200Decoder;
|
||||
|
||||
public AbstractAFSKDecoder(AFSK1200Decoder decoder)
|
||||
{
|
||||
mAFSK1200Decoder = decoder;
|
||||
}
|
||||
|
||||
public AbstractAFSKDecoder(AFSK1200Decoder.Output output)
|
||||
{
|
||||
mAFSK1200Decoder = new AFSK1200Decoder(output);
|
||||
}
|
||||
|
||||
protected AFSK1200Decoder getDecoder()
|
||||
{
|
||||
return mAFSK1200Decoder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receive(ReusableBuffer reusableBuffer)
|
||||
{
|
||||
mAFSK1200Decoder.receive(reusableBuffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Listener<ReusableBuffer> getReusableBufferListener()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -20,34 +20,25 @@ package io.github.dsheirer.module.decode.fleetsync2;
|
||||
import io.github.dsheirer.alias.AliasList;
|
||||
import io.github.dsheirer.bits.MessageFramer;
|
||||
import io.github.dsheirer.bits.SyncPattern;
|
||||
import io.github.dsheirer.dsp.fsk.AFSK1200Decoder;
|
||||
import io.github.dsheirer.dsp.symbol.ISyncDetectListener;
|
||||
import io.github.dsheirer.dsp.symbol.SyncDetectProvider;
|
||||
import io.github.dsheirer.module.decode.Decoder;
|
||||
import io.github.dsheirer.dsp.afsk.AFSK1200Decoder;
|
||||
import io.github.dsheirer.module.decode.DecoderType;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.sample.buffer.IReusableBufferListener;
|
||||
import io.github.dsheirer.sample.buffer.ReusableBuffer;
|
||||
import io.github.dsheirer.module.decode.afsk.AbstractAFSKDecoder;
|
||||
|
||||
/**
|
||||
* Fleetsync II Decoder
|
||||
*/
|
||||
public class Fleetsync2Decoder extends Decoder implements IReusableBufferListener, Listener<ReusableBuffer>,
|
||||
SyncDetectProvider
|
||||
public class Fleetsync2Decoder extends AbstractAFSKDecoder
|
||||
{
|
||||
/* Message length - 5 x REVS + 16 x SYNC + 8 x 64Bit Blocks */
|
||||
protected static final int MESSAGE_LENGTH = 537;
|
||||
|
||||
protected AFSK1200Decoder mAFSK1200Decoder;
|
||||
//Message length - 5 x REVS + 16 x SYNC + 8 x 64Bit Blocks
|
||||
private static final int MESSAGE_LENGTH = 537;
|
||||
private MessageFramer mMessageFramer;
|
||||
private Fleetsync2MessageProcessor mMessageProcessor;
|
||||
|
||||
public Fleetsync2Decoder(AFSK1200Decoder afsk1200Decoder, AliasList aliasList)
|
||||
{
|
||||
mAFSK1200Decoder = afsk1200Decoder;
|
||||
super(afsk1200Decoder);
|
||||
mMessageFramer = new MessageFramer(SyncPattern.FLEETSYNC2.getPattern(), MESSAGE_LENGTH);
|
||||
mAFSK1200Decoder.setMessageFramer(mMessageFramer);
|
||||
mMessageFramer.setSyncDetectListener(mAFSK1200Decoder);
|
||||
getDecoder().setMessageFramer(mMessageFramer);
|
||||
mMessageProcessor = new Fleetsync2MessageProcessor(aliasList);
|
||||
mMessageFramer.addMessageListener(mMessageProcessor);
|
||||
mMessageProcessor.setMessageListener(getMessageListener());
|
||||
@@ -55,12 +46,7 @@ public class Fleetsync2Decoder extends Decoder implements IReusableBufferListene
|
||||
|
||||
public Fleetsync2Decoder(AliasList aliasList)
|
||||
{
|
||||
this(new AFSK1200Decoder(MESSAGE_LENGTH, false), aliasList);
|
||||
}
|
||||
|
||||
public void dispose()
|
||||
{
|
||||
super.dispose();
|
||||
this(new AFSK1200Decoder(AFSK1200Decoder.Output.NORMAL), aliasList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,27 +55,9 @@ public class Fleetsync2Decoder extends Decoder implements IReusableBufferListene
|
||||
return DecoderType.FLEETSYNC2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Listener<ReusableBuffer> getReusableBufferListener()
|
||||
{
|
||||
return mAFSK1200Decoder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receive(ReusableBuffer reusableBuffer)
|
||||
{
|
||||
mAFSK1200Decoder.receive(reusableBuffer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
mMessageFramer.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSyncDetectListener(ISyncDetectListener listener)
|
||||
{
|
||||
mMessageFramer.setSyncDetectListener(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,28 +15,25 @@
|
||||
******************************************************************************/
|
||||
package io.github.dsheirer.module.decode.fleetsync2;
|
||||
|
||||
import io.github.dsheirer.alias.AliasList;
|
||||
import io.github.dsheirer.dsp.fsk.AFSK1200Decoder;
|
||||
import io.github.dsheirer.dsp.fsk.AFSK1200DecoderInstrumented;
|
||||
import io.github.dsheirer.dsp.fsk.SampleBufferInstrumented;
|
||||
import io.github.dsheirer.dsp.fsk.ZeroCrossingErrorDetectorInstrumented;
|
||||
import io.github.dsheirer.dsp.afsk.AFSK1200DecoderInstrumented;
|
||||
import io.github.dsheirer.sample.buffer.ReusableBuffer;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
|
||||
/**
|
||||
* Instrumented version of the AFSK-1200 decoder for use with DemodulatorViewerFX
|
||||
*/
|
||||
public class Fleetsync2DecoderInstrumented extends Fleetsync2Decoder
|
||||
{
|
||||
public SimpleIntegerProperty bufferCount = new SimpleIntegerProperty();
|
||||
|
||||
public Fleetsync2DecoderInstrumented(AliasList aliasList)
|
||||
public Fleetsync2DecoderInstrumented()
|
||||
{
|
||||
super(new AFSK1200DecoderInstrumented(MESSAGE_LENGTH,
|
||||
new SampleBufferInstrumented(AFSK1200Decoder.SAMPLES_PER_SYMBOL, AFSK1200Decoder.COARSE_TIMING_GAIN),
|
||||
new ZeroCrossingErrorDetectorInstrumented(AFSK1200Decoder.SAMPLES_PER_SYMBOL), false), aliasList);
|
||||
super(new AFSK1200DecoderInstrumented(false), null);
|
||||
}
|
||||
|
||||
public AFSK1200DecoderInstrumented getAFSK1200Decoder()
|
||||
{
|
||||
return (AFSK1200DecoderInstrumented)mAFSK1200Decoder;
|
||||
return (AFSK1200DecoderInstrumented)getDecoder();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user