P25 LSM work in progress. CQPSK demodulator is working now, but there is a slight phase error in the constellation (it's rotated right by 5-10 degrees). I'm not sure if this is an error coming from the decoder, or if it's reflecting a phase imbalance from the source tuner i/q data.

This commit is contained in:
dennis.sheirer
2015-02-16 23:14:23 +00:00
parent 78163caf4f
commit 7d948c4af4
6 changed files with 322 additions and 281 deletions

View File

@@ -50,7 +50,7 @@ public class QPSKTapPanel extends TapViewPanel
mTap = tap;
mTap.addListener( getModel() );
mSampleCount = (int)( 500 * tap.getSampleRateRatio() );
mSampleCount = (int)( 100 * tap.getSampleRateRatio() );
getModel().setSampleCount( mSampleCount );
getModel().setDelay( tap.getDelay() );
@@ -78,9 +78,21 @@ public class QPSKTapPanel extends TapViewPanel
g2.setColor( Color.DARK_GRAY );
/* Vertical Line */
g2.drawLine( getWidth() / 2, 5, getWidth() / 2, getHeight() - 5 );
/* Horizontal Line */
g2.drawLine( getWidth() / 2 - (int)( middle ), getHeight() / 2,
getWidth() / 2 + (int)( middle ), getHeight() / 2 );
g2.setColor( Color.CYAN );
/* Crossed Lines */
g2.drawLine( getWidth() / 2 - (int)( middle ), 5,
getWidth() / 2 + (int)( middle ), getHeight() - 5 );
g2.drawLine( getWidth() / 2 + (int)( middle ), 5,
getWidth() / 2 - (int)( middle ), getHeight() - 5 );
if( mSamples != null &&
@@ -103,31 +115,35 @@ public class QPSKTapPanel extends TapViewPanel
g2.setColor( getForeground() );
}
float scale;
if( sample.real() != 0 && sample.imaginary() != 0 )
{
scale = 1.0f / sample.magnitude();
}
else if( sample.real() == 0 )
{
scale = 1.0f / sample.imaginary();
}
else
{
scale = 1.0f / sample.real();
}
// float scale;
//
// if( sample.real() != 0 && sample.imaginary() != 0 )
// {
// scale = 1.0f / sample.magnitude();
// }
// else if( sample.real() == 0 )
// {
// scale = 1.0f / sample.imaginary();
// }
// else
// {
// scale = 1.0f / sample.real();
// }
// float x = ( getWidth() / 2 ) +
// ( scale * sample.real() * middle * 0.75f * mVerticalZoom );
float x = ( getWidth() / 2 ) +
( scale * sample.real() * middle * 0.75f * mVerticalZoom );
( sample.real() * middle * 0.75f * mVerticalZoom );
if( Float.isNaN( x ) )
{
x = getWidth() / 2;
}
// float y = ( getHeight() / 2 ) +
// ( scale * sample.imaginary() * middle * 0.75f * mVerticalZoom );
float y = ( getHeight() / 2 ) +
( scale * sample.imaginary() * middle * 0.75f * mVerticalZoom );
( sample.imaginary() * middle * 0.75f * mVerticalZoom );
if( Float.isNaN( y ) )
{