Updates complex decimation filters to use either scalar or vector optimal implementation. (#1148)

Updates HackRF native byte buffers with automatic DC removal.
Creates new half-band channel source to replace the cic-based channel source in the heterodyne channelizer.  Resolves issue in RTL native buffer processing.  Creates a CACHED thread pool and reduces the number of threads for the SCHEDULED thread pool to 2.  Changes each of the channel source implementations to use a dedicated thread (Dispatcher class) instead of the scheduled thread pool, to reduce the amount of buffered/retained samples objects in memory. Lots of other small changes and tweaks.
Removes last of Reusable buffer code.  Updates DFTProcessor to use a single thread scheduled executor.  Updates Polyphase channelizer to use threads instead of an executor.  Removes a number of unused classes.
Commenting out window calibration.  Scalar is faster in both implementations.
Adds vector and scalar implementations for windows.  Repackages window and window type classes.
WIP adds vector implementations for Airspy non-interleaved buffer iterator and calibration plugins for both interleaved and non-interleaved buffer iterators.
WIP adds vector implementations for Airspy interleaved buffer iterator.
Work on developing scalar and vector implementations of airspy sample conversion and airspy native buffer processing.
Introduces new INativeBuffer framework where tuner raw samples are retained in their native (compressed) format until when they're needed and they are converted on-demand into smaller complex sample buffers to aid garbage collection.
Removes all usage of ReusableComplexBuffers and ReusableChannelREsultsBuffers.  Updates polyphase channelizer to be more efficient in output channel processing.
Updates ViterbiDecoder to change Map usage to array for memory efficiency.
Updates channel processors to used scalar implementation for gain and mixer, until the polyphase channel results can be fixed to be a multiple of the SIMD lane width.
Resolves final changes for the conversion from interleaved sample arrays to complexsamples buffers for distributing baseband samples to channels and processing chains.
Updates tuner channel sources and all decoders to receive new complex samples buffers, removing the previous reusable complex buffers as the default baseband samples buffer object.
Still to resolve is the ComplexMixer implementations.  Needs validation and a calibration implementation with an update to the complex mixer factory.
Updates the DMR decoder to use optimal (scalar vs vector) implementations of filter and AGC controls.
Updates the AM demodulator for separated I&Q float sample processing.
Code review and testing changes.
updates build script for runtime configuration.
Integrates calibration manager with main sdrtrunk application.  Updates NBFMDecoder to use new optimized FIR and Decimation filter options.
Updates real half-band decimation filters to select the optimal (scalar vs vector) implementation.
Adds calibration manager plugins.
Adds calibration manager and plugins to determine the optimal (scalar vs vector) implementation type to use for various classes of dsp components.
Adds vector squelching FM demodulator and cleans up the IIR filter and power squelch to use all floats.
Adds vector implementation of FM demodulator.  This introduces a new interface that accepts i/q samples as two separate float arrays, versus an interleaved array, which enables more efficient processing.  This new complex sample interface will be used across the codebase eventually.
Adds ComplexOscillator and a SIMD version VectorComplexOscillator.  Deprecates the LowPhaseNoiseOscillator because the ComplexOscillator is about 35% faster.  The vectorized version is about 43% faster when SIMD lane width is 8x.
Adds new vector complex filters and new real oscillators.  Note: the RealOscillator using straight Java math sin() function is 3x slower than the existing legacy implementation.  Will replace this with a complex oscillator that only uses the real part.
Updates ComplexFIRFilter to be 50% more efficient.
Adds 23 tap filter implementations.  Will not add 63-tap implementations because they are slower than the default vector implementation.
Adds 15-tap customized vector half band filters.
Adds initial custom complex vector half-band decimation filters for 11-tap and 15-tap decimation filters..
Adds vector complex half band filter implementations.  Note: performance of the generic 64-bit 2-lane filter is horrible and is not included.
Optimizes complex half-band filter to be 27% more efficient.
Implements vectorized real half-band filter implementations.
Implements a new FIR filter class that processes sample buffers instead of single sample at a time.
Refactored all of the calibratons to be time-duration based.  Testing on windows i7 gen 3 CPU showed that it took 1000x longer for one of the calibrations to run, versus my AMD 5800x.
Changed gradle jvm args so that the windows plaf export is always applied.
Updates gradle build script to ensure incubator module is included and to cleanup javafx library management for building runtime images.
Testing tweaks and changes.
Adds logging limiter to dispatcher for buffer overflows
Adds User Preferences editor for performing Vector/SIMD calibrations and new startup dialog prompting the user to perform calibrations.
Updates calibration manager and all calibration implementations to add warm-up and test phases and to reduce the overall time it takes to calibrate a system.

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2022-03-04 08:45:05 -05:00
committed by GitHub
parent 5e9c239ea3
commit 0eec2e7ab8
403 changed files with 22916 additions and 15088 deletions

View File

@@ -1,39 +1,35 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* ****************************************************************************
*/
package io.github.dsheirer.spectrum;
import com.jidesoft.swing.JideSplitPane;
import io.github.dsheirer.buffer.INativeBuffer;
import io.github.dsheirer.controller.channel.Channel;
import io.github.dsheirer.controller.channel.ChannelModel;
import io.github.dsheirer.controller.channel.ChannelProcessingManager;
import io.github.dsheirer.dsp.filter.Window.WindowType;
import io.github.dsheirer.dsp.filter.smoothing.SmoothingFilter.SmoothingType;
import io.github.dsheirer.dsp.window.WindowType;
import io.github.dsheirer.eventbus.MyEventBus;
import io.github.dsheirer.gui.playlist.channel.ViewChannelRequest;
import io.github.dsheirer.playlist.PlaylistManager;
import io.github.dsheirer.properties.SystemProperties;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.SampleType;
import io.github.dsheirer.sample.buffer.ReusableComplexBuffer;
import io.github.dsheirer.settings.ColorSetting.ColorSettingName;
import io.github.dsheirer.settings.ColorSettingMenuItem;
import io.github.dsheirer.settings.SettingsManager;
@@ -83,8 +79,8 @@ import java.awt.event.MouseWheelEvent;
import java.util.ArrayList;
import java.util.Hashtable;
public class SpectralDisplayPanel extends JPanel implements Listener<ReusableComplexBuffer>, ISourceEventProcessor,
IDFTWidthChangeProcessor
public class SpectralDisplayPanel extends JPanel
implements Listener<INativeBuffer>, ISourceEventProcessor, IDFTWidthChangeProcessor
{
private static final long serialVersionUID = 1L;
@@ -104,7 +100,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
private SpectrumPanel mSpectrumPanel;
private WaterfallPanel mWaterfallPanel;
private OverlayPanel mOverlayPanel;
private DFTProcessor mDFTProcessor;
private ComplexDftProcessor mComplexDftProcessor;
private DFTResultsConverter mDFTConverter;
private ChannelModel mChannelModel;
private ChannelProcessingManager mChannelProcessingManager;
@@ -116,10 +112,10 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
* Spectral Display Panel provides a frequency component display with a
* historical waterfall display and a transparent overlay to show frequency,
* cursor and channel information.
*
* <p>
* Mouse scrolling and zooming are supported and the waterfall display can
* be paused.
*
* <p>
* Complex sample buffers are processed by a DFTProcessor and the output of
* the DFT is translated to decibels for display in the spectrum and
* waterfall components.
@@ -175,8 +171,8 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
mSettingsManager = null;
mDFTProcessor.dispose();
mDFTProcessor = null;
mComplexDftProcessor.dispose();
mComplexDftProcessor = null;
mDFTConverter.dispose();
mDFTConverter = null;
@@ -190,7 +186,6 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
mOverlayPanel.dispose();
mOverlayPanel = null;
mTuner = null;
}
@@ -200,7 +195,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
*/
public void setDFTSize(DFTSize size, boolean save)
{
mDFTProcessor.setDFTSize(size);
mComplexDftProcessor.setDFTSize(size);
mOverlayPanel.setDFTSize(size);
mDFTSize = size;
@@ -217,8 +212,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
setDFTSize(size, true);
}
@Override
public DFTSize getDFTSize()
@Override public DFTSize getDFTSize()
{
return mDFTSize;
}
@@ -230,7 +224,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
/**
* Sets the current zoom level which will be 2 to the power of zoom (2^zoom)
*
* <p>
* 0 No Zoom
* 1 2x Zoom
* 2 4x Zoom
@@ -239,8 +233,8 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
* 5 32x Zoom
* 6 64x Zoom
*
* @param zoom level, 0 - 6.
* @param frequency under the mouse to maintain while zooming
* @param zoom level, 0 - 6.
* @param frequency under the mouse to maintain while zooming
* @param windowOffset where to maintain the frequency under the mouse
*/
public void setZoom(int zoom, long frequency, double windowOffset)
@@ -309,10 +303,9 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
return mDFTSize.getSize() / getZoomMultiplier();
}
public int getZoomMultiplier()
{
return (int) FastMath.pow(2.0, mZoom);
return (int)FastMath.pow(2.0, mZoom);
}
/**
@@ -328,9 +321,8 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
if(mOverlayPanel.containsFrequency(frequency))
{
offset = (double)mDFTSize.getSize() *
((double)(frequency - mOverlayPanel.getMinFrequency()) /
(double)mOverlayPanel.getBandwidth());
offset = (double)mDFTSize.getSize() * ((double)(frequency - mOverlayPanel.getMinFrequency())
/ (double)mOverlayPanel.getBandwidth());
}
return offset;
@@ -376,14 +368,14 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
mWaterfallPanel.addMouseWheelListener(mouser);
/* Attempt to set a 50/50 split preferred size for the split pane */
double totalHeight = mLayeredPanel.getPreferredSize().getHeight() +
mWaterfallPanel.getPreferredSize().getHeight();
double totalHeight =
mLayeredPanel.getPreferredSize().getHeight() + mWaterfallPanel.getPreferredSize().getHeight();
mLayeredPanel.setPreferredSize(new Dimension((int)mLayeredPanel
.getPreferredSize().getWidth(), (int)(totalHeight / 2.0d)));
mLayeredPanel.setPreferredSize(
new Dimension((int)mLayeredPanel.getPreferredSize().getWidth(), (int)(totalHeight / 2.0d)));
mWaterfallPanel.setPreferredSize(new Dimension((int)mWaterfallPanel
.getPreferredSize().getWidth(), (int)(totalHeight / 2.0d)));
mWaterfallPanel.setPreferredSize(
new Dimension((int)mWaterfallPanel.getPreferredSize().getWidth(), (int)(totalHeight / 2.0d)));
//Create the split pane to hold the layered pane and the waterfall
JideSplitPane splitPane = new JideSplitPane(JSplitPane.VERTICAL_SPLIT);
@@ -399,9 +391,9 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
* Setup DFTProcessor to process samples and register the waterfall and
* spectrum panel to receive the processed dft results
*/
mDFTProcessor = new DFTProcessor(SampleType.COMPLEX);
mComplexDftProcessor = new ComplexDftProcessor();
mDFTConverter = new ComplexDecibelConverter();
mDFTProcessor.addConverter(mDFTConverter);
mComplexDftProcessor.addConverter(mDFTConverter);
mDFTConverter.addListener((DFTResultsListener)mSpectrumPanel);
mDFTConverter.addListener((DFTResultsListener)mWaterfallPanel);
@@ -413,16 +405,14 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
public void process(SourceEvent event)
{
mOverlayPanel.process(event);
mDFTProcessor.process(event);
}
/**
* Complex sample buffer receive method
*/
@Override
public void receive(ReusableComplexBuffer reusableComplexBuffer)
@Override public void receive(INativeBuffer nativeBuffer)
{
mDFTProcessor.receive(reusableComplexBuffer);
mComplexDftProcessor.receive(nativeBuffer);
}
/**
@@ -433,9 +423,9 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
{
clearTuner();
mDFTProcessor.clearBuffer();
mComplexDftProcessor.clearBuffer();
mDFTProcessor.start();
mComplexDftProcessor.start();
mTuner = tuner;
@@ -445,7 +435,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
mTuner.getTunerController().addListener(this);
//Register the dft processor to receive samples from the tuner
mTuner.getTunerController().addBufferListener(mDFTProcessor);
mTuner.getTunerController().addBufferListener(mComplexDftProcessor);
mSpectrumPanel.setSampleSize(mTuner.getSampleSize());
@@ -468,12 +458,12 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
mTuner.getTunerController().removeListener(this);
//Deregister the dft processor from receiving samples
mTuner.getTunerController().removeBufferListener(mDFTProcessor);
mTuner.getTunerController().removeBufferListener(mComplexDftProcessor);
mTuner = null;
}
mDFTProcessor.stop();
mDFTProcessor.clearBuffer();
mComplexDftProcessor.stop();
mComplexDftProcessor.clearBuffer();
mSpectrumPanel.clearSpectrum();
mWaterfallPanel.clearWaterfall();
}
@@ -484,8 +474,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
*/
public class ResizeListener implements ComponentListener
{
@Override
public void componentResized(ComponentEvent e)
@Override public void componentResized(ComponentEvent e)
{
Component c = e.getComponent();
@@ -493,18 +482,15 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
mOverlayPanel.setBounds(0, 0, c.getWidth(), c.getHeight());
}
@Override
public void componentHidden(ComponentEvent arg0)
@Override public void componentHidden(ComponentEvent arg0)
{
}
@Override
public void componentMoved(ComponentEvent arg0)
@Override public void componentMoved(ComponentEvent arg0)
{
}
@Override
public void componentShown(ComponentEvent arg0)
@Override public void componentShown(ComponentEvent arg0)
{
}
}
@@ -522,8 +508,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
{
}
@Override
public void mouseWheelMoved(MouseWheelEvent e)
@Override public void mouseWheelMoved(MouseWheelEvent e)
{
int zoom = mZoom - e.getWheelRotation();
@@ -534,14 +519,12 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
setZoom(zoom, frequency, windowOffset);
}
@Override
public void mouseMoved(MouseEvent event)
@Override public void mouseMoved(MouseEvent event)
{
update(event);
}
@Override
public void mouseDragged(MouseEvent event)
@Override public void mouseDragged(MouseEvent event)
{
update(event);
@@ -566,16 +549,13 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
setZoomWindowOffset(offset);
}
@Override
public void mousePressed(MouseEvent e)
@Override public void mousePressed(MouseEvent e)
{
mDragStartX = e.getX();
mDFTZoomWindowOffsetAtDragStart = mDFTZoomWindowOffset;
mPixelsPerBin = (double)getWidth() /
((double)(mDFTSize.getSize()) /
(double)getZoomMultiplier());
mPixelsPerBin = (double)getWidth() / ((double)(mDFTSize.getSize()) / (double)getZoomMultiplier());
}
/**
@@ -590,13 +570,11 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
else
{
mWaterfallPanel.setCursorLocation(event.getPoint());
mWaterfallPanel.setCursorFrequency(
mOverlayPanel.getFrequencyFromAxis(event.getPoint().x));
mWaterfallPanel.setCursorFrequency(mOverlayPanel.getFrequencyFromAxis(event.getPoint().x));
}
}
@Override
public void mouseEntered(MouseEvent e)
@Override public void mouseEntered(MouseEvent e)
{
if(e.getComponent() == mOverlayPanel)
{
@@ -608,8 +586,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
}
}
@Override
public void mouseExited(MouseEvent e)
@Override public void mouseExited(MouseEvent e)
{
mOverlayPanel.setCursorVisible(false);
mWaterfallPanel.setCursorVisible(false);
@@ -618,8 +595,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
/**
* Displays the context menu.
*/
@Override
public void mouseClicked(MouseEvent event)
@Override public void mouseClicked(MouseEvent event)
{
if(SwingUtilities.isRightMouseButton(event))
{
@@ -631,8 +607,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
contextMenu.add(new JSeparator());
}
long frequency =
mOverlayPanel.getFrequencyFromAxis(event.getX());
long frequency = mOverlayPanel.getFrequencyFromAxis(event.getX());
if(event.getComponent() == mOverlayPanel)
{
@@ -642,7 +617,8 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
for(Channel channel : channels)
{
JMenuItem viewChannel = new JMenuItem("View/Edit: " + channel.getShortTitle());
viewChannel.addActionListener(e -> MyEventBus.getGlobalEventBus().post(new ViewChannelRequest(channel)));
viewChannel.addActionListener(
e -> MyEventBus.getGlobalEventBus().post(new ViewChannelRequest(channel)));
channelMenu.add(viewChannel);
}
@@ -659,29 +635,21 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
*/
JMenu colorMenu = new JMenu("Color");
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.CHANNEL_CONFIG));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.CHANNEL_CONFIG));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.CHANNEL_CONFIG_PROCESSING));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.CHANNEL_CONFIG_PROCESSING));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.CHANNEL_CONFIG_SELECTED));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.CHANNEL_CONFIG_SELECTED));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.SPECTRUM_CURSOR));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.SPECTRUM_CURSOR));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.SPECTRUM_LINE));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.SPECTRUM_LINE));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.SPECTRUM_BACKGROUND));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.SPECTRUM_BACKGROUND));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.SPECTRUM_GRADIENT_BOTTOM));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.SPECTRUM_GRADIENT_BOTTOM));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager,
ColorSettingName.SPECTRUM_GRADIENT_TOP));
colorMenu.add(new ColorSettingMenuItem(mSettingsManager, ColorSettingName.SPECTRUM_GRADIENT_TOP));
contextMenu.add(colorMenu);
@@ -697,8 +665,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
* Averaging menu
*/
JMenu averagingMenu = new JMenu("Averaging");
averagingMenu.add(
new AveragingItem(mSpectrumPanel, 4));
averagingMenu.add(new AveragingItem(mSpectrumPanel, 4));
displayMenu.add(averagingMenu);
/**
@@ -706,17 +673,13 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
*/
JMenu channelDisplayMenu = new JMenu("Channel");
channelDisplayMenu.add(new ChannelDisplayItem(
mOverlayPanel, ChannelDisplay.ALL));
channelDisplayMenu.add(new ChannelDisplayItem(
mOverlayPanel, ChannelDisplay.ENABLED));
channelDisplayMenu.add(new ChannelDisplayItem(
mOverlayPanel, ChannelDisplay.NONE));
channelDisplayMenu.add(new ChannelDisplayItem(mOverlayPanel, ChannelDisplay.ALL));
channelDisplayMenu.add(new ChannelDisplayItem(mOverlayPanel, ChannelDisplay.ENABLED));
channelDisplayMenu.add(new ChannelDisplayItem(mOverlayPanel, ChannelDisplay.NONE));
displayMenu.add(channelDisplayMenu);
}
/**
* FFT width
*/
@@ -734,14 +697,14 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
JMenu frameRateMenu = new JMenu("Frame Rate");
displayMenu.add(frameRateMenu);
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 14));
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 16));
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 18));
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 20));
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 25));
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 30));
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 40));
frameRateMenu.add(new FrameRateItem(mDFTProcessor, 50));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 14));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 16));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 18));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 20));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 25));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 30));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 40));
frameRateMenu.add(new FrameRateItem(mComplexDftProcessor, 50));
/**
* FFT Window Type
@@ -751,8 +714,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
for(WindowType type : WindowType.values())
{
fftWindowType.add(
new FFTWindowTypeItem(mDFTProcessor, type));
fftWindowType.add(new FFTWindowTypeItem(mComplexDftProcessor, type));
}
if(event.getComponent() != mWaterfallPanel)
@@ -794,7 +756,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
boolean separatorAdded = false;
for(Tuner tuner: mTunerModel.getTuners())
for(Tuner tuner : mTunerModel.getTuners())
{
if(mTuner == null || mTuner != tuner)
{
@@ -812,15 +774,11 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
{
if(event.getComponent() == mOverlayPanel)
{
contextMenu.show(mOverlayPanel,
event.getX(),
event.getY());
contextMenu.show(mOverlayPanel, event.getX(), event.getY());
}
else
{
contextMenu.show(mWaterfallPanel,
event.getX(),
event.getY());
contextMenu.show(mWaterfallPanel, event.getX(), event.getY());
}
}
}
@@ -845,13 +803,11 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
@Override public void actionPerformed(ActionEvent e)
{
EventQueue.invokeLater(new Runnable()
{
@Override
public void run()
@Override public void run()
{
mPausable.setPaused(!paused);
}
@@ -875,7 +831,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
mFrequency = frequency;
mWindowOffset = windowOffset;
Hashtable<Integer,JComponent> labels = new Hashtable<>();
Hashtable<Integer, JComponent> labels = new Hashtable<>();
labels.put(0, new JLabel("1x"));
labels.put(1, new JLabel("2x"));
labels.put(2, new JLabel("4x"));
@@ -893,8 +849,7 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
this.addChangeListener(new ChangeListener()
{
@Override
public void stateChanged(ChangeEvent e)
@Override public void stateChanged(ChangeEvent e)
{
setZoom(getValue(), mFrequency, mWindowOffset);
}
@@ -921,13 +876,11 @@ public class SpectralDisplayPanel extends JPanel implements Listener<ReusableCom
addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
@Override public void actionPerformed(ActionEvent e)
{
EventQueue.invokeLater(new Runnable()
{
@Override
public void run()
@Override public void run()
{
mOverlayPanel.setChannelDisplay(mChannelDisplay);
}