Memory/CPU performance improvement and Audio/Mixer source restructuring

Converted to use float primitives and to keep samples in buffer format until the sample rate is decimated to 48kHz.  
Added new non-recursive, CIC decimation filter -- untested

Updated sound card/mixer input source management.  Now testing for mono/stereo support for each card and limiting channel choices accordingly.  Separated the mixersource into a ComplexMixer and and SimplexMixerSource.  The ComplexMixer is used for sound card based tuners like the funcube.  The SimplexMixerSource is used for demodulated sound card inputs.

Interfaces for sample handling - standardized on using 'Complex' to indicate I/Q samples and 'Simplex' to indicate demodulated float samples.  The processing chain now accepts either a decimated (48k) list of complex samples from a tuner channel source, or a 48k simplex buffer (array of demodulated float samples).

Resolved issue with HackRF tuner not applying tuner configuration information.
This commit is contained in:
dennis.sheirer
2014-10-26 10:11:30 +00:00
parent 0ad710fea2
commit e61c3a891c
71 changed files with 1754 additions and 619 deletions

View File

@@ -17,7 +17,7 @@
******************************************************************************/
package audio;
import sample.Listener;
import sample.simplex.SimplexSampleListener;
import util.Oscillator;
import dsp.filter.Filters;
import dsp.filter.FloatFIRFilter;
@@ -26,11 +26,11 @@ import dsp.filter.FloatFIRFilter;
* Applies audio inversion (or un-inversion) to a stream of float audio samples
* by multiplying each successive sample by either a 1 or a -1 value.
*/
public class AudioInverter implements Listener<Float>
public class AudioInverter implements SimplexSampleListener
{
private Oscillator mSineWaveGenerator;
private FloatFIRFilter mPostInversionLowPassFilter;
private Listener<Float> mListener;
private SimplexSampleListener mListener;
public AudioInverter( int inversionFrequency, int sampleRate )
{
@@ -47,13 +47,13 @@ public class AudioInverter implements Listener<Float>
this( frequency.getFrequency(), sampleRate );
}
public void setListener( Listener<Float> listener )
public void setListener( SimplexSampleListener listener )
{
mListener = listener;
}
@Override
public void receive( Float sample )
public void receive( float sample )
{
//Multiply the sample by the folding frequency and then send it to
//the low pass filter
@@ -68,10 +68,10 @@ public class AudioInverter implements Listener<Float>
* Simple class to receive the output of the FIR low pass filter and then
* send it to the registered listener(s)
*/
class FilteredSampleProcessor implements Listener<Float>
class FilteredSampleProcessor implements SimplexSampleListener
{
@Override
public void receive( Float sample )
public void receive( float sample )
{
if( mListener != null )
{

View File

@@ -27,10 +27,10 @@ import javax.sound.sampled.SourceDataLine;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sample.Listener;
import sample.simplex.SimplexSampleListener;
import buffer.FloatSampleBufferAssembler;
public class AudioOutput implements Listener<Float>,
public class AudioOutput implements SimplexSampleListener,
SquelchListener,
AudioTypeListener
{
@@ -88,7 +88,7 @@ public class AudioOutput implements Listener<Float>,
}
@Override
public void receive( Float sample )
public void receive( float sample )
{
float outputSample = mAdapter.get( sample );