Channel Spectral Display

- Adds Channel Spectrum tab to display FFT of the audio output of the currently selected channel
 - Upgrades to JTransforms 3.0 FFT library
 - Adds three new context menus to main and channel spectral displays:
   -- Baseline - affects the vertical rendering baseline of the FFT
   -- Amplification - affects the vertical height of each FFT bin
   -- Averaging - affects how many FFTs are averaged to produce the display
This commit is contained in:
dennis.sheirer
2014-09-06 14:58:05 +00:00
parent 5ddf538e2a
commit 4e0fd9b7b0
44 changed files with 1986 additions and 549 deletions

View File

@@ -20,8 +20,6 @@ package source.mixer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import source.Source.SampleType;
/**
* Converts 16-bit little endian byte data into an array of floats
*/

View File

@@ -84,7 +84,7 @@ public enum TunerClass
return mVendorDescription + " " + mDeviceDescription;
}
public TunerType getTunerClass()
public TunerType getTunerType()
{
return mTunerType;
}

View File

@@ -141,7 +141,7 @@ public class TunerManager
case FUNCUBE_DONGLE_PRO:
//Locate the matching mixer tuner dataline
MixerTunerDataLine fcd1Dataline =
getMixerTunerDataLine( tunerClass.getTunerClass() );
getMixerTunerDataLine( tunerClass.getTunerType() );
if( fcd1Dataline != null )
{
FCD1TunerController fcd1Controller;
@@ -182,7 +182,7 @@ public class TunerManager
case FUNCUBE_DONGLE_PRO_PLUS:
//Locate the matching mixer tuner dataline
MixerTunerDataLine fcd2Dataline =
getMixerTunerDataLine( tunerClass.getTunerClass() );
getMixerTunerDataLine( tunerClass.getTunerType() );
if( fcd2Dataline != null )
{
@@ -245,13 +245,15 @@ public class TunerManager
case TERRATEC_T_STICK_PLUS:
case TWINTECH_UT40:
case ZAAPA_ZTMINDVBZP:
TunerType tunerType = tunerClass.getTunerClass();
TunerType tunerType = tunerClass.getTunerType();
if( tunerType == TunerType.RTL2832_VARIOUS )
{
tunerType = RTL2832TunerController.identifyTunerType( device );
}
Log.debug( "TunerManager - identified tuner class [" + tunerClass.toString() + "] with tuner type [" + tunerType.toString() + "]" );
switch( tunerType )
{
case ELONICS_E4000:
@@ -286,11 +288,13 @@ public class TunerManager
}
break;
case RAFAELMICRO_R820T:
Log.debug( "TunerManager - attempting to construct R820T tuner controller" );
try
{
R820TTunerController controller =
new R820TTunerController( device );
Log.debug( "TunerManager - init() R820T tuner controller" );
controller.init();
RTL2832Tuner rtlTuner =
@@ -302,8 +306,13 @@ public class TunerManager
if( config != null )
{
Log.debug( "TunerManager - applying tuner config to R820T tuner" );
rtlTuner.apply( config );
}
else
{
Log.debug( "TunerManager - R820T tuner config was null - not applied" );
}
mTuners.add( rtlTuner );
status = sLOADED;
@@ -315,6 +324,8 @@ public class TunerManager
status = sNOT_LOADED;
reason = "Error constructing R820T tuner "
+ "controller - " + se.getLocalizedMessage();
Log.error( "TunerManager - error constructing tuner", se );
}
break;
case FITIPOWER_FC0012:
@@ -324,8 +335,8 @@ public class TunerManager
default:
status = sNOT_LOADED;
reason = "SDRTRunk doesn't currently support RTL2832 "
+ "Dongle with [" + tunerType.toString() +
"] tuner";
+ "Dongle with [" + tunerType.toString() +
"] tuner for tuner class[" + tunerClass.toString() + "]";
break;
}
break;

View File

@@ -17,7 +17,6 @@
******************************************************************************/
package source.tuner.rtl;
import source.Source.SampleType;
import source.mixer.SampleAdapter;
public class RTL2832SampleAdapter extends SampleAdapter
@@ -26,17 +25,15 @@ public class RTL2832SampleAdapter extends SampleAdapter
/**
* Creates a static lookup table that converts the 8-bit valued range
* from 0 - 255 into scaled float values of -128 to 0 to 127
* from 0 - 255 into scaled float values of -32768.0 to 0 to 32512.0
*/
static
{
mLOOKUP_VALUES = new float[ 256 ];
float scale = (float)( 1.0f / 127.0f );
for( int x = 0; x < 256; x++ )
{
mLOOKUP_VALUES[ x ] = (float)( x - 128 ) * scale;
mLOOKUP_VALUES[ x ] = (float)( x - 128 ) * 256.0f;
}
mLOOKUP_VALUES[ 128 ] = 0.0000001f;

View File

@@ -412,7 +412,7 @@ public abstract class RTL2832TunerController extends TunerController
tunerClass = TunerType.FITIPOWER_FC0012;
}
Log.debug( "RTL2832 - disabling I2C repeater" );
Log.debug( "RTL2832 - disabling I2C repeater -- detected tuner type:" + tunerClass.toString() );
enableI2CRepeater( device, false );