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,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2021 Dennis Sheirer
* Copyright (C) 2014-2022 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
@@ -20,7 +20,6 @@ plugins {
id 'application'
id 'java'
id 'idea'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'org.beryx.runtime' version '1.12.7'
}
@@ -32,12 +31,6 @@ repositories {
version = '0.5.0-alpha7'
sourceCompatibility = '17'
javafx {
version = "17.0.1"
modules = ['javafx.base', 'javafx.controls', 'javafx.graphics', 'javafx.swing']
configuration = "implementation"
}
sourceSets {
main.java.srcDirs 'src/main'
test.java.srcDirs 'src/test'
@@ -47,12 +40,6 @@ test {
useJUnitPlatform()
}
configurations {
javafx_libs_linux
javafx_libs_osx
javafx_libs_win
}
dependencies {
// JUnit Tests
@@ -100,53 +87,21 @@ dependencies {
implementation 'org.usb4java:usb4java:1.3.0'
implementation 'org.usb4java:usb4java-javax:1.3.0'
implementation 'pl.edu.icm:JLargeArrays:1.6'
//JavaFX libraries for Linux
javafx_libs_linux "org.openjfx:javafx-base:$javafx.version:linux"
javafx_libs_linux "org.openjfx:javafx-controls:$javafx.version:linux"
javafx_libs_linux "org.openjfx:javafx-graphics:$javafx.version:linux"
javafx_libs_linux "org.openjfx:javafx-swing:$javafx.version:linux"
//JavaFX libraries for OSX
javafx_libs_osx "org.openjfx:javafx-base:$javafx.version:mac"
javafx_libs_osx "org.openjfx:javafx-controls:$javafx.version:mac"
javafx_libs_osx "org.openjfx:javafx-graphics:$javafx.version:mac"
javafx_libs_osx "org.openjfx:javafx-swing:$javafx.version:mac"
//JavaFX libraries for Windows
javafx_libs_win "org.openjfx:javafx-base:$javafx.version:win"
javafx_libs_win "org.openjfx:javafx-controls:$javafx.version:win"
javafx_libs_win "org.openjfx:javafx-graphics:$javafx.version:win"
javafx_libs_win "org.openjfx:javafx-swing:$javafx.version:win"
}
application {
mainClass.set("io.github.dsheirer.gui.SDRTrunk")
//Note: jide-oss.jar requires access to hidden windows look & feel
//Note: controlsfx.jar requires access to hidden javaFX classes
applicationDefaultJvmArgs = ['--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED',
'--add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls']
}
/**
* Runtime JVM arguments. JDK 17 has hidden a number of classes that are no longer exported from the
* modules. Some legacy support libraries still require access to these classes, so we explicitly
* add them to be exported from those modules here.
* This is needed for the JDK17 vector API ... until it moves out of incubation
*/
import org.gradle.internal.os.OperatingSystem;
tasks.withType(JavaCompile) {
options.compilerArgs.add("--add-modules=jdk.incubator.vector")
}
run {
if(OperatingSystem.current().isWindows()) {
//Note: jide-oss.jar requires access to hidden windows look & feel
//Note: controlsfx.jar requires access to hidden javaFX classes
jvmArgs = ['--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED',
'--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED']
}
else {
//Note: controlsfx.jar requires access to hidden javaFX classes
jvmArgs = ['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED']
}
application {
mainClassName = "io.github.dsheirer.gui.SDRTrunk"
applicationDefaultJvmArgs =
['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar
'--add-modules=jdk.incubator.vector', //Needed while Panama Vector API remains in incubator
'--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED'] //Windows Swing - jide-oss library
}
jar {
@@ -177,13 +132,13 @@ idea {
*/
def jdk_base = '/home/denny/java_jdks/'
def jdk_linux_arm64 = jdk_base + 'linux-arm64/jdk-17.0.1-full'
def jdk_linux_x86_64 = jdk_base + 'linux-x64/jdk-17.0.1-full'
def jdk_osx_x86_64 = jdk_base + 'osx-x64/jdk-17.0.1-full.jdk'
def jdk_windows_x86_64 = jdk_base + 'windows-x64/jdk-17.0.1-full'
def jdk_linux_arm64 = jdk_base + 'linux-arm64/jdk-17.0.2-full'
def jdk_linux_x86_64 = jdk_base + 'linux-x64/jdk-17.0.2-full'
def jdk_osx_x86_64 = jdk_base + 'osx-x64/jdk-17.0.2-full.jdk'
def jdk_windows_x86_64 = jdk_base + 'windows-x64/jdk-17.0.2-full'
def hasTargetJdk = file(jdk_linux_x86_64).exists() ||
file(jdk_linux_arm64) ||
file(jdk_linux_arm64).exists() ||
file(jdk_osx_x86_64).exists() ||
file(jdk_windows_x86_64).exists()
@@ -230,66 +185,5 @@ runtime {
}
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
modules = ['java.desktop', 'java.naming', 'jdk.unsupported', 'jdk.unsupported.desktop', 'java.net.http',
'java.sql', 'jdk.crypto.ec']
imageZip = hasTargetJdk ? file("$buildDir/image/sdr-trunk.zip") : file("$buildDir/image/sdr-trunk-" + version + ".zip")
}
def image_lib_linux_arm64 = file("$buildDir/image/sdr-trunk-linux-arm64-v" + version + "/lib")
def image_lib_linux_x86_64 = file("$buildDir/image/sdr-trunk-linux-x86_64-v" + version + "/lib")
def image_lib_osx_x86_64 = file("$buildDir/image/sdr-trunk-osx-x86_64-v" + version + "/lib")
def image_lib_win_x86_64 = file("$buildDir/image/sdr-trunk-windows-x86_64-v" + version + "/lib")
/**
* Copy JavaFX OS-specific libraries for each JDK to each platform target directory
*/
tasks.runtime.doLast
{
if(file(jdk_linux_arm64).exists())
{
//Delete any host system OS-specific JavaFX JDK modules that were inserted as part of default build
delete(fileTree(image_lib_linux_arm64).include { it.name ==~ /javafx.*-(win|mac|linux)\.jar/ })
//Copy OS-specific JavaFX libraries
copy {
from configurations.javafx_libs_linux
into image_lib_linux_arm64
}
}
if(file(jdk_linux_x86_64).exists())
{
//Delete any host system OS-specific JavaFX JDK modules that were inserted as part of default build
delete(fileTree(image_lib_linux_x86_64).include { it.name ==~ /javafx.*-(win|mac|linux)\.jar/ })
//Copy OS-specific JavaFX libraries
copy {
from configurations.javafx_libs_linux
into image_lib_linux_x86_64
}
}
if(file(jdk_osx_x86_64).exists())
{
//Delete any host system OS-specific JavaFX JDK modules that were inserted as part of default build
delete(fileTree(image_lib_osx_x86_64).include { it.name ==~ /javafx.*-(win|mac|linux)\.jar/ })
//Copy OS-specific JavaFX libraries
copy {
from configurations.javafx_libs_osx
into image_lib_osx_x86_64
}
}
if(file(jdk_windows_x86_64).exists())
{
//Delete any host system OS-specific JavaFX JDK modules that were inserted as part of default build
delete(fileTree(image_lib_win_x86_64).include { it.name ==~ /javafx.*-(win|mac|linux)\.jar/ })
//Copy OS-specific JavaFX libraries
copy {
from configurations.javafx_libs_win
into image_lib_win_x86_64
}
}
}