mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Converted frequency to long primitive type (from integer) in anticipation of HackRF support which requires frequencies greater than 2.147 GHz, which is the max hertz value that can be represented by an integer primitive.
This commit is contained in:
@@ -38,33 +38,6 @@ public class ComplexSample implements Serializable
|
||||
mRight = right;
|
||||
}
|
||||
|
||||
public static void main( String[] args )
|
||||
{
|
||||
Log.info( "Starting ... " );
|
||||
|
||||
int frequency = 15000;
|
||||
int sampleRate = 2000000;
|
||||
|
||||
float anglePerSample = (float)( 2.0d * Math.PI * (float)frequency / (float)sampleRate );
|
||||
|
||||
ComplexSample current = new ComplexSample( 0.0f, -1.0f );
|
||||
|
||||
ComplexSample stepPerSample = ComplexSample.fromAngle( anglePerSample );
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
for( int x = 0; x < sampleRate; x++ )
|
||||
{
|
||||
// Log.info( x + " " + current.toString() );
|
||||
current.multiply( stepPerSample );
|
||||
current.fastNormalize();
|
||||
}
|
||||
|
||||
Log.info( "Elapsed: " + ( System.currentTimeMillis() - start ) );
|
||||
|
||||
Log.info( "Finished!" );
|
||||
}
|
||||
|
||||
public ComplexSample copy()
|
||||
{
|
||||
return new ComplexSample( mLeft, mRight );
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ComplexSampleRateCounter implements Listener<ComplexSample>,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void frequencyChanged( int frequency, int bandwidth )
|
||||
public void frequencyChanged( long frequency, int bandwidth )
|
||||
{
|
||||
mExpectedSampleRate = bandwidth;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user