This commit is contained in:
Denny Sheirer
2015-12-16 00:11:58 +00:00
42 changed files with 882 additions and 355 deletions

View File

@@ -260,9 +260,6 @@ public class C4FMSymbolFilter implements FrequencyCorrectionResetListener,
// .getErrorCorrection() );
mFrequencyAdjustmentRequested = 0;
/* reset internal frequency error tracker */
mCoarseFrequencyCorrection = 0;
}
}

View File

@@ -149,9 +149,9 @@ public class P25DecoderPanel extends DecoderPanel
{
mFromAlias.setText( from.getName() );
String icon = from.getIconName();
final String icon = from.getIconName();
if( icon != null )
if( icon != null && mSettingsManager != null )
{
mFromAlias.setIcon( mSettingsManager.getImageIcon(
icon, SettingsManager.DEFAULT_ICON_SIZE ) );
@@ -180,9 +180,9 @@ public class P25DecoderPanel extends DecoderPanel
{
mToAlias.setText( to.getName() );
String icon = to.getIconName();
final String icon = to.getIconName();
if( icon != null )
if( icon != null && mSettingsManager != null )
{
mToAlias.setIcon( mSettingsManager.getImageIcon(
icon, SettingsManager.DEFAULT_ICON_SIZE ) );

View File

@@ -24,6 +24,7 @@ import instrument.tap.stream.FloatBufferTap;
import instrument.tap.stream.FloatTap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.slf4j.Logger;
@@ -74,8 +75,10 @@ public class P25_C4FMDecoder extends P25Decoder implements IRealBufferListener
super( aliasList );
/* Filter demodulated sample buffers */
mC4FMPreFilter = new RealFIRFilter_RB_RB( FilterFactory.getLowPass(
48000, 6750, 7500, 60, WindowType.HANNING, true ), 1.0f );
float[] filter = FilterFactory.getLowPass( 48000, 2500, 4000, 80, WindowType.HANNING, true );
mLog.debug( "Filter taps:" + filter.length + " co:" + Arrays.toString( filter ) );
mC4FMPreFilter = new RealFIRFilter_RB_RB( filter, 1.0f );
/* Issue tuned frequency correction commands, remotely controlled by the
* downstream symbol filter */

View File

@@ -6,8 +6,6 @@ import message.IMessageListener;
import message.Message;
import module.Module;
import module.decode.p25.message.ldu.LDUMessage;
import module.decode.p25.message.tdu.TDUMessage;
import module.decode.p25.message.tdu.lc.TDULinkControlMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -23,6 +21,8 @@ import audio.squelch.ISquelchStateListener;
import audio.squelch.SquelchState;
import controller.channel.ChannelEvent;
import controller.channel.IChannelEventListener;
import dsp.filter.iir.DeemphasisFilter;
import dsp.gain.NonClippingGain;
public class P25AudioModule extends Module implements Listener<Message>,
IAudioPacketProvider, IMessageListener, IChannelEventListener,
@@ -43,6 +43,7 @@ public class P25AudioModule extends Module implements Listener<Message>,
private AudioMetadata mAudioMetadata;
private ChannelEventListener mChannelEventListener = new ChannelEventListener();
private SquelchStateListener mSquelchStateListener = new SquelchStateListener();
private NonClippingGain mGain = new NonClippingGain( 5.0f, 0.95f );
public P25AudioModule( boolean record )
{
@@ -89,9 +90,10 @@ public class P25AudioModule extends Module implements Listener<Message>,
}
/**
* Primary inject point for p25 imbe audio frame messages. Each LDU audio
* message contains 9 imbe voice frames. If the audio is not encrypted,
* we insert each audio frame asynchronously into the audio converter.
* Primary processing method for p25 imbe audio frame messages. Each LDU
* audio message contains 9 imbe voice frames. Each frame is converted to
* audio when the JMBE library is loaded, processed by auto-gain, and
* broadcast to the audio packet listener.
*/
public void receive( Message message )
{
@@ -101,15 +103,15 @@ public class P25AudioModule extends Module implements Listener<Message>,
{
LDUMessage ldu = (LDUMessage)message;
/* If we detect a valid LDU message with the encryption flag
* set to true, we toggle the encrypted audio state until we
* receive the first TDU or TDULC message, then reset it. */
/* Only process unencrypted audio frames */
if( !( ldu.isValid() && ldu.isEncrypted() ) )
{
for( byte[] frame: ((LDUMessage)message).getIMBEFrames() )
for( byte[] frame: ldu.getIMBEFrames() )
{
float[] audio = mAudioConverter.decode( frame );
audio = mGain.apply( audio );
mAudioPacketListener.receive(
new AudioPacket( audio, mAudioMetadata.copyOf() ) );
}