Merge master and re-apply the source event structures to the DFT processor.

This commit is contained in:
Denny
2018-01-15 05:03:03 -05:00
parent 78205bb1bf
commit 5ae3cb38e1

View File

@@ -21,8 +21,8 @@ import io.github.dsheirer.properties.SystemProperties;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.SampleType;
import io.github.dsheirer.sample.complex.ComplexBuffer;
import io.github.dsheirer.source.tuner.frequency.FrequencyChangeEvent;
import io.github.dsheirer.source.tuner.frequency.IFrequencyChangeProcessor;
import io.github.dsheirer.source.ISourceEventProcessor;
import io.github.dsheirer.source.SourceEvent;
import io.github.dsheirer.spectrum.converter.DFTResultsConverter;
import io.github.dsheirer.util.ThreadPool;
import org.jtransforms.fft.FloatFFT_1D;
@@ -40,15 +40,15 @@ import java.util.concurrent.atomic.AtomicBoolean;
* Processes both complex samples or float samples and dispatches a float array of DFT results, using configurable fft
* size and output dispatch timelines.
*/
public class DFTProcessor implements Listener<ComplexBuffer>, IFrequencyChangeProcessor, IDFTWidthChangeProcessor
public class DFTProcessor implements Listener<ComplexBuffer>, ISourceEventProcessor, IDFTWidthChangeProcessor
{
private static final Logger mLog = LoggerFactory.getLogger(DFTProcessor.class);
private static final int BUFFER_QUEUE_MAX_SIZE = 12;
private static final int BUFFER_QUEUE_OVERFLOW_RESET_THRESHOLD = 6;
private static final String FRAME_RATE_PROPERTY = "spectral.display.frame.rate";
//The Cosine and Hanning windows seem to offer the best spectral display with minimal bin leakage/smearing
private WindowType mWindowType = Window.WindowType.HANNING;
//The Cosine and Hann windows seem to offer the best spectral display with minimal bin leakage/smearing
private WindowType mWindowType = WindowType.HANN;
private double[] mWindow;
private DFTSize mDFTSize = DFTSize.FFT04096;
private DFTSize mNewDFTSize = DFTSize.FFT04096;
@@ -289,7 +289,7 @@ public class DFTProcessor implements Listener<ComplexBuffer>, IFrequencyChangePr
}
@Override
public void frequencyChanged(FrequencyChangeEvent event)
public void process(SourceEvent event)
{
switch(event.getEvent())
{