mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Initial commit of redesigned internal processing and audio management.
Note: Several of the decoders are currently non-functioning in this commit. If you want the latest functioning codebase, please checkout the commit prior to this one. All decoders will eventually be updated with this new architecture. Currently broken: - Logging and recording - Aux decoders (Fleetsync/MDC/LoJack/Tait) - LTR/Passport decoders Changes in this commit: - Module architecture for decoders and components with central provisioning by the DecoderFactory - Transition from Complex sample stream processing to float buffer processing for improved memory management - Redesigned filter structures - to support buffers and streams - Resolved several memory leak issues - Universal sharing of the thread pool manager - Added centralized audio management with call/user prioritization and new gui with mute/volume controls - Embedded audio metadata for eventual streaming support - Redesigned ProcessingChain to support independent re-use - Added new TrafficChannelManager to handle traffic channel allocations - Traffic Channel pool size and Call timeout available in P25 and MPT1327 configs - Redesigned channel and decoder gui components
This commit is contained in:
@@ -26,7 +26,7 @@ import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
import sample.Listener;
|
||||
import sample.real.RealSampleListener;
|
||||
import sample.real.RealBuffer;
|
||||
import buffer.BooleanAveragingBuffer;
|
||||
import dsp.symbol.SymbolEvent;
|
||||
import dsp.symbol.SymbolEvent.Shift;
|
||||
@@ -51,7 +51,7 @@ import dsp.symbol.SymbolEvent.Shift;
|
||||
* Implements instrumentable interface, so that slice events can be received
|
||||
* externally to analyze decoder performance.
|
||||
*/
|
||||
public class FSK2Decoder implements Instrumentable, RealSampleListener
|
||||
public class FSK2Decoder implements Instrumentable, Listener<RealBuffer>
|
||||
{
|
||||
public enum Output{ NORMAL, INVERTED };
|
||||
|
||||
@@ -95,23 +95,26 @@ public class FSK2Decoder implements Instrumentable, RealSampleListener
|
||||
* Primary sample input
|
||||
*/
|
||||
@Override
|
||||
public void receive( float floatSample )
|
||||
public void receive( RealBuffer buffer )
|
||||
{
|
||||
/* Square the sample. Greater than zero is a 1 (true) and less than
|
||||
* zero is a 0 (false) */
|
||||
boolean bitSample = ( floatSample >= 0.0f );
|
||||
for( float sample: buffer.getSamples() )
|
||||
{
|
||||
/* Square the sample. Greater than zero is a 1 (true) and less than
|
||||
* zero is a 0 (false) */
|
||||
boolean bitSample = ( sample >= 0.0f );
|
||||
|
||||
/* Feed the delay buffer and fetch the one-baud delayed sample */
|
||||
boolean delayedBitSample = mDelayBuffer.get( bitSample );
|
||||
/* Feed the delay buffer and fetch the one-baud delayed sample */
|
||||
boolean delayedBitSample = mDelayBuffer.get( bitSample );
|
||||
|
||||
/* Correlation: xor current bit with delayed bit */
|
||||
boolean softBit = bitSample ^ delayedBitSample;
|
||||
/* Correlation: xor current bit with delayed bit */
|
||||
boolean softBit = bitSample ^ delayedBitSample;
|
||||
|
||||
/* Low pass filter to smooth the correlated values */
|
||||
boolean filteredSoftBit = mLowPassFilter.getAverage( softBit );
|
||||
/* Low pass filter to smooth the correlated values */
|
||||
boolean filteredSoftBit = mLowPassFilter.getAverage( softBit );
|
||||
|
||||
/* Send the filtered correlated bit to the slicer */
|
||||
mSlicer.receive( filteredSoftBit );
|
||||
/* Send the filtered correlated bit to the slicer */
|
||||
mSlicer.receive( filteredSoftBit );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user