From 343ec6ca1c5d981eac9db6b7f3a1cb9e99d52473 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 15 Jun 2022 16:08:28 +0200 Subject: [PATCH 01/39] lots o shit --- CMakeLists.txt | 2 +- core/src/core.cpp | 15 +- core/src/dsp/audio.h | 198 ---- core/src/dsp/block.h | 170 +-- core/src/dsp/buffer.h | 360 ------ core/src/dsp/chain.h | 346 +++--- core/src/dsp/clock_recovery.h | 255 ---- core/src/dsp/compression.h | 160 --- core/src/dsp/conversion.h | 337 ------ core/src/dsp/correction.h | 142 --- core/src/dsp/decimation.h | 106 -- core/src/dsp/deframing.h | 414 ------- core/src/dsp/demodulator.h | 834 ------------- core/src/dsp/falcon_fec.h | 147 --- core/src/dsp/falcon_packet.h | 125 -- core/src/dsp/filter.h | 269 ----- core/src/dsp/firdec/firdec_plans.h | 208 ---- core/src/dsp/firdec/taps/fir_1024_128.h | 579 --------- core/src/dsp/firdec/taps/fir_1024_32.h | 141 --- core/src/dsp/firdec/taps/fir_1024_64.h | 319 ----- core/src/dsp/firdec/taps/fir_128_16.h | 85 -- core/src/dsp/firdec/taps/fir_128_32.h | 194 --- core/src/dsp/firdec/taps/fir_128_4.h | 30 - core/src/dsp/firdec/taps/fir_128_64.h | 521 -------- core/src/dsp/firdec/taps/fir_128_8.h | 47 - core/src/dsp/firdec/taps/fir_16_16.h | 566 --------- core/src/dsp/firdec/taps/fir_16_2.h | 20 - core/src/dsp/firdec/taps/fir_16_4.h | 36 - core/src/dsp/firdec/taps/fir_16_8.h | 78 -- core/src/dsp/firdec/taps/fir_2048_128.h | 528 --------- core/src/dsp/firdec/taps/fir_2048_64.h | 267 ----- core/src/dsp/firdec/taps/fir_256_128.h | 1026 ---------------- core/src/dsp/firdec/taps/fir_256_16.h | 90 -- core/src/dsp/firdec/taps/fir_256_32.h | 156 --- core/src/dsp/firdec/taps/fir_256_64.h | 370 ------ core/src/dsp/firdec/taps/fir_256_8.h | 46 - core/src/dsp/firdec/taps/fir_2_2.h | 83 -- core/src/dsp/firdec/taps/fir_32_16.h | 142 --- core/src/dsp/firdec/taps/fir_32_2.h | 20 - core/src/dsp/firdec/taps/fir_32_32.h | 1117 ------------------ core/src/dsp/firdec/taps/fir_32_4.h | 31 - core/src/dsp/firdec/taps/fir_32_8.h | 59 - core/src/dsp/firdec/taps/fir_4096_128.h | 701 ----------- core/src/dsp/firdec/taps/fir_4_2.h | 29 - core/src/dsp/firdec/taps/fir_4_4.h | 153 --- core/src/dsp/firdec/taps/fir_512_128.h | 725 ------------ core/src/dsp/firdec/taps/fir_512_16.h | 78 -- core/src/dsp/firdec/taps/fir_512_32.h | 165 --- core/src/dsp/firdec/taps/fir_512_64.h | 298 ----- core/src/dsp/firdec/taps/fir_64_16.h | 104 -- core/src/dsp/firdec/taps/fir_64_2.h | 18 - core/src/dsp/firdec/taps/fir_64_32.h | 268 ----- core/src/dsp/firdec/taps/fir_64_4.h | 33 - core/src/dsp/firdec/taps/fir_64_8.h | 50 - core/src/dsp/firdec/taps/fir_8_2.h | 23 - core/src/dsp/firdec/taps/fir_8_4.h | 46 - core/src/dsp/firdec/taps/fir_8_8.h | 294 ----- core/src/dsp/interpolation_taps.h | 136 --- core/src/dsp/link.h | 54 - core/src/dsp/math.h | 246 ---- core/src/dsp/measure.h | 81 -- core/src/dsp/meteor/hrpt.h | 66 -- core/src/dsp/meteor/msumr.h | 77 -- core/src/dsp/noaa/hrpt.h | 110 -- core/src/dsp/noaa/tip.h | 240 ---- core/src/dsp/noise_reduction.h | 462 -------- core/src/dsp/pll.h | 332 ------ core/src/dsp/processing.h | 609 ---------- core/src/dsp/resampling.h | 218 ---- core/src/dsp/routing.h | 243 ---- core/src/dsp/sink.h | 192 +-- core/src/dsp/source.h | 113 +- core/src/dsp/stereo_fm.h | 291 ----- core/src/dsp/stream.h | 38 +- core/src/dsp/types.h | 46 +- core/src/dsp/utils/bitstream.h | 43 - core/src/dsp/utils/ccsds.h | 120 -- core/src/dsp/utils/macros.h | 6 - core/src/dsp/utils/math.h | 12 - core/src/dsp/utils/window_functions.h | 28 - core/src/dsp/vfo.h | 133 --- core/src/dsp/window.h | 419 ------- core/src/gui/main_window.cpp | 69 +- core/src/gui/main_window.h | 6 +- core/src/gui/menus/display.cpp | 22 +- core/src/gui/menus/source.cpp | 8 +- core/src/server.cpp | 13 +- core/src/signal_path/dsp.cpp | 278 ----- core/src/signal_path/dsp.h | 74 -- core/src/signal_path/signal_path.cpp | 2 +- core/src/signal_path/signal_path.h | 10 +- core/src/signal_path/sink.cpp | 2 +- core/src/signal_path/sink.h | 12 +- core/src/signal_path/source.cpp | 4 +- core/src/signal_path/vfo_manager.cpp | 8 +- core/src/signal_path/vfo_manager.h | 4 +- decoder_modules/radio/src/demodulators/am.h | 16 +- decoder_modules/radio/src/demodulators/cw.h | 20 +- decoder_modules/radio/src/demodulators/dsb.h | 18 +- decoder_modules/radio/src/demodulators/lsb.h | 18 +- decoder_modules/radio/src/demodulators/nfm.h | 16 +- decoder_modules/radio/src/demodulators/raw.h | 5 +- decoder_modules/radio/src/demodulators/usb.h | 18 +- decoder_modules/radio/src/demodulators/wfm.h | 41 +- decoder_modules/radio/src/radio_module.h | 175 +-- misc_modules/recorder/src/main.cpp | 8 +- sink_modules/audio_sink/src/main.cpp | 10 +- source_modules/bladerf_source/src/main.cpp | 1 - source_modules/file_source/src/main.cpp | 4 +- 109 files changed, 496 insertions(+), 18305 deletions(-) delete mode 100644 core/src/dsp/audio.h delete mode 100644 core/src/dsp/buffer.h delete mode 100644 core/src/dsp/clock_recovery.h delete mode 100644 core/src/dsp/compression.h delete mode 100644 core/src/dsp/conversion.h delete mode 100644 core/src/dsp/correction.h delete mode 100644 core/src/dsp/decimation.h delete mode 100644 core/src/dsp/deframing.h delete mode 100644 core/src/dsp/demodulator.h delete mode 100644 core/src/dsp/falcon_fec.h delete mode 100644 core/src/dsp/falcon_packet.h delete mode 100644 core/src/dsp/filter.h delete mode 100644 core/src/dsp/firdec/firdec_plans.h delete mode 100644 core/src/dsp/firdec/taps/fir_1024_128.h delete mode 100644 core/src/dsp/firdec/taps/fir_1024_32.h delete mode 100644 core/src/dsp/firdec/taps/fir_1024_64.h delete mode 100644 core/src/dsp/firdec/taps/fir_128_16.h delete mode 100644 core/src/dsp/firdec/taps/fir_128_32.h delete mode 100644 core/src/dsp/firdec/taps/fir_128_4.h delete mode 100644 core/src/dsp/firdec/taps/fir_128_64.h delete mode 100644 core/src/dsp/firdec/taps/fir_128_8.h delete mode 100644 core/src/dsp/firdec/taps/fir_16_16.h delete mode 100644 core/src/dsp/firdec/taps/fir_16_2.h delete mode 100644 core/src/dsp/firdec/taps/fir_16_4.h delete mode 100644 core/src/dsp/firdec/taps/fir_16_8.h delete mode 100644 core/src/dsp/firdec/taps/fir_2048_128.h delete mode 100644 core/src/dsp/firdec/taps/fir_2048_64.h delete mode 100644 core/src/dsp/firdec/taps/fir_256_128.h delete mode 100644 core/src/dsp/firdec/taps/fir_256_16.h delete mode 100644 core/src/dsp/firdec/taps/fir_256_32.h delete mode 100644 core/src/dsp/firdec/taps/fir_256_64.h delete mode 100644 core/src/dsp/firdec/taps/fir_256_8.h delete mode 100644 core/src/dsp/firdec/taps/fir_2_2.h delete mode 100644 core/src/dsp/firdec/taps/fir_32_16.h delete mode 100644 core/src/dsp/firdec/taps/fir_32_2.h delete mode 100644 core/src/dsp/firdec/taps/fir_32_32.h delete mode 100644 core/src/dsp/firdec/taps/fir_32_4.h delete mode 100644 core/src/dsp/firdec/taps/fir_32_8.h delete mode 100644 core/src/dsp/firdec/taps/fir_4096_128.h delete mode 100644 core/src/dsp/firdec/taps/fir_4_2.h delete mode 100644 core/src/dsp/firdec/taps/fir_4_4.h delete mode 100644 core/src/dsp/firdec/taps/fir_512_128.h delete mode 100644 core/src/dsp/firdec/taps/fir_512_16.h delete mode 100644 core/src/dsp/firdec/taps/fir_512_32.h delete mode 100644 core/src/dsp/firdec/taps/fir_512_64.h delete mode 100644 core/src/dsp/firdec/taps/fir_64_16.h delete mode 100644 core/src/dsp/firdec/taps/fir_64_2.h delete mode 100644 core/src/dsp/firdec/taps/fir_64_32.h delete mode 100644 core/src/dsp/firdec/taps/fir_64_4.h delete mode 100644 core/src/dsp/firdec/taps/fir_64_8.h delete mode 100644 core/src/dsp/firdec/taps/fir_8_2.h delete mode 100644 core/src/dsp/firdec/taps/fir_8_4.h delete mode 100644 core/src/dsp/firdec/taps/fir_8_8.h delete mode 100644 core/src/dsp/interpolation_taps.h delete mode 100644 core/src/dsp/link.h delete mode 100644 core/src/dsp/math.h delete mode 100644 core/src/dsp/measure.h delete mode 100644 core/src/dsp/meteor/hrpt.h delete mode 100644 core/src/dsp/meteor/msumr.h delete mode 100644 core/src/dsp/noaa/hrpt.h delete mode 100644 core/src/dsp/noaa/tip.h delete mode 100644 core/src/dsp/noise_reduction.h delete mode 100644 core/src/dsp/pll.h delete mode 100644 core/src/dsp/processing.h delete mode 100644 core/src/dsp/resampling.h delete mode 100644 core/src/dsp/routing.h delete mode 100644 core/src/dsp/stereo_fm.h delete mode 100644 core/src/dsp/utils/bitstream.h delete mode 100644 core/src/dsp/utils/ccsds.h delete mode 100644 core/src/dsp/utils/macros.h delete mode 100644 core/src/dsp/utils/math.h delete mode 100644 core/src/dsp/utils/window_functions.h delete mode 100644 core/src/dsp/vfo.h delete mode 100644 core/src/dsp/window.h delete mode 100644 core/src/signal_path/dsp.cpp delete mode 100644 core/src/signal_path/dsp.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ad8d003..5bea7e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ option(OPT_BUILD_NEW_PORTAUDIO_SINK "Build the new PortAudio Sink Module (Depend option(OPT_BUILD_FALCON9_DECODER "Build the falcon9 live decoder (Dependencies: ffplay)" OFF) option(OPT_BUILD_KG_SSTV_DECODER "Build the M17 decoder module (no dependencies required)" OFF) option(OPT_BUILD_M17_DECODER "Build the M17 decoder module (no dependencies required)" OFF) -option(OPT_BUILD_METEOR_DEMODULATOR "Build the meteor demodulator module (no dependencies required)" ON) +option(OPT_BUILD_METEOR_DEMODULATOR "Build the meteor demodulator module (no dependencies required)" OFF) option(OPT_BUILD_RADIO "Main audio modulation decoder (AM, FM, SSB, etc...)" ON) option(OPT_BUILD_WEATHER_SAT_DECODER "Build the HRPT decoder module (no dependencies required)" OFF) diff --git a/core/src/core.cpp b/core/src/core.cpp index a47601c..d6ac74c 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -42,15 +42,18 @@ namespace core { // Forward this to the server if (args["server"].b()) { server::setInputSampleRate(samplerate); return; } - sigpath::signalPath.sourceSampleRate = samplerate; - double effectiveSr = samplerate / ((double)(1 << sigpath::signalPath.decimation)); - // NOTE: Zoom controls won't work - spdlog::info("New DSP samplerate: {0} (source samplerate is {1})", effectiveSr, samplerate); + // Update IQ frontend input samplerate and get effective samplerate + sigpath::iqFrontEnd.setSampleRate(samplerate); + double effectiveSr = sigpath::iqFrontEnd.getEffectiveSamplerate(); + + // Reset zoom gui::waterfall.setBandwidth(effectiveSr); gui::waterfall.setViewOffset(0); gui::waterfall.setViewBandwidth(effectiveSr); - sigpath::signalPath.setSampleRate(effectiveSr); gui::mainWindow.setViewBandwidthSlider(1.0); + + // Debug logs + spdlog::info("New DSP samplerate: {0} (source samplerate is {1})", effectiveSr, samplerate); } }; @@ -363,7 +366,7 @@ int sdrpp_main(int argc, char* argv[]) { // Terminate backend (TODO: CHECK RETURN VALUE) backend::end(); - sigpath::signalPath.stop(); + sigpath::iqFrontEnd.stop(); core::configManager.disableAutoSave(); core::configManager.save(); diff --git a/core/src/dsp/audio.h b/core/src/dsp/audio.h deleted file mode 100644 index b51bf11..0000000 --- a/core/src/dsp/audio.h +++ /dev/null @@ -1,198 +0,0 @@ -#pragma once -#include - -namespace dsp { - class MonoToStereo : public generic_block { - public: - MonoToStereo() {} - - MonoToStereo(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32f_x2_interleave_32fc((lv_32fc_t*)out.writeBuf, _in->readBuf, _in->readBuf, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; - - class ChannelsToStereo : public generic_block { - public: - ChannelsToStereo() {} - - ChannelsToStereo(stream* in_left, stream* in_right) { init(in_left, in_right); } - - void init(stream* in_left, stream* in_right) { - _in_left = in_left; - _in_right = in_right; - nullbuf = new float[STREAM_BUFFER_SIZE]; - for (int i = 0; i < STREAM_BUFFER_SIZE; i++) { nullbuf[i] = 0; } - generic_block::registerInput(_in_left); - generic_block::registerInput(_in_right); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in_left, stream* in_right) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in_left); - generic_block::unregisterInput(_in_right); - _in_left = in_left; - _in_right = in_right; - generic_block::registerInput(_in_left); - generic_block::registerInput(_in_right); - generic_block::tempStart(); - } - - int run() { - int count_l = _in_left->read(); - if (count_l < 0) { return -1; } - int count_r = _in_right->read(); - if (count_r < 0) { return -1; } - - if (count_l != count_r) { - spdlog::warn("ChannelsToStereo block size mismatch"); - } - - volk_32f_x2_interleave_32fc((lv_32fc_t*)out.writeBuf, _in_left->readBuf, _in_right->readBuf, count_l); - - _in_left->flush(); - _in_right->flush(); - if (!out.swap(count_l)) { return -1; } - return count_l; - } - - stream out; - - private: - stream* _in_left; - stream* _in_right; - - float* nullbuf; - }; - - class StereoToMono : public generic_block { - public: - StereoToMono() {} - - StereoToMono(stream* in) { init(in); } - - ~StereoToMono() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - delete[] l_buf; - delete[] r_buf; - generic_block::_block_init = false; - } - - void init(stream* in) { - _in = in; - l_buf = new float[STREAM_BUFFER_SIZE]; - r_buf = new float[STREAM_BUFFER_SIZE]; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - for (int i = 0; i < count; i++) { - out.writeBuf[i] = (_in->readBuf[i].l + _in->readBuf[i].r) * 0.5f; - } - - _in->flush(); - - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float *l_buf, *r_buf; - stream* _in; - }; - - class StereoToChannels : public generic_block { - public: - StereoToChannels() {} - - StereoToChannels(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out_left); - generic_block::registerOutput(&out_right); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32fc_deinterleave_32f_x2(out_left.writeBuf, out_right.writeBuf, (lv_32fc_t*)_in->readBuf, count); - - _in->flush(); - if (!out_left.swap(count)) { return -1; } - if (!out_right.swap(count)) { return -1; } - return count; - } - - stream out_left; - stream out_right; - - private: - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/block.h b/core/src/dsp/block.h index c67b015..be240cc 100644 --- a/core/src/dsp/block.h +++ b/core/src/dsp/block.h @@ -1,29 +1,24 @@ #pragma once -#include -#include -#include +#include #include #include #include - -#include +#include "stream.h" +#include "types.h" namespace dsp { - - class generic_unnamed_block { + class generic_block { public: virtual void start() {} virtual void stop() {} - virtual int calcOutSize(int inSize) { return inSize; } virtual int run() { return -1; } }; - template - class generic_block : public generic_unnamed_block { + class block : public generic_block { public: virtual void init() {} - virtual ~generic_block() { + virtual ~block() { if (!_block_init) { return; } stop(); _block_init = false; @@ -31,7 +26,7 @@ namespace dsp { virtual void start() { assert(_block_init); - std::lock_guard lck(ctrlMtx); + std::lock_guard lck(ctrlMtx); if (running) { return; } @@ -41,7 +36,7 @@ namespace dsp { virtual void stop() { assert(_block_init); - std::lock_guard lck(ctrlMtx); + std::lock_guard lck(ctrlMtx); if (!running) { return; } @@ -51,6 +46,7 @@ namespace dsp { void tempStart() { assert(_block_init); + if (!tempStopDepth || --tempStopDepth) { return; } if (tempStopped) { doStart(); tempStopped = false; @@ -59,26 +55,45 @@ namespace dsp { void tempStop() { assert(_block_init); + if (tempStopDepth++) { return; } if (running && !tempStopped) { doStop(); tempStopped = true; } } - virtual int calcOutSize(int inSize) { - assert(_block_init); - return inSize; - } - virtual int run() = 0; - friend BLOCK; - - private: + protected: void workerLoop() { while (run() >= 0) {} } + virtual void doStart() { + workerThread = std::thread(&block::workerLoop, this); + } + + virtual void doStop() { + for (auto& in : inputs) { + in->stopReader(); + } + for (auto& out : outputs) { + out->stopWriter(); + } + + // TODO: Make sure this isn't needed, I don't know why it stops + if (workerThread.joinable()) { + workerThread.join(); + } + + for (auto& in : inputs) { + in->clearReadStop(); + } + for (auto& out : outputs) { + out->clearWriteStop(); + } + } + void acquire() { ctrlMtx.lock(); } @@ -103,125 +118,16 @@ namespace dsp { outputs.erase(std::remove(outputs.begin(), outputs.end(), outStream), outputs.end()); } - virtual void doStart() { - workerThread = std::thread(&generic_block::workerLoop, this); - } - - virtual void doStop() { - for (auto& in : inputs) { - in->stopReader(); - } - for (auto& out : outputs) { - out->stopWriter(); - } - - // TODO: Make sure this isn't needed, I don't know why it stops - if (workerThread.joinable()) { - workerThread.join(); - } - - for (auto& in : inputs) { - in->clearReadStop(); - } - for (auto& out : outputs) { - out->clearWriteStop(); - } - } - - protected: bool _block_init = false; - std::mutex ctrlMtx; + std::recursive_mutex ctrlMtx; std::vector inputs; std::vector outputs; bool running = false; bool tempStopped = false; + int tempStopDepth = 0; std::thread workerThread; }; - - template - class generic_hier_block { - public: - virtual void init() {} - - virtual ~generic_hier_block() { - if (!_block_init) { return; } - stop(); - _block_init = false; - } - - virtual void start() { - assert(_block_init); - std::lock_guard lck(ctrlMtx); - if (running) { - return; - } - running = true; - doStart(); - } - - virtual void stop() { - assert(_block_init); - std::lock_guard lck(ctrlMtx); - if (!running) { - return; - } - doStop(); - running = false; - } - - void tempStart() { - assert(_block_init); - if (tempStopped) { - doStart(); - tempStopped = false; - } - } - - void tempStop() { - assert(_block_init); - if (running && !tempStopped) { - doStop(); - tempStopped = true; - } - } - - virtual int calcOutSize(int inSize) { - assert(_block_init); - return inSize; - } - - friend BLOCK; - - private: - void registerBlock(generic_unnamed_block* block) { - blocks.push_back(block); - } - - void unregisterBlock(generic_unnamed_block* block) { - blocks.erase(std::remove(blocks.begin(), blocks.end(), block), blocks.end()); - } - - virtual void doStart() { - for (auto& block : blocks) { - block->start(); - } - } - - virtual void doStop() { - for (auto& block : blocks) { - block->stop(); - } - } - - std::vector blocks; - bool tempStopped = false; - bool running = false; - - protected: - bool _block_init = false; - std::mutex ctrlMtx; - }; } \ No newline at end of file diff --git a/core/src/dsp/buffer.h b/core/src/dsp/buffer.h deleted file mode 100644 index f46e08f..0000000 --- a/core/src/dsp/buffer.h +++ /dev/null @@ -1,360 +0,0 @@ -#pragma once -#include -#include - -#define RING_BUF_SZ 1000000 - -namespace dsp { - template - class RingBuffer { - public: - RingBuffer() {} - - RingBuffer(int maxLatency) { init(maxLatency); } - - ~RingBuffer() { - if (!_init) { return; } - delete _buffer; - _init = false; - } - - void init(int maxLatency) { - size = RING_BUF_SZ; - _buffer = new T[size]; - _stopReader = false; - _stopWriter = false; - this->maxLatency = maxLatency; - writec = 0; - readc = 0; - readable = 0; - writable = size; - memset(_buffer, 0, size * sizeof(T)); - _init = true; - } - - int read(T* data, int len) { - assert(_init); - int dataRead = 0; - int toRead = 0; - while (dataRead < len) { - toRead = std::min(waitUntilReadable(), len - dataRead); - if (toRead < 0) { return -1; }; - - if ((toRead + readc) > size) { - memcpy(&data[dataRead], &_buffer[readc], (size - readc) * sizeof(T)); - memcpy(&data[dataRead + (size - readc)], &_buffer[0], (toRead - (size - readc)) * sizeof(T)); - } - else { - memcpy(&data[dataRead], &_buffer[readc], toRead * sizeof(T)); - } - - dataRead += toRead; - - _readable_mtx.lock(); - readable -= toRead; - _readable_mtx.unlock(); - _writable_mtx.lock(); - writable += toRead; - _writable_mtx.unlock(); - readc = (readc + toRead) % size; - canWriteVar.notify_one(); - } - return len; - } - - int readAndSkip(T* data, int len, int skip) { - assert(_init); - int dataRead = 0; - int toRead = 0; - while (dataRead < len) { - toRead = std::min(waitUntilReadable(), len - dataRead); - if (toRead < 0) { return -1; }; - - if ((toRead + readc) > size) { - memcpy(&data[dataRead], &_buffer[readc], (size - readc) * sizeof(T)); - memcpy(&data[dataRead + (size - readc)], &_buffer[0], (toRead - (size - readc)) * sizeof(T)); - } - else { - memcpy(&data[dataRead], &_buffer[readc], toRead * sizeof(T)); - } - - dataRead += toRead; - - _readable_mtx.lock(); - readable -= toRead; - _readable_mtx.unlock(); - _writable_mtx.lock(); - writable += toRead; - _writable_mtx.unlock(); - readc = (readc + toRead) % size; - canWriteVar.notify_one(); - } - dataRead = 0; - while (dataRead < skip) { - toRead = std::min(waitUntilReadable(), skip - dataRead); - if (toRead < 0) { return -1; }; - - dataRead += toRead; - - _readable_mtx.lock(); - readable -= toRead; - _readable_mtx.unlock(); - _writable_mtx.lock(); - writable += toRead; - _writable_mtx.unlock(); - readc = (readc + toRead) % size; - canWriteVar.notify_one(); - } - return len; - } - - int waitUntilReadable() { - assert(_init); - if (_stopReader) { return -1; } - int _r = getReadable(); - if (_r != 0) { return _r; } - std::unique_lock lck(_readable_mtx); - canReadVar.wait(lck, [=]() { return ((this->getReadable(false) > 0) || this->getReadStop()); }); - if (_stopReader) { return -1; } - return getReadable(false); - } - - int getReadable(bool lock = true) { - assert(_init); - if (lock) { _readable_mtx.lock(); }; - int _r = readable; - if (lock) { _readable_mtx.unlock(); }; - return _r; - } - - int write(T* data, int len) { - assert(_init); - int dataWritten = 0; - int toWrite = 0; - while (dataWritten < len) { - toWrite = std::min(waitUntilwritable(), len - dataWritten); - if (toWrite < 0) { return -1; }; - - if ((toWrite + writec) > size) { - memcpy(&_buffer[writec], &data[dataWritten], (size - writec) * sizeof(T)); - memcpy(&_buffer[0], &data[dataWritten + (size - writec)], (toWrite - (size - writec)) * sizeof(T)); - } - else { - memcpy(&_buffer[writec], &data[dataWritten], toWrite * sizeof(T)); - } - - dataWritten += toWrite; - - _readable_mtx.lock(); - readable += toWrite; - _readable_mtx.unlock(); - _writable_mtx.lock(); - writable -= toWrite; - _writable_mtx.unlock(); - writec = (writec + toWrite) % size; - - canReadVar.notify_one(); - } - return len; - } - - int waitUntilwritable() { - assert(_init); - if (_stopWriter) { return -1; } - int _w = getWritable(); - if (_w != 0) { return _w; } - std::unique_lock lck(_writable_mtx); - canWriteVar.wait(lck, [=]() { return ((this->getWritable(false) > 0) || this->getWriteStop()); }); - if (_stopWriter) { return -1; } - return getWritable(false); - } - - int getWritable(bool lock = true) { - assert(_init); - if (lock) { _writable_mtx.lock(); }; - int _w = writable; - if (lock) { - _writable_mtx.unlock(); - _readable_mtx.lock(); - }; - int _r = readable; - if (lock) { _readable_mtx.unlock(); }; - return std::max(std::min(_w, maxLatency - _r), 0); - } - - void stopReader() { - assert(_init); - _stopReader = true; - canReadVar.notify_one(); - } - - void stopWriter() { - assert(_init); - _stopWriter = true; - canWriteVar.notify_one(); - } - - bool getReadStop() { - assert(_init); - return _stopReader; - } - - bool getWriteStop() { - assert(_init); - return _stopWriter; - } - - void clearReadStop() { - assert(_init); - _stopReader = false; - } - - void clearWriteStop() { - assert(_init); - _stopWriter = false; - } - - void setMaxLatency(int maxLatency) { - assert(_init); - this->maxLatency = maxLatency; - } - - private: - bool _init = false; - T* _buffer; - int size; - int readc; - int writec; - int readable; - int writable; - int maxLatency; - bool _stopReader; - bool _stopWriter; - std::mutex _readable_mtx; - std::mutex _writable_mtx; - std::condition_variable canReadVar; - std::condition_variable canWriteVar; - }; - -#define TEST_BUFFER_SIZE 32 - - template - class SampleFrameBuffer : public generic_block> { - public: - SampleFrameBuffer() {} - - SampleFrameBuffer(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - - for (int i = 0; i < TEST_BUFFER_SIZE; i++) { - buffers[i] = new T[STREAM_BUFFER_SIZE]; - } - - generic_block>::registerInput(in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void flush() { - std::unique_lock lck(bufMtx); - readCur = writeCur; - } - - int run() { - // Wait for data - int count = _in->read(); - if (count < 0) { return -1; } - - if (bypass) { - memcpy(out.writeBuf, _in->readBuf, count * sizeof(T)); - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - // Push it on the ring buffer - { - std::lock_guard lck(bufMtx); - memcpy(buffers[writeCur], _in->readBuf, count * sizeof(T)); - sizes[writeCur] = count; - writeCur++; - writeCur = ((writeCur) % TEST_BUFFER_SIZE); - - // if (((writeCur - readCur + TEST_BUFFER_SIZE) % TEST_BUFFER_SIZE) >= (TEST_BUFFER_SIZE-2)) { - // spdlog::warn("Overflow"); - // } - } - cnd.notify_all(); - _in->flush(); - return count; - } - - void worker() { - while (true) { - // Wait for data - std::unique_lock lck(bufMtx); - cnd.wait(lck, [this]() { return (((writeCur - readCur + TEST_BUFFER_SIZE) % TEST_BUFFER_SIZE) > 0) || stopWorker; }); - if (stopWorker) { break; } - - // Write one to output buffer and unlock in preparation to swap buffers - int count = sizes[readCur]; - memcpy(out.writeBuf, buffers[readCur], count * sizeof(T)); - readCur++; - readCur = ((readCur) % TEST_BUFFER_SIZE); - lck.unlock(); - - // Swap - if (!out.swap(count)) { break; } - } - } - - stream out; - - int writeCur = 0; - int readCur = 0; - - bool bypass = false; - - private: - void doStart() { - generic_block>::workerThread = std::thread(&generic_block>::workerLoop, this); - readWorkerThread = std::thread(&SampleFrameBuffer::worker, this); - } - - void doStop() { - _in->stopReader(); - out.stopWriter(); - stopWorker = true; - cnd.notify_all(); - - if (generic_block>::workerThread.joinable()) { generic_block>::workerThread.join(); } - if (readWorkerThread.joinable()) { readWorkerThread.join(); } - - _in->clearReadStop(); - out.clearWriteStop(); - stopWorker = false; - } - - stream* _in; - - std::thread readWorkerThread; - std::mutex bufMtx; - std::condition_variable cnd; - T* buffers[TEST_BUFFER_SIZE]; - int sizes[TEST_BUFFER_SIZE]; - - bool stopWorker = false; - }; -}; diff --git a/core/src/dsp/chain.h b/core/src/dsp/chain.h index 98c053c..1d4e950 100644 --- a/core/src/dsp/chain.h +++ b/core/src/dsp/chain.h @@ -1,209 +1,193 @@ #pragma once -#include -#include #include -#include +#include +#include "processor.h" namespace dsp { - template - class ChainLinkAny { + template + class chain { public: - virtual ~ChainLinkAny() {} - virtual void setInput(stream* stream) = 0; - virtual stream* getOutput() = 0; - virtual void start() = 0; - virtual void stop() = 0; - bool enabled = false; - }; + chain() {} - template - class ChainLink : public ChainLinkAny { - public: - ~ChainLink() {} + chain(stream* in) { init(in); } - void setInput(stream* stream) { - block.setInput(stream); + void init(stream* in) { + _in = in; + out = _in; } - stream* getOutput() { - return &block.out; + template + void setInput(stream* in, Func onOutputChange) { + _in = in; + for (auto& ln : links) { + if (states[ln]) { + ln->setInput(_in); + return; + } + } + out = _in; + onOutputChange(out); + } + + void addBlock(Processor* block, bool enabled) { + // Check if block is already part of the chain + if (blockExists(block)) { + throw std::runtime_error("[chain] Tried to add a block that is already part of the chain"); + } + + // Add to the list + links.push_back(block); + states[block] = false; + + // Enable if needed + if (enabled) { enableBlock(block, [](stream* out){}); } + } + + template + void removeBlock(Processor* block, Func onOutputChange) { + // Check if block is part of the chain + if (!blockExists(block)) { + throw std::runtime_error("[chain] Tried to remove a block that is not part of the chain"); + } + + // Disable the block + disableBlock(block, onOutputChange); + + // Remove block from the list + states.erase(block); + links.erase(std::find(links.begin(), links.end(), block)); + } + + template + void enableBlock(Processor* block, Func onOutputChange) { + // Check that the block is part of the chain + if (!blockExists(block)) { + throw std::runtime_error("[chain] Tried to enable a block that isn't part of the chain"); + } + + // If already enable, don't do anything + if (states[block]) { return; } + + // Gather blocks before and after the block to enable + Processor* before = blockBefore(block); + Processor* after = blockAfter(block); + + // Update input of next block or output + if (after) { + after->setInput(&block->out); + } + else { + out = &block->out; + onOutputChange(out); + } + + // Set input of the new block + block->setInput(before ? &before->out : _in); + + // Start new block + if (running) { block->start(); } + states[block] = true; + } + + template + void disableBlock(Processor* block, Func onOutputChange) { + // Check that the block is part of the chain + if (!blockExists(block)) { + throw std::runtime_error("[chain] Tried to enable a block that isn't part of the chain"); + } + + // If already disabled, don't do anything + if (!states[block]) { return; } + + // Stop disabled block + block->stop(); + states[block] = false; + + // Gather blocks before and after the block to disable + Processor* before = blockBefore(block); + Processor* after = blockAfter(block); + + // Update input of next block or output + if (after) { + after->setInput(before ? &before->out : _in); + } + else { + out = before ? &before->out : _in; + onOutputChange(out); + } + } + + template + void setBlockEnabled(Processor* block, bool enabled, Func onOutputChange) { + if (enabled) { + enableBlock(block, onOutputChange); + } + else { + disableBlock(block, onOutputChange); + } + } + + template + void enableAllBlocks(Func onOutputChange) { + for (auto& ln : links) { + enableBlock(ln, onOutputChange); + } + } + + template + void disableAllBlocks(Func onOutputChange) { + for (auto& ln : links) { + disableBlock(ln, onOutputChange); + } } void start() { - block.start(); - } - - void stop() { - block.stop(); - } - - BLOCK block; - }; - - template - class Chain { - public: - Chain() {} - - Chain(stream* input, EventHandler*>* outputChangedHandler) { - init(input, outputChangedHandler); - } - - void init(stream* input, EventHandler*>* outputChangedHandler) { - _input = input; - onOutputChanged.bindHandler(outputChangedHandler); - } - - void add(ChainLinkAny* link) { - // Check that link exists - if (std::find(links.begin(), links.end(), link) != links.end()) { - spdlog::error("Could not add new link to the chain, link already in the chain"); - return; - } - - // Assert that the link is stopped and disabled - link->stop(); - link->enabled = false; - - // Add new link to the list - links.push_back(link); - } - - void enable(ChainLinkAny* link) { - // Check that link exists and locate it - auto lnit = std::find(links.begin(), links.end(), link); - if (lnit == links.end()) { - spdlog::error("Could not enable link"); - return; - } - // Enable the link - link->enabled = true; - - // Find input - stream* input = _input; - for (auto i = links.begin(); i < lnit; i++) { - if (!(*i)->enabled) { continue; } - input = (*i)->getOutput(); - } - - // Find next block - ChainLinkAny* nextLink = NULL; - for (auto i = ++lnit; i < links.end(); i++) { - if (!(*i)->enabled) { continue; } - nextLink = *i; - break; - } - - if (nextLink) { - // If a next block exists, change its input - nextLink->setInput(link->getOutput()); - } - else { - // If there are no next blocks, change output of outside reader - onOutputChanged.emit(link->getOutput()); - } - - // Set input of newly enabled link - link->setInput(input); - - // If running, start everything - if (running) { start(); } - } - - void disable(ChainLinkAny* link) { - // Check that link exists and locate it - auto lnit = std::find(links.begin(), links.end(), link); - if (lnit == links.end()) { - spdlog::error("Could not disable link"); - return; - } - - // Stop and disable link - link->stop(); - link->enabled = false; - - // Find its input - stream* input = _input; - for (auto i = links.begin(); i < lnit; i++) { - if (!(*i)->enabled) { continue; } - input = (*i)->getOutput(); - } - - // Find next block - ChainLinkAny* nextLink = NULL; - for (auto i = ++lnit; i < links.end(); i++) { - if (!(*i)->enabled) { continue; } - nextLink = *i; - break; - } - - if (nextLink) { - // If a next block exists, change its input - nextLink->setInput(input); - } - else { - // If there are no next blocks, change output of outside reader - onOutputChanged.emit(input); - } - } - - void disableAll() { + if (running) { return; } for (auto& ln : links) { - disable(ln); + if (!states[ln]) { continue; } + ln->start(); } - } - - void setState(ChainLinkAny* link, bool enabled) { - enabled ? enable(link) : disable(link); - } - - void setInput(stream* input) { - _input = input; - - // Set input of first enabled link - for (auto& ln : links) { - if (!ln->enabled) { continue; } - ln->setInput(_input); - return; - } - - // No block found, this means nothing is enabled - onOutputChanged.emit(_input); - } - - stream* getOutput() { - stream* lastOutput = _input; - for (auto& ln : links) { - if (!ln->enabled) { continue; } - lastOutput = ln->getOutput(); - } - return lastOutput; - } - - void start() { running = true; - for (auto& ln : links) { - if (ln->enabled) { - ln->start(); - } - else { - ln->stop(); - } - } } void stop() { - running = false; + if (!running) { return; } for (auto& ln : links) { + if (!states[ln]) { continue; } ln->stop(); } + running = false; } - Event*> onOutputChanged; + stream* out; private: - stream* _input; - std::vector*> links; + Processor* blockBefore(Processor* block) { + for (auto& ln : links) { + if (ln == block) { return NULL; } + if (states[ln]) { return ln; } + } + } + + Processor* blockAfter(Processor* block) { + bool blockFound = false; + for (auto& ln : links) { + if (ln == block) { + blockFound = true; + continue; + } + if (states[ln] && blockFound) { return ln; } + } + return NULL; + } + + bool blockExists(Processor* block) { + return states.find(block) != states.end(); + } + + stream* _in; + std::vector*> links; + std::map*, bool> states; bool running = false; }; } \ No newline at end of file diff --git a/core/src/dsp/clock_recovery.h b/core/src/dsp/clock_recovery.h deleted file mode 100644 index 92a31f7..0000000 --- a/core/src/dsp/clock_recovery.h +++ /dev/null @@ -1,255 +0,0 @@ -#pragma once -#include -#include -#include - -namespace dsp { - class EdgeTrigClockRecovery : public generic_block { - public: - EdgeTrigClockRecovery() {} - - EdgeTrigClockRecovery(stream* in, int omega) { init(in, omega); } - - void init(stream* in, int omega) { - _in = in; - samplesPerSymbol = omega; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - int outCount = 0; - - for (int i = 0; i < count; i++) { - if (DSP_SIGN(lastVal) != DSP_SIGN(_in->readBuf[i])) { - counter = samplesPerSymbol / 2; - lastVal = _in->readBuf[i]; - continue; - } - - if (counter >= samplesPerSymbol) { - counter = 0; - out.writeBuf[outCount] = _in->readBuf[i]; - outCount++; - } - else { - counter++; - } - - lastVal = _in->readBuf[i]; - } - - _in->flush(); - if (outCount > 0 && !out.swap(outCount)) { return -1; } - return count; - } - - stream out; - - private: - int count; - int samplesPerSymbol = 1; - int counter = 0; - float lastVal = 0; - stream* _in; - }; - - template - class MMClockRecovery : public generic_block> { - public: - MMClockRecovery() {} - - MMClockRecovery(stream* in, float omega, float gainOmega, float muGain, float omegaRelLimit) { - init(in, omega, gainOmega, muGain, omegaRelLimit); - } - - void init(stream* in, float omega, float gainOmega, float muGain, float omegaRelLimit) { - _in = in; - _omega = omega; - _muGain = muGain; - _gainOmega = gainOmega; - _omegaRelLimit = omegaRelLimit; - - omegaMin = _omega - (_omega * _omegaRelLimit); - omegaMax = _omega + (_omega * _omegaRelLimit); - _dynOmega = _omega; - - memset(delay, 0, 1024 * sizeof(T)); - - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setOmega(float omega, float omegaRelLimit) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - omegaMin = _omega - (_omega * _omegaRelLimit); - omegaMax = _omega + (_omega * _omegaRelLimit); - _omega = omega; - _dynOmega = _omega; - generic_block>::tempStart(); - } - - void setGains(float omegaGain, float muGain) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - _gainOmega = omegaGain; - _muGain = muGain; - generic_block>::tempStart(); - } - - void setOmegaRelLimit(float omegaRelLimit) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - _omegaRelLimit = omegaRelLimit; - omegaMin = _omega - (_omega * _omegaRelLimit); - omegaMax = _omega + (_omega * _omegaRelLimit); - generic_block>::tempStart(); - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - int outCount = 0; - float outVal; - float phaseError; - float roundedStep; - int maxOut = 2.0f * _omega * (float)count; - - // Copy the first 7 values to the delay buffer for fast computing - memcpy(&delay[7], _in->readBuf, 7 * sizeof(T)); - - int i = nextOffset; - for (; i < count && outCount < maxOut;) { - - if constexpr (std::is_same_v) { - // Calculate output value - // If we still need to use the old values, calculate using delay buf - // Otherwise, use normal buffer - if (i < 7) { - volk_32f_x2_dot_prod_32f(&outVal, &delay[i], INTERP_TAPS[(int)roundf(_mu * 128.0f)], 8); - } - else { - volk_32f_x2_dot_prod_32f(&outVal, &_in->readBuf[i - 7], INTERP_TAPS[(int)roundf(_mu * 128.0f)], 8); - } - out.writeBuf[outCount++] = outVal; - - // Cursed phase detect approximation (don't ask me how this approximation works) - phaseError = (DSP_STEP(lastOutput) * outVal) - (lastOutput * DSP_STEP(outVal)); - lastOutput = outVal; - } - if constexpr (std::is_same_v || std::is_same_v) { - // Propagate delay - _p_2T = _p_1T; - _p_1T = _p_0T; - - _c_2T = _c_1T; - _c_1T = _c_0T; - - // Perform interpolation the same way as for float values - if (i < 7) { - volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&_p_0T, (lv_32fc_t*)&delay[i], INTERP_TAPS[(int)roundf(_mu * 128.0f)], 8); - } - else { - volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&_p_0T, (lv_32fc_t*)&_in->readBuf[i - 7], INTERP_TAPS[(int)roundf(_mu * 128.0f)], 8); - } - out.writeBuf[outCount++] = _p_0T; - - // Slice output value - _c_0T = DSP_STEP_CPLX(_p_0T); - - // Cursed math to calculate the phase error - phaseError = (((_p_0T - _p_2T) * _c_1T.conj()) - ((_c_0T - _c_2T) * _p_1T.conj())).re; - } - - // Clamp phase error - if (phaseError > 1.0f) { phaseError = 1.0f; } - if (phaseError < -1.0f) { phaseError = -1.0f; } - - // Adjust the symbol rate using the phase error approximation and clamp - // TODO: Branchless clamp - _dynOmega = _dynOmega + (_gainOmega * phaseError); - if (_dynOmega > omegaMax) { _dynOmega = omegaMax; } - else if (_dynOmega < omegaMin) { - _dynOmega = omegaMin; - } - - // Adjust the symbol phase according to the phase error approximation - // It will now contain the phase delta needed to jump to the next symbol - // Rounded step will contain the rounded number of symbols - _mu = _mu + _dynOmega + (_muGain * phaseError); - roundedStep = floor(_mu); - - // Step to where the next symbol should be, and check for bogus input - i += (int)roundedStep; - if (i < 0) { i = 0; } - - // Now that we've stepped to the next symbol, keep only the offset inside the symbol - _mu -= roundedStep; - } - - nextOffset = i - count; - - // Save the last 7 values for the next round - memcpy(delay, &_in->readBuf[count - 7], 7 * sizeof(T)); - - _in->flush(); - if (outCount > 0 && !out.swap(outCount)) { return -1; } - return count; - } - - stream out; - - private: - int count; - - // Delay buffer - T delay[1024]; - int nextOffset = 0; - - // Configuration - float _omega = 1.0f; - float _muGain = 1.0f; - float _gainOmega = 0.001f; - float _omegaRelLimit = 0.005; - - // Precalculated values - float omegaMin = _omega + (_omega * _omegaRelLimit); - float omegaMax = _omega + (_omega * _omegaRelLimit); - - // Runtime adjusted - float _dynOmega = _omega; - float _mu = 0.5f; - float lastOutput = 0.0f; - - // Cursed complex stuff - complex_t _p_0T = { 0, 0 }, _p_1T = { 0, 0 }, _p_2T = { 0, 0 }; - complex_t _c_0T = { 0, 0 }, _c_1T = { 0, 0 }, _c_2T = { 0, 0 }; - - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/compression.h b/core/src/dsp/compression.h deleted file mode 100644 index f97e11b..0000000 --- a/core/src/dsp/compression.h +++ /dev/null @@ -1,160 +0,0 @@ -#pragma once -#include - -namespace dsp { - enum PCMType { - PCM_TYPE_I8, - PCM_TYPE_I16, - PCM_TYPE_F32 - }; - - class DynamicRangeCompressor : public generic_block { - public: - DynamicRangeCompressor() {} - - DynamicRangeCompressor(stream* in, PCMType pcmType) { - init(in, pcmType); - } - - void init(stream* in, PCMType pcmType) { - _in = in; - _pcmType = pcmType; - - out.setBufferSize((sizeof(dsp::complex_t) * STREAM_BUFFER_SIZE) + 8); - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setPCMType(PCMType pcmType) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - _pcmType = pcmType; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - PCMType type = _pcmType; - - uint16_t* compressionType = (uint16_t*)out.writeBuf; - uint16_t* sampleType = (uint16_t*)&out.writeBuf[2]; - float* scaler = (float*)&out.writeBuf[4]; - void* dataBuf = &out.writeBuf[8]; - - // Write options and leave blank space for compression - *compressionType = 0; - *sampleType = type; - - // If type is float32, no compression is needed - if (type == PCM_TYPE_F32) { - *scaler = 0; - memcpy(dataBuf, _in->readBuf, count * sizeof(complex_t)); - _in->flush(); - if (!out.swap(8 + (count * sizeof(complex_t)))) { return -1; } - return count; - } - - // Find maximum value - uint32_t maxIdx; - volk_32f_index_max_32u(&maxIdx, (float*)_in->readBuf, count * 2); - float maxVal = ((float*)_in->readBuf)[maxIdx]; - *scaler = maxVal; - - // Convert to the right type and send it out (sign bit determines pcm type) - if (type == PCM_TYPE_I8) { - volk_32f_s32f_convert_8i((int8_t*)dataBuf, (float*)_in->readBuf, 128.0f / maxVal, count * 2); - _in->flush(); - if (!out.swap(8 + (count * sizeof(int8_t) * 2))) { return -1; } - } - else if (type == PCM_TYPE_I16) { - volk_32f_s32f_convert_16i((int16_t*)dataBuf, (float*)_in->readBuf, 32768.0f / maxVal, count * 2); - _in->flush(); - if (!out.swap(8 + (count * sizeof(int16_t) * 2))) { return -1; } - } - else { - _in->flush(); - } - - return count; - } - - stream out; - - private: - stream* _in; - PCMType _pcmType; - }; - - class DynamicRangeDecompressor : public generic_block { - public: - DynamicRangeDecompressor() {} - - DynamicRangeDecompressor(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - uint16_t sampleType = *(uint16_t*)&_in->readBuf[2]; - float scaler = *(float*)&_in->readBuf[4]; - void* dataBuf = &_in->readBuf[8]; - - if (sampleType == PCM_TYPE_F32) { - memcpy(out.writeBuf, dataBuf, count - 8); - _in->flush(); - if (!out.swap((count - 8) / sizeof(complex_t))) { return -1; } - } - else if (sampleType == PCM_TYPE_I16) { - int outCount = (count - 8) / (sizeof(int16_t) * 2); - volk_16i_s32f_convert_32f((float*)out.writeBuf, (int16_t*)dataBuf, 32768.0f / scaler, outCount * 2); - _in->flush(); - if (!out.swap(outCount)) { return -1; } - } - else if (sampleType == PCM_TYPE_I8) { - int outCount = (count - 8) / (sizeof(int8_t) * 2); - volk_8i_s32f_convert_32f((float*)out.writeBuf, (int8_t*)dataBuf, 128.0f / scaler, outCount * 2); - _in->flush(); - if (!out.swap(outCount)) { return -1; } - } - else { - _in->flush(); - } - - return count; - } - - stream out; - - private: - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/conversion.h b/core/src/dsp/conversion.h deleted file mode 100644 index 593c3ab..0000000 --- a/core/src/dsp/conversion.h +++ /dev/null @@ -1,337 +0,0 @@ -#pragma once -#include - -namespace dsp { - class ComplexToStereo : public generic_block { - public: - ComplexToStereo() {} - - ComplexToStereo(stream* in) { init(in); } - - static_assert(sizeof(complex_t) == sizeof(stereo_t)); - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - memcpy(out.writeBuf, _in->readBuf, count * sizeof(complex_t)); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; - - class ComplexToReal : public generic_block { - public: - ComplexToReal() {} - - ComplexToReal(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32fc_deinterleave_real_32f(out.writeBuf, (lv_32fc_t*)_in->readBuf, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; - - class ComplexToImag : public generic_block { - public: - ComplexToImag() {} - - ComplexToImag(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32fc_deinterleave_imag_32f(out.writeBuf, (lv_32fc_t*)_in->readBuf, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; - - - class RealToComplex : public generic_block { - public: - RealToComplex() {} - - RealToComplex(stream* in) { init(in); } - - ~RealToComplex() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - delete[] nullBuffer; - generic_block::_block_init = false; - } - - void init(stream* in) { - _in = in; - nullBuffer = new float[STREAM_BUFFER_SIZE]; - memset(nullBuffer, 0, STREAM_BUFFER_SIZE * sizeof(float)); - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32f_x2_interleave_32fc((lv_32fc_t*)out.writeBuf, _in->readBuf, nullBuffer, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float* nullBuffer; - stream* _in; - }; - - class Int16CToComplex : public generic_block { - public: - Int16CToComplex() {} - - Int16CToComplex(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_16i_s32f_convert_32f((float*)out.writeBuf, _in->readBuf, 32768.0f, count * 2); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; - - class ComplexToInt16C : public generic_block { - public: - ComplexToInt16C() {} - - ComplexToInt16C(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32f_s32f_convert_16i(out.writeBuf, (float*)_in->readBuf, 32768.0f, count * 2); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; - - class Int16ToFloat : public generic_block { - public: - Int16ToFloat() {} - - Int16ToFloat(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_16i_s32f_convert_32f(out.writeBuf, _in->readBuf, 32768.0f, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; - - class FloatToInt16 : public generic_block { - public: - FloatToInt16() {} - - FloatToInt16(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32f_s32f_convert_16i(out.writeBuf, _in->readBuf, 32768.0f, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/correction.h b/core/src/dsp/correction.h deleted file mode 100644 index ea2ffc8..0000000 --- a/core/src/dsp/correction.h +++ /dev/null @@ -1,142 +0,0 @@ -#pragma once -#include -#include -#include -#include - -namespace dsp { - class IQCorrector : public generic_block { - public: - IQCorrector() {} - - IQCorrector(stream* in, float rate) { init(in, rate); } - - void init(stream* in, float rate) { - _in = in; - correctionRate = rate; - offset.re = 0; - offset.im = 0; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setCorrectionRate(float rate) { - correctionRate = rate; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - if (bypass) { - memcpy(out.writeBuf, _in->readBuf, count * sizeof(complex_t)); - - _in->flush(); - - if (!out.swap(count)) { return -1; } - - return count; - } - - for (int i = 0; i < count; i++) { - out.writeBuf[i] = _in->readBuf[i] - offset; - offset = offset + (out.writeBuf[i] * correctionRate); - } - - _in->flush(); - - if (!out.swap(count)) { return -1; } - - return count; - } - - stream out; - - // TEMPORARY FOR DEBUG PURPOSES - bool bypass = false; - complex_t offset; - - private: - stream* _in; - float correctionRate = 0.00001; - }; - - class DCBlocker : public generic_block { - public: - DCBlocker() {} - - DCBlocker(stream* in, float rate) { init(in, rate); } - - void init(stream* in, float rate) { - _in = in; - correctionRate = rate; - offset = 0; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setCorrectionRate(float rate) { - correctionRate = rate; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - if (bypass) { - memcpy(out.writeBuf, _in->readBuf, count * sizeof(complex_t)); - - _in->flush(); - - if (!out.swap(count)) { return -1; } - - return count; - } - - for (int i = 0; i < count; i++) { - out.writeBuf[i] = _in->readBuf[i] - offset; - offset = offset + (out.writeBuf[i] * correctionRate); - } - - _in->flush(); - - if (!out.swap(count)) { return -1; } - - return count; - } - - stream out; - - // TEMPORARY FOR DEBUG PURPOSES - bool bypass = false; - float offset; - - private: - stream* _in; - float correctionRate = 0.00001; - }; - - -} \ No newline at end of file diff --git a/core/src/dsp/decimation.h b/core/src/dsp/decimation.h deleted file mode 100644 index 58d63b0..0000000 --- a/core/src/dsp/decimation.h +++ /dev/null @@ -1,106 +0,0 @@ -#pragma once -#include -#include -#include -#include - -namespace dsp { - template - class HalfDecimator : public generic_block> { - public: - HalfDecimator() {} - - HalfDecimator(stream* in, dsp::filter_window::generic_window* window) { init(in, window); } - - ~HalfDecimator() { - if (!generic_block>::_block_init) { return; } - generic_block>::stop(); - volk_free(buffer); - volk_free(taps); - generic_block>::_block_init = false; - } - - void init(stream* in, dsp::filter_window::generic_window* window) { - _in = in; - - tapCount = window->getTapCount(); - taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment()); - window->createTaps(taps, tapCount); - - buffer = (T*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(T) * 2, volk_get_alignment()); - bufStart = &buffer[tapCount]; - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void updateWindow(dsp::filter_window::generic_window* window) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - std::lock_guard lck2(bufMtx); - _window = window; - volk_free(taps); - tapCount = window->getTapCount(); - taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment()); - bufStart = &buffer[tapCount]; - window->createTaps(taps, tapCount); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - memcpy(bufStart, _in->readBuf, count * sizeof(T)); - _in->flush(); - - int inIndex = _inIndex; - int outIndex = 0; - if constexpr (std::is_same_v) { - while (inIndex < count) { - volk_32f_x2_dot_prod_32f((float*)&out.writeBuf[outIndex], (float*)&buffer[inIndex + 1], taps, tapCount); - inIndex += 2; - outIndex++; - } - } - if constexpr (std::is_same_v) { - while (inIndex < count) { - volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&out.writeBuf[outIndex], (lv_32fc_t*)&buffer[inIndex + 1], taps, tapCount); - inIndex += 2; - outIndex++; - } - } - _inIndex = inIndex - count; - - if (!out.swap(outIndex)) { return -1; } - - memmove(buffer, &buffer[count], tapCount * sizeof(T)); - - - return count; - } - - stream out; - - private: - stream* _in; - - dsp::filter_window::generic_window* _window; - std::mutex bufMtx; - - T* bufStart; - T* buffer; - int tapCount; - float* taps; - int _inIndex = 0; - }; -} \ No newline at end of file diff --git a/core/src/dsp/deframing.h b/core/src/dsp/deframing.h deleted file mode 100644 index 058fa2f..0000000 --- a/core/src/dsp/deframing.h +++ /dev/null @@ -1,414 +0,0 @@ -#pragma once -#include -#include - -#define DSP_SIGN(n) ((n) >= 0) -#define DSP_STEP(n) (((n) > 0.0f) ? 1.0f : -1.0f) - -namespace dsp { - class Deframer : public generic_block { - public: - Deframer() {} - - Deframer(stream* in, int frameLen, uint8_t* syncWord, int syncLen) { init(in, frameLen, syncWord, syncLen); } - - ~Deframer() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - generic_block::_block_init = false; - } - - void init(stream* in, int frameLen, uint8_t* syncWord, int syncLen) { - _in = in; - _frameLen = frameLen; - _syncword = new uint8_t[syncLen]; - _syncLen = syncLen; - memcpy(_syncword, syncWord, syncLen); - - buffer = new uint8_t[STREAM_BUFFER_SIZE + syncLen]; - memset(buffer, 0, syncLen); - bufferStart = buffer + syncLen; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - // Copy data into work buffer - memcpy(bufferStart, _in->readBuf, count - 1); - - // Iterate through all symbols - for (int i = 0; i < count;) { - - // If already in the process of reading bits - if (bitsRead >= 0) { - if ((bitsRead % 8) == 0) { out.writeBuf[bitsRead / 8] = 0; } - out.writeBuf[bitsRead / 8] |= (buffer[i] << (7 - (bitsRead % 8))); - i++; - bitsRead++; - - if (bitsRead >= _frameLen) { - if (!out.swap((bitsRead / 8) + ((bitsRead % 8) > 0))) { return -1; } - bitsRead = -1; - if (allowSequential) { nextBitIsStartOfFrame = true; } - } - - continue; - } - - // Else, check for a header - else if (memcmp(buffer + i, _syncword, _syncLen) == 0) { - bitsRead = 0; - //printf("Frame found!\n"); - badFrameCount = 0; - continue; - } - else if (nextBitIsStartOfFrame) { - nextBitIsStartOfFrame = false; - - // try to save - if (badFrameCount < 5) { - badFrameCount++; - //printf("Frame found!\n"); - bitsRead = 0; - continue; - } - } - - else { - i++; - } - - nextBitIsStartOfFrame = false; - } - - // Keep last _syncLen4 symbols - memcpy(buffer, &_in->readBuf[count - _syncLen], _syncLen); - - //printf("Block processed\n"); - callcount++; - - _in->flush(); - return count; - } - - bool allowSequential = true; - - stream out; - - private: - uint8_t* buffer; - uint8_t* bufferStart; - uint8_t* _syncword; - int count; - int _frameLen; - int _syncLen; - int bitsRead = -1; - - int badFrameCount = 5; - bool nextBitIsStartOfFrame = false; - - int callcount = 0; - - stream* _in; - }; - - inline int MachesterHammingDistance(float* data, uint8_t* syncBits, int n) { - int dist = 0; - for (int i = 0; i < n; i++) { - if ((data[(2 * i) + 1] > data[2 * i]) != syncBits[i]) { dist++; } - } - return dist; - } - - inline int HammingDistance(uint8_t* data, uint8_t* syncBits, int n) { - int dist = 0; - for (int i = 0; i < n; i++) { - if (data[i] != syncBits[i]) { dist++; } - } - return dist; - } - - class ManchesterDeframer : public generic_block { - public: - ManchesterDeframer() {} - - ManchesterDeframer(stream* in, int frameLen, uint8_t* syncWord, int syncLen) { init(in, frameLen, syncWord, syncLen); } - - void init(stream* in, int frameLen, uint8_t* syncWord, int syncLen) { - _in = in; - _frameLen = frameLen; - _syncword = new uint8_t[syncLen]; - _syncLen = syncLen; - memcpy(_syncword, syncWord, syncLen); - - buffer = new float[STREAM_BUFFER_SIZE + (syncLen * 2)]; - memset(buffer, 0, syncLen * 2 * sizeof(float)); - bufferStart = &buffer[syncLen * 2]; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - int readable; - - // Copy data into work buffer - memcpy(bufferStart, _in->readBuf, (count - 1) * sizeof(float)); - - // Iterate through all symbols - for (int i = 0; i < count;) { - - // If already in the process of reading bits - if (bitsRead >= 0) { - readable = std::min(count - i, _frameLen - bitsRead); - memcpy(&out.writeBuf[bitsRead], &buffer[i], readable * sizeof(float)); - bitsRead += readable; - i += readable; - if (bitsRead >= _frameLen) { - out.swap(_frameLen); - bitsRead = -1; - } - continue; - } - - // Else, check for a header - if (MachesterHammingDistance(&buffer[i], _syncword, _syncLen) <= 2) { - bitsRead = 0; - continue; - } - - i++; - } - - // Keep last _syncLen symbols - memcpy(buffer, &_in->readBuf[count - (_syncLen * 2)], _syncLen * 2 * sizeof(float)); - - _in->flush(); - return count; - } - - stream out; - - private: - float* buffer; - float* bufferStart; - uint8_t* _syncword; - int count; - int _frameLen; - int _syncLen; - int bitsRead = -1; - - stream* _in; - }; - - class SymbolDeframer : public generic_block { - public: - SymbolDeframer() {} - - SymbolDeframer(stream* in, int frameLen, uint8_t* syncWord, int syncLen) { init(in, frameLen, syncWord, syncLen); } - - void init(stream* in, int frameLen, uint8_t* syncWord, int syncLen) { - _in = in; - _frameLen = frameLen; - _syncword = new uint8_t[syncLen]; - _syncLen = syncLen; - memcpy(_syncword, syncWord, syncLen); - - buffer = new uint8_t[STREAM_BUFFER_SIZE + syncLen]; - memset(buffer, 0, syncLen); - bufferStart = &buffer[syncLen]; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - int readable; - - // Copy data into work buffer - memcpy(bufferStart, _in->readBuf, count - 1); - - // Iterate through all symbols - for (int i = 0; i < count;) { - - // If already in the process of reading bits - if (bitsRead >= 0) { - readable = std::min(count - i, _frameLen - bitsRead); - memcpy(&out.writeBuf[bitsRead], &buffer[i], readable); - bitsRead += readable; - i += readable; - if (bitsRead >= _frameLen) { - out.swap(_frameLen); - bitsRead = -1; - } - continue; - } - - // Else, check for a header - if (HammingDistance(&buffer[i], _syncword, _syncLen) <= 2) { - bitsRead = 0; - continue; - } - - i++; - } - - // Keep last _syncLen symbols - memcpy(buffer, &_in->readBuf[count - _syncLen], _syncLen); - - _in->flush(); - return count; - } - - stream out; - - private: - uint8_t* buffer; - uint8_t* bufferStart; - uint8_t* _syncword; - int count; - int _frameLen; - int _syncLen; - int bitsRead = -1; - - stream* _in; - }; - - class ManchesterDecoder : public generic_block { - public: - ManchesterDecoder() {} - - ManchesterDecoder(stream* in, bool inverted) { init(in, inverted); } - - void init(stream* in, bool inverted) { - _in = in; - _inverted = inverted; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - if (_inverted) { - for (int i = 0; i < count; i += 2) { - out.writeBuf[i / 2] = (_in->readBuf[i + 1] < _in->readBuf[i]); - } - } - else { - for (int i = 0; i < count; i += 2) { - out.writeBuf[i / 2] = (_in->readBuf[i + 1] > _in->readBuf[i]); - } - } - - _in->flush(); - out.swap(count / 2); - return count; - } - - stream out; - - private: - stream* _in; - bool _inverted; - }; - - class BitPacker : public generic_block { - public: - BitPacker() {} - - BitPacker(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - for (int i = 0; i < count; i++) { - if ((i % 8) == 0) { out.writeBuf[i / 8] = 0; } - out.writeBuf[i / 8] |= (_in->readBuf[i] & 1) << (7 - (i % 8)); - } - - _in->flush(); - out.swap((count / 8) + (((count % 8) == 0) ? 0 : 1)); - return count; - } - - stream out; - - private: - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/demodulator.h b/core/src/dsp/demodulator.h deleted file mode 100644 index 545949c..0000000 --- a/core/src/dsp/demodulator.h +++ /dev/null @@ -1,834 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define FAST_ATAN2_COEF1 FL_M_PI / 4.0f -#define FAST_ATAN2_COEF2 3.0f * FAST_ATAN2_COEF1 - -inline float fast_arctan2(float y, float x) { - float abs_y = fabsf(y); - float r, angle; - if (x == 0.0f && y == 0.0f) { return 0.0f; } - if (x >= 0.0f) { - r = (x - abs_y) / (x + abs_y); - angle = FAST_ATAN2_COEF1 - FAST_ATAN2_COEF1 * r; - } - else { - r = (x + abs_y) / (abs_y - x); - angle = FAST_ATAN2_COEF2 - FAST_ATAN2_COEF1 * r; - } - if (y < 0.0f) { - return -angle; - } - return angle; -} - -namespace dsp { - class FloatFMDemod : public generic_block { - public: - FloatFMDemod() {} - - FloatFMDemod(stream* in, float sampleRate, float deviation) { init(in, sampleRate, deviation); } - - void init(stream* in, float sampleRate, float deviation) { - _in = in; - _sampleRate = sampleRate; - _deviation = deviation; - phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation); - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setSampleRate(float sampleRate) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - _sampleRate = sampleRate; - phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation); - generic_block::tempStart(); - } - - float getSampleRate() { - assert(generic_block::_block_init); - return _sampleRate; - } - - void setDeviation(float deviation) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - _deviation = deviation; - phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation); - generic_block::tempStart(); - } - - float getDeviation() { - assert(generic_block::_block_init); - return _deviation; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - // This is somehow faster than volk... - float diff, currentPhase; - for (int i = 0; i < count; i++) { - currentPhase = fast_arctan2(_in->readBuf[i].im, _in->readBuf[i].re); - diff = currentPhase - phase; - if (diff > 3.1415926535f) { diff -= 2 * 3.1415926535f; } - else if (diff <= -3.1415926535f) { - diff += 2 * 3.1415926535f; - } - out.writeBuf[i] = diff / phasorSpeed; - phase = currentPhase; - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float phase = 0; - float phasorSpeed, _sampleRate, _deviation; - stream* _in; - }; - - class FMDemod : public generic_block { - public: - FMDemod() {} - - FMDemod(stream* in, float sampleRate, float deviation) { init(in, sampleRate, deviation); } - - void init(stream* in, float sampleRate, float deviation) { - _in = in; - _sampleRate = sampleRate; - _deviation = deviation; - phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation); - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setSampleRate(float sampleRate) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - _sampleRate = sampleRate; - phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation); - generic_block::tempStart(); - } - - float getSampleRate() { - assert(generic_block::_block_init); - return _sampleRate; - } - - void setDeviation(float deviation) { - assert(generic_block::_block_init); - _deviation = deviation; - phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation); - } - - float getDeviation() { - assert(generic_block::_block_init); - return _deviation; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - // This is somehow faster than volk... - - float diff, currentPhase; - for (int i = 0; i < count; i++) { - currentPhase = fast_arctan2(_in->readBuf[i].im, _in->readBuf[i].re); - diff = currentPhase - phase; - if (diff > 3.1415926535f) { diff -= 2 * 3.1415926535f; } - else if (diff <= -3.1415926535f) { - diff += 2 * 3.1415926535f; - } - out.writeBuf[i].l = diff / phasorSpeed; - out.writeBuf[i].r = diff / phasorSpeed; - phase = currentPhase; - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float phase = 0; - float phasorSpeed, _sampleRate, _deviation; - stream* _in; - }; - - class AMDemod : public generic_block { - public: - AMDemod() {} - - AMDemod(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32fc_magnitude_32f(out.writeBuf, (lv_32fc_t*)_in->readBuf, count); - - _in->flush(); - - for (int i = 0; i < count; i++) { - out.writeBuf[i] -= avg; - avg += out.writeBuf[i] * 10e-4; - } - - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - float avg = 0; - }; - - class SSBDemod : public generic_block { - public: - SSBDemod() {} - - SSBDemod(stream* in, float sampleRate, float bandWidth, int mode) { init(in, sampleRate, bandWidth, mode); } - - ~SSBDemod() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - delete[] buffer; - generic_block::_block_init = false; - } - - enum { - MODE_USB, - MODE_LSB, - MODE_DSB - }; - - void init(stream* in, float sampleRate, float bandWidth, int mode) { - _in = in; - _sampleRate = sampleRate; - _bandWidth = bandWidth; - _mode = mode; - phase = lv_cmake(1.0f, 0.0f); - switch (_mode) { - case MODE_USB: - phaseDelta = lv_cmake(std::cos((_bandWidth / _sampleRate) * FL_M_PI), std::sin((_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_LSB: - phaseDelta = lv_cmake(std::cos(-(_bandWidth / _sampleRate) * FL_M_PI), std::sin(-(_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_DSB: - phaseDelta = lv_cmake(1.0f, 0.0f); - break; - } - buffer = new lv_32fc_t[STREAM_BUFFER_SIZE]; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setSampleRate(float sampleRate) { - assert(generic_block::_block_init); - _sampleRate = sampleRate; - switch (_mode) { - case MODE_USB: - phaseDelta = lv_cmake(std::cos((_bandWidth / _sampleRate) * FL_M_PI), std::sin((_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_LSB: - phaseDelta = lv_cmake(std::cos(-(_bandWidth / _sampleRate) * FL_M_PI), std::sin(-(_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_DSB: - phaseDelta = lv_cmake(1.0f, 0.0f); - break; - } - } - - void setBandWidth(float bandWidth) { - assert(generic_block::_block_init); - _bandWidth = bandWidth; - switch (_mode) { - case MODE_USB: - phaseDelta = lv_cmake(std::cos((_bandWidth / _sampleRate) * FL_M_PI), std::sin((_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_LSB: - phaseDelta = lv_cmake(std::cos(-(_bandWidth / _sampleRate) * FL_M_PI), std::sin(-(_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_DSB: - phaseDelta = lv_cmake(1.0f, 0.0f); - break; - } - } - - void setMode(int mode) { - assert(generic_block::_block_init); - _mode = mode; - switch (_mode) { - case MODE_USB: - phaseDelta = lv_cmake(std::cos((_bandWidth / _sampleRate) * FL_M_PI), std::sin((_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_LSB: - phaseDelta = lv_cmake(std::cos(-(_bandWidth / _sampleRate) * FL_M_PI), std::sin(-(_bandWidth / _sampleRate) * FL_M_PI)); - break; - case MODE_DSB: - phaseDelta = lv_cmake(1.0f, 0.0f); - break; - } - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32fc_s32fc_x2_rotator_32fc(buffer, (lv_32fc_t*)_in->readBuf, phaseDelta, &phase, count); - volk_32fc_deinterleave_real_32f(out.writeBuf, buffer, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - int _mode; - float _sampleRate, _bandWidth; - stream* _in; - lv_32fc_t* buffer; - lv_32fc_t phase; - lv_32fc_t phaseDelta; - }; - - class FSKDemod : public generic_hier_block { - public: - FSKDemod() {} - - FSKDemod(stream* input, float sampleRate, float deviation, float baudRate, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - init(input, sampleRate, deviation, baudRate, omegaGain, muGain, omegaRelLimit); - } - - void init(stream* input, float sampleRate, float deviation, float baudRate, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - _sampleRate = sampleRate; - _deviation = deviation; - _baudRate = baudRate; - _omegaGain = omegaGain; - _muGain = muGain; - _omegaRelLimit = omegaRelLimit; - - demod.init(input, _sampleRate, _deviation); - recov.init(&demod.out, _sampleRate / _baudRate, _omegaGain, _muGain, _omegaRelLimit); - out = &recov.out; - - generic_hier_block::registerBlock(&demod); - generic_hier_block::registerBlock(&recov); - generic_hier_block::_block_init = true; - } - - void setInput(stream* input) { - assert((generic_hier_block::_block_init)); - demod.setInput(input); - } - - void setSampleRate(float sampleRate) { - assert(generic_hier_block::_block_init); - generic_hier_block::tempStop(); - _sampleRate = sampleRate; - demod.setSampleRate(_sampleRate); - recov.setOmega(_sampleRate / _baudRate, _omegaRelLimit); - generic_hier_block::tempStart(); - } - - void setDeviation(float deviation) { - assert(generic_hier_block::_block_init); - _deviation = deviation; - demod.setDeviation(deviation); - } - - void setBaudRate(float baudRate, float omegaRelLimit) { - assert(generic_hier_block::_block_init); - _baudRate = baudRate; - _omegaRelLimit = omegaRelLimit; - recov.setOmega(_sampleRate / _baudRate, _omegaRelLimit); - } - - void setMMGains(float omegaGain, float myGain) { - assert(generic_hier_block::_block_init); - _omegaGain = omegaGain; - _muGain = myGain; - recov.setGains(_omegaGain, _muGain); - } - - void setOmegaRelLimit(float omegaRelLimit) { - assert(generic_hier_block::_block_init); - _omegaRelLimit = omegaRelLimit; - recov.setOmegaRelLimit(_omegaRelLimit); - } - - stream* out = NULL; - - private: - FloatFMDemod demod; - MMClockRecovery recov; - - float _sampleRate; - float _deviation; - float _baudRate; - float _omegaGain; - float _muGain; - float _omegaRelLimit; - }; - - class GFSKDemod : public generic_hier_block { - public: - GFSKDemod() {} - - GFSKDemod(stream* input, float sampleRate, float deviation, float rrcAlpha, float baudRate, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - init(input, sampleRate, deviation, rrcAlpha, baudRate, omegaGain, muGain, omegaRelLimit); - } - - void init(stream* input, float sampleRate, float deviation, float rrcAlpha, float baudRate, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - _sampleRate = sampleRate; - _deviation = deviation; - _rrcAlpha = rrcAlpha; - _baudRate = baudRate; - _omegaGain = omegaGain; - _muGain = muGain; - _omegaRelLimit = omegaRelLimit; - - demod.init(input, _sampleRate, _deviation); - rrc.init(31, _sampleRate, _baudRate, _rrcAlpha); - fir.init(&demod.out, &rrc); - recov.init(&fir.out, _sampleRate / _baudRate, _omegaGain, _muGain, _omegaRelLimit); - out = &recov.out; - - generic_hier_block::registerBlock(&demod); - generic_hier_block::registerBlock(&fir); - generic_hier_block::registerBlock(&recov); - generic_hier_block::_block_init = true; - } - - void setInput(stream* input) { - assert((generic_hier_block::_block_init)); - demod.setInput(input); - } - - void setSampleRate(float sampleRate) { - assert(generic_hier_block::_block_init); - generic_hier_block::tempStop(); - _sampleRate = sampleRate; - demod.setSampleRate(_sampleRate); - recov.setOmega(_sampleRate / _baudRate, _omegaRelLimit); - rrc.setSampleRate(_sampleRate); - fir.updateWindow(&rrc); - generic_hier_block::tempStart(); - } - - void setDeviation(float deviation) { - assert(generic_hier_block::_block_init); - _deviation = deviation; - demod.setDeviation(deviation); - } - - void setRRCAlpha(float rrcAlpha) { - assert(generic_hier_block::_block_init); - _rrcAlpha = rrcAlpha; - rrc.setAlpha(_rrcAlpha); - fir.updateWindow(&rrc); - } - - void setBaudRate(float baudRate, float omegaRelLimit) { - assert(generic_hier_block::_block_init); - _baudRate = baudRate; - _omegaRelLimit = omegaRelLimit; - generic_hier_block::tempStop(); - recov.setOmega(_sampleRate / _baudRate, _omegaRelLimit); - rrc.setBaudRate(_baudRate); - fir.updateWindow(&rrc); - generic_hier_block::tempStart(); - } - - void setMMGains(float omegaGain, float myGain) { - assert(generic_hier_block::_block_init); - _omegaGain = omegaGain; - _muGain = myGain; - recov.setGains(_omegaGain, _muGain); - } - - void setOmegaRelLimit(float omegaRelLimit) { - assert(generic_hier_block::_block_init); - _omegaRelLimit = omegaRelLimit; - recov.setOmegaRelLimit(_omegaRelLimit); - } - - stream* out = NULL; - - private: - FloatFMDemod demod; - RRCTaps rrc; - FIR fir; - MMClockRecovery recov; - - float _sampleRate; - float _deviation; - float _rrcAlpha; - float _baudRate; - float _omegaGain; - float _muGain; - float _omegaRelLimit; - }; - - template - class PSKDemod : public generic_hier_block> { - public: - PSKDemod() {} - - PSKDemod(stream* input, float sampleRate, float baudRate, int RRCTapCount = 31, float RRCAlpha = 0.32f, float agcRate = 10e-4, float costasLoopBw = 0.004f, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - init(input, sampleRate, baudRate, RRCTapCount, RRCAlpha, agcRate, costasLoopBw, omegaGain, muGain, omegaRelLimit); - } - - void init(stream* input, float sampleRate, float baudRate, int RRCTapCount = 31, float RRCAlpha = 0.32f, float agcRate = 10e-4, float costasLoopBw = 0.004f, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - _RRCTapCount = RRCTapCount; - _RRCAlpha = RRCAlpha; - _sampleRate = sampleRate; - _agcRate = agcRate; - _costasLoopBw = costasLoopBw; - _baudRate = baudRate; - _omegaGain = omegaGain; - _muGain = muGain; - _omegaRelLimit = omegaRelLimit; - - agc.init(input, 1.0f, 65535, _agcRate); - taps.init(_RRCTapCount, _sampleRate, _baudRate, _RRCAlpha); - rrc.init(&agc.out, &taps); - demod.init(&rrc.out, _costasLoopBw); - - generic_hier_block>::registerBlock(&agc); - generic_hier_block>::registerBlock(&rrc); - generic_hier_block>::registerBlock(&demod); - - if constexpr (OFFSET) { - delay.init(&demod.out); - recov.init(&delay.out, _sampleRate / _baudRate, _omegaGain, _muGain, _omegaRelLimit); - generic_hier_block>::registerBlock(&delay); - } - else { - recov.init(&demod.out, _sampleRate / _baudRate, _omegaGain, _muGain, _omegaRelLimit); - } - - generic_hier_block>::registerBlock(&recov); - - out = &recov.out; - - generic_hier_block>::_block_init = true; - } - - void setInput(stream* input) { - assert((generic_hier_block>::_block_init)); - agc.setInput(input); - } - - void setSampleRate(float sampleRate) { - assert((generic_hier_block>::_block_init)); - _sampleRate = sampleRate; - rrc.tempStop(); - recov.tempStop(); - taps.setSampleRate(_sampleRate); - rrc.updateWindow(&taps); - recov.setOmega(_sampleRate / _baudRate, _omegaRelLimit); - rrc.tempStart(); - recov.tempStart(); - } - - void setBaudRate(float baudRate) { - assert((generic_hier_block>::_block_init)); - _baudRate = baudRate; - rrc.tempStop(); - recov.tempStop(); - taps.setBaudRate(_baudRate); - rrc.updateWindow(&taps); - recov.setOmega(_sampleRate / _baudRate, _omegaRelLimit); - rrc.tempStart(); - recov.tempStart(); - } - - void setRRCParams(int RRCTapCount, float RRCAlpha) { - assert((generic_hier_block>::_block_init)); - _RRCTapCount = RRCTapCount; - _RRCAlpha = RRCAlpha; - taps.setTapCount(_RRCTapCount); - taps.setAlpha(RRCAlpha); - rrc.updateWindow(&taps); - } - - void setAgcRate(float agcRate) { - assert((generic_hier_block>::_block_init)); - _agcRate = agcRate; - agc.setRate(_agcRate); - } - - void setCostasLoopBw(float costasLoopBw) { - assert((generic_hier_block>::_block_init)); - _costasLoopBw = costasLoopBw; - demod.setLoopBandwidth(_costasLoopBw); - } - - void setMMGains(float omegaGain, float myGain) { - assert((generic_hier_block>::_block_init)); - _omegaGain = omegaGain; - _muGain = myGain; - recov.setGains(_omegaGain, _muGain); - } - - void setOmegaRelLimit(float omegaRelLimit) { - assert((generic_hier_block>::_block_init)); - _omegaRelLimit = omegaRelLimit; - recov.setOmegaRelLimit(_omegaRelLimit); - } - - stream* out = NULL; - - private: - dsp::ComplexAGC agc; - dsp::RRCTaps taps; - dsp::FIR rrc; - CostasLoop demod; - DelayImag delay; - MMClockRecovery recov; - - int _RRCTapCount; - float _RRCAlpha; - float _sampleRate; - float _agcRate; - float _baudRate; - float _costasLoopBw; - float _omegaGain; - float _muGain; - float _omegaRelLimit; - }; - - class PMDemod : public generic_hier_block { - public: - PMDemod() {} - - PMDemod(stream* input, float sampleRate, float baudRate, float agcRate = 0.02e-3f, float pllLoopBandwidth = (0.06f * 0.06f) / 4.0f, int rrcTapCount = 31, float rrcAlpha = 0.6f, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - init(input, sampleRate, baudRate, agcRate, pllLoopBandwidth, rrcTapCount, rrcAlpha, omegaGain, muGain, omegaRelLimit); - } - - void init(stream* input, float sampleRate, float baudRate, float agcRate = 0.02e-3f, float pllLoopBandwidth = (0.06f * 0.06f) / 4.0f, int rrcTapCount = 31, float rrcAlpha = 0.6f, float omegaGain = (0.01 * 0.01) / 4, float muGain = 0.01f, float omegaRelLimit = 0.005f) { - _sampleRate = sampleRate; - _baudRate = baudRate; - _agcRate = agcRate; - _pllLoopBandwidth = pllLoopBandwidth; - _rrcTapCount = rrcTapCount; - _rrcAlpha = rrcAlpha; - _omegaGain = omegaGain; - _muGain = muGain; - _omegaRelLimit = omegaRelLimit; - - agc.init(input, 1.0f, 65535, _agcRate); - pll.init(&agc.out, _pllLoopBandwidth); - rrcwin.init(_rrcTapCount, _sampleRate, _baudRate, _rrcAlpha); - rrc.init(&pll.out, &rrcwin); - recov.init(&rrc.out, _sampleRate / _baudRate, _omegaGain, _muGain, _omegaRelLimit); - - out = &recov.out; - - generic_hier_block::registerBlock(&agc); - generic_hier_block::registerBlock(&pll); - generic_hier_block::registerBlock(&rrc); - generic_hier_block::registerBlock(&recov); - generic_hier_block::_block_init = true; - } - - void setInput(stream* input) { - assert(generic_hier_block::_block_init); - agc.setInput(input); - } - - void setAgcRate(float agcRate) { - assert(generic_hier_block::_block_init); - _agcRate = agcRate; - agc.setRate(_agcRate); - } - - void setPllLoopBandwidth(float pllLoopBandwidth) { - assert(generic_hier_block::_block_init); - _pllLoopBandwidth = pllLoopBandwidth; - pll.setLoopBandwidth(_pllLoopBandwidth); - } - - void setRRCParams(int rrcTapCount, float rrcAlpha) { - assert(generic_hier_block::_block_init); - _rrcTapCount = rrcTapCount; - _rrcAlpha = rrcAlpha; - rrcwin.setTapCount(_rrcTapCount); - rrcwin.setAlpha(_rrcAlpha); - rrc.updateWindow(&rrcwin); - } - - void setMMGains(float omegaGain, float muGain) { - assert(generic_hier_block::_block_init); - _omegaGain = omegaGain; - _muGain = muGain; - recov.setGains(_omegaGain, _muGain); - } - - void setOmegaRelLimit(float omegaRelLimit) { - assert(generic_hier_block::_block_init); - _omegaRelLimit = omegaRelLimit; - recov.setOmegaRelLimit(_omegaRelLimit); - } - - stream* out = NULL; - - private: - dsp::ComplexAGC agc; - dsp::CarrierTrackingPLL pll; - dsp::RRCTaps rrcwin; - dsp::FIR rrc; - dsp::MMClockRecovery recov; - - float _sampleRate; - float _baudRate; - float _agcRate; - float _pllLoopBandwidth; - int _rrcTapCount; - float _rrcAlpha; - float _omegaGain; - float _muGain; - float _omegaRelLimit; - }; - - class StereoFMDemod : public generic_hier_block { - public: - StereoFMDemod() {} - - StereoFMDemod(stream* input, float sampleRate, float deviation) { - init(input, sampleRate, deviation); - } - - void init(stream* input, float sampleRate, float deviation) { - _sampleRate = sampleRate; - - PilotFirWin.init(18750, 19250, 3000, _sampleRate); - - demod.init(input, _sampleRate, deviation); - - r2c.init(&demod.out); - - pilotFilter.init(&r2c.out, &PilotFirWin); - - demux.init(&pilotFilter.dataOut, &pilotFilter.pilotOut, 0.1f); - - recon.init(&demux.AplusBOut, &demux.AminusBOut); - - out = &recon.out; - - generic_hier_block::registerBlock(&demod); - generic_hier_block::registerBlock(&r2c); - generic_hier_block::registerBlock(&pilotFilter); - generic_hier_block::registerBlock(&demux); - generic_hier_block::registerBlock(&recon); - generic_hier_block::_block_init = true; - } - - void setInput(stream* input) { - assert(generic_hier_block::_block_init); - demod.setInput(input); - } - - void setDeviation(float deviation) { - demod.setDeviation(deviation); - } - - stream* out = NULL; - - private: - filter_window::BandPassBlackmanWindow PilotFirWin; - - FloatFMDemod demod; - - RealToComplex r2c; - - FMStereoDemuxPilotFilter pilotFilter; - - FMStereoDemux demux; - - FMStereoReconstruct recon; - - float _sampleRate; - }; -} \ No newline at end of file diff --git a/core/src/dsp/falcon_fec.h b/core/src/dsp/falcon_fec.h deleted file mode 100644 index 73f012a..0000000 --- a/core/src/dsp/falcon_fec.h +++ /dev/null @@ -1,147 +0,0 @@ -#pragma once -#include -#include - -// WTF??? -extern "C" { -#include -} - -const uint8_t toDB[] = { - 0x00, 0x7b, 0xaf, 0xd4, 0x99, 0xe2, 0x36, 0x4d, 0xfa, 0x81, 0x55, 0x2e, 0x63, 0x18, 0xcc, 0xb7, 0x86, 0xfd, 0x29, 0x52, 0x1f, - 0x64, 0xb0, 0xcb, 0x7c, 0x07, 0xd3, 0xa8, 0xe5, 0x9e, 0x4a, 0x31, 0xec, 0x97, 0x43, 0x38, 0x75, 0x0e, 0xda, 0xa1, 0x16, 0x6d, 0xb9, 0xc2, 0x8f, 0xf4, - 0x20, 0x5b, 0x6a, 0x11, 0xc5, 0xbe, 0xf3, 0x88, 0x5c, 0x27, 0x90, 0xeb, 0x3f, 0x44, 0x09, 0x72, 0xa6, 0xdd, 0xef, 0x94, 0x40, 0x3b, 0x76, 0x0d, 0xd9, - 0xa2, 0x15, 0x6e, 0xba, 0xc1, 0x8c, 0xf7, 0x23, 0x58, 0x69, 0x12, 0xc6, 0xbd, 0xf0, 0x8b, 0x5f, 0x24, 0x93, 0xe8, 0x3c, 0x47, 0x0a, 0x71, 0xa5, 0xde, - 0x03, 0x78, 0xac, 0xd7, 0x9a, 0xe1, 0x35, 0x4e, 0xf9, 0x82, 0x56, 0x2d, 0x60, 0x1b, 0xcf, 0xb4, 0x85, 0xfe, 0x2a, 0x51, 0x1c, 0x67, 0xb3, 0xc8, 0x7f, - 0x04, 0xd0, 0xab, 0xe6, 0x9d, 0x49, 0x32, 0x8d, 0xf6, 0x22, 0x59, 0x14, 0x6f, 0xbb, 0xc0, 0x77, 0x0c, 0xd8, 0xa3, 0xee, 0x95, 0x41, 0x3a, 0x0b, 0x70, - 0xa4, 0xdf, 0x92, 0xe9, 0x3d, 0x46, 0xf1, 0x8a, 0x5e, 0x25, 0x68, 0x13, 0xc7, 0xbc, 0x61, 0x1a, 0xce, 0xb5, 0xf8, 0x83, 0x57, 0x2c, 0x9b, 0xe0, 0x34, - 0x4f, 0x02, 0x79, 0xad, 0xd6, 0xe7, 0x9c, 0x48, 0x33, 0x7e, 0x05, 0xd1, 0xaa, 0x1d, 0x66, 0xb2, 0xc9, 0x84, 0xff, 0x2b, 0x50, 0x62, 0x19, 0xcd, 0xb6, - 0xfb, 0x80, 0x54, 0x2f, 0x98, 0xe3, 0x37, 0x4c, 0x01, 0x7a, 0xae, 0xd5, 0xe4, 0x9f, 0x4b, 0x30, 0x7d, 0x06, 0xd2, 0xa9, 0x1e, 0x65, 0xb1, 0xca, 0x87, - 0xfc, 0x28, 0x53, 0x8e, 0xf5, 0x21, 0x5a, 0x17, 0x6c, 0xb8, 0xc3, 0x74, 0x0f, 0xdb, 0xa0, 0xed, 0x96, 0x42, 0x39, 0x08, 0x73, 0xa7, 0xdc, 0x91, 0xea, - 0x3e, 0x45, 0xf2, 0x89, 0x5d, 0x26, 0x6b, 0x10, 0xc4, 0xbf -}; - -const uint8_t fromDB[] = { - 0x00, 0xcc, 0xac, 0x60, 0x79, 0xb5, 0xd5, 0x19, 0xf0, 0x3c, 0x5c, 0x90, 0x89, 0x45, 0x25, 0xe9, 0xfd, 0x31, 0x51, 0x9d, - 0x84, 0x48, 0x28, 0xe4, 0x0d, 0xc1, 0xa1, 0x6d, 0x74, 0xb8, 0xd8, 0x14, 0x2e, 0xe2, 0x82, 0x4e, 0x57, 0x9b, 0xfb, 0x37, 0xde, 0x12, 0x72, 0xbe, 0xa7, - 0x6b, 0x0b, 0xc7, 0xd3, 0x1f, 0x7f, 0xb3, 0xaa, 0x66, 0x06, 0xca, 0x23, 0xef, 0x8f, 0x43, 0x5a, 0x96, 0xf6, 0x3a, 0x42, 0x8e, 0xee, 0x22, 0x3b, 0xf7, - 0x97, 0x5b, 0xb2, 0x7e, 0x1e, 0xd2, 0xcb, 0x07, 0x67, 0xab, 0xbf, 0x73, 0x13, 0xdf, 0xc6, 0x0a, 0x6a, 0xa6, 0x4f, 0x83, 0xe3, 0x2f, 0x36, 0xfa, 0x9a, - 0x56, 0x6c, 0xa0, 0xc0, 0x0c, 0x15, 0xd9, 0xb9, 0x75, 0x9c, 0x50, 0x30, 0xfc, 0xe5, 0x29, 0x49, 0x85, 0x91, 0x5d, 0x3d, 0xf1, 0xe8, 0x24, 0x44, 0x88, - 0x61, 0xad, 0xcd, 0x01, 0x18, 0xd4, 0xb4, 0x78, 0xc5, 0x09, 0x69, 0xa5, 0xbc, 0x70, 0x10, 0xdc, 0x35, 0xf9, 0x99, 0x55, 0x4c, 0x80, 0xe0, 0x2c, 0x38, - 0xf4, 0x94, 0x58, 0x41, 0x8d, 0xed, 0x21, 0xc8, 0x04, 0x64, 0xa8, 0xb1, 0x7d, 0x1d, 0xd1, 0xeb, 0x27, 0x47, 0x8b, 0x92, 0x5e, 0x3e, 0xf2, 0x1b, 0xd7, - 0xb7, 0x7b, 0x62, 0xae, 0xce, 0x02, 0x16, 0xda, 0xba, 0x76, 0x6f, 0xa3, 0xc3, 0x0f, 0xe6, 0x2a, 0x4a, 0x86, 0x9f, 0x53, 0x33, 0xff, 0x87, 0x4b, 0x2b, - 0xe7, 0xfe, 0x32, 0x52, 0x9e, 0x77, 0xbb, 0xdb, 0x17, 0x0e, 0xc2, 0xa2, 0x6e, 0x7a, 0xb6, 0xd6, 0x1a, 0x03, 0xcf, 0xaf, 0x63, 0x8a, 0x46, 0x26, 0xea, - 0xf3, 0x3f, 0x5f, 0x93, 0xa9, 0x65, 0x05, 0xc9, 0xd0, 0x1c, 0x7c, 0xb0, 0x59, 0x95, 0xf5, 0x39, 0x20, 0xec, 0x8c, 0x40, 0x54, 0x98, 0xf8, 0x34, 0x2d, - 0xe1, 0x81, 0x4d, 0xa4, 0x68, 0x08, 0xc4, 0xdd, 0x11, 0x71, 0xbd -}; - -const uint8_t randVals[] = { - 0xFF, 0x48, 0x0E, 0xC0, 0x9A, 0x0D, 0x70, 0xBC, 0x8E, 0x2C, 0x93, 0xAD, 0xA7, 0xB7, 0x46, 0xCE, - 0x5A, 0x97, 0x7D, 0xCC, 0x32, 0xA2, 0xBF, 0x3E, 0x0A, 0x10, 0xF1, 0x88, 0x94, 0xCD, 0xEA, 0xB1, - 0xFE, 0x90, 0x1D, 0x81, 0x34, 0x1A, 0xE1, 0x79, 0x1C, 0x59, 0x27, 0x5B, 0x4F, 0x6E, 0x8D, 0x9C, - 0xB5, 0x2E, 0xFB, 0x98, 0x65, 0x45, 0x7E, 0x7C, 0x14, 0x21, 0xE3, 0x11, 0x29, 0x9B, 0xD5, 0x63, - 0xFD, 0x20, 0x3B, 0x02, 0x68, 0x35, 0xC2, 0xF2, 0x38, 0xB2, 0x4E, 0xB6, 0x9E, 0xDD, 0x1B, 0x39, - 0x6A, 0x5D, 0xF7, 0x30, 0xCA, 0x8A, 0xFC, 0xF8, 0x28, 0x43, 0xC6, 0x22, 0x53, 0x37, 0xAA, 0xC7, - 0xFA, 0x40, 0x76, 0x04, 0xD0, 0x6B, 0x85, 0xE4, 0x71, 0x64, 0x9D, 0x6D, 0x3D, 0xBA, 0x36, 0x72, - 0xD4, 0xBB, 0xEE, 0x61, 0x95, 0x15, 0xF9, 0xF0, 0x50, 0x87, 0x8C, 0x44, 0xA6, 0x6F, 0x55, 0x8F, - 0xF4, 0x80, 0xEC, 0x09, 0xA0, 0xD7, 0x0B, 0xC8, 0xE2, 0xC9, 0x3A, 0xDA, 0x7B, 0x74, 0x6C, 0xE5, - 0xA9, 0x77, 0xDC, 0xC3, 0x2A, 0x2B, 0xF3, 0xE0, 0xA1, 0x0F, 0x18, 0x89, 0x4C, 0xDE, 0xAB, 0x1F, - 0xE9, 0x01, 0xD8, 0x13, 0x41, 0xAE, 0x17, 0x91, 0xC5, 0x92, 0x75, 0xB4, 0xF6, 0xE8, 0xD9, 0xCB, - 0x52, 0xEF, 0xB9, 0x86, 0x54, 0x57, 0xE7, 0xC1, 0x42, 0x1E, 0x31, 0x12, 0x99, 0xBD, 0x56, 0x3F, - 0xD2, 0x03, 0xB0, 0x26, 0x83, 0x5C, 0x2F, 0x23, 0x8B, 0x24, 0xEB, 0x69, 0xED, 0xD1, 0xB3, 0x96, - 0xA5, 0xDF, 0x73, 0x0C, 0xA8, 0xAF, 0xCF, 0x82, 0x84, 0x3C, 0x62, 0x25, 0x33, 0x7A, 0xAC, 0x7F, - 0xA4, 0x07, 0x60, 0x4D, 0x06, 0xB8, 0x5E, 0x47, 0x16, 0x49, 0xD6, 0xD3, 0xDB, 0xA3, 0x67, 0x2D, - 0x4B, 0xBE, 0xE6, 0x19, 0x51, 0x5F, 0x9F, 0x05, 0x08, 0x78, 0xC4, 0x4A, 0x66, 0xF5, 0x58 -}; - -namespace dsp { - class FalconRS : public generic_block { - public: - FalconRS() {} - - FalconRS(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - - for (int i = 0; i < 5; i++) { memset(buffers[i], 0, 255); } - for (int i = 0; i < 5; i++) { memset(outBuffers[i], 0, 255); } - rs = correct_reed_solomon_create(correct_rs_primitive_polynomial_ccsds, 120, 11, 16); - if (rs == NULL) { printf("Error creating the reed solomon decoder\n"); } - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - uint8_t* data = _in->readBuf + 4; - - // Deinterleave - for (int i = 0; i < 255 * 5; i++) { - buffers[i % 5][i / 5] = fromDB[data[i]]; - } - - // Reed the solomon :weary: - int result = 0; - result = correct_reed_solomon_decode(rs, buffers[0], 255, outBuffers[0]); - if (result == -1) { - _in->flush(); - return count; - } - result = correct_reed_solomon_decode(rs, buffers[1], 255, outBuffers[1]); - if (result == -1) { - _in->flush(); - return count; - } - result = correct_reed_solomon_decode(rs, buffers[2], 255, outBuffers[2]); - if (result == -1) { - _in->flush(); - return count; - } - result = correct_reed_solomon_decode(rs, buffers[3], 255, outBuffers[3]); - if (result == -1) { - _in->flush(); - return count; - } - result = correct_reed_solomon_decode(rs, buffers[4], 255, outBuffers[4]); - if (result == -1) { - _in->flush(); - return count; - } - - // Reinterleave - for (int i = 0; i < 255 * 5; i++) { - out.writeBuf[i] = toDB[outBuffers[i % 5][i / 5]] ^ randVals[i % 255]; - } - - out.swap(255 * 5); - - _in->flush(); - return count; - } - - stream out; - - private: - int count; - uint8_t buffers[5][255]; - uint8_t outBuffers[5][255]; - correct_reed_solomon* rs; - - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/falcon_packet.h b/core/src/dsp/falcon_packet.h deleted file mode 100644 index c1486db..0000000 --- a/core/src/dsp/falcon_packet.h +++ /dev/null @@ -1,125 +0,0 @@ -#pragma once -#include -#include - -namespace dsp { - struct FalconFrameHeader { - uint32_t counter; - uint16_t packet; - }; - - class FalconPacketSync : public generic_block { - public: - FalconPacketSync() {} - - FalconPacketSync(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - // Parse frame header - FalconFrameHeader header; - header.packet = (_in->readBuf[3] | ((_in->readBuf[2] & 0b111) << 8)); - header.counter = ((_in->readBuf[2] >> 3) | (_in->readBuf[1] << 5) | ((_in->readBuf[0] & 0b111111) << 13)); - - // Pointer to the data aera of the frame - uint8_t* data = _in->readBuf + 4; - int dataLen = 1191; - - // If a frame was missed, cancel reading the current packet - if (lastCounter + 1 != header.counter) { - packetRead = -1; - } - lastCounter = header.counter; - - // If frame is just a continuation of a single packet, save it - // If we're not currently reading a packet - if (header.packet == 2047 && packetRead >= 0) { - memcpy(packet + packetRead, data, dataLen); - packetRead += dataLen; - _in->flush(); - printf("Wow, all data\n"); - return count; - } - else if (header.packet == 2047) { - printf("Wow, all data\n"); - _in->flush(); - return count; - } - - // Finish reading the last package and send it - if (packetRead >= 0) { - memcpy(packet + packetRead, data, header.packet); - memcpy(out.writeBuf, packet, packetRead + header.packet); - out.swap(packetRead + header.packet); - packetRead = -1; - } - - // Iterate through every packet of the frame - for (int i = header.packet; i < dataLen;) { - // First, check if we can read the header. If not, save and wait for next frame - if (dataLen - i < 4) { - packetRead = dataLen - i; - memcpy(packet, &data[i], packetRead); - break; - } - - // Extract packet length - uint16_t length = (((data[i] & 0b1111) << 8) | data[i + 1]) + 2; - - // Check if it's not an invalid zero length packet - if (length <= 2) { - packetRead = -1; - break; - } - - uint64_t pktId = ((uint64_t)data[i + 2] << 56) | ((uint64_t)data[i + 3] << 48) | ((uint64_t)data[i + 4] << 40) | ((uint64_t)data[i + 5] << 32) | ((uint64_t)data[i + 6] << 24) | ((uint64_t)data[i + 7] << 16) | ((uint64_t)data[i + 8] << 8) | data[i + 9]; - - // If the packet doesn't fit the frame, save and go to next frame - if (dataLen - i < length) { - packetRead = dataLen - i; - memcpy(packet, &data[i], packetRead); - break; - } - - // Here, the package fits fully, read it and jump to the next - memcpy(out.writeBuf, &data[i], length); - out.swap(length); - i += length; - } - - _in->flush(); - return count; - } - - stream out; - - private: - int count; - uint32_t lastCounter = 0; - - int packetRead = -1; - uint8_t packet[0x4008]; - - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/filter.h b/core/src/dsp/filter.h deleted file mode 100644 index ce6e762..0000000 --- a/core/src/dsp/filter.h +++ /dev/null @@ -1,269 +0,0 @@ -#pragma once -#include -#include -#include - -namespace dsp { - - template - class FIR : public generic_block> { - public: - FIR() {} - - FIR(stream* in, dsp::filter_window::generic_window* window) { init(in, window); } - - ~FIR() { - if (!generic_block>::_block_init) { return; } - generic_block>::stop(); - volk_free(buffer); - volk_free(taps); - generic_block>::_block_init = false; - } - - void init(stream* in, dsp::filter_window::generic_window* window) { - _in = in; - - tapCount = window->getTapCount(); - taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment()); - window->createTaps(taps, tapCount); - - buffer = (T*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(T) * 2, volk_get_alignment()); - bufStart = &buffer[tapCount]; - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void updateWindow(dsp::filter_window::generic_window* window) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - _window = window; - volk_free(taps); - tapCount = window->getTapCount(); - taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment()); - bufStart = &buffer[tapCount]; - window->createTaps(taps, tapCount); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - generic_block>::ctrlMtx.lock(); - - memcpy(bufStart, _in->readBuf, count * sizeof(T)); - _in->flush(); - - if constexpr (std::is_same_v) { - for (int i = 0; i < count; i++) { - volk_32f_x2_dot_prod_32f((float*)&out.writeBuf[i], (float*)&buffer[i + 1], taps, tapCount); - } - } - if constexpr (std::is_same_v) { - for (int i = 0; i < count; i++) { - volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&out.writeBuf[i], (lv_32fc_t*)&buffer[i + 1], taps, tapCount); - } - } - - if (!out.swap(count)) { return -1; } - - memmove(buffer, &buffer[count], tapCount * sizeof(T)); - - generic_block>::ctrlMtx.unlock(); - - return count; - } - - stream out; - - private: - stream* _in; - - dsp::filter_window::generic_window* _window; - - T* bufStart; - T* buffer; - int tapCount; - float* taps; - }; - - class ComplexFIR : public generic_block { - public: - ComplexFIR() {} - - ComplexFIR(stream* in, dsp::filter_window::generic_complex_window* window) { init(in, window); } - - ~ComplexFIR() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - volk_free(buffer); - volk_free(taps); - generic_block::_block_init = false; - } - - void init(stream* in, dsp::filter_window::generic_complex_window* window) { - _in = in; - - tapCount = window->getTapCount(); - taps = (complex_t*)volk_malloc(tapCount * sizeof(complex_t), volk_get_alignment()); - window->createTaps(taps, tapCount); - - buffer = (complex_t*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(complex_t) * 2, volk_get_alignment()); - bufStart = &buffer[tapCount]; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void updateWindow(dsp::filter_window::generic_complex_window* window) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - _window = window; - volk_free(taps); - tapCount = window->getTapCount(); - taps = (complex_t*)volk_malloc(tapCount * sizeof(complex_t), volk_get_alignment()); - bufStart = &buffer[tapCount]; - window->createTaps(taps, tapCount); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - generic_block::ctrlMtx.lock(); - - memcpy(bufStart, _in->readBuf, count * sizeof(complex_t)); - _in->flush(); - - for (int i = 0; i < count; i++) { - volk_32fc_x2_dot_prod_32fc((lv_32fc_t*)&out.writeBuf[i], (lv_32fc_t*)&buffer[i + 1], (lv_32fc_t*)taps, tapCount); - } - - if (!out.swap(count)) { return -1; } - - memmove(buffer, &buffer[count], tapCount * sizeof(complex_t)); - - generic_block::ctrlMtx.unlock(); - - return count; - } - - stream out; - - private: - stream* _in; - - dsp::filter_window::generic_complex_window* _window; - - complex_t* bufStart; - complex_t* buffer; - int tapCount; - complex_t* taps; - }; - - class BFMDeemp : public generic_block { - public: - BFMDeemp() {} - - BFMDeemp(stream* in, float sampleRate, float tau) { init(in, sampleRate, tau); } - - void init(stream* in, float sampleRate, float tau) { - _in = in; - _sampleRate = sampleRate; - _tau = tau; - float dt = 1.0f / _sampleRate; - alpha = dt / (_tau + dt); - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setSampleRate(float sampleRate) { - assert(generic_block::_block_init); - _sampleRate = sampleRate; - float dt = 1.0f / _sampleRate; - alpha = dt / (_tau + dt); - } - - void setTau(float tau) { - assert(generic_block::_block_init); - _tau = tau; - float dt = 1.0f / _sampleRate; - alpha = dt / (_tau + dt); - } - - int run() { - count = _in->read(); - if (count < 0) { return -1; } - - if (bypass) { - memcpy(out.writeBuf, _in->readBuf, count * sizeof(stereo_t)); - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - if (isnan(lastOutL)) { - lastOutL = 0.0f; - } - if (isnan(lastOutR)) { - lastOutR = 0.0f; - } - out.writeBuf[0].l = (alpha * _in->readBuf[0].l) + ((1 - alpha) * lastOutL); - out.writeBuf[0].r = (alpha * _in->readBuf[0].r) + ((1 - alpha) * lastOutR); - for (int i = 1; i < count; i++) { - out.writeBuf[i].l = (alpha * _in->readBuf[i].l) + ((1 - alpha) * out.writeBuf[i - 1].l); - out.writeBuf[i].r = (alpha * _in->readBuf[i].r) + ((1 - alpha) * out.writeBuf[i - 1].r); - } - lastOutL = out.writeBuf[count - 1].l; - lastOutR = out.writeBuf[count - 1].r; - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - bool bypass = false; - - stream out; - - private: - int count; - float lastOutL = 0.0f; - float lastOutR = 0.0f; - float alpha; - float _tau; - float _sampleRate; - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/firdec/firdec_plans.h b/core/src/dsp/firdec/firdec_plans.h deleted file mode 100644 index eb91df3..0000000 --- a/core/src/dsp/firdec/firdec_plans.h +++ /dev/null @@ -1,208 +0,0 @@ -#pragma once -#include "taps/fir_2_2.h" -#include "taps/fir_4_4.h" -#include "taps/fir_8_4.h" -#include "taps/fir_16_8.h" -#include "taps/fir_32_16.h" -#include "taps/fir_64_32.h" -#include "taps/fir_128_32.h" -#include "taps/fir_256_64.h" -#include "taps/fir_512_128.h" -#include "taps/fir_1024_128.h" -#include "taps/fir_2048_128.h" - -namespace dsp { - namespace firdec { - struct stage { - unsigned int decimation; - unsigned int tapcount; - const float* taps; - }; - - const unsigned int plan_2_len = 1; - const stage plan_2[] = { - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_4_len = 1; - const stage plan_4[] = { - { 4, fir_4_4_len, fir_4_4_taps } - }; - - const unsigned int plan_8_len = 2; - const stage plan_8[] = { - { 4, fir_8_4_len, fir_8_4_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_16_len = 2; - const stage plan_16[] = { - { 8, fir_16_8_len, fir_16_8_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_32_len = 2; - const stage plan_32[] = { - { 16, fir_32_16_len, fir_32_16_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_64_len = 2; - const stage plan_64[] = { - { 32, fir_64_32_len, fir_64_32_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_128_len = 2; - const stage plan_128[] = { - { 32, fir_128_32_len, fir_128_32_taps }, - { 4, fir_4_4_len, fir_4_4_taps } - }; - - const unsigned int plan_256_len = 2; - const stage plan_256[] = { - { 64, fir_256_64_len, fir_256_64_taps }, - { 4, fir_4_4_len, fir_4_4_taps } - }; - - const unsigned int plan_512_len = 2; - const stage plan_512[] = { - { 128, fir_512_128_len, fir_512_128_taps }, - { 4, fir_4_4_len, fir_4_4_taps } - }; - - const unsigned int plan_1024_len = 3; - const stage plan_1024[] = { - { 128, fir_1024_128_len, fir_1024_128_taps }, - { 4, fir_8_4_len, fir_8_4_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_2048_len = 3; - const stage plan_2048[] = { - { 128, fir_2048_128_len, fir_2048_128_taps }, - { 8, fir_16_8_len, fir_16_8_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_4096_len = 3; - const stage plan_4096[] = { - { 128, fir_2048_128_len, fir_2048_128_taps }, - { 16, fir_32_16_len, fir_32_16_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - const unsigned int plan_8192_len = 3; - const stage plan_8192[] = { - { 128, fir_2048_128_len, fir_2048_128_taps }, - { 32, fir_64_32_len, fir_64_32_taps }, - { 2, fir_2_2_len, fir_2_2_taps } - }; - - struct plan { - unsigned int stageCount; - const stage* stages; - }; - - const unsigned int plans_len = 13; - const plan plans[] { - { plan_2_len, plan_2 }, - { plan_4_len, plan_4 }, - { plan_8_len, plan_8 }, - { plan_16_len, plan_16 }, - { plan_32_len, plan_32 }, - { plan_64_len, plan_64 }, - { plan_128_len, plan_128 }, - { plan_256_len, plan_256 }, - { plan_512_len, plan_512 }, - { plan_1024_len, plan_1024 }, - { plan_2048_len, plan_2048 }, - { plan_4096_len, plan_4096 }, - { plan_8192_len, plan_8192 }, - }; - } -} - -/* - -Desired ratio: 2 -<====== BEST ======> -Stage 0 : 2 : 2 ( 69 taps) -<==================> 4.5464 - -Desired ratio: 4 -<====== BEST ======> -Stage 0 : 4 : 4 ( 139 taps) -<==================> 4.0912 - -Desired ratio: 8 -<====== BEST ======> -Stage 0 : 8 : 4 ( 32 taps) -Stage 1 : 2 : 2 ( 69 taps) -<==================> 2.5073 - -Desired ratio: 16 -<====== BEST ======> -Stage 0 : 16 : 8 ( 64 taps) -Stage 1 : 2 : 2 ( 69 taps) -<==================> 1.417775 - -Desired ratio: 32 -<====== BEST ======> -Stage 0 : 32 : 16 ( 128 taps) -Stage 1 : 2 : 2 ( 69 taps) -<==================> 0.897 - -Desired ratio: 64 -<====== BEST ======> -Stage 0 : 64 : 32 ( 254 taps) -Stage 1 : 2 : 2 ( 69 taps) -<==================> 0.6991562499999999 - -Desired ratio: 128 -<====== BEST ======> -Stage 0 : 128 : 32 ( 180 taps) -Stage 1 : 4 : 4 ( 139 taps) -<==================> 0.61851875 - -Desired ratio: 256 -<====== BEST ======> -Stage 0 : 256 : 64 ( 356 taps) -Stage 1 : 4 : 4 ( 139 taps) -<==================> 0.4696125 - -Desired ratio: 512 -<====== BEST ======> -Stage 0 : 512 : 128 ( 711 taps) -Stage 1 : 4 : 4 ( 139 taps) -<==================> 0.38787734375 - -Desired ratio: 1024 -<====== BEST ======> -Stage 0 : 1024 : 128 ( 565 taps) -Stage 1 : 8 : 4 ( 32 taps) -Stage 2 : 2 : 2 ( 69 taps) -<==================> 0.30618515625 - -Desired ratio: 2048 -<====== BEST ======> -Stage 0 : 2048 : 128 ( 514 taps) -Stage 1 : 16 : 8 ( 64 taps) -Stage 2 : 2 : 2 ( 69 taps) -<==================> 0.2665748046875 - -Desired ratio: 4096 -<====== BEST ======> -Stage 0 : 2048 : 128 ( 514 taps) -Stage 1 : 32 : 16 ( 128 taps) -Stage 2 : 2 : 2 ( 69 taps) -<==================> 0.26250625 - -Desired ratio: 8192 -<====== BEST ======> -Stage 0 : 2048 : 128 ( 514 taps) -Stage 1 : 64 : 32 ( 254 taps) -Stage 2 : 2 : 2 ( 69 taps) -<==================> 0.260960595703125 - -*/ \ No newline at end of file diff --git a/core/src/dsp/firdec/taps/fir_1024_128.h b/core/src/dsp/firdec/taps/fir_1024_128.h deleted file mode 100644 index c49bbf4..0000000 --- a/core/src/dsp/firdec/taps/fir_1024_128.h +++ /dev/null @@ -1,579 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_1024_128_len = 565; - const float fir_1024_128_taps[] = { - -0.0000004327587f, - 0.0000026997780f, - 0.0000011158244f, - 0.0000009851064f, - 0.0000010818484f, - 0.0000012233487f, - 0.0000013829611f, - 0.0000015574122f, - 0.0000017469545f, - 0.0000019523988f, - 0.0000021746708f, - 0.0000024147452f, - 0.0000026736369f, - 0.0000029524002f, - 0.0000032521294f, - 0.0000035739593f, - 0.0000039190664f, - 0.0000042886691f, - 0.0000046840291f, - 0.0000051064513f, - 0.0000055572854f, - 0.0000060379258f, - 0.0000065498127f, - 0.0000070944329f, - 0.0000076733199f, - 0.0000082880550f, - 0.0000089402676f, - 0.0000096316359f, - 0.0000103638874f, - 0.0000111387995f, - 0.0000119581996f, - 0.0000128239662f, - 0.0000137380287f, - 0.0000147023683f, - 0.0000157190179f, - 0.0000167900628f, - 0.0000179176408f, - 0.0000191039423f, - 0.0000203512110f, - 0.0000216617435f, - 0.0000230378899f, - 0.0000244820535f, - 0.0000259966913f, - 0.0000275843135f, - 0.0000292474837f, - 0.0000309888191f, - 0.0000328109897f, - 0.0000347167188f, - 0.0000367087824f, - 0.0000387900088f, - 0.0000409632787f, - 0.0000432315243f, - 0.0000455977293f, - 0.0000480649281f, - 0.0000506362055f, - 0.0000533146957f, - 0.0000561035822f, - 0.0000590060964f, - 0.0000620255175f, - 0.0000651651712f, - 0.0000684284288f, - 0.0000718187066f, - 0.0000753394644f, - 0.0000789942048f, - 0.0000827864719f, - 0.0000867198500f, - 0.0000907979625f, - 0.0000950244704f, - 0.0000994030710f, - 0.0001039374965f, - 0.0001086315122f, - 0.0001134889152f, - 0.0001185135326f, - 0.0001237092199f, - 0.0001290798590f, - 0.0001346293565f, - 0.0001403616418f, - 0.0001462806650f, - 0.0001523903952f, - 0.0001586948179f, - 0.0001651979332f, - 0.0001719037534f, - 0.0001788163010f, - 0.0001859396059f, - 0.0001932777035f, - 0.0002008346317f, - 0.0002086144290f, - 0.0002166211315f, - 0.0002248587702f, - 0.0002333313688f, - 0.0002420429405f, - 0.0002509974854f, - 0.0002601989878f, - 0.0002696514131f, - 0.0002793587049f, - 0.0002893247820f, - 0.0002995535358f, - 0.0003100488266f, - 0.0003208144809f, - 0.0003318542882f, - 0.0003431719977f, - 0.0003547713152f, - 0.0003666559000f, - 0.0003788293613f, - 0.0003912952551f, - 0.0004040570809f, - 0.0004171182782f, - 0.0004304822235f, - 0.0004441522261f, - 0.0004581315258f, - 0.0004724232886f, - 0.0004870306035f, - 0.0005019564795f, - 0.0005172038413f, - 0.0005327755266f, - 0.0005486742825f, - 0.0005649027617f, - 0.0005814635194f, - 0.0005983590097f, - 0.0006155915822f, - 0.0006331634787f, - 0.0006510768296f, - 0.0006693336508f, - 0.0006879358399f, - 0.0007068851735f, - 0.0007261833032f, - 0.0007458317529f, - 0.0007658319153f, - 0.0007861850487f, - 0.0008068922738f, - 0.0008279545709f, - 0.0008493727764f, - 0.0008711475801f, - 0.0008932795221f, - 0.0009157689899f, - 0.0009386162156f, - 0.0009618212732f, - 0.0009853840755f, - 0.0010093043719f, - 0.0010335817458f, - 0.0010582156116f, - 0.0010832052129f, - 0.0011085496198f, - 0.0011342477266f, - 0.0011602982499f, - 0.0011866997262f, - 0.0012134505102f, - 0.0012405487727f, - 0.0012679924989f, - 0.0012957794865f, - 0.0013239073445f, - 0.0013523734912f, - 0.0013811751533f, - 0.0014103093644f, - 0.0014397729637f, - 0.0014695625952f, - 0.0014996747065f, - 0.0015301055485f, - 0.0015608511740f, - 0.0015919074376f, - 0.0016232699954f, - 0.0016549343039f, - 0.0016868956210f, - 0.0017191490046f, - 0.0017516893140f, - 0.0017845112089f, - 0.0018176091508f, - 0.0018509774026f, - 0.0018846100298f, - 0.0019185009010f, - 0.0019526436887f, - 0.0019870318707f, - 0.0020216587307f, - 0.0020565173602f, - 0.0020916006596f, - 0.0021269013399f, - 0.0021624119242f, - 0.0021981247499f, - 0.0022340319707f, - 0.0022701255585f, - 0.0023063973058f, - 0.0023428388283f, - 0.0023794415672f, - 0.0024161967921f, - 0.0024530956039f, - 0.0024901289377f, - 0.0025272875658f, - 0.0025645621012f, - 0.0026019430011f, - 0.0026394205698f, - 0.0026769849632f, - 0.0027146261921f, - 0.0027523341262f, - 0.0027900984982f, - 0.0028279089079f, - 0.0028657548267f, - 0.0029036256018f, - 0.0029415104608f, - 0.0029793985165f, - 0.0030172787713f, - 0.0030551401225f, - 0.0030929713673f, - 0.0031307612072f, - 0.0031684982542f, - 0.0032061710353f, - 0.0032437679982f, - 0.0032812775168f, - 0.0033186878969f, - 0.0033559873813f, - 0.0033931641562f, - 0.0034302063567f, - 0.0034671020727f, - 0.0035038393549f, - 0.0035404062207f, - 0.0035767906605f, - 0.0036129806440f, - 0.0036489641257f, - 0.0036847290520f, - 0.0037202633668f, - 0.0037555550186f, - 0.0037905919660f, - 0.0038253621849f, - 0.0038598536743f, - 0.0038940544635f, - 0.0039279526178f, - 0.0039615362454f, - 0.0039947935041f, - 0.0040277126075f, - 0.0040602818315f, - 0.0040924895211f, - 0.0041243240966f, - 0.0041557740604f, - 0.0041868280032f, - 0.0042174746106f, - 0.0042477026695f, - 0.0042775010745f, - 0.0043068588342f, - 0.0043357650775f, - 0.0043642090601f, - 0.0043921801703f, - 0.0044196679357f, - 0.0044466620287f, - 0.0044731522730f, - 0.0044991286493f, - 0.0045245813014f, - 0.0045495005417f, - 0.0045738768574f, - 0.0045977009155f, - 0.0046209635689f, - 0.0046436558617f, - 0.0046657690344f, - 0.0046872945291f, - 0.0047082239951f, - 0.0047285492933f, - 0.0047482625015f, - 0.0047673559190f, - 0.0047858220715f, - 0.0048036537152f, - 0.0048208438417f, - 0.0048373856818f, - 0.0048532727100f, - 0.0048684986482f, - 0.0048830574697f, - 0.0048969434029f, - 0.0049101509346f, - 0.0049226748137f, - 0.0049345100543f, - 0.0049456519385f, - 0.0049560960197f, - 0.0049658381254f, - 0.0049748743591f, - 0.0049832011036f, - 0.0049908150224f, - 0.0049977130625f, - 0.0050038924557f, - 0.0050093507207f, - 0.0050140856644f, - 0.0050180953834f, - 0.0050213782651f, - 0.0050239329888f, - 0.0050257585263f, - 0.0050268541429f, - 0.0050272193974f, - 0.0050268541429f, - 0.0050257585263f, - 0.0050239329888f, - 0.0050213782651f, - 0.0050180953834f, - 0.0050140856644f, - 0.0050093507207f, - 0.0050038924557f, - 0.0049977130625f, - 0.0049908150224f, - 0.0049832011036f, - 0.0049748743591f, - 0.0049658381254f, - 0.0049560960197f, - 0.0049456519385f, - 0.0049345100543f, - 0.0049226748137f, - 0.0049101509346f, - 0.0048969434029f, - 0.0048830574697f, - 0.0048684986482f, - 0.0048532727100f, - 0.0048373856818f, - 0.0048208438417f, - 0.0048036537152f, - 0.0047858220715f, - 0.0047673559190f, - 0.0047482625015f, - 0.0047285492933f, - 0.0047082239951f, - 0.0046872945291f, - 0.0046657690344f, - 0.0046436558617f, - 0.0046209635689f, - 0.0045977009155f, - 0.0045738768574f, - 0.0045495005417f, - 0.0045245813014f, - 0.0044991286493f, - 0.0044731522730f, - 0.0044466620287f, - 0.0044196679357f, - 0.0043921801703f, - 0.0043642090601f, - 0.0043357650775f, - 0.0043068588342f, - 0.0042775010745f, - 0.0042477026695f, - 0.0042174746106f, - 0.0041868280032f, - 0.0041557740604f, - 0.0041243240966f, - 0.0040924895211f, - 0.0040602818315f, - 0.0040277126075f, - 0.0039947935041f, - 0.0039615362454f, - 0.0039279526178f, - 0.0038940544635f, - 0.0038598536743f, - 0.0038253621849f, - 0.0037905919660f, - 0.0037555550186f, - 0.0037202633668f, - 0.0036847290520f, - 0.0036489641257f, - 0.0036129806440f, - 0.0035767906605f, - 0.0035404062207f, - 0.0035038393549f, - 0.0034671020727f, - 0.0034302063567f, - 0.0033931641562f, - 0.0033559873813f, - 0.0033186878969f, - 0.0032812775168f, - 0.0032437679982f, - 0.0032061710353f, - 0.0031684982542f, - 0.0031307612072f, - 0.0030929713673f, - 0.0030551401225f, - 0.0030172787713f, - 0.0029793985165f, - 0.0029415104608f, - 0.0029036256018f, - 0.0028657548267f, - 0.0028279089079f, - 0.0027900984982f, - 0.0027523341262f, - 0.0027146261921f, - 0.0026769849632f, - 0.0026394205698f, - 0.0026019430011f, - 0.0025645621012f, - 0.0025272875658f, - 0.0024901289377f, - 0.0024530956039f, - 0.0024161967921f, - 0.0023794415672f, - 0.0023428388283f, - 0.0023063973058f, - 0.0022701255585f, - 0.0022340319707f, - 0.0021981247499f, - 0.0021624119242f, - 0.0021269013399f, - 0.0020916006596f, - 0.0020565173602f, - 0.0020216587307f, - 0.0019870318707f, - 0.0019526436887f, - 0.0019185009010f, - 0.0018846100298f, - 0.0018509774026f, - 0.0018176091508f, - 0.0017845112089f, - 0.0017516893140f, - 0.0017191490046f, - 0.0016868956210f, - 0.0016549343039f, - 0.0016232699954f, - 0.0015919074376f, - 0.0015608511740f, - 0.0015301055485f, - 0.0014996747065f, - 0.0014695625952f, - 0.0014397729637f, - 0.0014103093644f, - 0.0013811751533f, - 0.0013523734912f, - 0.0013239073445f, - 0.0012957794865f, - 0.0012679924989f, - 0.0012405487727f, - 0.0012134505102f, - 0.0011866997262f, - 0.0011602982499f, - 0.0011342477266f, - 0.0011085496198f, - 0.0010832052129f, - 0.0010582156116f, - 0.0010335817458f, - 0.0010093043719f, - 0.0009853840755f, - 0.0009618212732f, - 0.0009386162156f, - 0.0009157689899f, - 0.0008932795221f, - 0.0008711475801f, - 0.0008493727764f, - 0.0008279545709f, - 0.0008068922738f, - 0.0007861850487f, - 0.0007658319153f, - 0.0007458317529f, - 0.0007261833032f, - 0.0007068851735f, - 0.0006879358399f, - 0.0006693336508f, - 0.0006510768296f, - 0.0006331634787f, - 0.0006155915822f, - 0.0005983590097f, - 0.0005814635194f, - 0.0005649027617f, - 0.0005486742825f, - 0.0005327755266f, - 0.0005172038413f, - 0.0005019564795f, - 0.0004870306035f, - 0.0004724232886f, - 0.0004581315258f, - 0.0004441522261f, - 0.0004304822235f, - 0.0004171182782f, - 0.0004040570809f, - 0.0003912952551f, - 0.0003788293613f, - 0.0003666559000f, - 0.0003547713152f, - 0.0003431719977f, - 0.0003318542882f, - 0.0003208144809f, - 0.0003100488266f, - 0.0002995535358f, - 0.0002893247820f, - 0.0002793587049f, - 0.0002696514131f, - 0.0002601989878f, - 0.0002509974854f, - 0.0002420429405f, - 0.0002333313688f, - 0.0002248587702f, - 0.0002166211315f, - 0.0002086144290f, - 0.0002008346317f, - 0.0001932777035f, - 0.0001859396059f, - 0.0001788163010f, - 0.0001719037534f, - 0.0001651979332f, - 0.0001586948179f, - 0.0001523903952f, - 0.0001462806650f, - 0.0001403616418f, - 0.0001346293565f, - 0.0001290798590f, - 0.0001237092199f, - 0.0001185135326f, - 0.0001134889152f, - 0.0001086315122f, - 0.0001039374965f, - 0.0000994030710f, - 0.0000950244704f, - 0.0000907979625f, - 0.0000867198500f, - 0.0000827864719f, - 0.0000789942048f, - 0.0000753394644f, - 0.0000718187066f, - 0.0000684284288f, - 0.0000651651712f, - 0.0000620255175f, - 0.0000590060964f, - 0.0000561035822f, - 0.0000533146957f, - 0.0000506362055f, - 0.0000480649281f, - 0.0000455977293f, - 0.0000432315243f, - 0.0000409632787f, - 0.0000387900088f, - 0.0000367087824f, - 0.0000347167188f, - 0.0000328109897f, - 0.0000309888191f, - 0.0000292474837f, - 0.0000275843135f, - 0.0000259966913f, - 0.0000244820535f, - 0.0000230378899f, - 0.0000216617435f, - 0.0000203512110f, - 0.0000191039423f, - 0.0000179176408f, - 0.0000167900628f, - 0.0000157190179f, - 0.0000147023683f, - 0.0000137380287f, - 0.0000128239662f, - 0.0000119581996f, - 0.0000111387995f, - 0.0000103638874f, - 0.0000096316359f, - 0.0000089402676f, - 0.0000082880550f, - 0.0000076733199f, - 0.0000070944329f, - 0.0000065498127f, - 0.0000060379258f, - 0.0000055572854f, - 0.0000051064513f, - 0.0000046840291f, - 0.0000042886691f, - 0.0000039190664f, - 0.0000035739593f, - 0.0000032521294f, - 0.0000029524002f, - 0.0000026736369f, - 0.0000024147452f, - 0.0000021746708f, - 0.0000019523988f, - 0.0000017469545f, - 0.0000015574122f, - 0.0000013829611f, - 0.0000012233487f, - 0.0000010818484f, - 0.0000009851064f, - 0.0000011158244f, - 0.0000026997780f, - -0.0000004327587f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_1024_32.h b/core/src/dsp/firdec/taps/fir_1024_32.h deleted file mode 100644 index 68ae7b0..0000000 --- a/core/src/dsp/firdec/taps/fir_1024_32.h +++ /dev/null @@ -1,141 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_1024_32_len = 127; - const float fir_1024_32_taps[] = { - 0.0000088623347f, - 0.0000103966907f, - 0.0000163498386f, - 0.0000244235766f, - 0.0000351129776f, - 0.0000489833599f, - 0.0000666735323f, - 0.0000888982223f, - 0.0001164495403f, - 0.0001501973386f, - 0.0001910883324f, - 0.0002401438579f, - 0.0002984561609f, - 0.0003671831240f, - 0.0004475413632f, - 0.0005407976486f, - 0.0006482586323f, - 0.0007712588932f, - 0.0009111473429f, - 0.0010692720689f, - 0.0012469637247f, - 0.0014455176106f, - 0.0016661746238f, - 0.0019101012879f, - 0.0021783691022f, - 0.0024719334814f, - 0.0027916125787f, - 0.0031380663077f, - 0.0035117758952f, - 0.0039130243058f, - 0.0043418778893f, - 0.0047981695968f, - 0.0052814841081f, - 0.0057911451996f, - 0.0063262056615f, - 0.0068854400478f, - 0.0074673405131f, - 0.0080701159494f, - 0.0086916945938f, - 0.0093297302355f, - 0.0099816120904f, - 0.0106444783655f, - 0.0113152334735f, - 0.0119905688011f, - 0.0126669868781f, - 0.0133408287327f, - 0.0140083041674f, - 0.0146655246349f, - 0.0153085383440f, - 0.0159333671827f, - 0.0165360450080f, - 0.0171126568203f, - 0.0176593783140f, - 0.0181725152845f, - 0.0186485423586f, - 0.0190841405193f, - 0.0194762329058f, - 0.0198220183835f, - 0.0201190024112f, - 0.0203650247621f, - 0.0205582836996f, - 0.0206973562585f, - 0.0207812143359f, - 0.0208092363555f, - 0.0207812143359f, - 0.0206973562585f, - 0.0205582836996f, - 0.0203650247621f, - 0.0201190024112f, - 0.0198220183835f, - 0.0194762329058f, - 0.0190841405193f, - 0.0186485423586f, - 0.0181725152845f, - 0.0176593783140f, - 0.0171126568203f, - 0.0165360450080f, - 0.0159333671827f, - 0.0153085383440f, - 0.0146655246349f, - 0.0140083041674f, - 0.0133408287327f, - 0.0126669868781f, - 0.0119905688011f, - 0.0113152334735f, - 0.0106444783655f, - 0.0099816120904f, - 0.0093297302355f, - 0.0086916945938f, - 0.0080701159494f, - 0.0074673405131f, - 0.0068854400478f, - 0.0063262056615f, - 0.0057911451996f, - 0.0052814841081f, - 0.0047981695968f, - 0.0043418778893f, - 0.0039130243058f, - 0.0035117758952f, - 0.0031380663077f, - 0.0027916125787f, - 0.0024719334814f, - 0.0021783691022f, - 0.0019101012879f, - 0.0016661746238f, - 0.0014455176106f, - 0.0012469637247f, - 0.0010692720689f, - 0.0009111473429f, - 0.0007712588932f, - 0.0006482586323f, - 0.0005407976486f, - 0.0004475413632f, - 0.0003671831240f, - 0.0002984561609f, - 0.0002401438579f, - 0.0001910883324f, - 0.0001501973386f, - 0.0001164495403f, - 0.0000888982223f, - 0.0000666735323f, - 0.0000489833599f, - 0.0000351129776f, - 0.0000244235766f, - 0.0000163498386f, - 0.0000103966907f, - 0.0000088623347f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_1024_64.h b/core/src/dsp/firdec/taps/fir_1024_64.h deleted file mode 100644 index 84c718a..0000000 --- a/core/src/dsp/firdec/taps/fir_1024_64.h +++ /dev/null @@ -1,319 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_1024_64_len = 305; - const float fir_1024_64_taps[] = { - -0.0000003266961f, - 0.0000005644686f, - 0.0000005207559f, - 0.0000006201056f, - 0.0000007969193f, - 0.0000010314179f, - 0.0000013207983f, - 0.0000016688347f, - 0.0000020821477f, - 0.0000025688841f, - 0.0000031382689f, - 0.0000038004715f, - 0.0000045665874f, - 0.0000054486602f, - 0.0000064597188f, - 0.0000076138203f, - 0.0000089260936f, - 0.0000104127838f, - 0.0000120912955f, - 0.0000139802356f, - 0.0000160994544f, - 0.0000184700853f, - 0.0000211145831f, - 0.0000240567590f, - 0.0000273218150f, - 0.0000309363737f, - 0.0000349285069f, - 0.0000393277598f, - 0.0000441651722f, - 0.0000494732958f, - 0.0000552862073f, - 0.0000616395176f, - 0.0000685703757f, - 0.0000761174680f, - 0.0000843210124f, - 0.0000932227473f, - 0.0001028659142f, - 0.0001132952349f, - 0.0001245568823f, - 0.0001366984450f, - 0.0001497688854f, - 0.0001638184908f, - 0.0001788988175f, - 0.0001950626288f, - 0.0002123638243f, - 0.0002308573636f, - 0.0002505991815f, - 0.0002716460964f, - 0.0002940557114f, - 0.0003178863073f, - 0.0003431967298f, - 0.0003700462674f, - 0.0003984945244f, - 0.0004286012850f, - 0.0004604263715f, - 0.0004940294961f, - 0.0005294701054f, - 0.0005668072195f, - 0.0006060992649f, - 0.0006474039021f, - 0.0006907778476f, - 0.0007362766917f, - 0.0007839547115f, - 0.0008338646804f, - 0.0008860576734f, - 0.0009405828709f, - 0.0009974873584f, - 0.0010568159258f, - 0.0011186108652f, - 0.0011829117671f, - 0.0012497553185f, - 0.0013191750998f, - 0.0013912013845f, - 0.0014658609399f, - 0.0015431768319f, - 0.0016231682316f, - 0.0017058502277f, - 0.0017912336426f, - 0.0018793248552f, - 0.0019701256291f, - 0.0020636329490f, - 0.0021598388638f, - 0.0022587303394f, - 0.0023602891198f, - 0.0024644915987f, - 0.0025713087020f, - 0.0026807057805f, - 0.0027926425160f, - 0.0029070728383f, - 0.0030239448570f, - 0.0031432008054f, - 0.0032647769995f, - 0.0033886038113f, - 0.0035146056570f, - 0.0036427010010f, - 0.0037728023754f, - 0.0039048164157f, - 0.0040386439125f, - 0.0041741798805f, - 0.0043113136430f, - 0.0044499289348f, - 0.0045899040199f, - 0.0047311118279f, - 0.0048734201058f, - 0.0050166915869f, - 0.0051607841763f, - 0.0053055511521f, - 0.0054508413827f, - 0.0055964995596f, - 0.0057423664451f, - 0.0058882791347f, - 0.0060340713337f, - 0.0061795736469f, - 0.0063246138814f, - 0.0064690173614f, - 0.0066126072545f, - 0.0067552049086f, - 0.0068966301982f, - 0.0070367018801f, - 0.0071752379566f, - 0.0073120560462f, - 0.0074469737596f, - 0.0075798090815f, - 0.0077103807554f, - 0.0078385086722f, - 0.0079640142599f, - 0.0080867208743f, - 0.0082064541886f, - 0.0083230425826f, - 0.0084363175276f, - 0.0085461139687f, - 0.0086522707012f, - 0.0087546307414f, - 0.0088530416894f, - 0.0089473560847f, - 0.0090374317506f, - 0.0091231321298f, - 0.0092043266071f, - 0.0092808908203f, - 0.0093527069569f, - 0.0094196640373f, - 0.0094816581810f, - 0.0095385928587f, - 0.0095903791253f, - 0.0096369358365f, - 0.0096781898465f, - 0.0097140761868f, - 0.0097445382248f, - 0.0097695278031f, - 0.0097890053575f, - 0.0098029400143f, - 0.0098113096665f, - 0.0098141010281f, - 0.0098113096665f, - 0.0098029400143f, - 0.0097890053575f, - 0.0097695278031f, - 0.0097445382248f, - 0.0097140761868f, - 0.0096781898465f, - 0.0096369358365f, - 0.0095903791253f, - 0.0095385928587f, - 0.0094816581810f, - 0.0094196640373f, - 0.0093527069569f, - 0.0092808908203f, - 0.0092043266071f, - 0.0091231321298f, - 0.0090374317506f, - 0.0089473560847f, - 0.0088530416894f, - 0.0087546307414f, - 0.0086522707012f, - 0.0085461139687f, - 0.0084363175276f, - 0.0083230425826f, - 0.0082064541886f, - 0.0080867208743f, - 0.0079640142599f, - 0.0078385086722f, - 0.0077103807554f, - 0.0075798090815f, - 0.0074469737596f, - 0.0073120560462f, - 0.0071752379566f, - 0.0070367018801f, - 0.0068966301982f, - 0.0067552049086f, - 0.0066126072545f, - 0.0064690173614f, - 0.0063246138814f, - 0.0061795736469f, - 0.0060340713337f, - 0.0058882791347f, - 0.0057423664451f, - 0.0055964995596f, - 0.0054508413827f, - 0.0053055511521f, - 0.0051607841763f, - 0.0050166915869f, - 0.0048734201058f, - 0.0047311118279f, - 0.0045899040199f, - 0.0044499289348f, - 0.0043113136430f, - 0.0041741798805f, - 0.0040386439125f, - 0.0039048164157f, - 0.0037728023754f, - 0.0036427010010f, - 0.0035146056570f, - 0.0033886038113f, - 0.0032647769995f, - 0.0031432008054f, - 0.0030239448570f, - 0.0029070728383f, - 0.0027926425160f, - 0.0026807057805f, - 0.0025713087020f, - 0.0024644915987f, - 0.0023602891198f, - 0.0022587303394f, - 0.0021598388638f, - 0.0020636329490f, - 0.0019701256291f, - 0.0018793248552f, - 0.0017912336426f, - 0.0017058502277f, - 0.0016231682316f, - 0.0015431768319f, - 0.0014658609399f, - 0.0013912013845f, - 0.0013191750998f, - 0.0012497553185f, - 0.0011829117671f, - 0.0011186108652f, - 0.0010568159258f, - 0.0009974873584f, - 0.0009405828709f, - 0.0008860576734f, - 0.0008338646804f, - 0.0007839547115f, - 0.0007362766917f, - 0.0006907778476f, - 0.0006474039021f, - 0.0006060992649f, - 0.0005668072195f, - 0.0005294701054f, - 0.0004940294961f, - 0.0004604263715f, - 0.0004286012850f, - 0.0003984945244f, - 0.0003700462674f, - 0.0003431967298f, - 0.0003178863073f, - 0.0002940557114f, - 0.0002716460964f, - 0.0002505991815f, - 0.0002308573636f, - 0.0002123638243f, - 0.0001950626288f, - 0.0001788988175f, - 0.0001638184908f, - 0.0001497688854f, - 0.0001366984450f, - 0.0001245568823f, - 0.0001132952349f, - 0.0001028659142f, - 0.0000932227473f, - 0.0000843210124f, - 0.0000761174680f, - 0.0000685703757f, - 0.0000616395176f, - 0.0000552862073f, - 0.0000494732958f, - 0.0000441651722f, - 0.0000393277598f, - 0.0000349285069f, - 0.0000309363737f, - 0.0000273218150f, - 0.0000240567590f, - 0.0000211145831f, - 0.0000184700853f, - 0.0000160994544f, - 0.0000139802356f, - 0.0000120912955f, - 0.0000104127838f, - 0.0000089260936f, - 0.0000076138203f, - 0.0000064597188f, - 0.0000054486602f, - 0.0000045665874f, - 0.0000038004715f, - 0.0000031382689f, - 0.0000025688841f, - 0.0000020821477f, - 0.0000016688347f, - 0.0000013207983f, - 0.0000010314179f, - 0.0000007969193f, - 0.0000006201056f, - 0.0000005207559f, - 0.0000005644686f, - -0.0000003266961f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_128_16.h b/core/src/dsp/firdec/taps/fir_128_16.h deleted file mode 100644 index 46dbd84..0000000 --- a/core/src/dsp/firdec/taps/fir_128_16.h +++ /dev/null @@ -1,85 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_128_16_len = 71; - const float fir_128_16_taps[] = { - 0.0000064694540f, - 0.0000182067578f, - 0.0000368085722f, - 0.0000719935366f, - 0.0001252867548f, - 0.0002081925226f, - 0.0003273131837f, - 0.0004962053053f, - 0.0007259672049f, - 0.0010324295967f, - 0.0014300214273f, - 0.0019359256876f, - 0.0025658768245f, - 0.0033363360449f, - 0.0042614372892f, - 0.0053539132757f, - 0.0066227902827f, - 0.0080736193595f, - 0.0097067738877f, - 0.0115174330954f, - 0.0134944842883f, - 0.0156206149876f, - 0.0178718768069f, - 0.0202181371097f, - 0.0226233377697f, - 0.0250464274976f, - 0.0274422678072f, - 0.0297630224211f, - 0.0319595549880f, - 0.0339831151557f, - 0.0357869729439f, - 0.0373281403598f, - 0.0385689282047f, - 0.0394784014454f, - 0.0400335473450f, - 0.0402201936432f, - 0.0400335473450f, - 0.0394784014454f, - 0.0385689282047f, - 0.0373281403598f, - 0.0357869729439f, - 0.0339831151557f, - 0.0319595549880f, - 0.0297630224211f, - 0.0274422678072f, - 0.0250464274976f, - 0.0226233377697f, - 0.0202181371097f, - 0.0178718768069f, - 0.0156206149876f, - 0.0134944842883f, - 0.0115174330954f, - 0.0097067738877f, - 0.0080736193595f, - 0.0066227902827f, - 0.0053539132757f, - 0.0042614372892f, - 0.0033363360449f, - 0.0025658768245f, - 0.0019359256876f, - 0.0014300214273f, - 0.0010324295967f, - 0.0007259672049f, - 0.0004962053053f, - 0.0003273131837f, - 0.0002081925226f, - 0.0001252867548f, - 0.0000719935366f, - 0.0000368085722f, - 0.0000182067578f, - 0.0000064694540f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_128_32.h b/core/src/dsp/firdec/taps/fir_128_32.h deleted file mode 100644 index bf4f222..0000000 --- a/core/src/dsp/firdec/taps/fir_128_32.h +++ /dev/null @@ -1,194 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_128_32_len = 180; - const float fir_128_32_taps[] = { - -0.0000073470522f, - -0.0000069110271f, - -0.0000100675012f, - -0.0000140912235f, - -0.0000191269472f, - -0.0000253238429f, - -0.0000328428415f, - -0.0000418456044f, - -0.0000525009779f, - -0.0000649731010f, - -0.0000794269134f, - -0.0000960153923f, - -0.0001148841160f, - -0.0001361576878f, - -0.0001599434282f, - -0.0001863171187f, - -0.0002153259738f, - -0.0002469739186f, - -0.0002812240728f, - -0.0003179838558f, - -0.0003571072928f, - -0.0003983803151f, - -0.0004415232676f, - -0.0004861768325f, - -0.0005319051695f, - -0.0005781829346f, - -0.0006243995153f, - -0.0006698476317f, - -0.0007137291329f, - -0.0007551456568f, - -0.0007931064250f, - -0.0008265213926f, - -0.0008542114175f, - -0.0008749042532f, - -0.0008872473744f, - -0.0008898070530f, - -0.0008810839958f, - -0.0008595156045f, - -0.0008234944283f, - -0.0007713735444f, - -0.0007014876566f, - -0.0006121613543f, - -0.0005017325051f, - -0.0003685629664f, - -0.0002110637384f, - -0.0000277075239f, - 0.0001829450626f, - 0.0004222318502f, - 0.0006913626978f, - 0.0009914056595f, - 0.0013232613264f, - 0.0016876497890f, - 0.0020850867621f, - 0.0025158723705f, - 0.0029800700983f, - 0.0034774984108f, - 0.0040077135249f, - 0.0045700048063f, - 0.0051633822546f, - 0.0057865764825f, - 0.0064380316487f, - 0.0071159106399f, - 0.0078180939705f, - 0.0085421905540f, - 0.0092855428368f, - 0.0100452432731f, - 0.0108181456753f, - 0.0116008872163f, - 0.0123899056779f, - 0.0131814665052f, - 0.0139716853391f, - 0.0147565593567f, - 0.0155319941959f, - 0.0162938385551f, - 0.0170379143753f, - 0.0177600534535f, - 0.0184561295564f, - 0.0191220956422f, - 0.0197540164501f, - 0.0203481048339f, - 0.0209007533176f, - 0.0214085680250f, - 0.0218683977139f, - 0.0222773638505f, - 0.0226328857338f, - 0.0229327054015f, - 0.0231749076307f, - 0.0233579385724f, - 0.0234806196554f, - 0.0235421591137f, - 0.0235421591137f, - 0.0234806196554f, - 0.0233579385724f, - 0.0231749076307f, - 0.0229327054015f, - 0.0226328857338f, - 0.0222773638505f, - 0.0218683977139f, - 0.0214085680250f, - 0.0209007533176f, - 0.0203481048339f, - 0.0197540164501f, - 0.0191220956422f, - 0.0184561295564f, - 0.0177600534535f, - 0.0170379143753f, - 0.0162938385551f, - 0.0155319941959f, - 0.0147565593567f, - 0.0139716853391f, - 0.0131814665052f, - 0.0123899056779f, - 0.0116008872163f, - 0.0108181456753f, - 0.0100452432731f, - 0.0092855428368f, - 0.0085421905540f, - 0.0078180939705f, - 0.0071159106399f, - 0.0064380316487f, - 0.0057865764825f, - 0.0051633822546f, - 0.0045700048063f, - 0.0040077135249f, - 0.0034774984108f, - 0.0029800700983f, - 0.0025158723705f, - 0.0020850867621f, - 0.0016876497890f, - 0.0013232613264f, - 0.0009914056595f, - 0.0006913626978f, - 0.0004222318502f, - 0.0001829450626f, - -0.0000277075239f, - -0.0002110637384f, - -0.0003685629664f, - -0.0005017325051f, - -0.0006121613543f, - -0.0007014876566f, - -0.0007713735444f, - -0.0008234944283f, - -0.0008595156045f, - -0.0008810839958f, - -0.0008898070530f, - -0.0008872473744f, - -0.0008749042532f, - -0.0008542114175f, - -0.0008265213926f, - -0.0007931064250f, - -0.0007551456568f, - -0.0007137291329f, - -0.0006698476317f, - -0.0006243995153f, - -0.0005781829346f, - -0.0005319051695f, - -0.0004861768325f, - -0.0004415232676f, - -0.0003983803151f, - -0.0003571072928f, - -0.0003179838558f, - -0.0002812240728f, - -0.0002469739186f, - -0.0002153259738f, - -0.0001863171187f, - -0.0001599434282f, - -0.0001361576878f, - -0.0001148841160f, - -0.0000960153923f, - -0.0000794269134f, - -0.0000649731010f, - -0.0000525009779f, - -0.0000418456044f, - -0.0000328428415f, - -0.0000253238429f, - -0.0000191269472f, - -0.0000140912235f, - -0.0000100675012f, - -0.0000069110271f, - -0.0000073470522f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_128_4.h b/core/src/dsp/firdec/taps/fir_128_4.h deleted file mode 100644 index cf3b780..0000000 --- a/core/src/dsp/firdec/taps/fir_128_4.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_128_4_len = 16; - const float fir_128_4_taps[] = { - 0.0003502294673f, - 0.0025622621714f, - 0.0100604175711f, - 0.0274832811630f, - 0.0576540582560f, - 0.0975667617613f, - 0.1368722747794f, - 0.1615718864375f, - 0.1615718864375f, - 0.1368722747794f, - 0.0975667617613f, - 0.0576540582560f, - 0.0274832811630f, - 0.0100604175711f, - 0.0025622621714f, - 0.0003502294673f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_128_64.h b/core/src/dsp/firdec/taps/fir_128_64.h deleted file mode 100644 index a0b71b4..0000000 --- a/core/src/dsp/firdec/taps/fir_128_64.h +++ /dev/null @@ -1,521 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_128_64_len = 507; - const float fir_128_64_taps[] = { - 0.0000059328143f, - 0.0000021865747f, - 0.0000025830027f, - 0.0000030222125f, - 0.0000035067628f, - 0.0000040392284f, - 0.0000046221895f, - 0.0000052582199f, - 0.0000059498747f, - 0.0000066996765f, - 0.0000075101016f, - 0.0000083835652f, - 0.0000093224054f, - 0.0000103288670f, - 0.0000114050841f, - 0.0000125530626f, - 0.0000137746613f, - 0.0000150715728f, - 0.0000164453038f, - 0.0000178971548f, - 0.0000194281990f, - 0.0000210392611f, - 0.0000227308957f, - 0.0000245033648f, - 0.0000263566159f, - 0.0000282902593f, - 0.0000303035451f, - 0.0000323953405f, - 0.0000345641075f, - 0.0000368078793f, - 0.0000391242389f, - 0.0000415102957f, - 0.0000439626648f, - 0.0000464774447f, - 0.0000490501970f, - 0.0000516759262f, - 0.0000543490601f, - 0.0000570634318f, - 0.0000598122618f, - 0.0000625881417f, - 0.0000653830194f, - 0.0000681881850f, - 0.0000709942585f, - 0.0000737911790f, - 0.0000765681960f, - 0.0000793138614f, - 0.0000820160247f, - 0.0000846618292f, - 0.0000872377109f, - 0.0000897293998f, - 0.0000921219225f, - 0.0000943996085f, - 0.0000965460984f, - 0.0000985443543f, - 0.0001003766741f, - 0.0001020247075f, - 0.0001034694753f, - 0.0001046913914f, - 0.0001056702886f, - 0.0001063854463f, - 0.0001068156220f, - 0.0001069390861f, - 0.0001067336594f, - 0.0001061767539f, - 0.0001052454174f, - 0.0001039163805f, - 0.0001021661074f, - 0.0000999708498f, - 0.0000973067041f, - 0.0000941496711f, - 0.0000904757201f, - 0.0000862608548f, - 0.0000814811826f, - 0.0000761129878f, - 0.0000701328055f, - 0.0000635175006f, - 0.0000562443479f, - 0.0000482911149f, - 0.0000396361475f, - 0.0000302584574f, - 0.0000201378119f, - 0.0000092548251f, - -0.0000024089487f, - -0.0000148709202f, - -0.0000281473694f, - -0.0000422533485f, - -0.0000572025836f, - -0.0000730073769f, - -0.0000896785070f, - -0.0001072251303f, - -0.0001256546823f, - -0.0001449727787f, - -0.0001651831180f, - -0.0001862873844f, - -0.0002082851526f, - -0.0002311737938f, - -0.0002549483834f, - -0.0002796016114f, - -0.0003051236947f, - -0.0003315022928f, - -0.0003587224261f, - -0.0003867663977f, - -0.0004156137196f, - -0.0004452410417f, - -0.0004756220865f, - -0.0005067275876f, - -0.0005385252334f, - -0.0005709796161f, - -0.0006040521866f, - -0.0006377012146f, - -0.0006718817554f, - -0.0007065456227f, - -0.0007416413688f, - -0.0007771142706f, - -0.0008129063239f, - -0.0008489562441f, - -0.0008851994755f, - -0.0009215682077f, - -0.0009579914002f, - -0.0009943948149f, - -0.0010307010577f, - -0.0010668296278f, - -0.0011026969756f, - -0.0011382165698f, - -0.0011732989726f, - -0.0012078519242f, - -0.0012417804357f, - -0.0012749868911f, - -0.0013073711584f, - -0.0013388307085f, - -0.0013692607440f, - -0.0013985543359f, - -0.0014266025695f, - -0.0014532946976f, - -0.0014785183035f, - -0.0015021594706f, - -0.0015241029610f, - -0.0015442324013f, - -0.0015624304759f, - -0.0015785791272f, - -0.0015925597630f, - -0.0016042534706f, - -0.0016135412362f, - -0.0016203041714f, - -0.0016244237439f, - -0.0016257820138f, - -0.0016242618751f, - -0.0016197472998f, - -0.0016121235873f, - -0.0016012776158f, - -0.0015870980974f, - -0.0015694758340f, - -0.0015483039764f, - -0.0015234782833f, - -0.0014948973813f, - -0.0014624630249f, - -0.0014260803553f, - -0.0013856581588f, - -0.0013411091226f, - -0.0012923500886f, - -0.0012393023038f, - -0.0011818916675f, - -0.0011200489733f, - -0.0010537101473f, - -0.0009828164799f, - -0.0009073148519f, - -0.0008271579535f, - -0.0007423044962f, - -0.0006527194165f, - -0.0005583740715f, - -0.0004592464247f, - -0.0003553212224f, - -0.0002465901604f, - -0.0001330520388f, - -0.0000147129070f, - 0.0001084138051f, - 0.0002363071656f, - 0.0003689386344f, - 0.0005062719681f, - 0.0006482631397f, - 0.0007948602715f, - 0.0009460035829f, - 0.0011016253518f, - 0.0012616498923f, - 0.0014259935461f, - 0.0015945646903f, - 0.0017672637604f, - 0.0019439832887f, - 0.0021246079593f, - 0.0023090146782f, - 0.0024970726603f, - 0.0026886435316f, - 0.0028835814481f, - 0.0030817332298f, - 0.0032829385117f, - 0.0034870299096f, - 0.0036938332018f, - 0.0039031675262f, - 0.0041148455925f, - 0.0043286739091f, - 0.0045444530249f, - 0.0047619777845f, - 0.0049810375985f, - 0.0052014167253f, - 0.0054228945678f, - 0.0056452459812f, - 0.0058682415926f, - 0.0060916481332f, - 0.0063152287796f, - 0.0065387435067f, - 0.0067619494488f, - 0.0069846012704f, - 0.0072064515449f, - 0.0074272511403f, - 0.0076467496121f, - 0.0078646956013f, - 0.0080808372388f, - 0.0082949225525f, - 0.0085066998790f, - 0.0087159182778f, - 0.0089223279466f, - 0.0091256806387f, - 0.0093257300791f, - 0.0095222323814f, - 0.0097149464619f, - 0.0099036344516f, - 0.0100880621047f, - 0.0102679992034f, - 0.0104432199569f, - 0.0106135033952f, - 0.0107786337550f, - 0.0109384008597f, - 0.0110926004890f, - 0.0112410347414f, - 0.0113835123847f, - 0.0115198491970f, - 0.0116498682958f, - 0.0117734004551f, - 0.0118902844090f, - 0.0120003671424f, - 0.0121035041671f, - 0.0121995597832f, - 0.0122884073249f, - 0.0123699293904f, - 0.0124440180558f, - 0.0125105750712f, - 0.0125695120403f, - 0.0126207505817f, - 0.0126642224718f, - 0.0126998697703f, - 0.0127276449258f, - 0.0127475108633f, - 0.0127594410518f, - 0.0127634195532f, - 0.0127594410518f, - 0.0127475108633f, - 0.0127276449258f, - 0.0126998697703f, - 0.0126642224718f, - 0.0126207505817f, - 0.0125695120403f, - 0.0125105750712f, - 0.0124440180558f, - 0.0123699293904f, - 0.0122884073249f, - 0.0121995597832f, - 0.0121035041671f, - 0.0120003671424f, - 0.0118902844090f, - 0.0117734004551f, - 0.0116498682958f, - 0.0115198491970f, - 0.0113835123847f, - 0.0112410347414f, - 0.0110926004890f, - 0.0109384008597f, - 0.0107786337550f, - 0.0106135033952f, - 0.0104432199569f, - 0.0102679992034f, - 0.0100880621047f, - 0.0099036344516f, - 0.0097149464619f, - 0.0095222323814f, - 0.0093257300791f, - 0.0091256806387f, - 0.0089223279466f, - 0.0087159182778f, - 0.0085066998790f, - 0.0082949225525f, - 0.0080808372388f, - 0.0078646956013f, - 0.0076467496121f, - 0.0074272511403f, - 0.0072064515449f, - 0.0069846012704f, - 0.0067619494488f, - 0.0065387435067f, - 0.0063152287796f, - 0.0060916481332f, - 0.0058682415926f, - 0.0056452459812f, - 0.0054228945678f, - 0.0052014167253f, - 0.0049810375985f, - 0.0047619777845f, - 0.0045444530249f, - 0.0043286739091f, - 0.0041148455925f, - 0.0039031675262f, - 0.0036938332018f, - 0.0034870299096f, - 0.0032829385117f, - 0.0030817332298f, - 0.0028835814481f, - 0.0026886435316f, - 0.0024970726603f, - 0.0023090146782f, - 0.0021246079593f, - 0.0019439832887f, - 0.0017672637604f, - 0.0015945646903f, - 0.0014259935461f, - 0.0012616498923f, - 0.0011016253518f, - 0.0009460035829f, - 0.0007948602715f, - 0.0006482631397f, - 0.0005062719681f, - 0.0003689386344f, - 0.0002363071656f, - 0.0001084138051f, - -0.0000147129070f, - -0.0001330520388f, - -0.0002465901604f, - -0.0003553212224f, - -0.0004592464247f, - -0.0005583740715f, - -0.0006527194165f, - -0.0007423044962f, - -0.0008271579535f, - -0.0009073148519f, - -0.0009828164799f, - -0.0010537101473f, - -0.0011200489733f, - -0.0011818916675f, - -0.0012393023038f, - -0.0012923500886f, - -0.0013411091226f, - -0.0013856581588f, - -0.0014260803553f, - -0.0014624630249f, - -0.0014948973813f, - -0.0015234782833f, - -0.0015483039764f, - -0.0015694758340f, - -0.0015870980974f, - -0.0016012776158f, - -0.0016121235873f, - -0.0016197472998f, - -0.0016242618751f, - -0.0016257820138f, - -0.0016244237439f, - -0.0016203041714f, - -0.0016135412362f, - -0.0016042534706f, - -0.0015925597630f, - -0.0015785791272f, - -0.0015624304759f, - -0.0015442324013f, - -0.0015241029610f, - -0.0015021594706f, - -0.0014785183035f, - -0.0014532946976f, - -0.0014266025695f, - -0.0013985543359f, - -0.0013692607440f, - -0.0013388307085f, - -0.0013073711584f, - -0.0012749868911f, - -0.0012417804357f, - -0.0012078519242f, - -0.0011732989726f, - -0.0011382165698f, - -0.0011026969756f, - -0.0010668296278f, - -0.0010307010577f, - -0.0009943948149f, - -0.0009579914002f, - -0.0009215682077f, - -0.0008851994755f, - -0.0008489562441f, - -0.0008129063239f, - -0.0007771142706f, - -0.0007416413688f, - -0.0007065456227f, - -0.0006718817554f, - -0.0006377012146f, - -0.0006040521866f, - -0.0005709796161f, - -0.0005385252334f, - -0.0005067275876f, - -0.0004756220865f, - -0.0004452410417f, - -0.0004156137196f, - -0.0003867663977f, - -0.0003587224261f, - -0.0003315022928f, - -0.0003051236947f, - -0.0002796016114f, - -0.0002549483834f, - -0.0002311737938f, - -0.0002082851526f, - -0.0001862873844f, - -0.0001651831180f, - -0.0001449727787f, - -0.0001256546823f, - -0.0001072251303f, - -0.0000896785070f, - -0.0000730073769f, - -0.0000572025836f, - -0.0000422533485f, - -0.0000281473694f, - -0.0000148709202f, - -0.0000024089487f, - 0.0000092548251f, - 0.0000201378119f, - 0.0000302584574f, - 0.0000396361475f, - 0.0000482911149f, - 0.0000562443479f, - 0.0000635175006f, - 0.0000701328055f, - 0.0000761129878f, - 0.0000814811826f, - 0.0000862608548f, - 0.0000904757201f, - 0.0000941496711f, - 0.0000973067041f, - 0.0000999708498f, - 0.0001021661074f, - 0.0001039163805f, - 0.0001052454174f, - 0.0001061767539f, - 0.0001067336594f, - 0.0001069390861f, - 0.0001068156220f, - 0.0001063854463f, - 0.0001056702886f, - 0.0001046913914f, - 0.0001034694753f, - 0.0001020247075f, - 0.0001003766741f, - 0.0000985443543f, - 0.0000965460984f, - 0.0000943996085f, - 0.0000921219225f, - 0.0000897293998f, - 0.0000872377109f, - 0.0000846618292f, - 0.0000820160247f, - 0.0000793138614f, - 0.0000765681960f, - 0.0000737911790f, - 0.0000709942585f, - 0.0000681881850f, - 0.0000653830194f, - 0.0000625881417f, - 0.0000598122618f, - 0.0000570634318f, - 0.0000543490601f, - 0.0000516759262f, - 0.0000490501970f, - 0.0000464774447f, - 0.0000439626648f, - 0.0000415102957f, - 0.0000391242389f, - 0.0000368078793f, - 0.0000345641075f, - 0.0000323953405f, - 0.0000303035451f, - 0.0000282902593f, - 0.0000263566159f, - 0.0000245033648f, - 0.0000227308957f, - 0.0000210392611f, - 0.0000194281990f, - 0.0000178971548f, - 0.0000164453038f, - 0.0000150715728f, - 0.0000137746613f, - 0.0000125530626f, - 0.0000114050841f, - 0.0000103288670f, - 0.0000093224054f, - 0.0000083835652f, - 0.0000075101016f, - 0.0000066996765f, - 0.0000059498747f, - 0.0000052582199f, - 0.0000046221895f, - 0.0000040392284f, - 0.0000035067628f, - 0.0000030222125f, - 0.0000025830027f, - 0.0000021865747f, - 0.0000059328143f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_128_8.h b/core/src/dsp/firdec/taps/fir_128_8.h deleted file mode 100644 index 576a515..0000000 --- a/core/src/dsp/firdec/taps/fir_128_8.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_128_8_len = 33; - const float fir_128_8_taps[] = { - 0.0000402645396f, - 0.0001776497260f, - 0.0005328099895f, - 0.0012889952275f, - 0.0026955140465f, - 0.0050490564879f, - 0.0086535181818f, - 0.0137600626254f, - 0.0204960424230f, - 0.0287971941582f, - 0.0383605456257f, - 0.0486341848839f, - 0.0588539901422f, - 0.0681275795918f, - 0.0755543850679f, - 0.0803608914008f, - 0.0820245881555f, - 0.0803608914008f, - 0.0755543850679f, - 0.0681275795918f, - 0.0588539901422f, - 0.0486341848839f, - 0.0383605456257f, - 0.0287971941582f, - 0.0204960424230f, - 0.0137600626254f, - 0.0086535181818f, - 0.0050490564879f, - 0.0026955140465f, - 0.0012889952275f, - 0.0005328099895f, - 0.0001776497260f, - 0.0000402645396f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_16_16.h b/core/src/dsp/firdec/taps/fir_16_16.h deleted file mode 100644 index 7893d63..0000000 --- a/core/src/dsp/firdec/taps/fir_16_16.h +++ /dev/null @@ -1,566 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_16_16_len = 552; - const float fir_16_16_taps[] = { - 0.0000083199827f, - 0.0000084881676f, - 0.0000125885567f, - 0.0000177804634f, - 0.0000241852833f, - 0.0000319042337f, - 0.0000410140885f, - 0.0000515556971f, - 0.0000635293624f, - 0.0000768836058f, - 0.0000915114120f, - 0.0001072405937f, - 0.0001238323243f, - 0.0001409745652f, - 0.0001582843174f, - 0.0001753054713f, - 0.0001915159849f, - 0.0002063311677f, - 0.0002191165223f, - 0.0002291968856f, - 0.0002358749754f, - 0.0002384460258f, - 0.0002362212252f, - 0.0002285465848f, - 0.0002148295414f, - 0.0001945599050f, - 0.0001673370635f, - 0.0001328901081f, - 0.0000911024573f, - 0.0000420277999f, - -0.0000140913087f, - -0.0000768150927f, - -0.0001454972457f, - -0.0002192871274f, - -0.0002971322962f, - -0.0003777932686f, - -0.0004598592590f, - -0.0005417761096f, - -0.0006218750188f, - -0.0006984125260f, - -0.0007696102015f, - -0.0008337037348f, - -0.0008889897559f, - -0.0009338793741f, - -0.0009669467668f, - -0.0009869812183f, - -0.0009930311084f, - -0.0009844478476f, - -0.0009609186466f, - -0.0009224959242f, - -0.0008696128718f, - -0.0008030930096f, - -0.0007241441121f, - -0.0006343445666f, - -0.0005356135898f, - -0.0004301737349f, - -0.0003204982716f, - -0.0002092522968f, - -0.0000992213271f, - 0.0000067633979f, - 0.0001059080771f, - 0.0001955385388f, - 0.0002731857749f, - 0.0003366654366f, - 0.0003841550469f, - 0.0004142599400f, - 0.0004260714830f, - 0.0004192093552f, - 0.0003938516106f, - 0.0003507454223f, - 0.0002912027367f, - 0.0002170751467f, - 0.0001307129555f, - 0.0000349043239f, - -0.0000671996814f, - -0.0001721766401f, - -0.0002764343270f, - -0.0003763233051f, - -0.0004682533995f, - -0.0005488139662f, - -0.0006148906121f, - -0.0006637776003f, - -0.0006932789118f, - -0.0007017970554f, - -0.0006884034538f, - -0.0006528899123f, - -0.0005957963722f, - -0.0005184153646f, - -0.0004227701586f, - -0.0003115682847f, - -0.0001881294675f, - -0.0000562910721f, - 0.0000797078370f, - 0.0002153593731f, - 0.0003460336990f, - 0.0004671344133f, - 0.0005742581225f, - 0.0006633522280f, - 0.0007308658562f, - 0.0007738881585f, - 0.0007902689274f, - 0.0007787167083f, - 0.0007388701444f, - 0.0006713394034f, - 0.0005777148960f, - 0.0004605423719f, - 0.0003232635598f, - 0.0001701240020f, - 0.0000060494092f, - -0.0001635052308f, - -0.0003327304257f, - -0.0004956543392f, - -0.0006463473881f, - -0.0007791311572f, - -0.0008887858391f, - -0.0009707473406f, - -0.0010212883637f, - -0.0010376748928f, - -0.0010182935142f, - -0.0009627423256f, - -0.0008718829334f, - -0.0007478485121f, - -0.0005940082363f, - -0.0004148858953f, - -0.0002160362179f, - -0.0000038797853f, - 0.0002144967369f, - 0.0004315713068f, - 0.0006396386805f, - 0.0008310780982f, - 0.0009986251377f, - 0.0011356405836f, - 0.0012363642899f, - 0.0012961469552f, - 0.0013116484677f, - 0.0012809971563f, - 0.0012039006285f, - 0.0010817051861f, - 0.0009173976585f, - 0.0007155502328f, - 0.0004822060361f, - 0.0002247101187f, - -0.0000485122542f, - -0.0003282213579f, - -0.0006046670924f, - -0.0008679194122f, - -0.0011082164816f, - -0.0013163164160f, - -0.0014838424648f, - -0.0016036069166f, - -0.0016699037326f, - -0.0016787563734f, - -0.0016281127287f, - -0.0015179765142f, - -0.0013504705242f, - -0.0011298254200f, - -0.0008622940855f, - -0.0005559904445f, - -0.0002206579656f, - 0.0001326278146f, - 0.0004918125002f, - 0.0008442625446f, - 0.0011771971009f, - 0.0014781391329f, - 0.0017353688983f, - 0.0019383651103f, - 0.0020782164138f, - 0.0021479888549f, - 0.0021430337774f, - 0.0020612244406f, - 0.0019031097610f, - 0.0016719780803f, - 0.0013738250803f, - 0.0010172247913f, - 0.0006131045972f, - 0.0001744298610f, - -0.0002841939575f, - -0.0007469896914f, - -0.0011975333012f, - -0.0016193180225f, - -0.0019963392576f, - -0.0023136800202f, - -0.0025580762604f, - -0.0027184414762f, - -0.0027863306535f, - -0.0027563254360f, - -0.0026263241476f, - -0.0023977237973f, - -0.0020754837838f, - -0.0016680658389f, - -0.0011872477991f, - -0.0006478144405f, - -0.0000671315905f, - 0.0005353843889f, - 0.0011388873506f, - 0.0017217924441f, - 0.0022625165854f, - 0.0027402428016f, - 0.0031356836285f, - 0.0034318155224f, - 0.0036145589782f, - 0.0036733773953f, - 0.0036017725718f, - 0.0033976546025f, - 0.0030635707180f, - 0.0026067787615f, - 0.0020391592667f, - 0.0013769620179f, - 0.0006403921219f, - -0.0001469573694f, - -0.0009588099622f, - -0.0017670296747f, - -0.0025425381258f, - -0.0032562984671f, - -0.0038803325839f, - -0.0043887399877f, - -0.0047586814357f, - -0.0049712946658f, - -0.0050125064331f, - -0.0048737118489f, - -0.0045522909896f, - -0.0040519418186f, - -0.0033828092770f, - -0.0025614012271f, - -0.0016102839965f, - -0.0005575620934f, - 0.0005638508289f, - 0.0017171507753f, - 0.0028627309673f, - 0.0039594061171f, - 0.0049657407264f, - 0.0058414394672f, - 0.0065487591885f, - 0.0070538953140f, - 0.0073282995418f, - 0.0073498818543f, - 0.0071040568482f, - 0.0065845934106f, - 0.0057942364555f, - 0.0047450710480f, - 0.0034586110723f, - 0.0019655981535f, - 0.0003055096637f, - -0.0014742207991f, - -0.0033192537092f, - -0.0051696434604f, - -0.0069613540836f, - -0.0086279538448f, - -0.0101024412833f, - -0.0113191540820f, - -0.0122157045903f, - -0.0127348875124f, - -0.0128265011561f, - -0.0124490285360f, - -0.0115711241461f, - -0.0101728602554f, - -0.0082466894895f, - -0.0057980911592f, - -0.0028458744398f, - 0.0005778759911f, - 0.0044282188570f, - 0.0086481335451f, - 0.0131696415938f, - 0.0179152456807f, - 0.0227996521306f, - 0.0277317322133f, - 0.0326166721023f, - 0.0373582535356f, - 0.0418612046008f, - 0.0460335559188f, - 0.0497889382248f, - 0.0530487572435f, - 0.0557441859425f, - 0.0578179180988f, - 0.0592256344327f, - 0.0599371398233f, - 0.0599371398233f, - 0.0592256344327f, - 0.0578179180988f, - 0.0557441859425f, - 0.0530487572435f, - 0.0497889382248f, - 0.0460335559188f, - 0.0418612046008f, - 0.0373582535356f, - 0.0326166721023f, - 0.0277317322133f, - 0.0227996521306f, - 0.0179152456807f, - 0.0131696415938f, - 0.0086481335451f, - 0.0044282188570f, - 0.0005778759911f, - -0.0028458744398f, - -0.0057980911592f, - -0.0082466894895f, - -0.0101728602554f, - -0.0115711241461f, - -0.0124490285360f, - -0.0128265011561f, - -0.0127348875124f, - -0.0122157045903f, - -0.0113191540820f, - -0.0101024412833f, - -0.0086279538448f, - -0.0069613540836f, - -0.0051696434604f, - -0.0033192537092f, - -0.0014742207991f, - 0.0003055096637f, - 0.0019655981535f, - 0.0034586110723f, - 0.0047450710480f, - 0.0057942364555f, - 0.0065845934106f, - 0.0071040568482f, - 0.0073498818543f, - 0.0073282995418f, - 0.0070538953140f, - 0.0065487591885f, - 0.0058414394672f, - 0.0049657407264f, - 0.0039594061171f, - 0.0028627309673f, - 0.0017171507753f, - 0.0005638508289f, - -0.0005575620934f, - -0.0016102839965f, - -0.0025614012271f, - -0.0033828092770f, - -0.0040519418186f, - -0.0045522909896f, - -0.0048737118489f, - -0.0050125064331f, - -0.0049712946658f, - -0.0047586814357f, - -0.0043887399877f, - -0.0038803325839f, - -0.0032562984671f, - -0.0025425381258f, - -0.0017670296747f, - -0.0009588099622f, - -0.0001469573694f, - 0.0006403921219f, - 0.0013769620179f, - 0.0020391592667f, - 0.0026067787615f, - 0.0030635707180f, - 0.0033976546025f, - 0.0036017725718f, - 0.0036733773953f, - 0.0036145589782f, - 0.0034318155224f, - 0.0031356836285f, - 0.0027402428016f, - 0.0022625165854f, - 0.0017217924441f, - 0.0011388873506f, - 0.0005353843889f, - -0.0000671315905f, - -0.0006478144405f, - -0.0011872477991f, - -0.0016680658389f, - -0.0020754837838f, - -0.0023977237973f, - -0.0026263241476f, - -0.0027563254360f, - -0.0027863306535f, - -0.0027184414762f, - -0.0025580762604f, - -0.0023136800202f, - -0.0019963392576f, - -0.0016193180225f, - -0.0011975333012f, - -0.0007469896914f, - -0.0002841939575f, - 0.0001744298610f, - 0.0006131045972f, - 0.0010172247913f, - 0.0013738250803f, - 0.0016719780803f, - 0.0019031097610f, - 0.0020612244406f, - 0.0021430337774f, - 0.0021479888549f, - 0.0020782164138f, - 0.0019383651103f, - 0.0017353688983f, - 0.0014781391329f, - 0.0011771971009f, - 0.0008442625446f, - 0.0004918125002f, - 0.0001326278146f, - -0.0002206579656f, - -0.0005559904445f, - -0.0008622940855f, - -0.0011298254200f, - -0.0013504705242f, - -0.0015179765142f, - -0.0016281127287f, - -0.0016787563734f, - -0.0016699037326f, - -0.0016036069166f, - -0.0014838424648f, - -0.0013163164160f, - -0.0011082164816f, - -0.0008679194122f, - -0.0006046670924f, - -0.0003282213579f, - -0.0000485122542f, - 0.0002247101187f, - 0.0004822060361f, - 0.0007155502328f, - 0.0009173976585f, - 0.0010817051861f, - 0.0012039006285f, - 0.0012809971563f, - 0.0013116484677f, - 0.0012961469552f, - 0.0012363642899f, - 0.0011356405836f, - 0.0009986251377f, - 0.0008310780982f, - 0.0006396386805f, - 0.0004315713068f, - 0.0002144967369f, - -0.0000038797853f, - -0.0002160362179f, - -0.0004148858953f, - -0.0005940082363f, - -0.0007478485121f, - -0.0008718829334f, - -0.0009627423256f, - -0.0010182935142f, - -0.0010376748928f, - -0.0010212883637f, - -0.0009707473406f, - -0.0008887858391f, - -0.0007791311572f, - -0.0006463473881f, - -0.0004956543392f, - -0.0003327304257f, - -0.0001635052308f, - 0.0000060494092f, - 0.0001701240020f, - 0.0003232635598f, - 0.0004605423719f, - 0.0005777148960f, - 0.0006713394034f, - 0.0007388701444f, - 0.0007787167083f, - 0.0007902689274f, - 0.0007738881585f, - 0.0007308658562f, - 0.0006633522280f, - 0.0005742581225f, - 0.0004671344133f, - 0.0003460336990f, - 0.0002153593731f, - 0.0000797078370f, - -0.0000562910721f, - -0.0001881294675f, - -0.0003115682847f, - -0.0004227701586f, - -0.0005184153646f, - -0.0005957963722f, - -0.0006528899123f, - -0.0006884034538f, - -0.0007017970554f, - -0.0006932789118f, - -0.0006637776003f, - -0.0006148906121f, - -0.0005488139662f, - -0.0004682533995f, - -0.0003763233051f, - -0.0002764343270f, - -0.0001721766401f, - -0.0000671996814f, - 0.0000349043239f, - 0.0001307129555f, - 0.0002170751467f, - 0.0002912027367f, - 0.0003507454223f, - 0.0003938516106f, - 0.0004192093552f, - 0.0004260714830f, - 0.0004142599400f, - 0.0003841550469f, - 0.0003366654366f, - 0.0002731857749f, - 0.0001955385388f, - 0.0001059080771f, - 0.0000067633979f, - -0.0000992213271f, - -0.0002092522968f, - -0.0003204982716f, - -0.0004301737349f, - -0.0005356135898f, - -0.0006343445666f, - -0.0007241441121f, - -0.0008030930096f, - -0.0008696128718f, - -0.0009224959242f, - -0.0009609186466f, - -0.0009844478476f, - -0.0009930311084f, - -0.0009869812183f, - -0.0009669467668f, - -0.0009338793741f, - -0.0008889897559f, - -0.0008337037348f, - -0.0007696102015f, - -0.0006984125260f, - -0.0006218750188f, - -0.0005417761096f, - -0.0004598592590f, - -0.0003777932686f, - -0.0002971322962f, - -0.0002192871274f, - -0.0001454972457f, - -0.0000768150927f, - -0.0000140913087f, - 0.0000420277999f, - 0.0000911024573f, - 0.0001328901081f, - 0.0001673370635f, - 0.0001945599050f, - 0.0002148295414f, - 0.0002285465848f, - 0.0002362212252f, - 0.0002384460258f, - 0.0002358749754f, - 0.0002291968856f, - 0.0002191165223f, - 0.0002063311677f, - 0.0001915159849f, - 0.0001753054713f, - 0.0001582843174f, - 0.0001409745652f, - 0.0001238323243f, - 0.0001072405937f, - 0.0000915114120f, - 0.0000768836058f, - 0.0000635293624f, - 0.0000515556971f, - 0.0000410140885f, - 0.0000319042337f, - 0.0000241852833f, - 0.0000177804634f, - 0.0000125885567f, - 0.0000084881676f, - 0.0000083199827f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_16_2.h b/core/src/dsp/firdec/taps/fir_16_2.h deleted file mode 100644 index 60575f5..0000000 --- a/core/src/dsp/firdec/taps/fir_16_2.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_16_2_len = 6; - const float fir_16_2_taps[] = { - 0.0314633937131f, - 0.1579813285983f, - 0.3165763689208f, - 0.3165763689208f, - 0.1579813285983f, - 0.0314633937131f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_16_4.h b/core/src/dsp/firdec/taps/fir_16_4.h deleted file mode 100644 index 710c405..0000000 --- a/core/src/dsp/firdec/taps/fir_16_4.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_16_4_len = 22; - const float fir_16_4_taps[] = { - -0.0002023708919f, - -0.0011062368313f, - -0.0032163920847f, - -0.0059942384543f, - -0.0065224236296f, - 0.0007775124540f, - 0.0220383093327f, - 0.0596819563778f, - 0.1084838507550f, - 0.1553460280327f, - 0.1842685402388f, - 0.1842685402388f, - 0.1553460280327f, - 0.1084838507550f, - 0.0596819563778f, - 0.0220383093327f, - 0.0007775124540f, - -0.0065224236296f, - -0.0059942384543f, - -0.0032163920847f, - -0.0011062368313f, - -0.0002023708919f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_16_8.h b/core/src/dsp/firdec/taps/fir_16_8.h deleted file mode 100644 index 2f94b10..0000000 --- a/core/src/dsp/firdec/taps/fir_16_8.h +++ /dev/null @@ -1,78 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_16_8_len = 64; - const float fir_16_8_taps[] = { - 0.0000212056278f, - 0.0000592989663f, - 0.0001311135234f, - 0.0002438111297f, - 0.0003985063745f, - 0.0005834891258f, - 0.0007686964633f, - 0.0009019314371f, - 0.0009086374568f, - 0.0006969087115f, - 0.0001688400440f, - -0.0007617044022f, - -0.0021461871891f, - -0.0039761281907f, - -0.0061595555220f, - -0.0085040839445f, - -0.0107115695084f, - -0.0123883739229f, - -0.0130733894948f, - -0.0122833118289f, - -0.0095715783432f, - -0.0045944308163f, - 0.0028247220059f, - 0.0126425561455f, - 0.0245641604270f, - 0.0380398062836f, - 0.0522939777968f, - 0.0663859606669f, - 0.0792964905438f, - 0.0900306798861f, - 0.0977244326410f, - 0.1017403886275f, - 0.1017403886275f, - 0.0977244326410f, - 0.0900306798861f, - 0.0792964905438f, - 0.0663859606669f, - 0.0522939777968f, - 0.0380398062836f, - 0.0245641604270f, - 0.0126425561455f, - 0.0028247220059f, - -0.0045944308163f, - -0.0095715783432f, - -0.0122833118289f, - -0.0130733894948f, - -0.0123883739229f, - -0.0107115695084f, - -0.0085040839445f, - -0.0061595555220f, - -0.0039761281907f, - -0.0021461871891f, - -0.0007617044022f, - 0.0001688400440f, - 0.0006969087115f, - 0.0009086374568f, - 0.0009019314371f, - 0.0007686964633f, - 0.0005834891258f, - 0.0003985063745f, - 0.0002438111297f, - 0.0001311135234f, - 0.0000592989663f, - 0.0000212056278f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_2048_128.h b/core/src/dsp/firdec/taps/fir_2048_128.h deleted file mode 100644 index c6f3c48..0000000 --- a/core/src/dsp/firdec/taps/fir_2048_128.h +++ /dev/null @@ -1,528 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_2048_128_len = 514; - const float fir_2048_128_taps[] = { - 0.0000056977543f, - 0.0000016519060f, - 0.0000018900898f, - 0.0000021498690f, - 0.0000024330160f, - 0.0000027405173f, - 0.0000030742515f, - 0.0000034353223f, - 0.0000038257163f, - 0.0000042466607f, - 0.0000047002521f, - 0.0000051878472f, - 0.0000057116542f, - 0.0000062731650f, - 0.0000068747009f, - 0.0000075178944f, - 0.0000082051812f, - 0.0000089383392f, - 0.0000097199199f, - 0.0000105518511f, - 0.0000114368007f, - 0.0000123768507f, - 0.0000133747862f, - 0.0000144328464f, - 0.0000155539344f, - 0.0000167404496f, - 0.0000179954131f, - 0.0000193213868f, - 0.0000207215097f, - 0.0000221985076f, - 0.0000237556374f, - 0.0000253957896f, - 0.0000271223379f, - 0.0000289383380f, - 0.0000308472794f, - 0.0000328523820f, - 0.0000349572499f, - 0.0000371652659f, - 0.0000394801467f, - 0.0000419054357f, - 0.0000444449599f, - 0.0000471024204f, - 0.0000498817519f, - 0.0000527868089f, - 0.0000558216304f, - 0.0000589902202f, - 0.0000622967176f, - 0.0000657452697f, - 0.0000693401121f, - 0.0000730855287f, - 0.0000769858465f, - 0.0000810454789f, - 0.0000852688387f, - 0.0000896604605f, - 0.0000942248370f, - 0.0000989666149f, - 0.0001038903598f, - 0.0001090008210f, - 0.0001143026296f, - 0.0001198006263f, - 0.0001254994998f, - 0.0001314041710f, - 0.0001375193773f, - 0.0001438501072f, - 0.0001504011376f, - 0.0001571775115f, - 0.0001641840351f, - 0.0001714257921f, - 0.0001789076072f, - 0.0001866345903f, - 0.0001946115730f, - 0.0002028436762f, - 0.0002113357263f, - 0.0002200928393f, - 0.0002291198237f, - 0.0002384217741f, - 0.0002480034673f, - 0.0002578699598f, - 0.0002680259827f, - 0.0002784765367f, - 0.0002892262923f, - 0.0003002801771f, - 0.0003116427850f, - 0.0003233189523f, - 0.0003353131809f, - 0.0003476301967f, - 0.0003602743932f, - 0.0003732503673f, - 0.0003865623868f, - 0.0004002149008f, - 0.0004142120341f, - 0.0004285580685f, - 0.0004432569680f, - 0.0004583128281f, - 0.0004737294337f, - 0.0004895106749f, - 0.0005056601389f, - 0.0005221814910f, - 0.0005390781024f, - 0.0005563533944f, - 0.0005740105034f, - 0.0005920525879f, - 0.0006104825303f, - 0.0006293032077f, - 0.0006485172300f, - 0.0006681271742f, - 0.0006881353590f, - 0.0007085440434f, - 0.0007293552362f, - 0.0007505708607f, - 0.0007721925977f, - 0.0007942220177f, - 0.0008166604553f, - 0.0008395091117f, - 0.0008627689581f, - 0.0008864408102f, - 0.0009105252585f, - 0.0009350227185f, - 0.0009599333834f, - 0.0009852572538f, - 0.0010109941099f, - 0.0010371435239f, - 0.0010637048482f, - 0.0010906772135f, - 0.0011180595302f, - 0.0011458504759f, - 0.0011740485059f, - 0.0012026518338f, - 0.0012316584473f, - 0.0012610660863f, - 0.0012908722603f, - 0.0013210742267f, - 0.0013516690064f, - 0.0013826533670f, - 0.0014140238326f, - 0.0014457766743f, - 0.0014779079120f, - 0.0015104133153f, - 0.0015432883942f, - 0.0015765284129f, - 0.0016101283668f, - 0.0016440830124f, - 0.0016783868277f, - 0.0017130340602f, - 0.0017480186691f, - 0.0017833343933f, - 0.0018189746732f, - 0.0018549327411f, - 0.0018912015203f, - 0.0019277737394f, - 0.0019646418086f, - 0.0020017979573f, - 0.0020392340874f, - 0.0020769419357f, - 0.0021149129027f, - 0.0021531382398f, - 0.0021916088550f, - 0.0022303155238f, - 0.0022692486717f, - 0.0023083986089f, - 0.0023477552904f, - 0.0023873085737f, - 0.0024270479569f, - 0.0024669628584f, - 0.0025070423351f, - 0.0025472753813f, - 0.0025876506298f, - 0.0026281566678f, - 0.0026687817225f, - 0.0027095139925f, - 0.0027503413194f, - 0.0027912515330f, - 0.0028322321111f, - 0.0028732705358f, - 0.0029143539447f, - 0.0029554694944f, - 0.0029966040069f, - 0.0030377443376f, - 0.0030788770187f, - 0.0031199886295f, - 0.0031610654399f, - 0.0032020937793f, - 0.0032430596841f, - 0.0032839492614f, - 0.0033247483433f, - 0.0033654428438f, - 0.0034060184215f, - 0.0034464608266f, - 0.0034867555758f, - 0.0035268882866f, - 0.0035668443662f, - 0.0036066093308f, - 0.0036461685116f, - 0.0036855073558f, - 0.0037246111522f, - 0.0037634653125f, - 0.0038020551175f, - 0.0038403659769f, - 0.0038783831984f, - 0.0039160922239f, - 0.0039534784232f, - 0.0039905273052f, - 0.0040272243371f, - 0.0040635551298f, - 0.0040995052831f, - 0.0041350605451f, - 0.0041702066839f, - 0.0042049296200f, - 0.0042392153249f, - 0.0042730499268f, - 0.0043064196357f, - 0.0043393108225f, - 0.0043717099704f, - 0.0044036037280f, - 0.0044349788856f, - 0.0044658224039f, - 0.0044961214142f, - 0.0045258632233f, - 0.0045550353360f, - 0.0045836254386f, - 0.0046116214419f, - 0.0046390114441f, - 0.0046657837931f, - 0.0046919270308f, - 0.0047174299722f, - 0.0047422816340f, - 0.0047664713274f, - 0.0047899885734f, - 0.0048128232074f, - 0.0048349652830f, - 0.0048564051867f, - 0.0048771335320f, - 0.0048971412812f, - 0.0049164196340f, - 0.0049349601525f, - 0.0049527546463f, - 0.0049697952998f, - 0.0049860745555f, - 0.0050015852406f, - 0.0050163204516f, - 0.0050302736774f, - 0.0050434386878f, - 0.0050558096508f, - 0.0050673810271f, - 0.0050781476793f, - 0.0050881047743f, - 0.0050972478830f, - 0.0051055728926f, - 0.0051130760938f, - 0.0051197541055f, - 0.0051256039484f, - 0.0051306229828f, - 0.0051348089672f, - 0.0051381600106f, - 0.0051406746155f, - 0.0051423516450f, - 0.0051431903494f, - 0.0051431903494f, - 0.0051423516450f, - 0.0051406746155f, - 0.0051381600106f, - 0.0051348089672f, - 0.0051306229828f, - 0.0051256039484f, - 0.0051197541055f, - 0.0051130760938f, - 0.0051055728926f, - 0.0050972478830f, - 0.0050881047743f, - 0.0050781476793f, - 0.0050673810271f, - 0.0050558096508f, - 0.0050434386878f, - 0.0050302736774f, - 0.0050163204516f, - 0.0050015852406f, - 0.0049860745555f, - 0.0049697952998f, - 0.0049527546463f, - 0.0049349601525f, - 0.0049164196340f, - 0.0048971412812f, - 0.0048771335320f, - 0.0048564051867f, - 0.0048349652830f, - 0.0048128232074f, - 0.0047899885734f, - 0.0047664713274f, - 0.0047422816340f, - 0.0047174299722f, - 0.0046919270308f, - 0.0046657837931f, - 0.0046390114441f, - 0.0046116214419f, - 0.0045836254386f, - 0.0045550353360f, - 0.0045258632233f, - 0.0044961214142f, - 0.0044658224039f, - 0.0044349788856f, - 0.0044036037280f, - 0.0043717099704f, - 0.0043393108225f, - 0.0043064196357f, - 0.0042730499268f, - 0.0042392153249f, - 0.0042049296200f, - 0.0041702066839f, - 0.0041350605451f, - 0.0040995052831f, - 0.0040635551298f, - 0.0040272243371f, - 0.0039905273052f, - 0.0039534784232f, - 0.0039160922239f, - 0.0038783831984f, - 0.0038403659769f, - 0.0038020551175f, - 0.0037634653125f, - 0.0037246111522f, - 0.0036855073558f, - 0.0036461685116f, - 0.0036066093308f, - 0.0035668443662f, - 0.0035268882866f, - 0.0034867555758f, - 0.0034464608266f, - 0.0034060184215f, - 0.0033654428438f, - 0.0033247483433f, - 0.0032839492614f, - 0.0032430596841f, - 0.0032020937793f, - 0.0031610654399f, - 0.0031199886295f, - 0.0030788770187f, - 0.0030377443376f, - 0.0029966040069f, - 0.0029554694944f, - 0.0029143539447f, - 0.0028732705358f, - 0.0028322321111f, - 0.0027912515330f, - 0.0027503413194f, - 0.0027095139925f, - 0.0026687817225f, - 0.0026281566678f, - 0.0025876506298f, - 0.0025472753813f, - 0.0025070423351f, - 0.0024669628584f, - 0.0024270479569f, - 0.0023873085737f, - 0.0023477552904f, - 0.0023083986089f, - 0.0022692486717f, - 0.0022303155238f, - 0.0021916088550f, - 0.0021531382398f, - 0.0021149129027f, - 0.0020769419357f, - 0.0020392340874f, - 0.0020017979573f, - 0.0019646418086f, - 0.0019277737394f, - 0.0018912015203f, - 0.0018549327411f, - 0.0018189746732f, - 0.0017833343933f, - 0.0017480186691f, - 0.0017130340602f, - 0.0016783868277f, - 0.0016440830124f, - 0.0016101283668f, - 0.0015765284129f, - 0.0015432883942f, - 0.0015104133153f, - 0.0014779079120f, - 0.0014457766743f, - 0.0014140238326f, - 0.0013826533670f, - 0.0013516690064f, - 0.0013210742267f, - 0.0012908722603f, - 0.0012610660863f, - 0.0012316584473f, - 0.0012026518338f, - 0.0011740485059f, - 0.0011458504759f, - 0.0011180595302f, - 0.0010906772135f, - 0.0010637048482f, - 0.0010371435239f, - 0.0010109941099f, - 0.0009852572538f, - 0.0009599333834f, - 0.0009350227185f, - 0.0009105252585f, - 0.0008864408102f, - 0.0008627689581f, - 0.0008395091117f, - 0.0008166604553f, - 0.0007942220177f, - 0.0007721925977f, - 0.0007505708607f, - 0.0007293552362f, - 0.0007085440434f, - 0.0006881353590f, - 0.0006681271742f, - 0.0006485172300f, - 0.0006293032077f, - 0.0006104825303f, - 0.0005920525879f, - 0.0005740105034f, - 0.0005563533944f, - 0.0005390781024f, - 0.0005221814910f, - 0.0005056601389f, - 0.0004895106749f, - 0.0004737294337f, - 0.0004583128281f, - 0.0004432569680f, - 0.0004285580685f, - 0.0004142120341f, - 0.0004002149008f, - 0.0003865623868f, - 0.0003732503673f, - 0.0003602743932f, - 0.0003476301967f, - 0.0003353131809f, - 0.0003233189523f, - 0.0003116427850f, - 0.0003002801771f, - 0.0002892262923f, - 0.0002784765367f, - 0.0002680259827f, - 0.0002578699598f, - 0.0002480034673f, - 0.0002384217741f, - 0.0002291198237f, - 0.0002200928393f, - 0.0002113357263f, - 0.0002028436762f, - 0.0001946115730f, - 0.0001866345903f, - 0.0001789076072f, - 0.0001714257921f, - 0.0001641840351f, - 0.0001571775115f, - 0.0001504011376f, - 0.0001438501072f, - 0.0001375193773f, - 0.0001314041710f, - 0.0001254994998f, - 0.0001198006263f, - 0.0001143026296f, - 0.0001090008210f, - 0.0001038903598f, - 0.0000989666149f, - 0.0000942248370f, - 0.0000896604605f, - 0.0000852688387f, - 0.0000810454789f, - 0.0000769858465f, - 0.0000730855287f, - 0.0000693401121f, - 0.0000657452697f, - 0.0000622967176f, - 0.0000589902202f, - 0.0000558216304f, - 0.0000527868089f, - 0.0000498817519f, - 0.0000471024204f, - 0.0000444449599f, - 0.0000419054357f, - 0.0000394801467f, - 0.0000371652659f, - 0.0000349572499f, - 0.0000328523820f, - 0.0000308472794f, - 0.0000289383380f, - 0.0000271223379f, - 0.0000253957896f, - 0.0000237556374f, - 0.0000221985076f, - 0.0000207215097f, - 0.0000193213868f, - 0.0000179954131f, - 0.0000167404496f, - 0.0000155539344f, - 0.0000144328464f, - 0.0000133747862f, - 0.0000123768507f, - 0.0000114368007f, - 0.0000105518511f, - 0.0000097199199f, - 0.0000089383392f, - 0.0000082051812f, - 0.0000075178944f, - 0.0000068747009f, - 0.0000062731650f, - 0.0000057116542f, - 0.0000051878472f, - 0.0000047002521f, - 0.0000042466607f, - 0.0000038257163f, - 0.0000034353223f, - 0.0000030742515f, - 0.0000027405173f, - 0.0000024330160f, - 0.0000021498690f, - 0.0000018900898f, - 0.0000016519060f, - 0.0000056977543f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_2048_64.h b/core/src/dsp/firdec/taps/fir_2048_64.h deleted file mode 100644 index 6e6aff0..0000000 --- a/core/src/dsp/firdec/taps/fir_2048_64.h +++ /dev/null @@ -1,267 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_2048_64_len = 253; - const float fir_2048_64_taps[] = { - 0.0000066902983f, - 0.0000039334795f, - 0.0000050760344f, - 0.0000064280051f, - 0.0000080150883f, - 0.0000098649890f, - 0.0000120074887f, - 0.0000144745098f, - 0.0000173001750f, - 0.0000205208620f, - 0.0000241752518f, - 0.0000283043713f, - 0.0000329516280f, - 0.0000381628381f, - 0.0000439862461f, - 0.0000504725357f, - 0.0000576748313f, - 0.0000656486906f, - 0.0000744520862f, - 0.0000841453767f, - 0.0000947912669f, - 0.0001064547563f, - 0.0001192030760f, - 0.0001331056125f, - 0.0001482338200f, - 0.0001646611193f, - 0.0001824627837f, - 0.0002017158118f, - 0.0002224987872f, - 0.0002448917247f, - 0.0002689759031f, - 0.0002948336849f, - 0.0003225483233f, - 0.0003522037550f, - 0.0003838843823f, - 0.0004176748409f, - 0.0004536597574f, - 0.0004919234940f, - 0.0005325498835f, - 0.0005756219531f, - 0.0006212216387f, - 0.0006694294907f, - 0.0007203243711f, - 0.0007739831434f, - 0.0008304803565f, - 0.0008898879232f, - 0.0009522747932f, - 0.0010177066247f, - 0.0010862454523f, - 0.0011579493544f, - 0.0012328721212f, - 0.0013110629237f, - 0.0013925659858f, - 0.0014774202601f, - 0.0015656591097f, - 0.0016573099965f, - 0.0017523941775f, - 0.0018509264108f, - 0.0019529146726f, - 0.0020583598864f, - 0.0021672556657f, - 0.0022795880718f, - 0.0023953353879f, - 0.0025144679106f, - 0.0026369477603f, - 0.0027627287116f, - 0.0028917560447f, - 0.0030239664192f, - 0.0031592877711f, - 0.0032976392339f, - 0.0034389310850f, - 0.0035830647179f, - 0.0037299326406f, - 0.0038794185025f, - 0.0040313971475f, - 0.0041857346968f, - 0.0043422886590f, - 0.0045009080704f, - 0.0046614336629f, - 0.0048236980620f, - 0.0049875260128f, - 0.0051527346356f, - 0.0053191337090f, - 0.0054865259818f, - 0.0056547075111f, - 0.0058234680287f, - 0.0059925913320f, - 0.0061618557011f, - 0.0063310343392f, - 0.0064998958364f, - 0.0066682046550f, - 0.0068357216352f, - 0.0070022045210f, - 0.0071674085013f, - 0.0073310867697f, - 0.0074929910962f, - 0.0076528724136f, - 0.0078104814129f, - 0.0079655691490f, - 0.0081178876519f, - 0.0082671905449f, - 0.0084132336638f, - 0.0085557756782f, - 0.0086945787115f, - 0.0088294089578f, - 0.0089600372929f, - 0.0090862398788f, - 0.0092077987584f, - 0.0093245024384f, - 0.0094361464590f, - 0.0095425339481f, - 0.0096434761582f, - 0.0097387929827f, - 0.0098283134530f, - 0.0099118762107f, - 0.0099893299564f, - 0.0100605338714f, - 0.0101253580118f, - 0.0101836836737f, - 0.0102354037271f, - 0.0102804229187f, - 0.0103186581413f, - 0.0103500386692f, - 0.0103745063596f, - 0.0103920158177f, - 0.0104025345256f, - 0.0104060429356f, - 0.0104025345256f, - 0.0103920158177f, - 0.0103745063596f, - 0.0103500386692f, - 0.0103186581413f, - 0.0102804229187f, - 0.0102354037271f, - 0.0101836836737f, - 0.0101253580118f, - 0.0100605338714f, - 0.0099893299564f, - 0.0099118762107f, - 0.0098283134530f, - 0.0097387929827f, - 0.0096434761582f, - 0.0095425339481f, - 0.0094361464590f, - 0.0093245024384f, - 0.0092077987584f, - 0.0090862398788f, - 0.0089600372929f, - 0.0088294089578f, - 0.0086945787115f, - 0.0085557756782f, - 0.0084132336638f, - 0.0082671905449f, - 0.0081178876519f, - 0.0079655691490f, - 0.0078104814129f, - 0.0076528724136f, - 0.0074929910962f, - 0.0073310867697f, - 0.0071674085013f, - 0.0070022045210f, - 0.0068357216352f, - 0.0066682046550f, - 0.0064998958364f, - 0.0063310343392f, - 0.0061618557011f, - 0.0059925913320f, - 0.0058234680287f, - 0.0056547075111f, - 0.0054865259818f, - 0.0053191337090f, - 0.0051527346356f, - 0.0049875260128f, - 0.0048236980620f, - 0.0046614336629f, - 0.0045009080704f, - 0.0043422886590f, - 0.0041857346968f, - 0.0040313971475f, - 0.0038794185025f, - 0.0037299326406f, - 0.0035830647179f, - 0.0034389310850f, - 0.0032976392339f, - 0.0031592877711f, - 0.0030239664192f, - 0.0028917560447f, - 0.0027627287116f, - 0.0026369477603f, - 0.0025144679106f, - 0.0023953353879f, - 0.0022795880718f, - 0.0021672556657f, - 0.0020583598864f, - 0.0019529146726f, - 0.0018509264108f, - 0.0017523941775f, - 0.0016573099965f, - 0.0015656591097f, - 0.0014774202601f, - 0.0013925659858f, - 0.0013110629237f, - 0.0012328721212f, - 0.0011579493544f, - 0.0010862454523f, - 0.0010177066247f, - 0.0009522747932f, - 0.0008898879232f, - 0.0008304803565f, - 0.0007739831434f, - 0.0007203243711f, - 0.0006694294907f, - 0.0006212216387f, - 0.0005756219531f, - 0.0005325498835f, - 0.0004919234940f, - 0.0004536597574f, - 0.0004176748409f, - 0.0003838843823f, - 0.0003522037550f, - 0.0003225483233f, - 0.0002948336849f, - 0.0002689759031f, - 0.0002448917247f, - 0.0002224987872f, - 0.0002017158118f, - 0.0001824627837f, - 0.0001646611193f, - 0.0001482338200f, - 0.0001331056125f, - 0.0001192030760f, - 0.0001064547563f, - 0.0000947912669f, - 0.0000841453767f, - 0.0000744520862f, - 0.0000656486906f, - 0.0000576748313f, - 0.0000504725357f, - 0.0000439862461f, - 0.0000381628381f, - 0.0000329516280f, - 0.0000283043713f, - 0.0000241752518f, - 0.0000205208620f, - 0.0000173001750f, - 0.0000144745098f, - 0.0000120074887f, - 0.0000098649890f, - 0.0000080150883f, - 0.0000064280051f, - 0.0000050760344f, - 0.0000039334795f, - 0.0000066902983f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_256_128.h b/core/src/dsp/firdec/taps/fir_256_128.h deleted file mode 100644 index 71c1bbd..0000000 --- a/core/src/dsp/firdec/taps/fir_256_128.h +++ /dev/null @@ -1,1026 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_256_128_len = 1012; - const float fir_256_128_taps[] = { - 0.0000054617197f, - 0.0000010039987f, - 0.0000010956039f, - 0.0000011920904f, - 0.0000012938865f, - 0.0000014008804f, - 0.0000015134951f, - 0.0000016316288f, - 0.0000017556952f, - 0.0000018856055f, - 0.0000020217596f, - 0.0000021640841f, - 0.0000023129618f, - 0.0000024683369f, - 0.0000026305712f, - 0.0000027996282f, - 0.0000029758459f, - 0.0000031592080f, - 0.0000033500265f, - 0.0000035483053f, - 0.0000037543287f, - 0.0000039681205f, - 0.0000041899359f, - 0.0000044198178f, - 0.0000046579914f, - 0.0000049045172f, - 0.0000051595901f, - 0.0000054232859f, - 0.0000056957697f, - 0.0000059771297f, - 0.0000062675020f, - 0.0000065669838f, - 0.0000068756832f, - 0.0000071937032f, - 0.0000075211250f, - 0.0000078580532f, - 0.0000082045440f, - 0.0000085606992f, - 0.0000089265516f, - 0.0000093021962f, - 0.0000096876440f, - 0.0000100829787f, - 0.0000104881911f, - 0.0000109033494f, - 0.0000113284258f, - 0.0000117634690f, - 0.0000122084333f, - 0.0000126633440f, - 0.0000131281391f, - 0.0000136028167f, - 0.0000140872987f, - 0.0000145815531f, - 0.0000150854857f, - 0.0000155990318f, - 0.0000161220807f, - 0.0000166545325f, - 0.0000171962598f, - 0.0000177471253f, - 0.0000183069836f, - 0.0000188756586f, - 0.0000194529856f, - 0.0000200387487f, - 0.0000206327617f, - 0.0000212347684f, - 0.0000218445591f, - 0.0000224618368f, - 0.0000230863658f, - 0.0000237178084f, - 0.0000243559001f, - 0.0000250002630f, - 0.0000256506012f, - 0.0000263064966f, - 0.0000269676192f, - 0.0000276335113f, - 0.0000283038060f, - 0.0000289780068f, - 0.0000296557072f, - 0.0000303363724f, - 0.0000310195537f, - 0.0000317046787f, - 0.0000323912545f, - 0.0000330786713f, - 0.0000337663900f, - 0.0000344537638f, - 0.0000351402059f, - 0.0000358250326f, - 0.0000365076083f, - 0.0000371872122f, - 0.0000378631590f, - 0.0000385346910f, - 0.0000392010726f, - 0.0000398615087f, - 0.0000405152136f, - 0.0000411613543f, - 0.0000417990953f, - 0.0000424275651f, - 0.0000430458793f, - 0.0000436531270f, - 0.0000442483761f, - 0.0000448306757f, - 0.0000453990473f, - 0.0000459524996f, - 0.0000464900089f, - 0.0000470105429f, - 0.0000475130351f, - 0.0000479964116f, - 0.0000484595649f, - 0.0000489013793f, - 0.0000493207086f, - 0.0000497163952f, - 0.0000500872564f, - 0.0000504320934f, - 0.0000507496888f, - 0.0000510388032f, - 0.0000512981874f, - 0.0000515265621f, - 0.0000517226482f, - 0.0000518851286f, - 0.0000520126964f, - 0.0000521039980f, - 0.0000521577014f, - 0.0000521724191f, - 0.0000521467956f, - 0.0000520794123f, - 0.0000519688928f, - 0.0000518137901f, - 0.0000516127093f, - 0.0000513641784f, - 0.0000510667862f, - 0.0000507190397f, - 0.0000503195135f, - 0.0000498666979f, - 0.0000493591558f, - 0.0000487953650f, - 0.0000481738794f, - 0.0000474931688f, - 0.0000467517812f, - 0.0000459481829f, - 0.0000450809190f, - 0.0000441484575f, - 0.0000431493437f, - 0.0000420820523f, - 0.0000409451326f, - 0.0000397370709f, - 0.0000384564242f, - 0.0000371016959f, - 0.0000356714551f, - 0.0000341642269f, - 0.0000325785972f, - 0.0000309131181f, - 0.0000291663973f, - 0.0000273370189f, - 0.0000254236173f, - 0.0000234248141f, - 0.0000213392762f, - 0.0000191656671f, - 0.0000169026922f, - 0.0000145490624f, - 0.0000121035277f, - 0.0000095648509f, - 0.0000069318331f, - 0.0000042032944f, - 0.0000013780933f, - -0.0000015448876f, - -0.0000045667258f, - -0.0000076884710f, - -0.0000109111299f, - -0.0000142356795f, - -0.0000176630487f, - -0.0000211941363f, - -0.0000248297868f, - -0.0000285708153f, - -0.0000324179752f, - -0.0000363719922f, - -0.0000404335221f, - -0.0000446031954f, - -0.0000488815635f, - -0.0000532691560f, - -0.0000577664138f, - -0.0000623737594f, - -0.0000670915167f, - -0.0000719199952f, - -0.0000768593961f, - -0.0000819099094f, - -0.0000870716076f, - -0.0000923445550f, - -0.0000977286901f, - -0.0001032239450f, - -0.0001088301187f, - -0.0001145470050f, - -0.0001203742580f, - -0.0001263115271f, - -0.0001323583166f, - -0.0001385141249f, - -0.0001447783020f, - -0.0001511501895f, - -0.0001576289781f, - -0.0001642138471f, - -0.0001709038232f, - -0.0001776979177f, - -0.0001845949894f, - -0.0001915938761f, - -0.0001986932647f, - -0.0002058918142f, - -0.0002131880358f, - -0.0002205804055f, - -0.0002280672545f, - -0.0002356468714f, - -0.0002433174043f, - -0.0002510769507f, - -0.0002589234716f, - -0.0002668548703f, - -0.0002748689175f, - -0.0002829633193f, - -0.0002911356534f, - -0.0002993834261f, - -0.0003077040191f, - -0.0003160947374f, - -0.0003245527639f, - -0.0003330752009f, - -0.0003416590306f, - -0.0003503011513f, - -0.0003589983429f, - -0.0003677472992f, - -0.0003765445962f, - -0.0003853867235f, - -0.0003942700520f, - -0.0004031908675f, - -0.0004121453355f, - -0.0004211295386f, - -0.0004301394370f, - -0.0004391709117f, - -0.0004482197180f, - -0.0004572815366f, - -0.0004663519194f, - -0.0004754263492f, - -0.0004845001759f, - -0.0004935686869f, - -0.0005026270327f, - -0.0005116703080f, - -0.0005206934671f, - -0.0005296914154f, - -0.0005386589147f, - -0.0005475906847f, - -0.0005564812990f, - -0.0005653252961f, - -0.0005741170662f, - -0.0005828509711f, - -0.0005915212236f, - -0.0006001220139f, - -0.0006086473832f, - -0.0006170913558f, - -0.0006254478087f, - -0.0006337106061f, - -0.0006418734679f, - -0.0006499301053f, - -0.0006578740890f, - -0.0006656989842f, - -0.0006733982212f, - -0.0006809652268f, - -0.0006883933000f, - -0.0006956757374f, - -0.0007028057162f, - -0.0007097764122f, - -0.0007165808902f, - -0.0007232122149f, - -0.0007296633493f, - -0.0007359272569f, - -0.0007419968098f, - -0.0007478648811f, - -0.0007535242631f, - -0.0007589677498f, - -0.0007641880653f, - -0.0007691779366f, - -0.0007739300312f, - -0.0007784370217f, - -0.0007826915315f, - -0.0007866861914f, - -0.0007904135933f, - -0.0007938663403f, - -0.0007970370052f, - -0.0007999181773f, - -0.0008025024239f, - -0.0008047823347f, - -0.0008067504850f, - -0.0008083994801f, - -0.0008097219168f, - -0.0008107104310f, - -0.0008113576556f, - -0.0008116562723f, - -0.0008115989647f, - -0.0008111784758f, - -0.0008103875548f, - -0.0008092190219f, - -0.0008076657071f, - -0.0008057205234f, - -0.0008033763972f, - -0.0008006263506f, - -0.0007974634219f, - -0.0007938807581f, - -0.0007898715256f, - -0.0007854290126f, - -0.0007805465296f, - -0.0007752175217f, - -0.0007694354603f, - -0.0007631939632f, - -0.0007564866791f, - -0.0007493074146f, - -0.0007416500121f, - -0.0007335084828f, - -0.0007248768797f, - -0.0007157494339f, - -0.0007061204255f, - -0.0006959843215f, - -0.0006853356454f, - -0.0006741691151f, - -0.0006624795144f, - -0.0006502618271f, - -0.0006375111133f, - -0.0006242226379f, - -0.0006103917530f, - -0.0005960140195f, - -0.0005810850973f, - -0.0005656008577f, - -0.0005495572834f, - -0.0005329505706f, - -0.0005157770396f, - -0.0004980332255f, - -0.0004797158006f, - -0.0004608216523f, - -0.0004413478190f, - -0.0004212915539f, - -0.0004006502744f, - -0.0003794216126f, - -0.0003576033774f, - -0.0003351935927f, - -0.0003121904710f, - -0.0002885924395f, - -0.0002643981260f, - -0.0002396063730f, - -0.0002142162337f, - -0.0001882269770f, - -0.0001616380917f, - -0.0001344492837f, - -0.0001066604864f, - -0.0000782718524f, - -0.0000492837685f, - -0.0000196968430f, - 0.0000104880762f, - 0.0000412699167f, - 0.0000726473624f, - 0.0001046188693f, - 0.0001371826468f, - 0.0001703366727f, - 0.0002040786763f, - 0.0002384061515f, - 0.0002733163427f, - 0.0003088062548f, - 0.0003448726437f, - 0.0003815120213f, - 0.0004187206518f, - 0.0004564945514f, - 0.0004948294900f, - 0.0005337209861f, - 0.0005731643140f, - 0.0006131544939f, - 0.0006536863036f, - 0.0006947542648f, - 0.0007363526596f, - 0.0007784755123f, - 0.0008211166104f, - 0.0008642694829f, - 0.0009079274248f, - 0.0009520834733f, - 0.0009967304337f, - 0.0010418608557f, - 0.0010874670591f, - 0.0011335411113f, - 0.0011800748517f, - 0.0012270598713f, - 0.0012744875354f, - 0.0013223489661f, - 0.0013706350614f, - 0.0014193364826f, - 0.0014684436687f, - 0.0015179468293f, - 0.0015678359536f, - 0.0016181008094f, - 0.0016687309465f, - 0.0017197157018f, - 0.0017710441970f, - 0.0018227053500f, - 0.0018746878666f, - 0.0019269802582f, - 0.0019795708285f, - 0.0020324476959f, - 0.0020855987758f, - 0.0021390118086f, - 0.0021926743367f, - 0.0022465737373f, - 0.0023006971965f, - 0.0023550317442f, - 0.0024095642271f, - 0.0024642813451f, - 0.0025191696234f, - 0.0025742154495f, - 0.0026294050460f, - 0.0026847245064f, - 0.0027401597701f, - 0.0027956966562f, - 0.0028513208414f, - 0.0029070178900f, - 0.0029627732367f, - 0.0030185722124f, - 0.0030744000312f, - 0.0031302418118f, - 0.0031860825701f, - 0.0032419072346f, - 0.0032977006457f, - 0.0033534475647f, - 0.0034091326794f, - 0.0034647406073f, - 0.0035202559073f, - 0.0035756630769f, - 0.0036309465703f, - 0.0036860907892f, - 0.0037410801073f, - 0.0037958988559f, - 0.0038505313527f, - 0.0039049618835f, - 0.0039591747350f, - 0.0040131541736f, - 0.0040668844797f, - 0.0041203499262f, - 0.0041735348127f, - 0.0042264234446f, - 0.0042790001663f, - 0.0043312493419f, - 0.0043831553862f, - 0.0044347027481f, - 0.0044858759388f, - 0.0045366595183f, - 0.0045870381197f, - 0.0046369964405f, - 0.0046865192616f, - 0.0047355914438f, - 0.0047841979416f, - 0.0048323238052f, - 0.0048799541881f, - 0.0049270743557f, - 0.0049736696861f, - 0.0050197256849f, - 0.0050652279802f, - 0.0051101623431f, - 0.0051545146765f, - 0.0051982710415f, - 0.0052414176408f, - 0.0052839408493f, - 0.0053258271941f, - 0.0053670633876f, - 0.0054076363051f, - 0.0054475330196f, - 0.0054867407779f, - 0.0055252470364f, - 0.0055630394362f, - 0.0056001058389f, - 0.0056364343024f, - 0.0056720131146f, - 0.0057068307715f, - 0.0057408760083f, - 0.0057741377800f, - 0.0058066052887f, - 0.0058382679685f, - 0.0058691155076f, - 0.0058991378384f, - 0.0059283251534f, - 0.0059566679018f, - 0.0059841567980f, - 0.0060107828250f, - 0.0060365372360f, - 0.0060614115641f, - 0.0060853976175f, - 0.0061084874942f, - 0.0061306735723f, - 0.0061519485294f, - 0.0061723053272f, - 0.0061917372361f, - 0.0062102378145f, - 0.0062278009372f, - 0.0062444207718f, - 0.0062600918085f, - 0.0062748088344f, - 0.0062885669652f, - 0.0063013616175f, - 0.0063131885409f, - 0.0063240437903f, - 0.0063339237566f, - 0.0063428251405f, - 0.0063507449805f, - 0.0063576806296f, - 0.0063636297789f, - 0.0063685904388f, - 0.0063725609572f, - 0.0063755400055f, - 0.0063775265914f, - 0.0063785200498f, - 0.0063785200498f, - 0.0063775265914f, - 0.0063755400055f, - 0.0063725609572f, - 0.0063685904388f, - 0.0063636297789f, - 0.0063576806296f, - 0.0063507449805f, - 0.0063428251405f, - 0.0063339237566f, - 0.0063240437903f, - 0.0063131885409f, - 0.0063013616175f, - 0.0062885669652f, - 0.0062748088344f, - 0.0062600918085f, - 0.0062444207718f, - 0.0062278009372f, - 0.0062102378145f, - 0.0061917372361f, - 0.0061723053272f, - 0.0061519485294f, - 0.0061306735723f, - 0.0061084874942f, - 0.0060853976175f, - 0.0060614115641f, - 0.0060365372360f, - 0.0060107828250f, - 0.0059841567980f, - 0.0059566679018f, - 0.0059283251534f, - 0.0058991378384f, - 0.0058691155076f, - 0.0058382679685f, - 0.0058066052887f, - 0.0057741377800f, - 0.0057408760083f, - 0.0057068307715f, - 0.0056720131146f, - 0.0056364343024f, - 0.0056001058389f, - 0.0055630394362f, - 0.0055252470364f, - 0.0054867407779f, - 0.0054475330196f, - 0.0054076363051f, - 0.0053670633876f, - 0.0053258271941f, - 0.0052839408493f, - 0.0052414176408f, - 0.0051982710415f, - 0.0051545146765f, - 0.0051101623431f, - 0.0050652279802f, - 0.0050197256849f, - 0.0049736696861f, - 0.0049270743557f, - 0.0048799541881f, - 0.0048323238052f, - 0.0047841979416f, - 0.0047355914438f, - 0.0046865192616f, - 0.0046369964405f, - 0.0045870381197f, - 0.0045366595183f, - 0.0044858759388f, - 0.0044347027481f, - 0.0043831553862f, - 0.0043312493419f, - 0.0042790001663f, - 0.0042264234446f, - 0.0041735348127f, - 0.0041203499262f, - 0.0040668844797f, - 0.0040131541736f, - 0.0039591747350f, - 0.0039049618835f, - 0.0038505313527f, - 0.0037958988559f, - 0.0037410801073f, - 0.0036860907892f, - 0.0036309465703f, - 0.0035756630769f, - 0.0035202559073f, - 0.0034647406073f, - 0.0034091326794f, - 0.0033534475647f, - 0.0032977006457f, - 0.0032419072346f, - 0.0031860825701f, - 0.0031302418118f, - 0.0030744000312f, - 0.0030185722124f, - 0.0029627732367f, - 0.0029070178900f, - 0.0028513208414f, - 0.0027956966562f, - 0.0027401597701f, - 0.0026847245064f, - 0.0026294050460f, - 0.0025742154495f, - 0.0025191696234f, - 0.0024642813451f, - 0.0024095642271f, - 0.0023550317442f, - 0.0023006971965f, - 0.0022465737373f, - 0.0021926743367f, - 0.0021390118086f, - 0.0020855987758f, - 0.0020324476959f, - 0.0019795708285f, - 0.0019269802582f, - 0.0018746878666f, - 0.0018227053500f, - 0.0017710441970f, - 0.0017197157018f, - 0.0016687309465f, - 0.0016181008094f, - 0.0015678359536f, - 0.0015179468293f, - 0.0014684436687f, - 0.0014193364826f, - 0.0013706350614f, - 0.0013223489661f, - 0.0012744875354f, - 0.0012270598713f, - 0.0011800748517f, - 0.0011335411113f, - 0.0010874670591f, - 0.0010418608557f, - 0.0009967304337f, - 0.0009520834733f, - 0.0009079274248f, - 0.0008642694829f, - 0.0008211166104f, - 0.0007784755123f, - 0.0007363526596f, - 0.0006947542648f, - 0.0006536863036f, - 0.0006131544939f, - 0.0005731643140f, - 0.0005337209861f, - 0.0004948294900f, - 0.0004564945514f, - 0.0004187206518f, - 0.0003815120213f, - 0.0003448726437f, - 0.0003088062548f, - 0.0002733163427f, - 0.0002384061515f, - 0.0002040786763f, - 0.0001703366727f, - 0.0001371826468f, - 0.0001046188693f, - 0.0000726473624f, - 0.0000412699167f, - 0.0000104880762f, - -0.0000196968430f, - -0.0000492837685f, - -0.0000782718524f, - -0.0001066604864f, - -0.0001344492837f, - -0.0001616380917f, - -0.0001882269770f, - -0.0002142162337f, - -0.0002396063730f, - -0.0002643981260f, - -0.0002885924395f, - -0.0003121904710f, - -0.0003351935927f, - -0.0003576033774f, - -0.0003794216126f, - -0.0004006502744f, - -0.0004212915539f, - -0.0004413478190f, - -0.0004608216523f, - -0.0004797158006f, - -0.0004980332255f, - -0.0005157770396f, - -0.0005329505706f, - -0.0005495572834f, - -0.0005656008577f, - -0.0005810850973f, - -0.0005960140195f, - -0.0006103917530f, - -0.0006242226379f, - -0.0006375111133f, - -0.0006502618271f, - -0.0006624795144f, - -0.0006741691151f, - -0.0006853356454f, - -0.0006959843215f, - -0.0007061204255f, - -0.0007157494339f, - -0.0007248768797f, - -0.0007335084828f, - -0.0007416500121f, - -0.0007493074146f, - -0.0007564866791f, - -0.0007631939632f, - -0.0007694354603f, - -0.0007752175217f, - -0.0007805465296f, - -0.0007854290126f, - -0.0007898715256f, - -0.0007938807581f, - -0.0007974634219f, - -0.0008006263506f, - -0.0008033763972f, - -0.0008057205234f, - -0.0008076657071f, - -0.0008092190219f, - -0.0008103875548f, - -0.0008111784758f, - -0.0008115989647f, - -0.0008116562723f, - -0.0008113576556f, - -0.0008107104310f, - -0.0008097219168f, - -0.0008083994801f, - -0.0008067504850f, - -0.0008047823347f, - -0.0008025024239f, - -0.0007999181773f, - -0.0007970370052f, - -0.0007938663403f, - -0.0007904135933f, - -0.0007866861914f, - -0.0007826915315f, - -0.0007784370217f, - -0.0007739300312f, - -0.0007691779366f, - -0.0007641880653f, - -0.0007589677498f, - -0.0007535242631f, - -0.0007478648811f, - -0.0007419968098f, - -0.0007359272569f, - -0.0007296633493f, - -0.0007232122149f, - -0.0007165808902f, - -0.0007097764122f, - -0.0007028057162f, - -0.0006956757374f, - -0.0006883933000f, - -0.0006809652268f, - -0.0006733982212f, - -0.0006656989842f, - -0.0006578740890f, - -0.0006499301053f, - -0.0006418734679f, - -0.0006337106061f, - -0.0006254478087f, - -0.0006170913558f, - -0.0006086473832f, - -0.0006001220139f, - -0.0005915212236f, - -0.0005828509711f, - -0.0005741170662f, - -0.0005653252961f, - -0.0005564812990f, - -0.0005475906847f, - -0.0005386589147f, - -0.0005296914154f, - -0.0005206934671f, - -0.0005116703080f, - -0.0005026270327f, - -0.0004935686869f, - -0.0004845001759f, - -0.0004754263492f, - -0.0004663519194f, - -0.0004572815366f, - -0.0004482197180f, - -0.0004391709117f, - -0.0004301394370f, - -0.0004211295386f, - -0.0004121453355f, - -0.0004031908675f, - -0.0003942700520f, - -0.0003853867235f, - -0.0003765445962f, - -0.0003677472992f, - -0.0003589983429f, - -0.0003503011513f, - -0.0003416590306f, - -0.0003330752009f, - -0.0003245527639f, - -0.0003160947374f, - -0.0003077040191f, - -0.0002993834261f, - -0.0002911356534f, - -0.0002829633193f, - -0.0002748689175f, - -0.0002668548703f, - -0.0002589234716f, - -0.0002510769507f, - -0.0002433174043f, - -0.0002356468714f, - -0.0002280672545f, - -0.0002205804055f, - -0.0002131880358f, - -0.0002058918142f, - -0.0001986932647f, - -0.0001915938761f, - -0.0001845949894f, - -0.0001776979177f, - -0.0001709038232f, - -0.0001642138471f, - -0.0001576289781f, - -0.0001511501895f, - -0.0001447783020f, - -0.0001385141249f, - -0.0001323583166f, - -0.0001263115271f, - -0.0001203742580f, - -0.0001145470050f, - -0.0001088301187f, - -0.0001032239450f, - -0.0000977286901f, - -0.0000923445550f, - -0.0000870716076f, - -0.0000819099094f, - -0.0000768593961f, - -0.0000719199952f, - -0.0000670915167f, - -0.0000623737594f, - -0.0000577664138f, - -0.0000532691560f, - -0.0000488815635f, - -0.0000446031954f, - -0.0000404335221f, - -0.0000363719922f, - -0.0000324179752f, - -0.0000285708153f, - -0.0000248297868f, - -0.0000211941363f, - -0.0000176630487f, - -0.0000142356795f, - -0.0000109111299f, - -0.0000076884710f, - -0.0000045667258f, - -0.0000015448876f, - 0.0000013780933f, - 0.0000042032944f, - 0.0000069318331f, - 0.0000095648509f, - 0.0000121035277f, - 0.0000145490624f, - 0.0000169026922f, - 0.0000191656671f, - 0.0000213392762f, - 0.0000234248141f, - 0.0000254236173f, - 0.0000273370189f, - 0.0000291663973f, - 0.0000309131181f, - 0.0000325785972f, - 0.0000341642269f, - 0.0000356714551f, - 0.0000371016959f, - 0.0000384564242f, - 0.0000397370709f, - 0.0000409451326f, - 0.0000420820523f, - 0.0000431493437f, - 0.0000441484575f, - 0.0000450809190f, - 0.0000459481829f, - 0.0000467517812f, - 0.0000474931688f, - 0.0000481738794f, - 0.0000487953650f, - 0.0000493591558f, - 0.0000498666979f, - 0.0000503195135f, - 0.0000507190397f, - 0.0000510667862f, - 0.0000513641784f, - 0.0000516127093f, - 0.0000518137901f, - 0.0000519688928f, - 0.0000520794123f, - 0.0000521467956f, - 0.0000521724191f, - 0.0000521577014f, - 0.0000521039980f, - 0.0000520126964f, - 0.0000518851286f, - 0.0000517226482f, - 0.0000515265621f, - 0.0000512981874f, - 0.0000510388032f, - 0.0000507496888f, - 0.0000504320934f, - 0.0000500872564f, - 0.0000497163952f, - 0.0000493207086f, - 0.0000489013793f, - 0.0000484595649f, - 0.0000479964116f, - 0.0000475130351f, - 0.0000470105429f, - 0.0000464900089f, - 0.0000459524996f, - 0.0000453990473f, - 0.0000448306757f, - 0.0000442483761f, - 0.0000436531270f, - 0.0000430458793f, - 0.0000424275651f, - 0.0000417990953f, - 0.0000411613543f, - 0.0000405152136f, - 0.0000398615087f, - 0.0000392010726f, - 0.0000385346910f, - 0.0000378631590f, - 0.0000371872122f, - 0.0000365076083f, - 0.0000358250326f, - 0.0000351402059f, - 0.0000344537638f, - 0.0000337663900f, - 0.0000330786713f, - 0.0000323912545f, - 0.0000317046787f, - 0.0000310195537f, - 0.0000303363724f, - 0.0000296557072f, - 0.0000289780068f, - 0.0000283038060f, - 0.0000276335113f, - 0.0000269676192f, - 0.0000263064966f, - 0.0000256506012f, - 0.0000250002630f, - 0.0000243559001f, - 0.0000237178084f, - 0.0000230863658f, - 0.0000224618368f, - 0.0000218445591f, - 0.0000212347684f, - 0.0000206327617f, - 0.0000200387487f, - 0.0000194529856f, - 0.0000188756586f, - 0.0000183069836f, - 0.0000177471253f, - 0.0000171962598f, - 0.0000166545325f, - 0.0000161220807f, - 0.0000155990318f, - 0.0000150854857f, - 0.0000145815531f, - 0.0000140872987f, - 0.0000136028167f, - 0.0000131281391f, - 0.0000126633440f, - 0.0000122084333f, - 0.0000117634690f, - 0.0000113284258f, - 0.0000109033494f, - 0.0000104881911f, - 0.0000100829787f, - 0.0000096876440f, - 0.0000093021962f, - 0.0000089265516f, - 0.0000085606992f, - 0.0000082045440f, - 0.0000078580532f, - 0.0000075211250f, - 0.0000071937032f, - 0.0000068756832f, - 0.0000065669838f, - 0.0000062675020f, - 0.0000059771297f, - 0.0000056957697f, - 0.0000054232859f, - 0.0000051595901f, - 0.0000049045172f, - 0.0000046579914f, - 0.0000044198178f, - 0.0000041899359f, - 0.0000039681205f, - 0.0000037543287f, - 0.0000035483053f, - 0.0000033500265f, - 0.0000031592080f, - 0.0000029758459f, - 0.0000027996282f, - 0.0000026305712f, - 0.0000024683369f, - 0.0000023129618f, - 0.0000021640841f, - 0.0000020217596f, - 0.0000018856055f, - 0.0000017556952f, - 0.0000016316288f, - 0.0000015134951f, - 0.0000014008804f, - 0.0000012938865f, - 0.0000011920904f, - 0.0000010956039f, - 0.0000010039987f, - 0.0000054617197f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_256_16.h b/core/src/dsp/firdec/taps/fir_256_16.h deleted file mode 100644 index ac03072..0000000 --- a/core/src/dsp/firdec/taps/fir_256_16.h +++ /dev/null @@ -1,90 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_256_16_len = 76; - const float fir_256_16_taps[] = { - 0.0000015142320f, - 0.0000056182880f, - 0.0000124498946f, - 0.0000260499212f, - 0.0000484430498f, - 0.0000846870575f, - 0.0001399358873f, - 0.0002214698093f, - 0.0003376597827f, - 0.0004986987881f, - 0.0007161460168f, - 0.0010030447437f, - 0.0013735255533f, - 0.0018425379543f, - 0.0024253148288f, - 0.0031368140196f, - 0.0039910067755f, - 0.0050001228341f, - 0.0061738297617f, - 0.0075184160910f, - 0.0090360019122f, - 0.0107238349685f, - 0.0125737121967f, - 0.0145715758254f, - 0.0166973209914f, - 0.0189248478075f, - 0.0212223774387f, - 0.0235530403051f, - 0.0258757292104f, - 0.0281461957951f, - 0.0303183537669f, - 0.0323457392931f, - 0.0341830677768f, - 0.0357878183250f, - 0.0371217728573f, - 0.0381524365951f, - 0.0388542706370f, - 0.0392096753967f, - 0.0392096753967f, - 0.0388542706370f, - 0.0381524365951f, - 0.0371217728573f, - 0.0357878183250f, - 0.0341830677768f, - 0.0323457392931f, - 0.0303183537669f, - 0.0281461957951f, - 0.0258757292104f, - 0.0235530403051f, - 0.0212223774387f, - 0.0189248478075f, - 0.0166973209914f, - 0.0145715758254f, - 0.0125737121967f, - 0.0107238349685f, - 0.0090360019122f, - 0.0075184160910f, - 0.0061738297617f, - 0.0050001228341f, - 0.0039910067755f, - 0.0031368140196f, - 0.0024253148288f, - 0.0018425379543f, - 0.0013735255533f, - 0.0010030447437f, - 0.0007161460168f, - 0.0004986987881f, - 0.0003376597827f, - 0.0002214698093f, - 0.0001399358873f, - 0.0000846870575f, - 0.0000484430498f, - 0.0000260499212f, - 0.0000124498946f, - 0.0000056182880f, - 0.0000015142320f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_256_32.h b/core/src/dsp/firdec/taps/fir_256_32.h deleted file mode 100644 index dfa9b0b..0000000 --- a/core/src/dsp/firdec/taps/fir_256_32.h +++ /dev/null @@ -1,156 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_256_32_len = 142; - const float fir_256_32_taps[] = { - 0.0000017688668f, - 0.0000059240292f, - 0.0000063419158f, - 0.0000109315134f, - 0.0000155620383f, - 0.0000222451938f, - 0.0000306499257f, - 0.0000414255079f, - 0.0000549053491f, - 0.0000716171275f, - 0.0000920857379f, - 0.0001169121085f, - 0.0001467432458f, - 0.0001822838505f, - 0.0002242905946f, - 0.0002735720047f, - 0.0003309848921f, - 0.0003974308010f, - 0.0004738510608f, - 0.0005612209568f, - 0.0006605427983f, - 0.0007728379742f, - 0.0008991379865f, - 0.0010404745144f, - 0.0011978685639f, - 0.0013723187831f, - 0.0015647890362f, - 0.0017761953523f, - 0.0020073923789f, - 0.0022591594875f, - 0.0025321866931f, - 0.0028270605623f, - 0.0031442502958f, - 0.0034840941781f, - 0.0038467865966f, - 0.0042323658308f, - 0.0046407028156f, - 0.0050714910778f, - 0.0055242380402f, - 0.0059982578748f, - 0.0064926660779f, - 0.0070063759201f, - 0.0075380969064f, - 0.0080863353601f, - 0.0086493972198f, - 0.0092253931090f, - 0.0098122457142f, - 0.0104076994722f, - 0.0110093325391f, - 0.0116145709801f, - 0.0122207050884f, - 0.0128249077089f, - 0.0134242544118f, - 0.0140157453332f, - 0.0145963284712f, - 0.0151629242012f, - 0.0157124507544f, - 0.0162418503801f, - 0.0167481159032f, - 0.0172283173722f, - 0.0176796284881f, - 0.0180993525027f, - 0.0184849472748f, - 0.0188340491797f, - 0.0191444955798f, - 0.0194143455756f, - 0.0196418987797f, - 0.0198257118761f, - 0.0199646127554f, - 0.0200577120472f, - 0.0201044119003f, - 0.0201044119003f, - 0.0200577120472f, - 0.0199646127554f, - 0.0198257118761f, - 0.0196418987797f, - 0.0194143455756f, - 0.0191444955798f, - 0.0188340491797f, - 0.0184849472748f, - 0.0180993525027f, - 0.0176796284881f, - 0.0172283173722f, - 0.0167481159032f, - 0.0162418503801f, - 0.0157124507544f, - 0.0151629242012f, - 0.0145963284712f, - 0.0140157453332f, - 0.0134242544118f, - 0.0128249077089f, - 0.0122207050884f, - 0.0116145709801f, - 0.0110093325391f, - 0.0104076994722f, - 0.0098122457142f, - 0.0092253931090f, - 0.0086493972198f, - 0.0080863353601f, - 0.0075380969064f, - 0.0070063759201f, - 0.0064926660779f, - 0.0059982578748f, - 0.0055242380402f, - 0.0050714910778f, - 0.0046407028156f, - 0.0042323658308f, - 0.0038467865966f, - 0.0034840941781f, - 0.0031442502958f, - 0.0028270605623f, - 0.0025321866931f, - 0.0022591594875f, - 0.0020073923789f, - 0.0017761953523f, - 0.0015647890362f, - 0.0013723187831f, - 0.0011978685639f, - 0.0010404745144f, - 0.0008991379865f, - 0.0007728379742f, - 0.0006605427983f, - 0.0005612209568f, - 0.0004738510608f, - 0.0003974308010f, - 0.0003309848921f, - 0.0002735720047f, - 0.0002242905946f, - 0.0001822838505f, - 0.0001467432458f, - 0.0001169121085f, - 0.0000920857379f, - 0.0000716171275f, - 0.0000549053491f, - 0.0000414255079f, - 0.0000306499257f, - 0.0000222451938f, - 0.0000155620383f, - 0.0000109315134f, - 0.0000063419158f, - 0.0000059240292f, - 0.0000017688668f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_256_64.h b/core/src/dsp/firdec/taps/fir_256_64.h deleted file mode 100644 index 3e19766..0000000 --- a/core/src/dsp/firdec/taps/fir_256_64.h +++ /dev/null @@ -1,370 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_256_64_len = 356; - const float fir_256_64_taps[] = { - -0.0000062681742f, - -0.0000029140762f, - -0.0000035815110f, - -0.0000043422553f, - -0.0000052049053f, - -0.0000061772939f, - -0.0000072686109f, - -0.0000084872485f, - -0.0000098429063f, - -0.0000113444414f, - -0.0000130019541f, - -0.0000148246460f, - -0.0000168228827f, - -0.0000190060632f, - -0.0000213846550f, - -0.0000239680794f, - -0.0000267667146f, - -0.0000297898005f, - -0.0000330474067f, - -0.0000365483596f, - -0.0000403021726f, - -0.0000443169994f, - -0.0000486015224f, - -0.0000531629366f, - -0.0000580087933f, - -0.0000631450183f, - -0.0000685777077f, - -0.0000743111852f, - -0.0000803497472f, - -0.0000866957632f, - -0.0000933513680f, - -0.0001003166088f, - -0.0001075910834f, - -0.0001151721377f, - -0.0001230564481f, - -0.0001312382737f, - -0.0001397109815f, - -0.0001484653574f, - -0.0001574910729f, - -0.0001667750594f, - -0.0001763029154f, - -0.0001860573478f, - -0.0001960195192f, - -0.0002061675607f, - -0.0002164778583f, - -0.0002269236408f, - -0.0002374762065f, - -0.0002481035885f, - -0.0002587717224f, - -0.0002694431931f, - -0.0002800783421f, - -0.0002906341007f, - -0.0003010650378f, - -0.0003113222805f, - -0.0003213545042f, - -0.0003311069438f, - -0.0003405223259f, - -0.0003495399742f, - -0.0003580966832f, - -0.0003661259202f, - -0.0003735586428f, - -0.0003803225975f, - -0.0003863430819f, - -0.0003915423426f, - -0.0003958402819f, - -0.0003991539556f, - -0.0004013982252f, - -0.0004024853566f, - -0.0004023256179f, - -0.0004008269786f, - -0.0003978956543f, - -0.0003934359050f, - -0.0003873505277f, - -0.0003795407527f, - -0.0003699066836f, - -0.0003583472905f, - -0.0003447607977f, - -0.0003290447712f, - -0.0003110964540f, - -0.0002908129452f, - -0.0002680914824f, - -0.0002428297099f, - -0.0002149259070f, - -0.0001842793414f, - -0.0001507904431f, - -0.0001143612390f, - -0.0000748954712f, - -0.0000322991074f, - 0.0000135195964f, - 0.0000626495149f, - 0.0001151766480f, - 0.0001711834750f, - 0.0002307490067f, - 0.0002939480814f, - 0.0003608514761f, - 0.0004315251498f, - 0.0005060304153f, - 0.0005844231367f, - 0.0006667539631f, - 0.0007530674871f, - 0.0008434025410f, - 0.0009377913237f, - 0.0010362597605f, - 0.0011388266053f, - 0.0012455038652f, - 0.0013562958844f, - 0.0014711998354f, - 0.0015902047905f, - 0.0017132922802f, - 0.0018404353607f, - 0.0019715992373f, - 0.0021067403358f, - 0.0022458069916f, - 0.0023887385299f, - 0.0025354660208f, - 0.0026859113741f, - 0.0028399881592f, - 0.0029976007211f, - 0.0031586450629f, - 0.0033230079887f, - 0.0034905680464f, - 0.0036611947020f, - 0.0038347493416f, - 0.0040110844803f, - 0.0041900448203f, - 0.0043714664990f, - 0.0045551781983f, - 0.0047410004367f, - 0.0049287467249f, - 0.0051182229035f, - 0.0053092283419f, - 0.0055015553224f, - 0.0056949902776f, - 0.0058893132225f, - 0.0060842990234f, - 0.0062797168802f, - 0.0064753316199f, - 0.0066709032288f, - 0.0068661881644f, - 0.0070609389367f, - 0.0072549054317f, - 0.0074478345403f, - 0.0076394714860f, - 0.0078295595003f, - 0.0080178411460f, - 0.0082040580375f, - 0.0083879521517f, - 0.0085692655900f, - 0.0087477418693f, - 0.0089231257234f, - 0.0090951643643f, - 0.0092636073201f, - 0.0094282076595f, - 0.0095887218614f, - 0.0097449109950f, - 0.0098965406177f, - 0.0100433819014f, - 0.0101852115568f, - 0.0103218128967f, - 0.0104529757832f, - 0.0105784976211f, - 0.0106981833229f, - 0.0108118462264f, - 0.0109193080737f, - 0.0110203998455f, - 0.0111149617515f, - 0.0112028439747f, - 0.0112839066704f, - 0.0113580206147f, - 0.0114250672088f, - 0.0114849390277f, - 0.0115375398269f, - 0.0115827849866f, - 0.0116206015194f, - 0.0116509284062f, - 0.0116737166029f, - 0.0116889292662f, - 0.0116965417578f, - 0.0116965417578f, - 0.0116889292662f, - 0.0116737166029f, - 0.0116509284062f, - 0.0116206015194f, - 0.0115827849866f, - 0.0115375398269f, - 0.0114849390277f, - 0.0114250672088f, - 0.0113580206147f, - 0.0112839066704f, - 0.0112028439747f, - 0.0111149617515f, - 0.0110203998455f, - 0.0109193080737f, - 0.0108118462264f, - 0.0106981833229f, - 0.0105784976211f, - 0.0104529757832f, - 0.0103218128967f, - 0.0101852115568f, - 0.0100433819014f, - 0.0098965406177f, - 0.0097449109950f, - 0.0095887218614f, - 0.0094282076595f, - 0.0092636073201f, - 0.0090951643643f, - 0.0089231257234f, - 0.0087477418693f, - 0.0085692655900f, - 0.0083879521517f, - 0.0082040580375f, - 0.0080178411460f, - 0.0078295595003f, - 0.0076394714860f, - 0.0074478345403f, - 0.0072549054317f, - 0.0070609389367f, - 0.0068661881644f, - 0.0066709032288f, - 0.0064753316199f, - 0.0062797168802f, - 0.0060842990234f, - 0.0058893132225f, - 0.0056949902776f, - 0.0055015553224f, - 0.0053092283419f, - 0.0051182229035f, - 0.0049287467249f, - 0.0047410004367f, - 0.0045551781983f, - 0.0043714664990f, - 0.0041900448203f, - 0.0040110844803f, - 0.0038347493416f, - 0.0036611947020f, - 0.0034905680464f, - 0.0033230079887f, - 0.0031586450629f, - 0.0029976007211f, - 0.0028399881592f, - 0.0026859113741f, - 0.0025354660208f, - 0.0023887385299f, - 0.0022458069916f, - 0.0021067403358f, - 0.0019715992373f, - 0.0018404353607f, - 0.0017132922802f, - 0.0015902047905f, - 0.0014711998354f, - 0.0013562958844f, - 0.0012455038652f, - 0.0011388266053f, - 0.0010362597605f, - 0.0009377913237f, - 0.0008434025410f, - 0.0007530674871f, - 0.0006667539631f, - 0.0005844231367f, - 0.0005060304153f, - 0.0004315251498f, - 0.0003608514761f, - 0.0002939480814f, - 0.0002307490067f, - 0.0001711834750f, - 0.0001151766480f, - 0.0000626495149f, - 0.0000135195964f, - -0.0000322991074f, - -0.0000748954712f, - -0.0001143612390f, - -0.0001507904431f, - -0.0001842793414f, - -0.0002149259070f, - -0.0002428297099f, - -0.0002680914824f, - -0.0002908129452f, - -0.0003110964540f, - -0.0003290447712f, - -0.0003447607977f, - -0.0003583472905f, - -0.0003699066836f, - -0.0003795407527f, - -0.0003873505277f, - -0.0003934359050f, - -0.0003978956543f, - -0.0004008269786f, - -0.0004023256179f, - -0.0004024853566f, - -0.0004013982252f, - -0.0003991539556f, - -0.0003958402819f, - -0.0003915423426f, - -0.0003863430819f, - -0.0003803225975f, - -0.0003735586428f, - -0.0003661259202f, - -0.0003580966832f, - -0.0003495399742f, - -0.0003405223259f, - -0.0003311069438f, - -0.0003213545042f, - -0.0003113222805f, - -0.0003010650378f, - -0.0002906341007f, - -0.0002800783421f, - -0.0002694431931f, - -0.0002587717224f, - -0.0002481035885f, - -0.0002374762065f, - -0.0002269236408f, - -0.0002164778583f, - -0.0002061675607f, - -0.0001960195192f, - -0.0001860573478f, - -0.0001763029154f, - -0.0001667750594f, - -0.0001574910729f, - -0.0001484653574f, - -0.0001397109815f, - -0.0001312382737f, - -0.0001230564481f, - -0.0001151721377f, - -0.0001075910834f, - -0.0001003166088f, - -0.0000933513680f, - -0.0000866957632f, - -0.0000803497472f, - -0.0000743111852f, - -0.0000685777077f, - -0.0000631450183f, - -0.0000580087933f, - -0.0000531629366f, - -0.0000486015224f, - -0.0000443169994f, - -0.0000403021726f, - -0.0000365483596f, - -0.0000330474067f, - -0.0000297898005f, - -0.0000267667146f, - -0.0000239680794f, - -0.0000213846550f, - -0.0000190060632f, - -0.0000168228827f, - -0.0000148246460f, - -0.0000130019541f, - -0.0000113444414f, - -0.0000098429063f, - -0.0000084872485f, - -0.0000072686109f, - -0.0000061772939f, - -0.0000052049053f, - -0.0000043422553f, - -0.0000035815110f, - -0.0000029140762f, - -0.0000062681742f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_256_8.h b/core/src/dsp/firdec/taps/fir_256_8.h deleted file mode 100644 index cf07f38..0000000 --- a/core/src/dsp/firdec/taps/fir_256_8.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_256_8_len = 32; - const float fir_256_8_taps[] = { - 0.0000481199958f, - 0.0002120253977f, - 0.0006339322060f, - 0.0015268611634f, - 0.0031751774844f, - 0.0059080996632f, - 0.0100482128498f, - 0.0158389158363f, - 0.0233630301033f, - 0.0324710705948f, - 0.0427398820012f, - 0.0534789041603f, - 0.0637922520572f, - 0.0726919132761f, - 0.0792439704433f, - 0.0827196815814f, - 0.0827196815814f, - 0.0792439704433f, - 0.0726919132761f, - 0.0637922520572f, - 0.0534789041603f, - 0.0427398820012f, - 0.0324710705948f, - 0.0233630301033f, - 0.0158389158363f, - 0.0100482128498f, - 0.0059080996632f, - 0.0031751774844f, - 0.0015268611634f, - 0.0006339322060f, - 0.0002120253977f, - 0.0000481199958f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_2_2.h b/core/src/dsp/firdec/taps/fir_2_2.h deleted file mode 100644 index 45fde62..0000000 --- a/core/src/dsp/firdec/taps/fir_2_2.h +++ /dev/null @@ -1,83 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_2_2_len = 69; - const float fir_2_2_taps[] = { - 0.0004006336249f, - 0.0020755985056f, - 0.0048563649567f, - 0.0059790166982f, - 0.0026229226079f, - -0.0027182591526f, - -0.0033815336714f, - 0.0016386385398f, - 0.0040818147060f, - -0.0009840292282f, - -0.0051209884701f, - 0.0001774409073f, - 0.0064258526620f, - 0.0010093516023f, - -0.0079128279100f, - -0.0027137006752f, - 0.0095093112574f, - 0.0050706357235f, - -0.0111540204771f, - -0.0082460599199f, - 0.0127857167873f, - 0.0124879068372f, - -0.0143474523867f, - -0.0182057708485f, - 0.0157818585768f, - 0.0261723747167f, - -0.0170376434096f, - -0.0380514893049f, - 0.0180670706247f, - 0.0582124126716f, - -0.0188323041841f, - -0.1027724866049f, - 0.0193031650356f, - 0.3171894887336f, - 0.4805375200904f, - 0.3171894887336f, - 0.0193031650356f, - -0.1027724866049f, - -0.0188323041841f, - 0.0582124126716f, - 0.0180670706247f, - -0.0380514893049f, - -0.0170376434096f, - 0.0261723747167f, - 0.0157818585768f, - -0.0182057708485f, - -0.0143474523867f, - 0.0124879068372f, - 0.0127857167873f, - -0.0082460599199f, - -0.0111540204771f, - 0.0050706357235f, - 0.0095093112574f, - -0.0027137006752f, - -0.0079128279100f, - 0.0010093516023f, - 0.0064258526620f, - 0.0001774409073f, - -0.0051209884701f, - -0.0009840292282f, - 0.0040818147060f, - 0.0016386385398f, - -0.0033815336714f, - -0.0027182591526f, - 0.0026229226079f, - 0.0059790166982f, - 0.0048563649567f, - 0.0020755985056f, - 0.0004006336249f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_32_16.h b/core/src/dsp/firdec/taps/fir_32_16.h deleted file mode 100644 index a253911..0000000 --- a/core/src/dsp/firdec/taps/fir_32_16.h +++ /dev/null @@ -1,142 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_32_16_len = 128; - const float fir_32_16_taps[] = { - 0.0000099342222f, - 0.0000146490348f, - 0.0000247646101f, - 0.0000387541309f, - 0.0000572736657f, - 0.0000808761926f, - 0.0001099349979f, - 0.0001445574213f, - 0.0001844922748f, - 0.0002290353727f, - 0.0002769386619f, - 0.0003263293316f, - 0.0003746459569f, - 0.0004185990900f, - 0.0004541637106f, - 0.0004766105134f, - 0.0004805821127f, - 0.0004602188681f, - 0.0004093371919f, - 0.0003216609257f, - 0.0001911037388f, - 0.0000120976033f, - -0.0002200406423f, - -0.0005087156694f, - -0.0008556468821f, - -0.0012604649511f, - -0.0017203301735f, - -0.0022295925790f, - -0.0027795143093f, - -0.0033580744939f, - -0.0039498755635f, - -0.0045361676357f, - -0.0050950043052f, - -0.0056015389258f, - -0.0060284654152f, - -0.0063466019019f, - -0.0065256093963f, - -0.0065348313327f, - -0.0063442336013f, - -0.0059254188348f, - -0.0052526835481f, - -0.0043040825207f, - -0.0030624618152f, - -0.0015164202550f, - 0.0003388408046f, - 0.0025008178935f, - 0.0049591911398f, - 0.0076955253725f, - 0.0106832101994f, - 0.0138876548446f, - 0.0172667447174f, - 0.0207715571925f, - 0.0243473242916f, - 0.0279346202686f, - 0.0314707429314f, - 0.0348912492894f, - 0.0381315991625f, - 0.0411288550641f, - 0.0438233832299f, - 0.0461604993011f, - 0.0480920029752f, - 0.0495775489259f, - 0.0505858063661f, - 0.0510953666101f, - 0.0510953666101f, - 0.0505858063661f, - 0.0495775489259f, - 0.0480920029752f, - 0.0461604993011f, - 0.0438233832299f, - 0.0411288550641f, - 0.0381315991625f, - 0.0348912492894f, - 0.0314707429314f, - 0.0279346202686f, - 0.0243473242916f, - 0.0207715571925f, - 0.0172667447174f, - 0.0138876548446f, - 0.0106832101994f, - 0.0076955253725f, - 0.0049591911398f, - 0.0025008178935f, - 0.0003388408046f, - -0.0015164202550f, - -0.0030624618152f, - -0.0043040825207f, - -0.0052526835481f, - -0.0059254188348f, - -0.0063442336013f, - -0.0065348313327f, - -0.0065256093963f, - -0.0063466019019f, - -0.0060284654152f, - -0.0056015389258f, - -0.0050950043052f, - -0.0045361676357f, - -0.0039498755635f, - -0.0033580744939f, - -0.0027795143093f, - -0.0022295925790f, - -0.0017203301735f, - -0.0012604649511f, - -0.0008556468821f, - -0.0005087156694f, - -0.0002200406423f, - 0.0000120976033f, - 0.0001911037388f, - 0.0003216609257f, - 0.0004093371919f, - 0.0004602188681f, - 0.0004805821127f, - 0.0004766105134f, - 0.0004541637106f, - 0.0004185990900f, - 0.0003746459569f, - 0.0003263293316f, - 0.0002769386619f, - 0.0002290353727f, - 0.0001844922748f, - 0.0001445574213f, - 0.0001099349979f, - 0.0000808761926f, - 0.0000572736657f, - 0.0000387541309f, - 0.0000247646101f, - 0.0000146490348f, - 0.0000099342222f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_32_2.h b/core/src/dsp/firdec/taps/fir_32_2.h deleted file mode 100644 index 189fb8c..0000000 --- a/core/src/dsp/firdec/taps/fir_32_2.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_32_2_len = 6; - const float fir_32_2_taps[] = { - 0.0303426484663f, - 0.1557222116669f, - 0.3154225044548f, - 0.3154225044548f, - 0.1557222116669f, - 0.0303426484663f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_32_32.h b/core/src/dsp/firdec/taps/fir_32_32.h deleted file mode 100644 index caa6228..0000000 --- a/core/src/dsp/firdec/taps/fir_32_32.h +++ /dev/null @@ -1,1117 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_32_32_len = 1103; - const float fir_32_32_taps[] = { - 0.0000064425788f, - 0.0000033014804f, - 0.0000041249453f, - 0.0000050666069f, - 0.0000061347473f, - 0.0000073374059f, - 0.0000086822757f, - 0.0000101765938f, - 0.0000118270277f, - 0.0000136395560f, - 0.0000156193469f, - 0.0000177706336f, - 0.0000200965883f, - 0.0000225991964f, - 0.0000252791303f, - 0.0000281356268f, - 0.0000311663665f, - 0.0000343673588f, - 0.0000377328326f, - 0.0000412551345f, - 0.0000449246363f, - 0.0000487296525f, - 0.0000526563699f, - 0.0000566887903f, - 0.0000608086879f, - 0.0000649955829f, - 0.0000692267316f, - 0.0000734771355f, - 0.0000777195696f, - 0.0000819246310f, - 0.0000860608088f, - 0.0000900945758f, - 0.0000939905024f, - 0.0000977113936f, - 0.0001012184487f, - 0.0001044714435f, - 0.0001074289359f, - 0.0001100484926f, - 0.0001122869384f, - 0.0001141006252f, - 0.0001154457210f, - 0.0001162785168f, - 0.0001165557502f, - 0.0001162349436f, - 0.0001152747551f, - 0.0001136353405f, - 0.0001112787225f, - 0.0001081691663f, - 0.0001042735572f, - 0.0000995617786f, - 0.0000940070861f, - 0.0000875864757f, - 0.0000802810417f, - 0.0000720763221f, - 0.0000629626269f, - 0.0000529353467f, - 0.0000419952383f, - 0.0000301486828f, - 0.0000174079151f, - 0.0000037912184f, - -0.0000106769153f, - -0.0000259656655f, - -0.0000420378042f, - -0.0000588496612f, - -0.0000763511359f, - -0.0000944857564f, - -0.0001131907895f, - -0.0001323974004f, - -0.0001520308649f, - -0.0001720108329f, - -0.0001922516448f, - -0.0002126626991f, - -0.0002331488711f, - -0.0002536109811f, - -0.0002739463104f, - -0.0002940491630f, - -0.0003138114702f, - -0.0003331234349f, - -0.0003518742125f, - -0.0003699526238f, - -0.0003872478959f, - -0.0004036504263f, - -0.0004190525651f, - -0.0004333494098f, - -0.0004464396065f, - -0.0004582261523f, - -0.0004686171928f, - -0.0004775268066f, - -0.0004848757728f, - -0.0004905923132f, - -0.0004946128030f, - -0.0004968824437f, - -0.0004973558920f, - -0.0004959978377f, - -0.0004927835248f, - -0.0004876992105f, - -0.0004807425563f, - -0.0004719229454f, - -0.0004612617230f, - -0.0004487923547f, - -0.0004345604987f, - -0.0004186239903f, - -0.0004010527353f, - -0.0003819285099f, - -0.0003613446675f, - -0.0003394057517f, - -0.0003162270149f, - -0.0002919338447f, - -0.0002666611005f, - -0.0002405523614f, - -0.0002137590910f, - -0.0001864397218f, - -0.0001587586656f, - -0.0001308852545f, - -0.0001029926207f, - -0.0000752565205f, - -0.0000478541121f, - -0.0000209626947f, - 0.0000052415821f, - 0.0000305850284f, - 0.0000548977338f, - 0.0000780148883f, - 0.0000997780906f, - 0.0001200366365f, - 0.0001386487747f, - 0.0001554829191f, - 0.0001704188086f, - 0.0001833486017f, - 0.0001941778982f, - 0.0002028266752f, - 0.0002092301313f, - 0.0002133394270f, - 0.0002151223160f, - 0.0002145636574f, - 0.0002116658040f, - 0.0002064488603f, - 0.0001989508042f, - 0.0001892274713f, - 0.0001773523961f, - 0.0001634165101f, - 0.0001475276961f, - 0.0001298101992f, - 0.0001104038960f, - 0.0000894634263f, - 0.0000671571903f, - 0.0000436662173f, - 0.0000191829133f, - -0.0000060903059f, - -0.0000319424858f, - -0.0000581556992f, - -0.0000845066962f, - -0.0001107686256f, - -0.0001367128149f, - -0.0001621105962f, - -0.0001867351629f, - -0.0002103634419f, - -0.0002327779678f, - -0.0002537687424f, - -0.0002731350628f, - -0.0002906873051f, - -0.0003062486452f, - -0.0003196567027f, - -0.0003307650922f, - -0.0003394448683f, - -0.0003455858480f, - -0.0003490978007f, - -0.0003499114897f, - -0.0003479795568f, - -0.0003432772379f, - -0.0003358029014f, - -0.0003255784014f, - -0.0003126492400f, - -0.0002970845330f, - -0.0002789767769f, - -0.0002584414148f, - -0.0002356162023f, - -0.0002106603742f, - -0.0001837536163f, - -0.0001550948484f, - -0.0001249008236f, - -0.0000934045545f, - -0.0000608535759f, - -0.0000275080565f, - 0.0000063612278f, - 0.0000404750427f, - 0.0000745479515f, - 0.0001082906593f, - 0.0001414124288f, - 0.0001736235455f, - 0.0002046378152f, - 0.0002341750699f, - 0.0002619636629f, - 0.0002877429300f, - 0.0003112655965f, - 0.0003323001063f, - 0.0003506328541f, - 0.0003660702983f, - 0.0003784409347f, - 0.0003875971118f, - 0.0003934166692f, - 0.0003958043827f, - 0.0003946931989f, - 0.0003900452468f, - 0.0003818526131f, - 0.0003701378703f, - 0.0003549543498f, - 0.0003363861529f, - 0.0003145478953f, - 0.0002895841828f, - 0.0002616688194f, - 0.0002310037485f, - 0.0001978177334f, - 0.0001623647845f, - 0.0001249223415f, - 0.0000857892233f, - 0.0000452833598f, - 0.0000037393217f, - -0.0000384943344f, - -0.0000810578837f, - -0.0001235833928f, - -0.0001656977983f, - -0.0002070260772f, - -0.0002471944859f, - -0.0002858338377f, - -0.0003225827932f, - -0.0003570911325f, - -0.0003890229831f, - -0.0004180599723f, - -0.0004439042760f, - -0.0004662815362f, - -0.0004849436183f, - -0.0004996711823f, - -0.0005102760424f, - -0.0005166032906f, - -0.0005185331617f, - -0.0005159826200f, - -0.0005089066484f, - -0.0004972992247f, - -0.0004811939705f, - -0.0004606644634f, - -0.0004358242025f, - -0.0004068262238f, - -0.0003738623613f, - -0.0003371621574f, - -0.0002969914239f, - -0.0002536504622f, - -0.0002074719536f, - -0.0001588185305f, - -0.0001080800484f, - -0.0000556705748f, - -0.0000020251190f, - 0.0000524038732f, - 0.0001071502323f, - 0.0001617379566f, - 0.0002156852502f, - 0.0002685086744f, - 0.0003197273785f, - 0.0003688673719f, - 0.0004154658029f, - 0.0004590752048f, - 0.0004992676723f, - 0.0005356389296f, - 0.0005678122527f, - 0.0005954422100f, - 0.0006182181836f, - 0.0006358676383f, - 0.0006481591046f, - 0.0006549048458f, - 0.0006559631794f, - 0.0006512404284f, - 0.0006406924783f, - 0.0006243259206f, - 0.0006021987666f, - 0.0005744207175f, - 0.0005411529820f, - 0.0005026076371f, - 0.0004590465283f, - 0.0004107797148f, - 0.0003581634636f, - 0.0003015978052f, - 0.0002415236649f, - 0.0001784195887f, - 0.0001127980870f, - 0.0000452016213f, - -0.0000238017346f, - -0.0000936229265f, - -0.0001636568079f, - -0.0002332872451f, - -0.0003018923975f, - -0.0003688501294f, - -0.0004335435059f, - -0.0004953663284f, - -0.0005537286580f, - -0.0006080622805f, - -0.0006578260616f, - -0.0007025111454f, - -0.0007416459455f, - -0.0007748008827f, - -0.0008015928239f, - -0.0008216891766f, - -0.0008348115993f, - -0.0008407392879f, - -0.0008393118036f, - -0.0008304314087f, - -0.0008140648836f, - -0.0007902448005f, - -0.0007590702339f, - -0.0007207068934f, - -0.0006753866683f, - -0.0006234065804f, - -0.0005651271432f, - -0.0005009701345f, - -0.0004314157931f, - -0.0003569994547f, - -0.0002783076491f, - -0.0001959736845f, - -0.0001106727507f, - -0.0000231165764f, - 0.0000659523175f, - 0.0001557667262f, - 0.0002455411796f, - 0.0003344786214f, - 0.0004217772924f, - 0.0005066377605f, - 0.0005882700376f, - 0.0006659007212f, - 0.0007387800990f, - 0.0008061891518f, - 0.0008674463921f, - 0.0009219144750f, - 0.0009690065202f, - 0.0010081920830f, - 0.0010390027190f, - 0.0010610370839f, - 0.0010739655188f, - 0.0010775340714f, - 0.0010715679088f, - 0.0010559740836f, - 0.0010307436170f, - 0.0009959528728f, - 0.0009517641963f, - 0.0008984258034f, - 0.0008362709091f, - 0.0007657160900f, - 0.0006872588853f, - 0.0006014746453f, - 0.0005090126426f, - 0.0004105914704f, - 0.0003069937573f, - 0.0001990602342f, - 0.0000876831956f, - -0.0000262005955f, - -0.0001416175057f, - -0.0002575650727f, - -0.0003730204271f, - -0.0004869490246f, - -0.0005983136178f, - -0.0007060833913f, - -0.0008092431831f, - -0.0009068027112f, - -0.0009978057260f, - -0.0010813390042f, - -0.0011565411061f, - -0.0012226108118f, - -0.0012788151601f, - -0.0013244970116f, - -0.0013590820627f, - -0.0013820852403f, - -0.0013931164108f, - -0.0013918853438f, - -0.0013782058733f, - -0.0013519992101f, - -0.0013132963596f, - -0.0012622396133f, - -0.0011990830835f, - -0.0011241922635f, - -0.0010380426004f, - -0.0009412170790f, - -0.0008344028202f, - -0.0007183867113f, - -0.0005940500874f, - -0.0004623624990f, - -0.0003243746032f, - -0.0001812102286f, - -0.0000340576689f, - 0.0001158397300f, - 0.0002671936193f, - 0.0004186812546f, - 0.0005689565779f, - 0.0007166616851f, - 0.0008604385851f, - 0.0009989411533f, - 0.0011308471768f, - 0.0012548703897f, - 0.0013697723925f, - 0.0014743743505f, - 0.0015675683649f, - 0.0016483284140f, - 0.0017157207613f, - 0.0017689137313f, - 0.0018071867586f, - 0.0018299386199f, - 0.0018366947630f, - 0.0018271136566f, - 0.0018009920869f, - 0.0017582693411f, - 0.0016990302210f, - 0.0016235068417f, - 0.0015320791808f, - 0.0014252743518f, - 0.0013037645862f, - 0.0011683639225f, - 0.0010200236060f, - 0.0008598262202f, - 0.0006889785773f, - 0.0005088034091f, - 0.0003207299089f, - 0.0001262831873f, - -0.0000729272881f, - -0.0002752201843f, - -0.0004788556370f, - -0.0006820493265f, - -0.0008829871871f, - -0.0010798406364f, - -0.0012707822026f, - -0.0014540014231f, - -0.0016277208850f, - -0.0017902122715f, - -0.0019398122798f, - -0.0020749382716f, - -0.0021941035199f, - -0.0022959319149f, - -0.0023791719963f, - -0.0024427101804f, - -0.0024855830567f, - -0.0025069886346f, - -0.0025062964261f, - -0.0024830562593f, - -0.0024370057269f, - -0.0023680761826f, - -0.0022763972095f, - -0.0021622994954f, - -0.0020263160645f, - -0.0018691818234f, - -0.0016918313969f, - -0.0014953952408f, - -0.0012811940314f, - -0.0010507313508f, - -0.0008056846932f, - -0.0005478948409f, - -0.0002793536645f, - -0.0000021904215f, - 0.0002813433620f, - 0.0005688903286f, - 0.0008580049348f, - 0.0011461721821f, - 0.0014308273011f, - 0.0017093762462f, - 0.0019792168491f, - 0.0022377604712f, - 0.0024824539913f, - 0.0027108019552f, - 0.0029203887137f, - 0.0031089003710f, - 0.0032741463650f, - 0.0034140805006f, - 0.0035268212589f, - 0.0036106712088f, - 0.0036641353518f, - 0.0036859382353f, - 0.0036750396796f, - 0.0036306489697f, - 0.0035522373756f, - 0.0034395488724f, - 0.0032926089480f, - 0.0031117313961f, - 0.0028975230072f, - 0.0026508860881f, - 0.0023730187510f, - 0.0020654129361f, - 0.0017298501434f, - 0.0013683948695f, - 0.0009833857623f, - 0.0005774245247f, - 0.0001533626145f, - -0.0002857141922f, - -0.0007365032920f, - -0.0011955046994f, - -0.0016590423288f, - -0.0021232869835f, - -0.0025842809035f, - -0.0030379637136f, - -0.0034801995974f, - -0.0039068055144f, - -0.0043135802655f, - -0.0046963342035f, - -0.0050509193789f, - -0.0053732599050f, - -0.0056593823215f, - -0.0059054457343f, - -0.0061077715081f, - -0.0062628722893f, - -0.0063674801377f, - -0.0064185735538f, - -0.0064134031881f, - -0.0063495160337f, - -0.0062247779062f, - -0.0060373940293f, - -0.0057859275562f, - -0.0054693158688f, - -0.0050868845136f, - -0.0046383586475f, - -0.0041238718858f, - -0.0035439724591f, - -0.0028996266103f, - -0.0021922191758f, - -0.0014235513217f, - -0.0005958354197f, - 0.0002883129257f, - 0.0012258856715f, - 0.0022134959000f, - 0.0032473940837f, - 0.0043234869591f, - 0.0054373588997f, - 0.0065842956603f, - 0.0077593103446f, - 0.0089571714337f, - 0.0101724326945f, - 0.0113994647757f, - 0.0126324882830f, - 0.0138656081140f, - 0.0150928488250f, - 0.0163081907913f, - 0.0175056069151f, - 0.0186790996341f, - 0.0198227379747f, - 0.0209306943985f, - 0.0219972811850f, - 0.0230169861023f, - 0.0239845071163f, - 0.0248947858968f, - 0.0257430398889f, - 0.0265247927237f, - 0.0272359027557f, - 0.0278725895284f, - 0.0284314579800f, - 0.0289095202198f, - 0.0293042147231f, - 0.0296134228075f, - 0.0298354822751f, - 0.0299691981248f, - 0.0300138502580f, - 0.0299691981248f, - 0.0298354822751f, - 0.0296134228075f, - 0.0293042147231f, - 0.0289095202198f, - 0.0284314579800f, - 0.0278725895284f, - 0.0272359027557f, - 0.0265247927237f, - 0.0257430398889f, - 0.0248947858968f, - 0.0239845071163f, - 0.0230169861023f, - 0.0219972811850f, - 0.0209306943985f, - 0.0198227379747f, - 0.0186790996341f, - 0.0175056069151f, - 0.0163081907913f, - 0.0150928488250f, - 0.0138656081140f, - 0.0126324882830f, - 0.0113994647757f, - 0.0101724326945f, - 0.0089571714337f, - 0.0077593103446f, - 0.0065842956603f, - 0.0054373588997f, - 0.0043234869591f, - 0.0032473940837f, - 0.0022134959000f, - 0.0012258856715f, - 0.0002883129257f, - -0.0005958354197f, - -0.0014235513217f, - -0.0021922191758f, - -0.0028996266103f, - -0.0035439724591f, - -0.0041238718858f, - -0.0046383586475f, - -0.0050868845136f, - -0.0054693158688f, - -0.0057859275562f, - -0.0060373940293f, - -0.0062247779062f, - -0.0063495160337f, - -0.0064134031881f, - -0.0064185735538f, - -0.0063674801377f, - -0.0062628722893f, - -0.0061077715081f, - -0.0059054457343f, - -0.0056593823215f, - -0.0053732599050f, - -0.0050509193789f, - -0.0046963342035f, - -0.0043135802655f, - -0.0039068055144f, - -0.0034801995974f, - -0.0030379637136f, - -0.0025842809035f, - -0.0021232869835f, - -0.0016590423288f, - -0.0011955046994f, - -0.0007365032920f, - -0.0002857141922f, - 0.0001533626145f, - 0.0005774245247f, - 0.0009833857623f, - 0.0013683948695f, - 0.0017298501434f, - 0.0020654129361f, - 0.0023730187510f, - 0.0026508860881f, - 0.0028975230072f, - 0.0031117313961f, - 0.0032926089480f, - 0.0034395488724f, - 0.0035522373756f, - 0.0036306489697f, - 0.0036750396796f, - 0.0036859382353f, - 0.0036641353518f, - 0.0036106712088f, - 0.0035268212589f, - 0.0034140805006f, - 0.0032741463650f, - 0.0031089003710f, - 0.0029203887137f, - 0.0027108019552f, - 0.0024824539913f, - 0.0022377604712f, - 0.0019792168491f, - 0.0017093762462f, - 0.0014308273011f, - 0.0011461721821f, - 0.0008580049348f, - 0.0005688903286f, - 0.0002813433620f, - -0.0000021904215f, - -0.0002793536645f, - -0.0005478948409f, - -0.0008056846932f, - -0.0010507313508f, - -0.0012811940314f, - -0.0014953952408f, - -0.0016918313969f, - -0.0018691818234f, - -0.0020263160645f, - -0.0021622994954f, - -0.0022763972095f, - -0.0023680761826f, - -0.0024370057269f, - -0.0024830562593f, - -0.0025062964261f, - -0.0025069886346f, - -0.0024855830567f, - -0.0024427101804f, - -0.0023791719963f, - -0.0022959319149f, - -0.0021941035199f, - -0.0020749382716f, - -0.0019398122798f, - -0.0017902122715f, - -0.0016277208850f, - -0.0014540014231f, - -0.0012707822026f, - -0.0010798406364f, - -0.0008829871871f, - -0.0006820493265f, - -0.0004788556370f, - -0.0002752201843f, - -0.0000729272881f, - 0.0001262831873f, - 0.0003207299089f, - 0.0005088034091f, - 0.0006889785773f, - 0.0008598262202f, - 0.0010200236060f, - 0.0011683639225f, - 0.0013037645862f, - 0.0014252743518f, - 0.0015320791808f, - 0.0016235068417f, - 0.0016990302210f, - 0.0017582693411f, - 0.0018009920869f, - 0.0018271136566f, - 0.0018366947630f, - 0.0018299386199f, - 0.0018071867586f, - 0.0017689137313f, - 0.0017157207613f, - 0.0016483284140f, - 0.0015675683649f, - 0.0014743743505f, - 0.0013697723925f, - 0.0012548703897f, - 0.0011308471768f, - 0.0009989411533f, - 0.0008604385851f, - 0.0007166616851f, - 0.0005689565779f, - 0.0004186812546f, - 0.0002671936193f, - 0.0001158397300f, - -0.0000340576689f, - -0.0001812102286f, - -0.0003243746032f, - -0.0004623624990f, - -0.0005940500874f, - -0.0007183867113f, - -0.0008344028202f, - -0.0009412170790f, - -0.0010380426004f, - -0.0011241922635f, - -0.0011990830835f, - -0.0012622396133f, - -0.0013132963596f, - -0.0013519992101f, - -0.0013782058733f, - -0.0013918853438f, - -0.0013931164108f, - -0.0013820852403f, - -0.0013590820627f, - -0.0013244970116f, - -0.0012788151601f, - -0.0012226108118f, - -0.0011565411061f, - -0.0010813390042f, - -0.0009978057260f, - -0.0009068027112f, - -0.0008092431831f, - -0.0007060833913f, - -0.0005983136178f, - -0.0004869490246f, - -0.0003730204271f, - -0.0002575650727f, - -0.0001416175057f, - -0.0000262005955f, - 0.0000876831956f, - 0.0001990602342f, - 0.0003069937573f, - 0.0004105914704f, - 0.0005090126426f, - 0.0006014746453f, - 0.0006872588853f, - 0.0007657160900f, - 0.0008362709091f, - 0.0008984258034f, - 0.0009517641963f, - 0.0009959528728f, - 0.0010307436170f, - 0.0010559740836f, - 0.0010715679088f, - 0.0010775340714f, - 0.0010739655188f, - 0.0010610370839f, - 0.0010390027190f, - 0.0010081920830f, - 0.0009690065202f, - 0.0009219144750f, - 0.0008674463921f, - 0.0008061891518f, - 0.0007387800990f, - 0.0006659007212f, - 0.0005882700376f, - 0.0005066377605f, - 0.0004217772924f, - 0.0003344786214f, - 0.0002455411796f, - 0.0001557667262f, - 0.0000659523175f, - -0.0000231165764f, - -0.0001106727507f, - -0.0001959736845f, - -0.0002783076491f, - -0.0003569994547f, - -0.0004314157931f, - -0.0005009701345f, - -0.0005651271432f, - -0.0006234065804f, - -0.0006753866683f, - -0.0007207068934f, - -0.0007590702339f, - -0.0007902448005f, - -0.0008140648836f, - -0.0008304314087f, - -0.0008393118036f, - -0.0008407392879f, - -0.0008348115993f, - -0.0008216891766f, - -0.0008015928239f, - -0.0007748008827f, - -0.0007416459455f, - -0.0007025111454f, - -0.0006578260616f, - -0.0006080622805f, - -0.0005537286580f, - -0.0004953663284f, - -0.0004335435059f, - -0.0003688501294f, - -0.0003018923975f, - -0.0002332872451f, - -0.0001636568079f, - -0.0000936229265f, - -0.0000238017346f, - 0.0000452016213f, - 0.0001127980870f, - 0.0001784195887f, - 0.0002415236649f, - 0.0003015978052f, - 0.0003581634636f, - 0.0004107797148f, - 0.0004590465283f, - 0.0005026076371f, - 0.0005411529820f, - 0.0005744207175f, - 0.0006021987666f, - 0.0006243259206f, - 0.0006406924783f, - 0.0006512404284f, - 0.0006559631794f, - 0.0006549048458f, - 0.0006481591046f, - 0.0006358676383f, - 0.0006182181836f, - 0.0005954422100f, - 0.0005678122527f, - 0.0005356389296f, - 0.0004992676723f, - 0.0004590752048f, - 0.0004154658029f, - 0.0003688673719f, - 0.0003197273785f, - 0.0002685086744f, - 0.0002156852502f, - 0.0001617379566f, - 0.0001071502323f, - 0.0000524038732f, - -0.0000020251190f, - -0.0000556705748f, - -0.0001080800484f, - -0.0001588185305f, - -0.0002074719536f, - -0.0002536504622f, - -0.0002969914239f, - -0.0003371621574f, - -0.0003738623613f, - -0.0004068262238f, - -0.0004358242025f, - -0.0004606644634f, - -0.0004811939705f, - -0.0004972992247f, - -0.0005089066484f, - -0.0005159826200f, - -0.0005185331617f, - -0.0005166032906f, - -0.0005102760424f, - -0.0004996711823f, - -0.0004849436183f, - -0.0004662815362f, - -0.0004439042760f, - -0.0004180599723f, - -0.0003890229831f, - -0.0003570911325f, - -0.0003225827932f, - -0.0002858338377f, - -0.0002471944859f, - -0.0002070260772f, - -0.0001656977983f, - -0.0001235833928f, - -0.0000810578837f, - -0.0000384943344f, - 0.0000037393217f, - 0.0000452833598f, - 0.0000857892233f, - 0.0001249223415f, - 0.0001623647845f, - 0.0001978177334f, - 0.0002310037485f, - 0.0002616688194f, - 0.0002895841828f, - 0.0003145478953f, - 0.0003363861529f, - 0.0003549543498f, - 0.0003701378703f, - 0.0003818526131f, - 0.0003900452468f, - 0.0003946931989f, - 0.0003958043827f, - 0.0003934166692f, - 0.0003875971118f, - 0.0003784409347f, - 0.0003660702983f, - 0.0003506328541f, - 0.0003323001063f, - 0.0003112655965f, - 0.0002877429300f, - 0.0002619636629f, - 0.0002341750699f, - 0.0002046378152f, - 0.0001736235455f, - 0.0001414124288f, - 0.0001082906593f, - 0.0000745479515f, - 0.0000404750427f, - 0.0000063612278f, - -0.0000275080565f, - -0.0000608535759f, - -0.0000934045545f, - -0.0001249008236f, - -0.0001550948484f, - -0.0001837536163f, - -0.0002106603742f, - -0.0002356162023f, - -0.0002584414148f, - -0.0002789767769f, - -0.0002970845330f, - -0.0003126492400f, - -0.0003255784014f, - -0.0003358029014f, - -0.0003432772379f, - -0.0003479795568f, - -0.0003499114897f, - -0.0003490978007f, - -0.0003455858480f, - -0.0003394448683f, - -0.0003307650922f, - -0.0003196567027f, - -0.0003062486452f, - -0.0002906873051f, - -0.0002731350628f, - -0.0002537687424f, - -0.0002327779678f, - -0.0002103634419f, - -0.0001867351629f, - -0.0001621105962f, - -0.0001367128149f, - -0.0001107686256f, - -0.0000845066962f, - -0.0000581556992f, - -0.0000319424858f, - -0.0000060903059f, - 0.0000191829133f, - 0.0000436662173f, - 0.0000671571903f, - 0.0000894634263f, - 0.0001104038960f, - 0.0001298101992f, - 0.0001475276961f, - 0.0001634165101f, - 0.0001773523961f, - 0.0001892274713f, - 0.0001989508042f, - 0.0002064488603f, - 0.0002116658040f, - 0.0002145636574f, - 0.0002151223160f, - 0.0002133394270f, - 0.0002092301313f, - 0.0002028266752f, - 0.0001941778982f, - 0.0001833486017f, - 0.0001704188086f, - 0.0001554829191f, - 0.0001386487747f, - 0.0001200366365f, - 0.0000997780906f, - 0.0000780148883f, - 0.0000548977338f, - 0.0000305850284f, - 0.0000052415821f, - -0.0000209626947f, - -0.0000478541121f, - -0.0000752565205f, - -0.0001029926207f, - -0.0001308852545f, - -0.0001587586656f, - -0.0001864397218f, - -0.0002137590910f, - -0.0002405523614f, - -0.0002666611005f, - -0.0002919338447f, - -0.0003162270149f, - -0.0003394057517f, - -0.0003613446675f, - -0.0003819285099f, - -0.0004010527353f, - -0.0004186239903f, - -0.0004345604987f, - -0.0004487923547f, - -0.0004612617230f, - -0.0004719229454f, - -0.0004807425563f, - -0.0004876992105f, - -0.0004927835248f, - -0.0004959978377f, - -0.0004973558920f, - -0.0004968824437f, - -0.0004946128030f, - -0.0004905923132f, - -0.0004848757728f, - -0.0004775268066f, - -0.0004686171928f, - -0.0004582261523f, - -0.0004464396065f, - -0.0004333494098f, - -0.0004190525651f, - -0.0004036504263f, - -0.0003872478959f, - -0.0003699526238f, - -0.0003518742125f, - -0.0003331234349f, - -0.0003138114702f, - -0.0002940491630f, - -0.0002739463104f, - -0.0002536109811f, - -0.0002331488711f, - -0.0002126626991f, - -0.0001922516448f, - -0.0001720108329f, - -0.0001520308649f, - -0.0001323974004f, - -0.0001131907895f, - -0.0000944857564f, - -0.0000763511359f, - -0.0000588496612f, - -0.0000420378042f, - -0.0000259656655f, - -0.0000106769153f, - 0.0000037912184f, - 0.0000174079151f, - 0.0000301486828f, - 0.0000419952383f, - 0.0000529353467f, - 0.0000629626269f, - 0.0000720763221f, - 0.0000802810417f, - 0.0000875864757f, - 0.0000940070861f, - 0.0000995617786f, - 0.0001042735572f, - 0.0001081691663f, - 0.0001112787225f, - 0.0001136353405f, - 0.0001152747551f, - 0.0001162349436f, - 0.0001165557502f, - 0.0001162785168f, - 0.0001154457210f, - 0.0001141006252f, - 0.0001122869384f, - 0.0001100484926f, - 0.0001074289359f, - 0.0001044714435f, - 0.0001012184487f, - 0.0000977113936f, - 0.0000939905024f, - 0.0000900945758f, - 0.0000860608088f, - 0.0000819246310f, - 0.0000777195696f, - 0.0000734771355f, - 0.0000692267316f, - 0.0000649955829f, - 0.0000608086879f, - 0.0000566887903f, - 0.0000526563699f, - 0.0000487296525f, - 0.0000449246363f, - 0.0000412551345f, - 0.0000377328326f, - 0.0000343673588f, - 0.0000311663665f, - 0.0000281356268f, - 0.0000252791303f, - 0.0000225991964f, - 0.0000200965883f, - 0.0000177706336f, - 0.0000156193469f, - 0.0000136395560f, - 0.0000118270277f, - 0.0000101765938f, - 0.0000086822757f, - 0.0000073374059f, - 0.0000061347473f, - 0.0000050666069f, - 0.0000041249453f, - 0.0000033014804f, - 0.0000064425788f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_32_4.h b/core/src/dsp/firdec/taps/fir_32_4.h deleted file mode 100644 index f593a95..0000000 --- a/core/src/dsp/firdec/taps/fir_32_4.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_32_4_len = 17; - const float fir_32_4_taps[] = { - 0.0002602343386f, - 0.0019197560804f, - 0.0076270554566f, - 0.0212647832351f, - 0.0459374309886f, - 0.0808345515056f, - 0.1191594258092f, - 0.1495554802033f, - 0.1611781123721f, - 0.1495554802033f, - 0.1191594258092f, - 0.0808345515056f, - 0.0459374309886f, - 0.0212647832351f, - 0.0076270554566f, - 0.0019197560804f, - 0.0002602343386f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_32_8.h b/core/src/dsp/firdec/taps/fir_32_8.h deleted file mode 100644 index b9fcd79..0000000 --- a/core/src/dsp/firdec/taps/fir_32_8.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_32_8_len = 45; - const float fir_32_8_taps[] = { - -0.0000309582228f, - -0.0001079580167f, - -0.0002728448293f, - -0.0005651806741f, - -0.0010146553103f, - -0.0016201042973f, - -0.0023253502129f, - -0.0029961993139f, - -0.0034054389929f, - -0.0032331082459f, - -0.0020878393215f, - 0.0004484139474f, - 0.0047549865150f, - 0.0110947837587f, - 0.0195373899494f, - 0.0298988087157f, - 0.0417130694495f, - 0.0542467727184f, - 0.0665603957204f, - 0.0776111715593f, - 0.0863835049898f, - 0.0920262381310f, - 0.0939733024676f, - 0.0920262381310f, - 0.0863835049898f, - 0.0776111715593f, - 0.0665603957204f, - 0.0542467727184f, - 0.0417130694495f, - 0.0298988087157f, - 0.0195373899494f, - 0.0110947837587f, - 0.0047549865150f, - 0.0004484139474f, - -0.0020878393215f, - -0.0032331082459f, - -0.0034054389929f, - -0.0029961993139f, - -0.0023253502129f, - -0.0016201042973f, - -0.0010146553103f, - -0.0005651806741f, - -0.0002728448293f, - -0.0001079580167f, - -0.0000309582228f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_4096_128.h b/core/src/dsp/firdec/taps/fir_4096_128.h deleted file mode 100644 index 3ee393f..0000000 --- a/core/src/dsp/firdec/taps/fir_4096_128.h +++ /dev/null @@ -1,701 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_4096_128_len = 687; - const float fir_4096_128_taps[] = { - -0.0000001853079f, - -0.0000000346264f, - -0.0000000376411f, - -0.0000000406683f, - -0.0000000436847f, - -0.0000000466640f, - -0.0000000495767f, - -0.0000000523896f, - -0.0000000550661f, - -0.0000000575654f, - -0.0000000598428f, - -0.0000000618489f, - -0.0000000635299f, - -0.0000000648269f, - -0.0000000656757f, - -0.0000000660068f, - -0.0000000657448f, - -0.0000000648081f, - -0.0000000631089f, - -0.0000000605524f, - -0.0000000570369f, - -0.0000000524531f, - -0.0000000466841f, - -0.0000000396046f, - -0.0000000310810f, - -0.0000000209706f, - -0.0000000091215f, - 0.0000000046280f, - 0.0000000204496f, - 0.0000000385257f, - 0.0000000590497f, - 0.0000000822264f, - 0.0000001082725f, - 0.0000001374170f, - 0.0000001699018f, - 0.0000002059821f, - 0.0000002459268f, - 0.0000002900194f, - 0.0000003385579f, - 0.0000003918557f, - 0.0000004502420f, - 0.0000005140626f, - 0.0000005836800f, - 0.0000006594741f, - 0.0000007418430f, - 0.0000008312033f, - 0.0000009279907f, - 0.0000010326607f, - 0.0000011456888f, - 0.0000012675717f, - 0.0000013988273f, - 0.0000015399957f, - 0.0000016916395f, - 0.0000018543446f, - 0.0000020287205f, - 0.0000022154015f, - 0.0000024150466f, - 0.0000026283404f, - 0.0000028559940f, - 0.0000030987450f, - 0.0000033573588f, - 0.0000036326283f, - 0.0000039253756f, - 0.0000042364515f, - 0.0000045667370f, - 0.0000049171433f, - 0.0000052886125f, - 0.0000056821186f, - 0.0000060986673f, - 0.0000065392974f, - 0.0000070050805f, - 0.0000074971223f, - 0.0000080165629f, - 0.0000085645769f, - 0.0000091423747f, - 0.0000097512023f, - 0.0000103923421f, - 0.0000110671135f, - 0.0000117768730f, - 0.0000125230151f, - 0.0000133069722f, - 0.0000141302156f, - 0.0000149942554f, - 0.0000159006412f, - 0.0000168509623f, - 0.0000178468480f, - 0.0000188899682f, - 0.0000199820332f, - 0.0000211247945f, - 0.0000223200446f, - 0.0000235696176f, - 0.0000248753891f, - 0.0000262392764f, - 0.0000276632389f, - 0.0000291492778f, - 0.0000306994366f, - 0.0000323158008f, - 0.0000340004981f, - 0.0000357556983f, - 0.0000375836134f, - 0.0000394864972f, - 0.0000414666457f, - 0.0000435263962f, - 0.0000456681279f, - 0.0000478942611f, - 0.0000502072572f, - 0.0000526096182f, - 0.0000551038867f, - 0.0000576926449f, - 0.0000603785150f, - 0.0000631641580f, - 0.0000660522733f, - 0.0000690455987f, - 0.0000721469091f, - 0.0000753590162f, - 0.0000786847678f, - 0.0000821270469f, - 0.0000856887711f, - 0.0000893728917f, - 0.0000931823927f, - 0.0000971202902f, - 0.0001011896310f, - 0.0001053934918f, - 0.0001097349782f, - 0.0001142172235f, - 0.0001188433875f, - 0.0001236166552f, - 0.0001285402359f, - 0.0001336173613f, - 0.0001388512848f, - 0.0001442452795f, - 0.0001498026371f, - 0.0001555266664f, - 0.0001614206914f, - 0.0001674880501f, - 0.0001737320925f, - 0.0001801561792f, - 0.0001867636795f, - 0.0001935579694f, - 0.0002005424304f, - 0.0002077204468f, - 0.0002150954042f, - 0.0002226706877f, - 0.0002304496792f, - 0.0002384357564f, - 0.0002466322894f, - 0.0002550426396f, - 0.0002636701572f, - 0.0002725181784f, - 0.0002815900242f, - 0.0002908889972f, - 0.0003004183794f, - 0.0003101814303f, - 0.0003201813839f, - 0.0003304214468f, - 0.0003409047951f, - 0.0003516345723f, - 0.0003626138868f, - 0.0003738458092f, - 0.0003853333694f, - 0.0003970795547f, - 0.0004090873065f, - 0.0004213595178f, - 0.0004338990308f, - 0.0004467086339f, - 0.0004597910591f, - 0.0004731489791f, - 0.0004867850049f, - 0.0005007016827f, - 0.0005149014913f, - 0.0005293868393f, - 0.0005441600623f, - 0.0005592234204f, - 0.0005745790947f, - 0.0005902291855f, - 0.0006061757086f, - 0.0006224205933f, - 0.0006389656791f, - 0.0006558127133f, - 0.0006729633479f, - 0.0006904191373f, - 0.0007081815354f, - 0.0007262518929f, - 0.0007446314546f, - 0.0007633213568f, - 0.0007823226250f, - 0.0008016361709f, - 0.0008212627897f, - 0.0008412031585f, - 0.0008614578327f, - 0.0008820272443f, - 0.0009029116994f, - 0.0009241113755f, - 0.0009456263198f, - 0.0009674564462f, - 0.0009896015337f, - 0.0010120612242f, - 0.0010348350198f, - 0.0010579222817f, - 0.0010813222275f, - 0.0011050339296f, - 0.0011290563132f, - 0.0011533881548f, - 0.0011780280801f, - 0.0012029745628f, - 0.0012282259227f, - 0.0012537803242f, - 0.0012796357754f, - 0.0013057901260f, - 0.0013322410668f, - 0.0013589861279f, - 0.0013860226783f, - 0.0014133479243f, - 0.0014409589089f, - 0.0014688525111f, - 0.0014970254450f, - 0.0015254742592f, - 0.0015541953364f, - 0.0015831848930f, - 0.0016124389787f, - 0.0016419534764f, - 0.0016717241017f, - 0.0017017464036f, - 0.0017320157641f, - 0.0017625273983f, - 0.0017932763553f, - 0.0018242575180f, - 0.0018554656041f, - 0.0018868951663f, - 0.0019185405936f, - 0.0019503961118f, - 0.0019824557844f, - 0.0020147135141f, - 0.0020471630437f, - 0.0020797979574f, - 0.0021126116823f, - 0.0021455974903f, - 0.0021787484991f, - 0.0022120576745f, - 0.0022455178321f, - 0.0022791216394f, - 0.0023128616177f, - 0.0023467301445f, - 0.0023807194560f, - 0.0024148216493f, - 0.0024490286850f, - 0.0024833323899f, - 0.0025177244601f, - 0.0025521964633f, - 0.0025867398422f, - 0.0026213459177f, - 0.0026560058918f, - 0.0026907108512f, - 0.0027254517703f, - 0.0027602195153f, - 0.0027950048475f, - 0.0028297984269f, - 0.0028645908163f, - 0.0028993724850f, - 0.0029341338127f, - 0.0029688650939f, - 0.0030035565421f, - 0.0030381982934f, - 0.0030727804117f, - 0.0031072928924f, - 0.0031417256676f, - 0.0031760686099f, - 0.0032103115375f, - 0.0032444442190f, - 0.0032784563779f, - 0.0033123376974f, - 0.0033460778257f, - 0.0033796663804f, - 0.0034130929541f, - 0.0034463471189f, - 0.0034794184319f, - 0.0035122964401f, - 0.0035449706860f, - 0.0035774307122f, - 0.0036096660671f, - 0.0036416663102f, - 0.0036734210173f, - 0.0037049197858f, - 0.0037361522402f, - 0.0037671080372f, - 0.0037977768717f, - 0.0038281484815f, - 0.0038582126530f, - 0.0038879592268f, - 0.0039173781029f, - 0.0039464592460f, - 0.0039751926911f, - 0.0040035685488f, - 0.0040315770105f, - 0.0040592083542f, - 0.0040864529492f, - 0.0041133012618f, - 0.0041397438603f, - 0.0041657714205f, - 0.0041913747306f, - 0.0042165446965f, - 0.0042412723466f, - 0.0042655488373f, - 0.0042893654574f, - 0.0043127136335f, - 0.0043355849347f, - 0.0043579710770f, - 0.0043798639286f, - 0.0044012555142f, - 0.0044221380197f, - 0.0044425037963f, - 0.0044623453655f, - 0.0044816554230f, - 0.0045004268430f, - 0.0045186526821f, - 0.0045363261840f, - 0.0045534407824f, - 0.0045699901059f, - 0.0045859679809f, - 0.0046013684356f, - 0.0046161857032f, - 0.0046304142258f, - 0.0046440486570f, - 0.0046570838656f, - 0.0046695149383f, - 0.0046813371826f, - 0.0046925461296f, - 0.0047031375370f, - 0.0047131073910f, - 0.0047224519091f, - 0.0047311675420f, - 0.0047392509762f, - 0.0047466991355f, - 0.0047535091831f, - 0.0047596785231f, - 0.0047652048022f, - 0.0047700859110f, - 0.0047743199853f, - 0.0047779054073f, - 0.0047808408063f, - 0.0047831250597f, - 0.0047847572939f, - 0.0047857368844f, - 0.0047860634562f, - 0.0047857368844f, - 0.0047847572939f, - 0.0047831250597f, - 0.0047808408063f, - 0.0047779054073f, - 0.0047743199853f, - 0.0047700859110f, - 0.0047652048022f, - 0.0047596785231f, - 0.0047535091831f, - 0.0047466991355f, - 0.0047392509762f, - 0.0047311675420f, - 0.0047224519091f, - 0.0047131073910f, - 0.0047031375370f, - 0.0046925461296f, - 0.0046813371826f, - 0.0046695149383f, - 0.0046570838656f, - 0.0046440486570f, - 0.0046304142258f, - 0.0046161857032f, - 0.0046013684356f, - 0.0045859679809f, - 0.0045699901059f, - 0.0045534407824f, - 0.0045363261840f, - 0.0045186526821f, - 0.0045004268430f, - 0.0044816554230f, - 0.0044623453655f, - 0.0044425037963f, - 0.0044221380197f, - 0.0044012555142f, - 0.0043798639286f, - 0.0043579710770f, - 0.0043355849347f, - 0.0043127136335f, - 0.0042893654574f, - 0.0042655488373f, - 0.0042412723466f, - 0.0042165446965f, - 0.0041913747306f, - 0.0041657714205f, - 0.0041397438603f, - 0.0041133012618f, - 0.0040864529492f, - 0.0040592083542f, - 0.0040315770105f, - 0.0040035685488f, - 0.0039751926911f, - 0.0039464592460f, - 0.0039173781029f, - 0.0038879592268f, - 0.0038582126530f, - 0.0038281484815f, - 0.0037977768717f, - 0.0037671080372f, - 0.0037361522402f, - 0.0037049197858f, - 0.0036734210173f, - 0.0036416663102f, - 0.0036096660671f, - 0.0035774307122f, - 0.0035449706860f, - 0.0035122964401f, - 0.0034794184319f, - 0.0034463471189f, - 0.0034130929541f, - 0.0033796663804f, - 0.0033460778257f, - 0.0033123376974f, - 0.0032784563779f, - 0.0032444442190f, - 0.0032103115375f, - 0.0031760686099f, - 0.0031417256676f, - 0.0031072928924f, - 0.0030727804117f, - 0.0030381982934f, - 0.0030035565421f, - 0.0029688650939f, - 0.0029341338127f, - 0.0028993724850f, - 0.0028645908163f, - 0.0028297984269f, - 0.0027950048475f, - 0.0027602195153f, - 0.0027254517703f, - 0.0026907108512f, - 0.0026560058918f, - 0.0026213459177f, - 0.0025867398422f, - 0.0025521964633f, - 0.0025177244601f, - 0.0024833323899f, - 0.0024490286850f, - 0.0024148216493f, - 0.0023807194560f, - 0.0023467301445f, - 0.0023128616177f, - 0.0022791216394f, - 0.0022455178321f, - 0.0022120576745f, - 0.0021787484991f, - 0.0021455974903f, - 0.0021126116823f, - 0.0020797979574f, - 0.0020471630437f, - 0.0020147135141f, - 0.0019824557844f, - 0.0019503961118f, - 0.0019185405936f, - 0.0018868951663f, - 0.0018554656041f, - 0.0018242575180f, - 0.0017932763553f, - 0.0017625273983f, - 0.0017320157641f, - 0.0017017464036f, - 0.0016717241017f, - 0.0016419534764f, - 0.0016124389787f, - 0.0015831848930f, - 0.0015541953364f, - 0.0015254742592f, - 0.0014970254450f, - 0.0014688525111f, - 0.0014409589089f, - 0.0014133479243f, - 0.0013860226783f, - 0.0013589861279f, - 0.0013322410668f, - 0.0013057901260f, - 0.0012796357754f, - 0.0012537803242f, - 0.0012282259227f, - 0.0012029745628f, - 0.0011780280801f, - 0.0011533881548f, - 0.0011290563132f, - 0.0011050339296f, - 0.0010813222275f, - 0.0010579222817f, - 0.0010348350198f, - 0.0010120612242f, - 0.0009896015337f, - 0.0009674564462f, - 0.0009456263198f, - 0.0009241113755f, - 0.0009029116994f, - 0.0008820272443f, - 0.0008614578327f, - 0.0008412031585f, - 0.0008212627897f, - 0.0008016361709f, - 0.0007823226250f, - 0.0007633213568f, - 0.0007446314546f, - 0.0007262518929f, - 0.0007081815354f, - 0.0006904191373f, - 0.0006729633479f, - 0.0006558127133f, - 0.0006389656791f, - 0.0006224205933f, - 0.0006061757086f, - 0.0005902291855f, - 0.0005745790947f, - 0.0005592234204f, - 0.0005441600623f, - 0.0005293868393f, - 0.0005149014913f, - 0.0005007016827f, - 0.0004867850049f, - 0.0004731489791f, - 0.0004597910591f, - 0.0004467086339f, - 0.0004338990308f, - 0.0004213595178f, - 0.0004090873065f, - 0.0003970795547f, - 0.0003853333694f, - 0.0003738458092f, - 0.0003626138868f, - 0.0003516345723f, - 0.0003409047951f, - 0.0003304214468f, - 0.0003201813839f, - 0.0003101814303f, - 0.0003004183794f, - 0.0002908889972f, - 0.0002815900242f, - 0.0002725181784f, - 0.0002636701572f, - 0.0002550426396f, - 0.0002466322894f, - 0.0002384357564f, - 0.0002304496792f, - 0.0002226706877f, - 0.0002150954042f, - 0.0002077204468f, - 0.0002005424304f, - 0.0001935579694f, - 0.0001867636795f, - 0.0001801561792f, - 0.0001737320925f, - 0.0001674880501f, - 0.0001614206914f, - 0.0001555266664f, - 0.0001498026371f, - 0.0001442452795f, - 0.0001388512848f, - 0.0001336173613f, - 0.0001285402359f, - 0.0001236166552f, - 0.0001188433875f, - 0.0001142172235f, - 0.0001097349782f, - 0.0001053934918f, - 0.0001011896310f, - 0.0000971202902f, - 0.0000931823927f, - 0.0000893728917f, - 0.0000856887711f, - 0.0000821270469f, - 0.0000786847678f, - 0.0000753590162f, - 0.0000721469091f, - 0.0000690455987f, - 0.0000660522733f, - 0.0000631641580f, - 0.0000603785150f, - 0.0000576926449f, - 0.0000551038867f, - 0.0000526096182f, - 0.0000502072572f, - 0.0000478942611f, - 0.0000456681279f, - 0.0000435263962f, - 0.0000414666457f, - 0.0000394864972f, - 0.0000375836134f, - 0.0000357556983f, - 0.0000340004981f, - 0.0000323158008f, - 0.0000306994366f, - 0.0000291492778f, - 0.0000276632389f, - 0.0000262392764f, - 0.0000248753891f, - 0.0000235696176f, - 0.0000223200446f, - 0.0000211247945f, - 0.0000199820332f, - 0.0000188899682f, - 0.0000178468480f, - 0.0000168509623f, - 0.0000159006412f, - 0.0000149942554f, - 0.0000141302156f, - 0.0000133069722f, - 0.0000125230151f, - 0.0000117768730f, - 0.0000110671135f, - 0.0000103923421f, - 0.0000097512023f, - 0.0000091423747f, - 0.0000085645769f, - 0.0000080165629f, - 0.0000074971223f, - 0.0000070050805f, - 0.0000065392974f, - 0.0000060986673f, - 0.0000056821186f, - 0.0000052886125f, - 0.0000049171433f, - 0.0000045667370f, - 0.0000042364515f, - 0.0000039253756f, - 0.0000036326283f, - 0.0000033573588f, - 0.0000030987450f, - 0.0000028559940f, - 0.0000026283404f, - 0.0000024150466f, - 0.0000022154015f, - 0.0000020287205f, - 0.0000018543446f, - 0.0000016916395f, - 0.0000015399957f, - 0.0000013988273f, - 0.0000012675717f, - 0.0000011456888f, - 0.0000010326607f, - 0.0000009279907f, - 0.0000008312033f, - 0.0000007418430f, - 0.0000006594741f, - 0.0000005836800f, - 0.0000005140626f, - 0.0000004502420f, - 0.0000003918557f, - 0.0000003385579f, - 0.0000002900194f, - 0.0000002459268f, - 0.0000002059821f, - 0.0000001699018f, - 0.0000001374170f, - 0.0000001082725f, - 0.0000000822264f, - 0.0000000590497f, - 0.0000000385257f, - 0.0000000204496f, - 0.0000000046280f, - -0.0000000091215f, - -0.0000000209706f, - -0.0000000310810f, - -0.0000000396046f, - -0.0000000466841f, - -0.0000000524531f, - -0.0000000570369f, - -0.0000000605524f, - -0.0000000631089f, - -0.0000000648081f, - -0.0000000657448f, - -0.0000000660068f, - -0.0000000656757f, - -0.0000000648269f, - -0.0000000635299f, - -0.0000000618489f, - -0.0000000598428f, - -0.0000000575654f, - -0.0000000550661f, - -0.0000000523896f, - -0.0000000495767f, - -0.0000000466640f, - -0.0000000436847f, - -0.0000000406683f, - -0.0000000376411f, - -0.0000000346264f, - -0.0000001853079f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_4_2.h b/core/src/dsp/firdec/taps/fir_4_2.h deleted file mode 100644 index d1f2b6d..0000000 --- a/core/src/dsp/firdec/taps/fir_4_2.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_4_2_len = 15; - const float fir_4_2_taps[] = { - 0.0021282968604f, - 0.0076473554450f, - 0.0006460703751f, - -0.0368053147543f, - -0.0516552094180f, - 0.0659607033051f, - 0.2951835298658f, - 0.4189947458581f, - 0.2951835298658f, - 0.0659607033051f, - -0.0516552094180f, - -0.0368053147543f, - 0.0006460703751f, - 0.0076473554450f, - 0.0021282968604f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_4_4.h b/core/src/dsp/firdec/taps/fir_4_4.h deleted file mode 100644 index 684cde6..0000000 --- a/core/src/dsp/firdec/taps/fir_4_4.h +++ /dev/null @@ -1,153 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_4_4_len = 139; - const float fir_4_4_taps[] = { - 0.0000421670468f, - 0.0001624808733f, - 0.0004134748309f, - 0.0008154887363f, - 0.0013234848969f, - 0.0018039325195f, - 0.0020508055942f, - 0.0018514767578f, - 0.0010883586950f, - -0.0001655988021f, - -0.0016128396844f, - -0.0027991727988f, - -0.0032807371963f, - -0.0028309298807f, - -0.0015892963679f, - -0.0000601423367f, - 0.0010721577127f, - 0.0012520595571f, - 0.0003467812959f, - -0.0012334913120f, - -0.0026828654998f, - -0.0031783401077f, - -0.0023201194397f, - -0.0004020929064f, - 0.0016614376925f, - 0.0027617271233f, - 0.0021869815035f, - 0.0000713073547f, - -0.0025708936840f, - -0.0043015122742f, - -0.0040150945520f, - -0.0016068800323f, - 0.0018386741176f, - 0.0045100483540f, - 0.0048045475259f, - 0.0022668636218f, - -0.0020047039996f, - -0.0057855488980f, - -0.0068496560241f, - -0.0042397202795f, - 0.0010243185376f, - 0.0062751930360f, - 0.0085115122341f, - 0.0060706031243f, - -0.0002476114409f, - -0.0073175117999f, - -0.0111703368494f, - -0.0091526981761f, - -0.0016211575907f, - 0.0078514356977f, - 0.0140732387192f, - 0.0129726920823f, - 0.0040874732850f, - -0.0086349542834f, - -0.0184139640743f, - -0.0190500116861f, - -0.0085456264258f, - 0.0090399664680f, - 0.0247932831806f, - 0.0290341811985f, - 0.0165603631688f, - -0.0095223462745f, - -0.0375695624710f, - -0.0514111407319f, - -0.0372217902165f, - 0.0096794936561f, - 0.0812862136678f, - 0.1585522999585f, - 0.2179171693939f, - 0.2401648350457f, - 0.2179171693939f, - 0.1585522999585f, - 0.0812862136678f, - 0.0096794936561f, - -0.0372217902165f, - -0.0514111407319f, - -0.0375695624710f, - -0.0095223462745f, - 0.0165603631688f, - 0.0290341811985f, - 0.0247932831806f, - 0.0090399664680f, - -0.0085456264258f, - -0.0190500116861f, - -0.0184139640743f, - -0.0086349542834f, - 0.0040874732850f, - 0.0129726920823f, - 0.0140732387192f, - 0.0078514356977f, - -0.0016211575907f, - -0.0091526981761f, - -0.0111703368494f, - -0.0073175117999f, - -0.0002476114409f, - 0.0060706031243f, - 0.0085115122341f, - 0.0062751930360f, - 0.0010243185376f, - -0.0042397202795f, - -0.0068496560241f, - -0.0057855488980f, - -0.0020047039996f, - 0.0022668636218f, - 0.0048045475259f, - 0.0045100483540f, - 0.0018386741176f, - -0.0016068800323f, - -0.0040150945520f, - -0.0043015122742f, - -0.0025708936840f, - 0.0000713073547f, - 0.0021869815035f, - 0.0027617271233f, - 0.0016614376925f, - -0.0004020929064f, - -0.0023201194397f, - -0.0031783401077f, - -0.0026828654998f, - -0.0012334913120f, - 0.0003467812959f, - 0.0012520595571f, - 0.0010721577127f, - -0.0000601423367f, - -0.0015892963679f, - -0.0028309298807f, - -0.0032807371963f, - -0.0027991727988f, - -0.0016128396844f, - -0.0001655988021f, - 0.0010883586950f, - 0.0018514767578f, - 0.0020508055942f, - 0.0018039325195f, - 0.0013234848969f, - 0.0008154887363f, - 0.0004134748309f, - 0.0001624808733f, - 0.0000421670468f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_512_128.h b/core/src/dsp/firdec/taps/fir_512_128.h deleted file mode 100644 index 4a422ab..0000000 --- a/core/src/dsp/firdec/taps/fir_512_128.h +++ /dev/null @@ -1,725 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_512_128_len = 711; - const float fir_512_128_taps[] = { - -0.0000055896992f, - -0.0000013001543f, - -0.0000014502329f, - -0.0000016110215f, - -0.0000017829984f, - -0.0000019666521f, - -0.0000021624812f, - -0.0000023709942f, - -0.0000025927091f, - -0.0000028281532f, - -0.0000030778629f, - -0.0000033423834f, - -0.0000036222682f, - -0.0000039180789f, - -0.0000042303847f, - -0.0000045597620f, - -0.0000049067942f, - -0.0000052720710f, - -0.0000056561877f, - -0.0000060597452f, - -0.0000064833493f, - -0.0000069276099f, - -0.0000073931405f, - -0.0000078805577f, - -0.0000083904807f, - -0.0000089235302f, - -0.0000094803279f, - -0.0000100614958f, - -0.0000106676557f, - -0.0000112994278f, - -0.0000119574304f, - -0.0000126422788f, - -0.0000133545848f, - -0.0000140949552f, - -0.0000148639914f, - -0.0000156622882f, - -0.0000164904329f, - -0.0000173490044f, - -0.0000182385717f, - -0.0000191596936f, - -0.0000201129171f, - -0.0000210987761f, - -0.0000221177911f, - -0.0000231704670f, - -0.0000242572927f, - -0.0000253787397f, - -0.0000265352606f, - -0.0000277272881f, - -0.0000289552338f, - -0.0000302194865f, - -0.0000315204114f, - -0.0000328583485f, - -0.0000342336112f, - -0.0000356464850f, - -0.0000370972263f, - -0.0000385860605f, - -0.0000401131811f, - -0.0000416787480f, - -0.0000432828861f, - -0.0000449256839f, - -0.0000466071919f, - -0.0000483274213f, - -0.0000500863422f, - -0.0000518838825f, - -0.0000537199261f, - -0.0000555943117f, - -0.0000575068307f, - -0.0000594572265f, - -0.0000614451922f, - -0.0000634703697f, - -0.0000655323476f, - -0.0000676306604f, - -0.0000697647864f, - -0.0000719341464f, - -0.0000741381022f, - -0.0000763759553f, - -0.0000786469450f, - -0.0000809502475f, - -0.0000832849740f, - -0.0000856501695f, - -0.0000880448112f, - -0.0000904678075f, - -0.0000929179961f, - -0.0000953941432f, - -0.0000978949415f, - -0.0001004190099f, - -0.0001029648911f, - -0.0001055310512f, - -0.0001081158783f, - -0.0001107176810f, - -0.0001133346877f, - -0.0001159650452f, - -0.0001186068179f, - -0.0001212579865f, - -0.0001239164473f, - -0.0001265800111f, - -0.0001292464023f, - -0.0001319132583f, - -0.0001345781284f, - -0.0001372384734f, - -0.0001398916645f, - -0.0001425349833f, - -0.0001451656204f, - -0.0001477806759f, - -0.0001503771580f, - -0.0001529519831f, - -0.0001555019757f, - -0.0001580238676f, - -0.0001605142982f, - -0.0001629698139f, - -0.0001653868686f, - -0.0001677618232f, - -0.0001700909463f, - -0.0001723704138f, - -0.0001745963094f, - -0.0001767646249f, - -0.0001788712607f, - -0.0001809120262f, - -0.0001828826403f, - -0.0001847787321f, - -0.0001865958418f, - -0.0001883294212f, - -0.0001899748350f, - -0.0001915273613f, - -0.0001929821931f, - -0.0001943344392f, - -0.0001955791256f, - -0.0001967111968f, - -0.0001977255172f, - -0.0001986168726f, - -0.0001993799720f, - -0.0002000094489f, - -0.0002004998634f, - -0.0002008457042f, - -0.0002010413902f, - -0.0002010812729f, - -0.0002009596382f, - -0.0002006707090f, - -0.0002002086476f, - -0.0001995675575f, - -0.0001987414866f, - -0.0001977244297f, - -0.0001965103308f, - -0.0001950930862f, - -0.0001934665474f, - -0.0001916245241f, - -0.0001895607869f, - -0.0001872690707f, - -0.0001847430782f, - -0.0001819764827f, - -0.0001789629316f, - -0.0001756960501f, - -0.0001721694447f, - -0.0001683767065f, - -0.0001643114154f, - -0.0001599671433f, - -0.0001553374586f, - -0.0001504159297f, - -0.0001451961290f, - -0.0001396716370f, - -0.0001338360466f, - -0.0001276829672f, - -0.0001212060287f, - -0.0001143988861f, - -0.0001072552238f, - -0.0000997687600f, - -0.0000919332511f, - -0.0000837424964f, - -0.0000751903422f, - -0.0000662706872f, - -0.0000569774862f, - -0.0000473047557f, - -0.0000372465778f, - -0.0000267971056f, - -0.0000159505676f, - -0.0000047012723f, - 0.0000069563861f, - 0.0000190279240f, - 0.0000315187628f, - 0.0000444342241f, - 0.0000577795252f, - 0.0000715597739f, - 0.0000857799638f, - 0.0001004449692f, - 0.0001155595405f, - 0.0001311282992f, - 0.0001471557332f, - 0.0001636461917f, - 0.0001806038808f, - 0.0001980328584f, - 0.0002159370295f, - 0.0002343201416f, - 0.0002531857801f, - 0.0002725373634f, - 0.0002923781387f, - 0.0003127111768f, - 0.0003335393686f, - 0.0003548654197f, - 0.0003766918469f, - 0.0003990209730f, - 0.0004218549234f, - 0.0004451956214f, - 0.0004690447845f, - 0.0004934039201f, - 0.0005182743216f, - 0.0005436570649f, - 0.0005695530043f, - 0.0005959627692f, - 0.0006228867602f, - 0.0006503251459f, - 0.0006782778596f, - 0.0007067445959f, - 0.0007357248078f, - 0.0007652177037f, - 0.0007952222443f, - 0.0008257371403f, - 0.0008567608492f, - 0.0008882915736f, - 0.0009203272580f, - 0.0009528655873f, - 0.0009859039843f, - 0.0010194396081f, - 0.0010534693522f, - 0.0010879898425f, - 0.0011229974367f, - 0.0011584882220f, - 0.0011944580146f, - 0.0012309023586f, - 0.0012678165250f, - 0.0013051955110f, - 0.0013430340397f, - 0.0013813265595f, - 0.0014200672442f, - 0.0014592499929f, - 0.0014988684300f, - 0.0015389159058f, - 0.0015793854968f, - 0.0016202700068f, - 0.0016615619670f, - 0.0017032536381f, - 0.0017453370105f, - 0.0017878038064f, - 0.0018306454814f, - 0.0018738532257f, - 0.0019174179666f, - 0.0019613303706f, - 0.0020055808454f, - 0.0020501595428f, - 0.0020950563610f, - 0.0021402609477f, - 0.0021857627034f, - 0.0022315507840f, - 0.0022776141047f, - 0.0023239413434f, - 0.0023705209447f, - 0.0024173411233f, - 0.0024643898688f, - 0.0025116549495f, - 0.0025591239169f, - 0.0026067841107f, - 0.0026546226632f, - 0.0027026265043f, - 0.0027507823669f, - 0.0027990767918f, - 0.0028474961335f, - 0.0028960265655f, - 0.0029446540864f, - 0.0029933645254f, - 0.0030421435486f, - 0.0030909766650f, - 0.0031398492332f, - 0.0031887464674f, - 0.0032376534443f, - 0.0032865551097f, - 0.0033354362854f, - 0.0033842816762f, - 0.0034330758769f, - 0.0034818033796f, - 0.0035304485810f, - 0.0035789957896f, - 0.0036274292338f, - 0.0036757330686f, - 0.0037238913843f, - 0.0037718882136f, - 0.0038197075396f, - 0.0038673333040f, - 0.0039147494150f, - 0.0039619397550f, - 0.0040088881896f, - 0.0040555785748f, - 0.0041019947660f, - 0.0041481206260f, - 0.0041939400332f, - 0.0042394368905f, - 0.0042845951330f, - 0.0043293987369f, - 0.0043738317277f, - 0.0044178781890f, - 0.0044615222704f, - 0.0045047481964f, - 0.0045475402748f, - 0.0045898829050f, - 0.0046317605863f, - 0.0046731579268f, - 0.0047140596512f, - 0.0047544506094f, - 0.0047943157851f, - 0.0048336403032f, - 0.0048724094390f, - 0.0049106086256f, - 0.0049482234626f, - 0.0049852397233f, - 0.0050216433634f, - 0.0050574205286f, - 0.0050925575621f, - 0.0051270410128f, - 0.0051608576423f, - 0.0051939944329f, - 0.0052264385945f, - 0.0052581775725f, - 0.0052891990541f, - 0.0053194909762f, - 0.0053490415314f, - 0.0053778391756f, - 0.0054058726342f, - 0.0054331309083f, - 0.0054596032817f, - 0.0054852793266f, - 0.0055101489098f, - 0.0055342021983f, - 0.0055574296655f, - 0.0055798220963f, - 0.0056013705925f, - 0.0056220665783f, - 0.0056419018048f, - 0.0056608683553f, - 0.0056789586495f, - 0.0056961654483f, - 0.0057124818576f, - 0.0057279013330f, - 0.0057424176828f, - 0.0057560250723f, - 0.0057687180271f, - 0.0057804914360f, - 0.0057913405542f, - 0.0058012610063f, - 0.0058102487887f, - 0.0058183002716f, - 0.0058254122019f, - 0.0058315817045f, - 0.0058368062842f, - 0.0058410838272f, - 0.0058444126023f, - 0.0058467912620f, - 0.0058482188432f, - 0.0058486947679f, - 0.0058482188432f, - 0.0058467912620f, - 0.0058444126023f, - 0.0058410838272f, - 0.0058368062842f, - 0.0058315817045f, - 0.0058254122019f, - 0.0058183002716f, - 0.0058102487887f, - 0.0058012610063f, - 0.0057913405542f, - 0.0057804914360f, - 0.0057687180271f, - 0.0057560250723f, - 0.0057424176828f, - 0.0057279013330f, - 0.0057124818576f, - 0.0056961654483f, - 0.0056789586495f, - 0.0056608683553f, - 0.0056419018048f, - 0.0056220665783f, - 0.0056013705925f, - 0.0055798220963f, - 0.0055574296655f, - 0.0055342021983f, - 0.0055101489098f, - 0.0054852793266f, - 0.0054596032817f, - 0.0054331309083f, - 0.0054058726342f, - 0.0053778391756f, - 0.0053490415314f, - 0.0053194909762f, - 0.0052891990541f, - 0.0052581775725f, - 0.0052264385945f, - 0.0051939944329f, - 0.0051608576423f, - 0.0051270410128f, - 0.0050925575621f, - 0.0050574205286f, - 0.0050216433634f, - 0.0049852397233f, - 0.0049482234626f, - 0.0049106086256f, - 0.0048724094390f, - 0.0048336403032f, - 0.0047943157851f, - 0.0047544506094f, - 0.0047140596512f, - 0.0046731579268f, - 0.0046317605863f, - 0.0045898829050f, - 0.0045475402748f, - 0.0045047481964f, - 0.0044615222704f, - 0.0044178781890f, - 0.0043738317277f, - 0.0043293987369f, - 0.0042845951330f, - 0.0042394368905f, - 0.0041939400332f, - 0.0041481206260f, - 0.0041019947660f, - 0.0040555785748f, - 0.0040088881896f, - 0.0039619397550f, - 0.0039147494150f, - 0.0038673333040f, - 0.0038197075396f, - 0.0037718882136f, - 0.0037238913843f, - 0.0036757330686f, - 0.0036274292338f, - 0.0035789957896f, - 0.0035304485810f, - 0.0034818033796f, - 0.0034330758769f, - 0.0033842816762f, - 0.0033354362854f, - 0.0032865551097f, - 0.0032376534443f, - 0.0031887464674f, - 0.0031398492332f, - 0.0030909766650f, - 0.0030421435486f, - 0.0029933645254f, - 0.0029446540864f, - 0.0028960265655f, - 0.0028474961335f, - 0.0027990767918f, - 0.0027507823669f, - 0.0027026265043f, - 0.0026546226632f, - 0.0026067841107f, - 0.0025591239169f, - 0.0025116549495f, - 0.0024643898688f, - 0.0024173411233f, - 0.0023705209447f, - 0.0023239413434f, - 0.0022776141047f, - 0.0022315507840f, - 0.0021857627034f, - 0.0021402609477f, - 0.0020950563610f, - 0.0020501595428f, - 0.0020055808454f, - 0.0019613303706f, - 0.0019174179666f, - 0.0018738532257f, - 0.0018306454814f, - 0.0017878038064f, - 0.0017453370105f, - 0.0017032536381f, - 0.0016615619670f, - 0.0016202700068f, - 0.0015793854968f, - 0.0015389159058f, - 0.0014988684300f, - 0.0014592499929f, - 0.0014200672442f, - 0.0013813265595f, - 0.0013430340397f, - 0.0013051955110f, - 0.0012678165250f, - 0.0012309023586f, - 0.0011944580146f, - 0.0011584882220f, - 0.0011229974367f, - 0.0010879898425f, - 0.0010534693522f, - 0.0010194396081f, - 0.0009859039843f, - 0.0009528655873f, - 0.0009203272580f, - 0.0008882915736f, - 0.0008567608492f, - 0.0008257371403f, - 0.0007952222443f, - 0.0007652177037f, - 0.0007357248078f, - 0.0007067445959f, - 0.0006782778596f, - 0.0006503251459f, - 0.0006228867602f, - 0.0005959627692f, - 0.0005695530043f, - 0.0005436570649f, - 0.0005182743216f, - 0.0004934039201f, - 0.0004690447845f, - 0.0004451956214f, - 0.0004218549234f, - 0.0003990209730f, - 0.0003766918469f, - 0.0003548654197f, - 0.0003335393686f, - 0.0003127111768f, - 0.0002923781387f, - 0.0002725373634f, - 0.0002531857801f, - 0.0002343201416f, - 0.0002159370295f, - 0.0001980328584f, - 0.0001806038808f, - 0.0001636461917f, - 0.0001471557332f, - 0.0001311282992f, - 0.0001155595405f, - 0.0001004449692f, - 0.0000857799638f, - 0.0000715597739f, - 0.0000577795252f, - 0.0000444342241f, - 0.0000315187628f, - 0.0000190279240f, - 0.0000069563861f, - -0.0000047012723f, - -0.0000159505676f, - -0.0000267971056f, - -0.0000372465778f, - -0.0000473047557f, - -0.0000569774862f, - -0.0000662706872f, - -0.0000751903422f, - -0.0000837424964f, - -0.0000919332511f, - -0.0000997687600f, - -0.0001072552238f, - -0.0001143988861f, - -0.0001212060287f, - -0.0001276829672f, - -0.0001338360466f, - -0.0001396716370f, - -0.0001451961290f, - -0.0001504159297f, - -0.0001553374586f, - -0.0001599671433f, - -0.0001643114154f, - -0.0001683767065f, - -0.0001721694447f, - -0.0001756960501f, - -0.0001789629316f, - -0.0001819764827f, - -0.0001847430782f, - -0.0001872690707f, - -0.0001895607869f, - -0.0001916245241f, - -0.0001934665474f, - -0.0001950930862f, - -0.0001965103308f, - -0.0001977244297f, - -0.0001987414866f, - -0.0001995675575f, - -0.0002002086476f, - -0.0002006707090f, - -0.0002009596382f, - -0.0002010812729f, - -0.0002010413902f, - -0.0002008457042f, - -0.0002004998634f, - -0.0002000094489f, - -0.0001993799720f, - -0.0001986168726f, - -0.0001977255172f, - -0.0001967111968f, - -0.0001955791256f, - -0.0001943344392f, - -0.0001929821931f, - -0.0001915273613f, - -0.0001899748350f, - -0.0001883294212f, - -0.0001865958418f, - -0.0001847787321f, - -0.0001828826403f, - -0.0001809120262f, - -0.0001788712607f, - -0.0001767646249f, - -0.0001745963094f, - -0.0001723704138f, - -0.0001700909463f, - -0.0001677618232f, - -0.0001653868686f, - -0.0001629698139f, - -0.0001605142982f, - -0.0001580238676f, - -0.0001555019757f, - -0.0001529519831f, - -0.0001503771580f, - -0.0001477806759f, - -0.0001451656204f, - -0.0001425349833f, - -0.0001398916645f, - -0.0001372384734f, - -0.0001345781284f, - -0.0001319132583f, - -0.0001292464023f, - -0.0001265800111f, - -0.0001239164473f, - -0.0001212579865f, - -0.0001186068179f, - -0.0001159650452f, - -0.0001133346877f, - -0.0001107176810f, - -0.0001081158783f, - -0.0001055310512f, - -0.0001029648911f, - -0.0001004190099f, - -0.0000978949415f, - -0.0000953941432f, - -0.0000929179961f, - -0.0000904678075f, - -0.0000880448112f, - -0.0000856501695f, - -0.0000832849740f, - -0.0000809502475f, - -0.0000786469450f, - -0.0000763759553f, - -0.0000741381022f, - -0.0000719341464f, - -0.0000697647864f, - -0.0000676306604f, - -0.0000655323476f, - -0.0000634703697f, - -0.0000614451922f, - -0.0000594572265f, - -0.0000575068307f, - -0.0000555943117f, - -0.0000537199261f, - -0.0000518838825f, - -0.0000500863422f, - -0.0000483274213f, - -0.0000466071919f, - -0.0000449256839f, - -0.0000432828861f, - -0.0000416787480f, - -0.0000401131811f, - -0.0000385860605f, - -0.0000370972263f, - -0.0000356464850f, - -0.0000342336112f, - -0.0000328583485f, - -0.0000315204114f, - -0.0000302194865f, - -0.0000289552338f, - -0.0000277272881f, - -0.0000265352606f, - -0.0000253787397f, - -0.0000242572927f, - -0.0000231704670f, - -0.0000221177911f, - -0.0000210987761f, - -0.0000201129171f, - -0.0000191596936f, - -0.0000182385717f, - -0.0000173490044f, - -0.0000164904329f, - -0.0000156622882f, - -0.0000148639914f, - -0.0000140949552f, - -0.0000133545848f, - -0.0000126422788f, - -0.0000119574304f, - -0.0000112994278f, - -0.0000106676557f, - -0.0000100614958f, - -0.0000094803279f, - -0.0000089235302f, - -0.0000083904807f, - -0.0000078805577f, - -0.0000073931405f, - -0.0000069276099f, - -0.0000064833493f, - -0.0000060597452f, - -0.0000056561877f, - -0.0000052720710f, - -0.0000049067942f, - -0.0000045597620f, - -0.0000042303847f, - -0.0000039180789f, - -0.0000036222682f, - -0.0000033423834f, - -0.0000030778629f, - -0.0000028281532f, - -0.0000025927091f, - -0.0000023709942f, - -0.0000021624812f, - -0.0000019666521f, - -0.0000017829984f, - -0.0000016110215f, - -0.0000014502329f, - -0.0000013001543f, - -0.0000055896992f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_512_16.h b/core/src/dsp/firdec/taps/fir_512_16.h deleted file mode 100644 index 0093877..0000000 --- a/core/src/dsp/firdec/taps/fir_512_16.h +++ /dev/null @@ -1,78 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_512_16_len = 64; - const float fir_512_16_taps[] = { - 0.0000151940580f, - 0.0000353162294f, - 0.0000744053215f, - 0.0001396086425f, - 0.0002418195104f, - 0.0003943662769f, - 0.0006129837252f, - 0.0009156126139f, - 0.0013220032816f, - 0.0018531099165f, - 0.0025302756637f, - 0.0033742244254f, - 0.0044038919853f, - 0.0056351456882f, - 0.0070794569573f, - 0.0087426030278f, - 0.0106234821202f, - 0.0127131288122f, - 0.0149940128678f, - 0.0174396949525f, - 0.0200148967258f, - 0.0226760214362f, - 0.0253721355820f, - 0.0280463940126f, - 0.0306378619753f, - 0.0330836601043f, - 0.0353213343016f, - 0.0372913337462f, - 0.0389394684890f, - 0.0402192143245f, - 0.0410937374123f, - 0.0415375243532f, - 0.0415375243532f, - 0.0410937374123f, - 0.0402192143245f, - 0.0389394684890f, - 0.0372913337462f, - 0.0353213343016f, - 0.0330836601043f, - 0.0306378619753f, - 0.0280463940126f, - 0.0253721355820f, - 0.0226760214362f, - 0.0200148967258f, - 0.0174396949525f, - 0.0149940128678f, - 0.0127131288122f, - 0.0106234821202f, - 0.0087426030278f, - 0.0070794569573f, - 0.0056351456882f, - 0.0044038919853f, - 0.0033742244254f, - 0.0025302756637f, - 0.0018531099165f, - 0.0013220032816f, - 0.0009156126139f, - 0.0006129837252f, - 0.0003943662769f, - 0.0002418195104f, - 0.0001396086425f, - 0.0000744053215f, - 0.0000353162294f, - 0.0000151940580f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_512_32.h b/core/src/dsp/firdec/taps/fir_512_32.h deleted file mode 100644 index f56ce9b..0000000 --- a/core/src/dsp/firdec/taps/fir_512_32.h +++ /dev/null @@ -1,165 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_512_32_len = 151; - const float fir_512_32_taps[] = { - 0.0000009251202f, - 0.0000018465197f, - 0.0000024464700f, - 0.0000043159736f, - 0.0000061801355f, - 0.0000092195926f, - 0.0000128748733f, - 0.0000179050798f, - 0.0000241667435f, - 0.0000322353329f, - 0.0000422298191f, - 0.0000546726009f, - 0.0000698676453f, - 0.0000883565591f, - 0.0001105894638f, - 0.0001371665649f, - 0.0001686634471f, - 0.0002057583064f, - 0.0002491382743f, - 0.0002995652579f, - 0.0003578243175f, - 0.0004247560835f, - 0.0005012264845f, - 0.0005881405242f, - 0.0006864223881f, - 0.0007970184354f, - 0.0009208819280f, - 0.0010589694866f, - 0.0012122275138f, - 0.0013815845184f, - 0.0015679378702f, - 0.0017721434865f, - 0.0019950024469f, - 0.0022372491131f, - 0.0024995376582f, - 0.0027824295157f, - 0.0030863801975f, - 0.0034117269055f, - 0.0037586762067f, - 0.0041272926196f, - 0.0045174878173f, - 0.0049290109819f, - 0.0053614402367f, - 0.0058141755168f, - 0.0062864329037f, - 0.0067772406753f, - 0.0072854371318f, - 0.0078096703652f, - 0.0083484000282f, - 0.0088999012000f, - 0.0094622703727f, - 0.0100334335903f, - 0.0106111567180f, - 0.0111930578078f, - 0.0117766214851f, - 0.0123592152594f, - 0.0129381076271f, - 0.0135104878117f, - 0.0140734869548f, - 0.0146242005530f, - 0.0151597119088f, - 0.0156771163460f, - 0.0161735459270f, - 0.0166461943912f, - 0.0170923420315f, - 0.0175093802160f, - 0.0178948352652f, - 0.0182463913957f, - 0.0185619124518f, - 0.0188394621562f, - 0.0190773226296f, - 0.0192740109449f, - 0.0194282935085f, - 0.0195391980867f, - 0.0196060233225f, - 0.0196283456221f, - 0.0196060233225f, - 0.0195391980867f, - 0.0194282935085f, - 0.0192740109449f, - 0.0190773226296f, - 0.0188394621562f, - 0.0185619124518f, - 0.0182463913957f, - 0.0178948352652f, - 0.0175093802160f, - 0.0170923420315f, - 0.0166461943912f, - 0.0161735459270f, - 0.0156771163460f, - 0.0151597119088f, - 0.0146242005530f, - 0.0140734869548f, - 0.0135104878117f, - 0.0129381076271f, - 0.0123592152594f, - 0.0117766214851f, - 0.0111930578078f, - 0.0106111567180f, - 0.0100334335903f, - 0.0094622703727f, - 0.0088999012000f, - 0.0083484000282f, - 0.0078096703652f, - 0.0072854371318f, - 0.0067772406753f, - 0.0062864329037f, - 0.0058141755168f, - 0.0053614402367f, - 0.0049290109819f, - 0.0045174878173f, - 0.0041272926196f, - 0.0037586762067f, - 0.0034117269055f, - 0.0030863801975f, - 0.0027824295157f, - 0.0024995376582f, - 0.0022372491131f, - 0.0019950024469f, - 0.0017721434865f, - 0.0015679378702f, - 0.0013815845184f, - 0.0012122275138f, - 0.0010589694866f, - 0.0009208819280f, - 0.0007970184354f, - 0.0006864223881f, - 0.0005881405242f, - 0.0005012264845f, - 0.0004247560835f, - 0.0003578243175f, - 0.0002995652579f, - 0.0002491382743f, - 0.0002057583064f, - 0.0001686634471f, - 0.0001371665649f, - 0.0001105894638f, - 0.0000883565591f, - 0.0000698676453f, - 0.0000546726009f, - 0.0000422298191f, - 0.0000322353329f, - 0.0000241667435f, - 0.0000179050798f, - 0.0000128748733f, - 0.0000092195926f, - 0.0000061801355f, - 0.0000043159736f, - 0.0000024464700f, - 0.0000018465197f, - 0.0000009251202f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_512_64.h b/core/src/dsp/firdec/taps/fir_512_64.h deleted file mode 100644 index 8b8ab1e..0000000 --- a/core/src/dsp/firdec/taps/fir_512_64.h +++ /dev/null @@ -1,298 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_512_64_len = 284; - const float fir_512_64_taps[] = { - -0.0000003515813f, - 0.0000031171026f, - 0.0000020524162f, - 0.0000024542289f, - 0.0000031065207f, - 0.0000038930134f, - 0.0000048162506f, - 0.0000058895006f, - 0.0000071310597f, - 0.0000085581431f, - 0.0000101918418f, - 0.0000120521359f, - 0.0000141629532f, - 0.0000165472024f, - 0.0000192318152f, - 0.0000222427880f, - 0.0000256102026f, - 0.0000293632777f, - 0.0000335353640f, - 0.0000381590070f, - 0.0000432709128f, - 0.0000489070228f, - 0.0000551074473f, - 0.0000619115526f, - 0.0000693628586f, - 0.0000775041409f, - 0.0000863822872f, - 0.0000960434161f, - 0.0001065376894f, - 0.0001179144487f, - 0.0001302269805f, - 0.0001435276713f, - 0.0001578727234f, - 0.0001733173295f, - 0.0001899203366f, - 0.0002077394422f, - 0.0002268358025f, - 0.0002472692536f, - 0.0002691028607f, - 0.0002923981667f, - 0.0003172196808f, - 0.0003436301558f, - 0.0003716950150f, - 0.0004014776616f, - 0.0004330438412f, - 0.0004664569860f, - 0.0005017825128f, - 0.0005390832050f, - 0.0005784234446f, - 0.0006198646358f, - 0.0006634693699f, - 0.0007092968953f, - 0.0007574072145f, - 0.0008078566037f, - 0.0008607016429f, - 0.0009159947893f, - 0.0009737883402f, - 0.0010341300646f, - 0.0010970670999f, - 0.0011626416466f, - 0.0012308947989f, - 0.0013018623072f, - 0.0013755783437f, - 0.0014520713385f, - 0.0015313676803f, - 0.0016134876310f, - 0.0016984489635f, - 0.0017862629594f, - 0.0018769379853f, - 0.0019704755784f, - 0.0020668739631f, - 0.0021661242292f, - 0.0022682137899f, - 0.0023731226581f, - 0.0024808268465f, - 0.0025912947466f, - 0.0027044904730f, - 0.0028203703485f, - 0.0029388861938f, - 0.0030599819237f, - 0.0031835967820f, - 0.0033096620532f, - 0.0034381042430f, - 0.0035688419092f, - 0.0037017887878f, - 0.0038368507462f, - 0.0039739288549f, - 0.0041129164657f, - 0.0042537022285f, - 0.0043961672967f, - 0.0045401882879f, - 0.0046856346183f, - 0.0048323714068f, - 0.0049802569384f, - 0.0051291455099f, - 0.0052788850244f, - 0.0054293197749f, - 0.0055802881698f, - 0.0057316254533f, - 0.0058831615603f, - 0.0060347237702f, - 0.0061861346909f, - 0.0063372148423f, - 0.0064877807676f, - 0.0066376475425f, - 0.0067866270121f, - 0.0069345302214f, - 0.0070811657753f, - 0.0072263421851f, - 0.0073698663497f, - 0.0075115458128f, - 0.0076511873613f, - 0.0077885991889f, - 0.0079235896075f, - 0.0080559691125f, - 0.0081855492031f, - 0.0083121443425f, - 0.0084355708848f, - 0.0085556489242f, - 0.0086722013236f, - 0.0087850554475f, - 0.0088940422881f, - 0.0089989980770f, - 0.0090997635037f, - 0.0091961852010f, - 0.0092881150520f, - 0.0093754115438f, - 0.0094579391596f, - 0.0095355695951f, - 0.0096081812323f, - 0.0096756602138f, - 0.0097378999951f, - 0.0097948022733f, - 0.0098462766138f, - 0.0098922412299f, - 0.0099326226814f, - 0.0099673565022f, - 0.0099963869681f, - 0.0100196675703f, - 0.0100371608503f, - 0.0100488387168f, - 0.0100546823476f, - 0.0100546823476f, - 0.0100488387168f, - 0.0100371608503f, - 0.0100196675703f, - 0.0099963869681f, - 0.0099673565022f, - 0.0099326226814f, - 0.0098922412299f, - 0.0098462766138f, - 0.0097948022733f, - 0.0097378999951f, - 0.0096756602138f, - 0.0096081812323f, - 0.0095355695951f, - 0.0094579391596f, - 0.0093754115438f, - 0.0092881150520f, - 0.0091961852010f, - 0.0090997635037f, - 0.0089989980770f, - 0.0088940422881f, - 0.0087850554475f, - 0.0086722013236f, - 0.0085556489242f, - 0.0084355708848f, - 0.0083121443425f, - 0.0081855492031f, - 0.0080559691125f, - 0.0079235896075f, - 0.0077885991889f, - 0.0076511873613f, - 0.0075115458128f, - 0.0073698663497f, - 0.0072263421851f, - 0.0070811657753f, - 0.0069345302214f, - 0.0067866270121f, - 0.0066376475425f, - 0.0064877807676f, - 0.0063372148423f, - 0.0061861346909f, - 0.0060347237702f, - 0.0058831615603f, - 0.0057316254533f, - 0.0055802881698f, - 0.0054293197749f, - 0.0052788850244f, - 0.0051291455099f, - 0.0049802569384f, - 0.0048323714068f, - 0.0046856346183f, - 0.0045401882879f, - 0.0043961672967f, - 0.0042537022285f, - 0.0041129164657f, - 0.0039739288549f, - 0.0038368507462f, - 0.0037017887878f, - 0.0035688419092f, - 0.0034381042430f, - 0.0033096620532f, - 0.0031835967820f, - 0.0030599819237f, - 0.0029388861938f, - 0.0028203703485f, - 0.0027044904730f, - 0.0025912947466f, - 0.0024808268465f, - 0.0023731226581f, - 0.0022682137899f, - 0.0021661242292f, - 0.0020668739631f, - 0.0019704755784f, - 0.0018769379853f, - 0.0017862629594f, - 0.0016984489635f, - 0.0016134876310f, - 0.0015313676803f, - 0.0014520713385f, - 0.0013755783437f, - 0.0013018623072f, - 0.0012308947989f, - 0.0011626416466f, - 0.0010970670999f, - 0.0010341300646f, - 0.0009737883402f, - 0.0009159947893f, - 0.0008607016429f, - 0.0008078566037f, - 0.0007574072145f, - 0.0007092968953f, - 0.0006634693699f, - 0.0006198646358f, - 0.0005784234446f, - 0.0005390832050f, - 0.0005017825128f, - 0.0004664569860f, - 0.0004330438412f, - 0.0004014776616f, - 0.0003716950150f, - 0.0003436301558f, - 0.0003172196808f, - 0.0002923981667f, - 0.0002691028607f, - 0.0002472692536f, - 0.0002268358025f, - 0.0002077394422f, - 0.0001899203366f, - 0.0001733173295f, - 0.0001578727234f, - 0.0001435276713f, - 0.0001302269805f, - 0.0001179144487f, - 0.0001065376894f, - 0.0000960434161f, - 0.0000863822872f, - 0.0000775041409f, - 0.0000693628586f, - 0.0000619115526f, - 0.0000551074473f, - 0.0000489070228f, - 0.0000432709128f, - 0.0000381590070f, - 0.0000335353640f, - 0.0000293632777f, - 0.0000256102026f, - 0.0000222427880f, - 0.0000192318152f, - 0.0000165472024f, - 0.0000141629532f, - 0.0000120521359f, - 0.0000101918418f, - 0.0000085581431f, - 0.0000071310597f, - 0.0000058895006f, - 0.0000048162506f, - 0.0000038930134f, - 0.0000031065207f, - 0.0000024542289f, - 0.0000020524162f, - 0.0000031171026f, - -0.0000003515813f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_64_16.h b/core/src/dsp/firdec/taps/fir_64_16.h deleted file mode 100644 index fb05579..0000000 --- a/core/src/dsp/firdec/taps/fir_64_16.h +++ /dev/null @@ -1,104 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_64_16_len = 90; - const float fir_64_16_taps[] = { - -0.0000120522386f, - -0.0000222544605f, - -0.0000415800824f, - -0.0000705601980f, - -0.0001117597283f, - -0.0001677821532f, - -0.0002410541699f, - -0.0003335536910f, - -0.0004464864558f, - -0.0005799214861f, - -0.0007324007475f, - -0.0009005433028f, - -0.0010786685830f, - -0.0012584667286f, - -0.0014287458994f, - -0.0015752866570f, - -0.0016808317559f, - -0.0017252357928f, - -0.0016857931470f, - -0.0015377546562f, - -0.0012550337974f, - -0.0008110922394f, - -0.0001799830654f, - 0.0006624815809f, - 0.0017374824702f, - 0.0030619182176f, - 0.0046471635731f, - 0.0064979256976f, - 0.0086112639295f, - 0.0109758357695f, - 0.0135714252753f, - 0.0163687998961f, - 0.0193299283477f, - 0.0224085760310f, - 0.0255512765146f, - 0.0286986586848f, - 0.0317870903592f, - 0.0347505815535f, - 0.0375228752484f, - 0.0400396413686f, - 0.0422406815901f, - 0.0440720490748f, - 0.0454879886598f, - 0.0464526093979f, - 0.0469412124342f, - 0.0469412124342f, - 0.0464526093979f, - 0.0454879886598f, - 0.0440720490748f, - 0.0422406815901f, - 0.0400396413686f, - 0.0375228752484f, - 0.0347505815535f, - 0.0317870903592f, - 0.0286986586848f, - 0.0255512765146f, - 0.0224085760310f, - 0.0193299283477f, - 0.0163687998961f, - 0.0135714252753f, - 0.0109758357695f, - 0.0086112639295f, - 0.0064979256976f, - 0.0046471635731f, - 0.0030619182176f, - 0.0017374824702f, - 0.0006624815809f, - -0.0001799830654f, - -0.0008110922394f, - -0.0012550337974f, - -0.0015377546562f, - -0.0016857931470f, - -0.0017252357928f, - -0.0016808317559f, - -0.0015752866570f, - -0.0014287458994f, - -0.0012584667286f, - -0.0010786685830f, - -0.0009005433028f, - -0.0007324007475f, - -0.0005799214861f, - -0.0004464864558f, - -0.0003335536910f, - -0.0002410541699f, - -0.0001677821532f, - -0.0001117597283f, - -0.0000705601980f, - -0.0000415800824f, - -0.0000222544605f, - -0.0000120522386f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_64_2.h b/core/src/dsp/firdec/taps/fir_64_2.h deleted file mode 100644 index 0c16fa2..0000000 --- a/core/src/dsp/firdec/taps/fir_64_2.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_64_2_len = 4; - const float fir_64_2_taps[] = { - 0.1238512125230f, - 0.3713298898913f, - 0.3713298898913f, - 0.1238512125230f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_64_32.h b/core/src/dsp/firdec/taps/fir_64_32.h deleted file mode 100644 index 635e394..0000000 --- a/core/src/dsp/firdec/taps/fir_64_32.h +++ /dev/null @@ -1,268 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_64_32_len = 254; - const float fir_64_32_taps[] = { - 0.0000071177827f, - 0.0000052360330f, - 0.0000070999389f, - 0.0000093491421f, - 0.0000120258010f, - 0.0000151698657f, - 0.0000188213706f, - 0.0000230162819f, - 0.0000277885900f, - 0.0000331659761f, - 0.0000391717261f, - 0.0000458202516f, - 0.0000531188652f, - 0.0000610632073f, - 0.0000696389402f, - 0.0000788171514f, - 0.0000885560397f, - 0.0000987963809f, - 0.0001094632965f, - 0.0001204618823f, - 0.0001316791619f, - 0.0001429799890f, - 0.0001542092968f, - 0.0001651883918f, - 0.0001757176133f, - 0.0001855731360f, - 0.0001945101517f, - 0.0002022602911f, - 0.0002085354301f, - 0.0002130258290f, - 0.0002154046469f, - 0.0002153268755f, - 0.0002124346213f, - 0.0002063568823f, - 0.0001967156262f, - 0.0001831264229f, - 0.0001652053085f, - 0.0001425702458f, - 0.0001148487208f, - 0.0000816799586f, - 0.0000427231519f, - -0.0000023396876f, - -0.0000537950170f, - -0.0001118944427f, - -0.0001768457191f, - -0.0002488091749f, - -0.0003278886589f, - -0.0004141279672f, - -0.0005075020096f, - -0.0006079135226f, - -0.0007151847604f, - -0.0008290548018f, - -0.0009491720834f, - -0.0010750926197f, - -0.0012062737004f, - -0.0013420733382f, - -0.0014817454403f, - -0.0016244407789f, - -0.0017692039202f, - -0.0019149759766f, - -0.0020605935333f, - -0.0022047933917f, - -0.0023462136721f, - -0.0024834006928f, - -0.0026148123580f, - -0.0027388272354f, - -0.0028537502533f, - -0.0029578239527f, - -0.0030492364244f, - -0.0031261346152f, - -0.0031866343375f, - -0.0032288354106f, - -0.0032508334770f, - -0.0032507366611f, - -0.0032266788309f, - -0.0031768373662f, - -0.0030994474167f, - -0.0029928202893f, - -0.0028553581802f, - -0.0026855726253f, - -0.0024820991257f, - -0.0022437150570f, - -0.0019693535723f, - -0.0016581203414f, - -0.0013093061003f, - -0.0009224015920f, - -0.0004971081448f, - -0.0000333502105f, - 0.0004687166063f, - 0.0010086959640f, - 0.0015859458172f, - 0.0021995722597f, - 0.0028484280438f, - 0.0035311102220f, - 0.0042459624638f, - 0.0049910767459f, - 0.0057642996479f, - 0.0065632382031f, - 0.0073852702104f, - 0.0082275542093f, - 0.0090870436937f, - 0.0099605010219f, - 0.0108445152647f, - 0.0117355197089f, - 0.0126298129235f, - 0.0135235793719f, - 0.0144129131434f, - 0.0152938410591f, - 0.0161623483955f, - 0.0170144037611f, - 0.0178459860423f, - 0.0186531102422f, - 0.0194318548104f, - 0.0201783875831f, - 0.0208889926181f, - 0.0215600953536f, - 0.0221882880668f, - 0.0227703533794f, - 0.0233032874883f, - 0.0237843211931f, - 0.0242109401088f, - 0.0245809024718f, - 0.0248922556389f, - 0.0251433500349f, - 0.0253328513679f, - 0.0254597502167f, - 0.0255233695354f, - 0.0255233695354f, - 0.0254597502167f, - 0.0253328513679f, - 0.0251433500349f, - 0.0248922556389f, - 0.0245809024718f, - 0.0242109401088f, - 0.0237843211931f, - 0.0233032874883f, - 0.0227703533794f, - 0.0221882880668f, - 0.0215600953536f, - 0.0208889926181f, - 0.0201783875831f, - 0.0194318548104f, - 0.0186531102422f, - 0.0178459860423f, - 0.0170144037611f, - 0.0161623483955f, - 0.0152938410591f, - 0.0144129131434f, - 0.0135235793719f, - 0.0126298129235f, - 0.0117355197089f, - 0.0108445152647f, - 0.0099605010219f, - 0.0090870436937f, - 0.0082275542093f, - 0.0073852702104f, - 0.0065632382031f, - 0.0057642996479f, - 0.0049910767459f, - 0.0042459624638f, - 0.0035311102220f, - 0.0028484280438f, - 0.0021995722597f, - 0.0015859458172f, - 0.0010086959640f, - 0.0004687166063f, - -0.0000333502105f, - -0.0004971081448f, - -0.0009224015920f, - -0.0013093061003f, - -0.0016581203414f, - -0.0019693535723f, - -0.0022437150570f, - -0.0024820991257f, - -0.0026855726253f, - -0.0028553581802f, - -0.0029928202893f, - -0.0030994474167f, - -0.0031768373662f, - -0.0032266788309f, - -0.0032507366611f, - -0.0032508334770f, - -0.0032288354106f, - -0.0031866343375f, - -0.0031261346152f, - -0.0030492364244f, - -0.0029578239527f, - -0.0028537502533f, - -0.0027388272354f, - -0.0026148123580f, - -0.0024834006928f, - -0.0023462136721f, - -0.0022047933917f, - -0.0020605935333f, - -0.0019149759766f, - -0.0017692039202f, - -0.0016244407789f, - -0.0014817454403f, - -0.0013420733382f, - -0.0012062737004f, - -0.0010750926197f, - -0.0009491720834f, - -0.0008290548018f, - -0.0007151847604f, - -0.0006079135226f, - -0.0005075020096f, - -0.0004141279672f, - -0.0003278886589f, - -0.0002488091749f, - -0.0001768457191f, - -0.0001118944427f, - -0.0000537950170f, - -0.0000023396876f, - 0.0000427231519f, - 0.0000816799586f, - 0.0001148487208f, - 0.0001425702458f, - 0.0001652053085f, - 0.0001831264229f, - 0.0001967156262f, - 0.0002063568823f, - 0.0002124346213f, - 0.0002153268755f, - 0.0002154046469f, - 0.0002130258290f, - 0.0002085354301f, - 0.0002022602911f, - 0.0001945101517f, - 0.0001855731360f, - 0.0001757176133f, - 0.0001651883918f, - 0.0001542092968f, - 0.0001429799890f, - 0.0001316791619f, - 0.0001204618823f, - 0.0001094632965f, - 0.0000987963809f, - 0.0000885560397f, - 0.0000788171514f, - 0.0000696389402f, - 0.0000610632073f, - 0.0000531188652f, - 0.0000458202516f, - 0.0000391717261f, - 0.0000331659761f, - 0.0000277885900f, - 0.0000230162819f, - 0.0000188213706f, - 0.0000151698657f, - 0.0000120258010f, - 0.0000093491421f, - 0.0000070999389f, - 0.0000052360330f, - 0.0000071177827f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_64_4.h b/core/src/dsp/firdec/taps/fir_64_4.h deleted file mode 100644 index 7b8fd49..0000000 --- a/core/src/dsp/firdec/taps/fir_64_4.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_64_4_len = 19; - const float fir_64_4_taps[] = { - 0.0000429609248f, - 0.0004765567633f, - 0.0024957623882f, - 0.0086502620997f, - 0.0224930555988f, - 0.0467176748088f, - 0.0803238710382f, - 0.1168174685032f, - 0.1455785879790f, - 0.1565458506682f, - 0.1455785879790f, - 0.1168174685032f, - 0.0803238710382f, - 0.0467176748088f, - 0.0224930555988f, - 0.0086502620997f, - 0.0024957623882f, - 0.0004765567633f, - 0.0000429609248f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_64_8.h b/core/src/dsp/firdec/taps/fir_64_8.h deleted file mode 100644 index 32725aa..0000000 --- a/core/src/dsp/firdec/taps/fir_64_8.h +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_64_8_len = 36; - const float fir_64_8_taps[] = { - 0.0000128128011f, - 0.0000776899411f, - 0.0002545373360f, - 0.0006610024251f, - 0.0014604787010f, - 0.0028714653290f, - 0.0051457499501f, - 0.0085388881542f, - 0.0132623498958f, - 0.0194293686660f, - 0.0270017805237f, - 0.0357514664485f, - 0.0452474908137f, - 0.0548772985184f, - 0.0639035753681f, - 0.0715509180316f, - 0.0771091525773f, - 0.0800353323941f, - 0.0800353323941f, - 0.0771091525773f, - 0.0715509180316f, - 0.0639035753681f, - 0.0548772985184f, - 0.0452474908137f, - 0.0357514664485f, - 0.0270017805237f, - 0.0194293686660f, - 0.0132623498958f, - 0.0085388881542f, - 0.0051457499501f, - 0.0028714653290f, - 0.0014604787010f, - 0.0006610024251f, - 0.0002545373360f, - 0.0000776899411f, - 0.0000128128011f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_8_2.h b/core/src/dsp/firdec/taps/fir_8_2.h deleted file mode 100644 index 2b307e4..0000000 --- a/core/src/dsp/firdec/taps/fir_8_2.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_8_2_len = 9; - const float fir_8_2_taps[] = { - -0.0096855460565f, - -0.0196926482904f, - 0.0627645107767f, - 0.2740445488509f, - 0.4025398240918f, - 0.2740445488509f, - 0.0627645107767f, - -0.0196926482904f, - -0.0096855460565f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_8_4.h b/core/src/dsp/firdec/taps/fir_8_4.h deleted file mode 100644 index b293942..0000000 --- a/core/src/dsp/firdec/taps/fir_8_4.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_8_4_len = 32; - const float fir_8_4_taps[] = { - 0.0000925825278f, - 0.0004344995834f, - 0.0011434673031f, - 0.0019921953877f, - 0.0021069453084f, - 0.0000218242037f, - -0.0055687125738f, - -0.0144165472383f, - -0.0233747474180f, - -0.0262097913981f, - -0.0154074590383f, - 0.0142533246733f, - 0.0619133245834f, - 0.1188703177504f, - 0.1704338338746f, - 0.2011522624092f, - 0.2011522624092f, - 0.1704338338746f, - 0.1188703177504f, - 0.0619133245834f, - 0.0142533246733f, - -0.0154074590383f, - -0.0262097913981f, - -0.0233747474180f, - -0.0144165472383f, - -0.0055687125738f, - 0.0000218242037f, - 0.0021069453084f, - 0.0019921953877f, - 0.0011434673031f, - 0.0004344995834f, - 0.0000925825278f, - }; - } -} diff --git a/core/src/dsp/firdec/taps/fir_8_8.h b/core/src/dsp/firdec/taps/fir_8_8.h deleted file mode 100644 index eddd59d..0000000 --- a/core/src/dsp/firdec/taps/fir_8_8.h +++ /dev/null @@ -1,294 +0,0 @@ -#pragma once - -/* - This file was auto-generated by Ryzerth's magic optimized FIR script. - DO NOT EDIT MANUALLY!!! -*/ - -namespace dsp { - namespace firdec { - const unsigned int fir_8_8_len = 280; - const float fir_8_8_taps[] = { - 0.0000052994842f, - 0.0000236531982f, - 0.0000454431541f, - 0.0000866606150f, - 0.0001454681461f, - 0.0002276460304f, - 0.0003345911923f, - 0.0004668904560f, - 0.0006220183860f, - 0.0007944666281f, - 0.0009753045793f, - 0.0011524547932f, - 0.0013112968761f, - 0.0014357836468f, - 0.0015099531702f, - 0.0015197416085f, - 0.0014549038561f, - 0.0013108132368f, - 0.0010898828479f, - 0.0008023617978f, - 0.0004663041298f, - 0.0001065892726f, - -0.0002470172936f, - -0.0005626469270f, - -0.0008097088243f, - -0.0009625110041f, - -0.0010036852815f, - -0.0009269528060f, - -0.0007387999373f, - -0.0004587307896f, - -0.0001179165349f, - 0.0002437426033f, - 0.0005819117379f, - 0.0008530352611f, - 0.0010198667279f, - 0.0010566109951f, - 0.0009529624621f, - 0.0007164088602f, - 0.0003723511050f, - -0.0000381502360f, - -0.0004628817408f, - -0.0008447972550f, - -0.0011294256831f, - -0.0012724326538f, - -0.0012463078782f, - -0.0010451923796f, - -0.0006870442177f, - -0.0002126532093f, - 0.0003185796904f, - 0.0008357346058f, - 0.0012655423999f, - 0.0015424876979f, - 0.0016184879319f, - 0.0014707552431f, - 0.0011066080375f, - 0.0005643461992f, - -0.0000901977407f, - -0.0007712304481f, - -0.0013838905368f, - -0.0018371322225f, - -0.0020568961991f, - -0.0019977090699f, - -0.0016509537671f, - -0.0010484135134f, - -0.0002602767483f, - 0.0006124690999f, - 0.0014505273627f, - 0.0021321900783f, - 0.0025505844320f, - 0.0026298818820f, - 0.0023380802069f, - 0.0016943083615f, - 0.0007692604372f, - -0.0003217361360f, - -0.0014324858797f, - -0.0024049762894f, - -0.0030913100580f, - -0.0033755493545f, - -0.0031923301613f, - -0.0025393728936f, - -0.0014817135720f, - -0.0001465338471f, - 0.0012912514887f, - 0.0026311543404f, - 0.0036743211895f, - 0.0042521988692f, - 0.0042526374291f, - 0.0036395284429f, - 0.0024627622943f, - 0.0008564752688f, - -0.0009748928184f, - -0.0027814968415f, - -0.0043010655579f, - -0.0052957555102f, - -0.0055878599029f, - -0.0050892037537f, - -0.0038196329489f, - -0.0019112679623f, - 0.0004029949855f, - 0.0028161150389f, - 0.0049858689474f, - 0.0065814235194f, - 0.0073314238254f, - 0.0070669002384f, - 0.0057525958483f, - 0.0035015266976f, - 0.0005695959447f, - -0.0026703422489f, - -0.0057727554561f, - -0.0082771418381f, - -0.0097720954139f, - -0.0099573040630f, - -0.0086947790176f, - -0.0060415019273f, - -0.0022576736745f, - 0.0022123488358f, - 0.0067858745476f, - 0.0108103047042f, - 0.0136467461009f, - 0.0147589153736f, - 0.0137961123447f, - 0.0106590975496f, - 0.0055392102924f, - -0.0010761158185f, - -0.0084344441235f, - -0.0155846252876f, - -0.0214724302300f, - -0.0250557443256f, - -0.0254266556205f, - -0.0219263229678f, - -0.0142387338262f, - -0.0024513843925f, - 0.0129256469755f, - 0.0309861862491f, - 0.0504987785185f, - 0.0700154216583f, - 0.0880072662488f, - 0.1030129814746f, - 0.1137837576738f, - 0.1194090364685f, - 0.1194090364685f, - 0.1137837576738f, - 0.1030129814746f, - 0.0880072662488f, - 0.0700154216583f, - 0.0504987785185f, - 0.0309861862491f, - 0.0129256469755f, - -0.0024513843925f, - -0.0142387338262f, - -0.0219263229678f, - -0.0254266556205f, - -0.0250557443256f, - -0.0214724302300f, - -0.0155846252876f, - -0.0084344441235f, - -0.0010761158185f, - 0.0055392102924f, - 0.0106590975496f, - 0.0137961123447f, - 0.0147589153736f, - 0.0136467461009f, - 0.0108103047042f, - 0.0067858745476f, - 0.0022123488358f, - -0.0022576736745f, - -0.0060415019273f, - -0.0086947790176f, - -0.0099573040630f, - -0.0097720954139f, - -0.0082771418381f, - -0.0057727554561f, - -0.0026703422489f, - 0.0005695959447f, - 0.0035015266976f, - 0.0057525958483f, - 0.0070669002384f, - 0.0073314238254f, - 0.0065814235194f, - 0.0049858689474f, - 0.0028161150389f, - 0.0004029949855f, - -0.0019112679623f, - -0.0038196329489f, - -0.0050892037537f, - -0.0055878599029f, - -0.0052957555102f, - -0.0043010655579f, - -0.0027814968415f, - -0.0009748928184f, - 0.0008564752688f, - 0.0024627622943f, - 0.0036395284429f, - 0.0042526374291f, - 0.0042521988692f, - 0.0036743211895f, - 0.0026311543404f, - 0.0012912514887f, - -0.0001465338471f, - -0.0014817135720f, - -0.0025393728936f, - -0.0031923301613f, - -0.0033755493545f, - -0.0030913100580f, - -0.0024049762894f, - -0.0014324858797f, - -0.0003217361360f, - 0.0007692604372f, - 0.0016943083615f, - 0.0023380802069f, - 0.0026298818820f, - 0.0025505844320f, - 0.0021321900783f, - 0.0014505273627f, - 0.0006124690999f, - -0.0002602767483f, - -0.0010484135134f, - -0.0016509537671f, - -0.0019977090699f, - -0.0020568961991f, - -0.0018371322225f, - -0.0013838905368f, - -0.0007712304481f, - -0.0000901977407f, - 0.0005643461992f, - 0.0011066080375f, - 0.0014707552431f, - 0.0016184879319f, - 0.0015424876979f, - 0.0012655423999f, - 0.0008357346058f, - 0.0003185796904f, - -0.0002126532093f, - -0.0006870442177f, - -0.0010451923796f, - -0.0012463078782f, - -0.0012724326538f, - -0.0011294256831f, - -0.0008447972550f, - -0.0004628817408f, - -0.0000381502360f, - 0.0003723511050f, - 0.0007164088602f, - 0.0009529624621f, - 0.0010566109951f, - 0.0010198667279f, - 0.0008530352611f, - 0.0005819117379f, - 0.0002437426033f, - -0.0001179165349f, - -0.0004587307896f, - -0.0007387999373f, - -0.0009269528060f, - -0.0010036852815f, - -0.0009625110041f, - -0.0008097088243f, - -0.0005626469270f, - -0.0002470172936f, - 0.0001065892726f, - 0.0004663041298f, - 0.0008023617978f, - 0.0010898828479f, - 0.0013108132368f, - 0.0014549038561f, - 0.0015197416085f, - 0.0015099531702f, - 0.0014357836468f, - 0.0013112968761f, - 0.0011524547932f, - 0.0009753045793f, - 0.0007944666281f, - 0.0006220183860f, - 0.0004668904560f, - 0.0003345911923f, - 0.0002276460304f, - 0.0001454681461f, - 0.0000866606150f, - 0.0000454431541f, - 0.0000236531982f, - 0.0000052994842f, - }; - } -} diff --git a/core/src/dsp/interpolation_taps.h b/core/src/dsp/interpolation_taps.h deleted file mode 100644 index 5550846..0000000 --- a/core/src/dsp/interpolation_taps.h +++ /dev/null @@ -1,136 +0,0 @@ -#pragma once - -const int INTERP_TAP_COUNT = 8; -const int INTERP_STEPS = 128; - -const float INTERP_TAPS[INTERP_STEPS + 1][INTERP_TAP_COUNT] = { - { 0.00000e+00, 0.00000e+00, 0.00000e+00, 1.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00 }, - { -1.98993e-04, 1.24642e-03, -5.41054e-03, 9.98534e-01, 7.89295e-03, -2.76968e-03, 8.53777e-04, -1.54700e-04 }, - { -3.96391e-04, 2.47942e-03, -1.07209e-02, 9.96891e-01, 1.58840e-02, -5.55134e-03, 1.70888e-03, -3.09412e-04 }, - { -5.92100e-04, 3.69852e-03, -1.59305e-02, 9.95074e-01, 2.39714e-02, -8.34364e-03, 2.56486e-03, -4.64053e-04 }, - { -7.86031e-04, 4.90322e-03, -2.10389e-02, 9.93082e-01, 3.21531e-02, -1.11453e-02, 3.42130e-03, -6.18544e-04 }, - { -9.78093e-04, 6.09305e-03, -2.60456e-02, 9.90917e-01, 4.04274e-02, -1.39548e-02, 4.27773e-03, -7.72802e-04 }, - { -1.16820e-03, 7.26755e-03, -3.09503e-02, 9.88580e-01, 4.87921e-02, -1.67710e-02, 5.13372e-03, -9.26747e-04 }, - { -1.35627e-03, 8.42626e-03, -3.57525e-02, 9.86071e-01, 5.72454e-02, -1.95925e-02, 5.98883e-03, -1.08030e-03 }, - { -1.54221e-03, 9.56876e-03, -4.04519e-02, 9.83392e-01, 6.57852e-02, -2.24178e-02, 6.84261e-03, -1.23337e-03 }, - { -1.72594e-03, 1.06946e-02, -4.50483e-02, 9.80543e-01, 7.44095e-02, -2.52457e-02, 7.69462e-03, -1.38589e-03 }, - { -1.90738e-03, 1.18034e-02, -4.95412e-02, 9.77526e-01, 8.31162e-02, -2.80746e-02, 8.54441e-03, -1.53777e-03 }, - { -2.08645e-03, 1.28947e-02, -5.39305e-02, 9.74342e-01, 9.19033e-02, -3.09033e-02, 9.39154e-03, -1.68894e-03 }, - { -2.26307e-03, 1.39681e-02, -5.82159e-02, 9.70992e-01, 1.00769e-01, -3.37303e-02, 1.02356e-02, -1.83931e-03 }, - { -2.43718e-03, 1.50233e-02, -6.23972e-02, 9.67477e-01, 1.09710e-01, -3.65541e-02, 1.10760e-02, -1.98880e-03 }, - { -2.60868e-03, 1.60599e-02, -6.64743e-02, 9.63798e-01, 1.18725e-01, -3.93735e-02, 1.19125e-02, -2.13733e-03 }, - { -2.77751e-03, 1.70776e-02, -7.04471e-02, 9.59958e-01, 1.27812e-01, -4.21869e-02, 1.27445e-02, -2.28483e-03 }, - { -2.94361e-03, 1.80759e-02, -7.43154e-02, 9.55956e-01, 1.36968e-01, -4.49929e-02, 1.35716e-02, -2.43121e-03 }, - { -3.10689e-03, 1.90545e-02, -7.80792e-02, 9.51795e-01, 1.46192e-01, -4.77900e-02, 1.43934e-02, -2.57640e-03 }, - { -3.26730e-03, 2.00132e-02, -8.17385e-02, 9.47477e-01, 1.55480e-01, -5.05770e-02, 1.52095e-02, -2.72032e-03 }, - { -3.42477e-03, 2.09516e-02, -8.52933e-02, 9.43001e-01, 1.64831e-01, -5.33522e-02, 1.60193e-02, -2.86289e-03 }, - { -3.57923e-03, 2.18695e-02, -8.87435e-02, 9.38371e-01, 1.74242e-01, -5.61142e-02, 1.68225e-02, -3.00403e-03 }, - { -3.73062e-03, 2.27664e-02, -9.20893e-02, 9.33586e-01, 1.83711e-01, -5.88617e-02, 1.76185e-02, -3.14367e-03 }, - { -3.87888e-03, 2.36423e-02, -9.53307e-02, 9.28650e-01, 1.93236e-01, -6.15931e-02, 1.84071e-02, -3.28174e-03 }, - { -4.02397e-03, 2.44967e-02, -9.84679e-02, 9.23564e-01, 2.02814e-01, -6.43069e-02, 1.91877e-02, -3.41815e-03 }, - { -4.16581e-03, 2.53295e-02, -1.01501e-01, 9.18329e-01, 2.12443e-01, -6.70018e-02, 1.99599e-02, -3.55283e-03 }, - { -4.30435e-03, 2.61404e-02, -1.04430e-01, 9.12947e-01, 2.22120e-01, -6.96762e-02, 2.07233e-02, -3.68570e-03 }, - { -4.43955e-03, 2.69293e-02, -1.07256e-01, 9.07420e-01, 2.31843e-01, -7.23286e-02, 2.14774e-02, -3.81671e-03 }, - { -4.57135e-03, 2.76957e-02, -1.09978e-01, 9.01749e-01, 2.41609e-01, -7.49577e-02, 2.22218e-02, -3.94576e-03 }, - { -4.69970e-03, 2.84397e-02, -1.12597e-01, 8.95936e-01, 2.51417e-01, -7.75620e-02, 2.29562e-02, -4.07279e-03 }, - { -4.82456e-03, 2.91609e-02, -1.15113e-01, 8.89984e-01, 2.61263e-01, -8.01399e-02, 2.36801e-02, -4.19774e-03 }, - { -4.94589e-03, 2.98593e-02, -1.17526e-01, 8.83893e-01, 2.71144e-01, -8.26900e-02, 2.43930e-02, -4.32052e-03 }, - { -5.06363e-03, 3.05345e-02, -1.19837e-01, 8.77666e-01, 2.81060e-01, -8.52109e-02, 2.50946e-02, -4.44107e-03 }, - { -5.17776e-03, 3.11866e-02, -1.22047e-01, 8.71305e-01, 2.91006e-01, -8.77011e-02, 2.57844e-02, -4.55932e-03 }, - { -5.28823e-03, 3.18153e-02, -1.24154e-01, 8.64812e-01, 3.00980e-01, -9.01591e-02, 2.64621e-02, -4.67520e-03 }, - { -5.39500e-03, 3.24205e-02, -1.26161e-01, 8.58189e-01, 3.10980e-01, -9.25834e-02, 2.71272e-02, -4.78866e-03 }, - { -5.49804e-03, 3.30021e-02, -1.28068e-01, 8.51437e-01, 3.21004e-01, -9.49727e-02, 2.77794e-02, -4.89961e-03 }, - { -5.59731e-03, 3.35600e-02, -1.29874e-01, 8.44559e-01, 3.31048e-01, -9.73254e-02, 2.84182e-02, -5.00800e-03 }, - { -5.69280e-03, 3.40940e-02, -1.31581e-01, 8.37557e-01, 3.41109e-01, -9.96402e-02, 2.90433e-02, -5.11376e-03 }, - { -5.78446e-03, 3.46042e-02, -1.33189e-01, 8.30432e-01, 3.51186e-01, -1.01915e-01, 2.96543e-02, -5.21683e-03 }, - { -5.87227e-03, 3.50903e-02, -1.34699e-01, 8.23188e-01, 3.61276e-01, -1.04150e-01, 3.02507e-02, -5.31716e-03 }, - { -5.95620e-03, 3.55525e-02, -1.36111e-01, 8.15826e-01, 3.71376e-01, -1.06342e-01, 3.08323e-02, -5.41467e-03 }, - { -6.03624e-03, 3.59905e-02, -1.37426e-01, 8.08348e-01, 3.81484e-01, -1.08490e-01, 3.13987e-02, -5.50931e-03 }, - { -6.11236e-03, 3.64044e-02, -1.38644e-01, 8.00757e-01, 3.91596e-01, -1.10593e-01, 3.19495e-02, -5.60103e-03 }, - { -6.18454e-03, 3.67941e-02, -1.39767e-01, 7.93055e-01, 4.01710e-01, -1.12650e-01, 3.24843e-02, -5.68976e-03 }, - { -6.25277e-03, 3.71596e-02, -1.40794e-01, 7.85244e-01, 4.11823e-01, -1.14659e-01, 3.30027e-02, -5.77544e-03 }, - { -6.31703e-03, 3.75010e-02, -1.41727e-01, 7.77327e-01, 4.21934e-01, -1.16618e-01, 3.35046e-02, -5.85804e-03 }, - { -6.37730e-03, 3.78182e-02, -1.42566e-01, 7.69305e-01, 4.32038e-01, -1.18526e-01, 3.39894e-02, -5.93749e-03 }, - { -6.43358e-03, 3.81111e-02, -1.43313e-01, 7.61181e-01, 4.42134e-01, -1.20382e-01, 3.44568e-02, -6.01374e-03 }, - { -6.48585e-03, 3.83800e-02, -1.43968e-01, 7.52958e-01, 4.52218e-01, -1.22185e-01, 3.49066e-02, -6.08674e-03 }, - { -6.53412e-03, 3.86247e-02, -1.44531e-01, 7.44637e-01, 4.62289e-01, -1.23933e-01, 3.53384e-02, -6.15644e-03 }, - { -6.57836e-03, 3.88454e-02, -1.45004e-01, 7.36222e-01, 4.72342e-01, -1.25624e-01, 3.57519e-02, -6.22280e-03 }, - { -6.61859e-03, 3.90420e-02, -1.45387e-01, 7.27714e-01, 4.82377e-01, -1.27258e-01, 3.61468e-02, -6.28577e-03 }, - { -6.65479e-03, 3.92147e-02, -1.45682e-01, 7.19116e-01, 4.92389e-01, -1.28832e-01, 3.65227e-02, -6.34530e-03 }, - { -6.68698e-03, 3.93636e-02, -1.45889e-01, 7.10431e-01, 5.02377e-01, -1.30347e-01, 3.68795e-02, -6.40135e-03 }, - { -6.71514e-03, 3.94886e-02, -1.46009e-01, 7.01661e-01, 5.12337e-01, -1.31800e-01, 3.72167e-02, -6.45388e-03 }, - { -6.73929e-03, 3.95900e-02, -1.46043e-01, 6.92808e-01, 5.22267e-01, -1.33190e-01, 3.75341e-02, -6.50285e-03 }, - { -6.75943e-03, 3.96678e-02, -1.45993e-01, 6.83875e-01, 5.32164e-01, -1.34515e-01, 3.78315e-02, -6.54823e-03 }, - { -6.77557e-03, 3.97222e-02, -1.45859e-01, 6.74865e-01, 5.42025e-01, -1.35775e-01, 3.81085e-02, -6.58996e-03 }, - { -6.78771e-03, 3.97532e-02, -1.45641e-01, 6.65779e-01, 5.51849e-01, -1.36969e-01, 3.83650e-02, -6.62802e-03 }, - { -6.79588e-03, 3.97610e-02, -1.45343e-01, 6.56621e-01, 5.61631e-01, -1.38094e-01, 3.86006e-02, -6.66238e-03 }, - { -6.80007e-03, 3.97458e-02, -1.44963e-01, 6.47394e-01, 5.71370e-01, -1.39150e-01, 3.88151e-02, -6.69300e-03 }, - { -6.80032e-03, 3.97077e-02, -1.44503e-01, 6.38099e-01, 5.81063e-01, -1.40136e-01, 3.90083e-02, -6.71985e-03 }, - { -6.79662e-03, 3.96469e-02, -1.43965e-01, 6.28739e-01, 5.90706e-01, -1.41050e-01, 3.91800e-02, -6.74291e-03 }, - { -6.78902e-03, 3.95635e-02, -1.43350e-01, 6.19318e-01, 6.00298e-01, -1.41891e-01, 3.93299e-02, -6.76214e-03 }, - { -6.77751e-03, 3.94578e-02, -1.42658e-01, 6.09836e-01, 6.09836e-01, -1.42658e-01, 3.94578e-02, -6.77751e-03 }, - { -6.76214e-03, 3.93299e-02, -1.41891e-01, 6.00298e-01, 6.19318e-01, -1.43350e-01, 3.95635e-02, -6.78902e-03 }, - { -6.74291e-03, 3.91800e-02, -1.41050e-01, 5.90706e-01, 6.28739e-01, -1.43965e-01, 3.96469e-02, -6.79662e-03 }, - { -6.71985e-03, 3.90083e-02, -1.40136e-01, 5.81063e-01, 6.38099e-01, -1.44503e-01, 3.97077e-02, -6.80032e-03 }, - { -6.69300e-03, 3.88151e-02, -1.39150e-01, 5.71370e-01, 6.47394e-01, -1.44963e-01, 3.97458e-02, -6.80007e-03 }, - { -6.66238e-03, 3.86006e-02, -1.38094e-01, 5.61631e-01, 6.56621e-01, -1.45343e-01, 3.97610e-02, -6.79588e-03 }, - { -6.62802e-03, 3.83650e-02, -1.36969e-01, 5.51849e-01, 6.65779e-01, -1.45641e-01, 3.97532e-02, -6.78771e-03 }, - { -6.58996e-03, 3.81085e-02, -1.35775e-01, 5.42025e-01, 6.74865e-01, -1.45859e-01, 3.97222e-02, -6.77557e-03 }, - { -6.54823e-03, 3.78315e-02, -1.34515e-01, 5.32164e-01, 6.83875e-01, -1.45993e-01, 3.96678e-02, -6.75943e-03 }, - { -6.50285e-03, 3.75341e-02, -1.33190e-01, 5.22267e-01, 6.92808e-01, -1.46043e-01, 3.95900e-02, -6.73929e-03 }, - { -6.45388e-03, 3.72167e-02, -1.31800e-01, 5.12337e-01, 7.01661e-01, -1.46009e-01, 3.94886e-02, -6.71514e-03 }, - { -6.40135e-03, 3.68795e-02, -1.30347e-01, 5.02377e-01, 7.10431e-01, -1.45889e-01, 3.93636e-02, -6.68698e-03 }, - { -6.34530e-03, 3.65227e-02, -1.28832e-01, 4.92389e-01, 7.19116e-01, -1.45682e-01, 3.92147e-02, -6.65479e-03 }, - { -6.28577e-03, 3.61468e-02, -1.27258e-01, 4.82377e-01, 7.27714e-01, -1.45387e-01, 3.90420e-02, -6.61859e-03 }, - { -6.22280e-03, 3.57519e-02, -1.25624e-01, 4.72342e-01, 7.36222e-01, -1.45004e-01, 3.88454e-02, -6.57836e-03 }, - { -6.15644e-03, 3.53384e-02, -1.23933e-01, 4.62289e-01, 7.44637e-01, -1.44531e-01, 3.86247e-02, -6.53412e-03 }, - { -6.08674e-03, 3.49066e-02, -1.22185e-01, 4.52218e-01, 7.52958e-01, -1.43968e-01, 3.83800e-02, -6.48585e-03 }, - { -6.01374e-03, 3.44568e-02, -1.20382e-01, 4.42134e-01, 7.61181e-01, -1.43313e-01, 3.81111e-02, -6.43358e-03 }, - { -5.93749e-03, 3.39894e-02, -1.18526e-01, 4.32038e-01, 7.69305e-01, -1.42566e-01, 3.78182e-02, -6.37730e-03 }, - { -5.85804e-03, 3.35046e-02, -1.16618e-01, 4.21934e-01, 7.77327e-01, -1.41727e-01, 3.75010e-02, -6.31703e-03 }, - { -5.77544e-03, 3.30027e-02, -1.14659e-01, 4.11823e-01, 7.85244e-01, -1.40794e-01, 3.71596e-02, -6.25277e-03 }, - { -5.68976e-03, 3.24843e-02, -1.12650e-01, 4.01710e-01, 7.93055e-01, -1.39767e-01, 3.67941e-02, -6.18454e-03 }, - { -5.60103e-03, 3.19495e-02, -1.10593e-01, 3.91596e-01, 8.00757e-01, -1.38644e-01, 3.64044e-02, -6.11236e-03 }, - { -5.50931e-03, 3.13987e-02, -1.08490e-01, 3.81484e-01, 8.08348e-01, -1.37426e-01, 3.59905e-02, -6.03624e-03 }, - { -5.41467e-03, 3.08323e-02, -1.06342e-01, 3.71376e-01, 8.15826e-01, -1.36111e-01, 3.55525e-02, -5.95620e-03 }, - { -5.31716e-03, 3.02507e-02, -1.04150e-01, 3.61276e-01, 8.23188e-01, -1.34699e-01, 3.50903e-02, -5.87227e-03 }, - { -5.21683e-03, 2.96543e-02, -1.01915e-01, 3.51186e-01, 8.30432e-01, -1.33189e-01, 3.46042e-02, -5.78446e-03 }, - { -5.11376e-03, 2.90433e-02, -9.96402e-02, 3.41109e-01, 8.37557e-01, -1.31581e-01, 3.40940e-02, -5.69280e-03 }, - { -5.00800e-03, 2.84182e-02, -9.73254e-02, 3.31048e-01, 8.44559e-01, -1.29874e-01, 3.35600e-02, -5.59731e-03 }, - { -4.89961e-03, 2.77794e-02, -9.49727e-02, 3.21004e-01, 8.51437e-01, -1.28068e-01, 3.30021e-02, -5.49804e-03 }, - { -4.78866e-03, 2.71272e-02, -9.25834e-02, 3.10980e-01, 8.58189e-01, -1.26161e-01, 3.24205e-02, -5.39500e-03 }, - { -4.67520e-03, 2.64621e-02, -9.01591e-02, 3.00980e-01, 8.64812e-01, -1.24154e-01, 3.18153e-02, -5.28823e-03 }, - { -4.55932e-03, 2.57844e-02, -8.77011e-02, 2.91006e-01, 8.71305e-01, -1.22047e-01, 3.11866e-02, -5.17776e-03 }, - { -4.44107e-03, 2.50946e-02, -8.52109e-02, 2.81060e-01, 8.77666e-01, -1.19837e-01, 3.05345e-02, -5.06363e-03 }, - { -4.32052e-03, 2.43930e-02, -8.26900e-02, 2.71144e-01, 8.83893e-01, -1.17526e-01, 2.98593e-02, -4.94589e-03 }, - { -4.19774e-03, 2.36801e-02, -8.01399e-02, 2.61263e-01, 8.89984e-01, -1.15113e-01, 2.91609e-02, -4.82456e-03 }, - { -4.07279e-03, 2.29562e-02, -7.75620e-02, 2.51417e-01, 8.95936e-01, -1.12597e-01, 2.84397e-02, -4.69970e-03 }, - { -3.94576e-03, 2.22218e-02, -7.49577e-02, 2.41609e-01, 9.01749e-01, -1.09978e-01, 2.76957e-02, -4.57135e-03 }, - { -3.81671e-03, 2.14774e-02, -7.23286e-02, 2.31843e-01, 9.07420e-01, -1.07256e-01, 2.69293e-02, -4.43955e-03 }, - { -3.68570e-03, 2.07233e-02, -6.96762e-02, 2.22120e-01, 9.12947e-01, -1.04430e-01, 2.61404e-02, -4.30435e-03 }, - { -3.55283e-03, 1.99599e-02, -6.70018e-02, 2.12443e-01, 9.18329e-01, -1.01501e-01, 2.53295e-02, -4.16581e-03 }, - { -3.41815e-03, 1.91877e-02, -6.43069e-02, 2.02814e-01, 9.23564e-01, -9.84679e-02, 2.44967e-02, -4.02397e-03 }, - { -3.28174e-03, 1.84071e-02, -6.15931e-02, 1.93236e-01, 9.28650e-01, -9.53307e-02, 2.36423e-02, -3.87888e-03 }, - { -3.14367e-03, 1.76185e-02, -5.88617e-02, 1.83711e-01, 9.33586e-01, -9.20893e-02, 2.27664e-02, -3.73062e-03 }, - { -3.00403e-03, 1.68225e-02, -5.61142e-02, 1.74242e-01, 9.38371e-01, -8.87435e-02, 2.18695e-02, -3.57923e-03 }, - { -2.86289e-03, 1.60193e-02, -5.33522e-02, 1.64831e-01, 9.43001e-01, -8.52933e-02, 2.09516e-02, -3.42477e-03 }, - { -2.72032e-03, 1.52095e-02, -5.05770e-02, 1.55480e-01, 9.47477e-01, -8.17385e-02, 2.00132e-02, -3.26730e-03 }, - { -2.57640e-03, 1.43934e-02, -4.77900e-02, 1.46192e-01, 9.51795e-01, -7.80792e-02, 1.90545e-02, -3.10689e-03 }, - { -2.43121e-03, 1.35716e-02, -4.49929e-02, 1.36968e-01, 9.55956e-01, -7.43154e-02, 1.80759e-02, -2.94361e-03 }, - { -2.28483e-03, 1.27445e-02, -4.21869e-02, 1.27812e-01, 9.59958e-01, -7.04471e-02, 1.70776e-02, -2.77751e-03 }, - { -2.13733e-03, 1.19125e-02, -3.93735e-02, 1.18725e-01, 9.63798e-01, -6.64743e-02, 1.60599e-02, -2.60868e-03 }, - { -1.98880e-03, 1.10760e-02, -3.65541e-02, 1.09710e-01, 9.67477e-01, -6.23972e-02, 1.50233e-02, -2.43718e-03 }, - { -1.83931e-03, 1.02356e-02, -3.37303e-02, 1.00769e-01, 9.70992e-01, -5.82159e-02, 1.39681e-02, -2.26307e-03 }, - { -1.68894e-03, 9.39154e-03, -3.09033e-02, 9.19033e-02, 9.74342e-01, -5.39305e-02, 1.28947e-02, -2.08645e-03 }, - { -1.53777e-03, 8.54441e-03, -2.80746e-02, 8.31162e-02, 9.77526e-01, -4.95412e-02, 1.18034e-02, -1.90738e-03 }, - { -1.38589e-03, 7.69462e-03, -2.52457e-02, 7.44095e-02, 9.80543e-01, -4.50483e-02, 1.06946e-02, -1.72594e-03 }, - { -1.23337e-03, 6.84261e-03, -2.24178e-02, 6.57852e-02, 9.83392e-01, -4.04519e-02, 9.56876e-03, -1.54221e-03 }, - { -1.08030e-03, 5.98883e-03, -1.95925e-02, 5.72454e-02, 9.86071e-01, -3.57525e-02, 8.42626e-03, -1.35627e-03 }, - { -9.26747e-04, 5.13372e-03, -1.67710e-02, 4.87921e-02, 9.88580e-01, -3.09503e-02, 7.26755e-03, -1.16820e-03 }, - { -7.72802e-04, 4.27773e-03, -1.39548e-02, 4.04274e-02, 9.90917e-01, -2.60456e-02, 6.09305e-03, -9.78093e-04 }, - { -6.18544e-04, 3.42130e-03, -1.11453e-02, 3.21531e-02, 9.93082e-01, -2.10389e-02, 4.90322e-03, -7.86031e-04 }, - { -4.64053e-04, 2.56486e-03, -8.34364e-03, 2.39714e-02, 9.95074e-01, -1.59305e-02, 3.69852e-03, -5.92100e-04 }, - { -3.09412e-04, 1.70888e-03, -5.55134e-03, 1.58840e-02, 9.96891e-01, -1.07209e-02, 2.47942e-03, -3.96391e-04 }, - { -1.54700e-04, 8.53777e-04, -2.76968e-03, 7.89295e-03, 9.98534e-01, -5.41054e-03, 1.24642e-03, -1.98993e-04 }, - { 0.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00, 1.00000e+00, 0.00000e+00, 0.00000e+00, 0.00000e+00 }, -}; diff --git a/core/src/dsp/link.h b/core/src/dsp/link.h deleted file mode 100644 index 2695408..0000000 --- a/core/src/dsp/link.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once -#include - -namespace dsp { - template - class Link : public generic_block> { - public: - Link() {} - - Link(stream* a, stream* b) { init(a, b); } - - void init(stream* in, stream* out) { - _in = in; - _out = out; - generic_block>::registerInput(_in); - generic_block>::registerOutput(_out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setOutput(stream* out) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterOutput(_out); - _out = out; - generic_block>::registerOutput(_out); - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - memcpy(_out->writeBuf, _in->readBuf, count * sizeof(T)); - - _in->flush(); - return _out->swap(count) ? count : -1; - } - - private: - stream* _in; - stream* _out; - }; -} \ No newline at end of file diff --git a/core/src/dsp/math.h b/core/src/dsp/math.h deleted file mode 100644 index ac24a13..0000000 --- a/core/src/dsp/math.h +++ /dev/null @@ -1,246 +0,0 @@ -#pragma once -#include -#include - -namespace dsp { - template - class Add : public generic_block> { - public: - Add() {} - - Add(stream* a, stream* b) { init(a, b); } - - void init(stream* a, stream* b) { - _a = a; - _b = b; - generic_block>::registerInput(a); - generic_block>::registerInput(b); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInputs(stream* a, stream* b) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_a); - generic_block>::unregisterInput(_b); - _a = a; - _b = b; - generic_block>::registerInput(_a); - generic_block>::registerInput(_b); - generic_block>::tempStart(); - } - - void setInputA(stream* a) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_a); - _a = a; - generic_block>::registerInput(_a); - generic_block>::tempStart(); - } - - void setInputB(stream* b) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_b); - _b = b; - generic_block>::registerInput(_b); - generic_block>::tempStart(); - } - - int run() { - int a_count = _a->read(); - if (a_count < 0) { return -1; } - int b_count = _b->read(); - if (b_count < 0) { return -1; } - if (a_count != b_count) { - _a->flush(); - _b->flush(); - return 0; - } - - if constexpr (std::is_same_v || std::is_same_v) { - // TODO: Switch this out for volk_32fc_x2_add_32fc with a check for old volk versions that don't have it (eg. Ubuntu 18.04 that has volk 1.3) - volk_32f_x2_add_32f((float*)out.writeBuf, (float*)_a->readBuf, (float*)_b->readBuf, a_count * 2); - } - else { - volk_32f_x2_add_32f(out.writeBuf, _a->readBuf, _b->readBuf, a_count); - } - - _a->flush(); - _b->flush(); - if (!out.swap(a_count)) { return -1; } - return a_count; - } - - stream out; - - private: - stream* _a; - stream* _b; - }; - - template - class Subtract : public generic_block> { - public: - Subtract() {} - - Subtract(stream* a, stream* b) { init(a, b); } - - void init(stream* a, stream* b) { - _a = a; - _b = b; - generic_block>::registerInput(a); - generic_block>::registerInput(b); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInputs(stream* a, stream* b) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_a); - generic_block>::unregisterInput(_b); - _a = a; - _b = b; - generic_block>::registerInput(_a); - generic_block>::registerInput(_b); - generic_block>::tempStart(); - } - - void setInputA(stream* a) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_a); - _a = a; - generic_block>::registerInput(_a); - generic_block>::tempStart(); - } - - void setInputB(stream* b) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_b); - _b = b; - generic_block>::registerInput(_b); - generic_block>::tempStart(); - } - - int run() { - int a_count = _a->read(); - if (a_count < 0) { return -1; } - int b_count = _b->read(); - if (b_count < 0) { return -1; } - if (a_count != b_count) { - _a->flush(); - _b->flush(); - return 0; - } - - if constexpr (std::is_same_v || std::is_same_v) { - volk_32f_x2_subtract_32f((float*)out.writeBuf, (float*)_a->readBuf, (float*)_b->readBuf, a_count * 2); - } - else { - volk_32f_x2_subtract_32f(out.writeBuf, _a->readBuf, _b->readBuf, a_count); - } - - _a->flush(); - _b->flush(); - if (!out.swap(a_count)) { return -1; } - return a_count; - } - - stream out; - - private: - stream* _a; - stream* _b; - }; - - template - class Multiply : public generic_block> { - public: - Multiply() {} - - Multiply(stream* a, stream* b) { init(a, b); } - - void init(stream* a, stream* b) { - _a = a; - _b = b; - generic_block>::registerInput(a); - generic_block>::registerInput(b); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInputs(stream* a, stream* b) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_a); - generic_block>::unregisterInput(_b); - _a = a; - _b = b; - generic_block>::registerInput(_a); - generic_block>::registerInput(_b); - generic_block>::tempStart(); - } - - void setInputA(stream* a) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_a); - _a = a; - generic_block>::registerInput(_a); - generic_block>::tempStart(); - } - - void setInputB(stream* b) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_b); - _b = b; - generic_block>::registerInput(_b); - generic_block>::tempStart(); - } - - int run() { - int a_count = _a->read(); - if (a_count < 0) { return -1; } - int b_count = _b->read(); - if (b_count < 0) { return -1; } - if (a_count != b_count) { - _a->flush(); - _b->flush(); - return 0; - } - - if constexpr (std::is_same_v) { - volk_32fc_x2_multiply_32fc((lv_32fc_t*)out.writeBuf, (lv_32fc_t*)_a->readBuf, (lv_32fc_t*)_b->readBuf, a_count); - } - else { - volk_32f_x2_multiply_32f(out.writeBuf, _a->readBuf, _b->readBuf, a_count); - } - - _a->flush(); - _b->flush(); - if (!out.swap(a_count)) { return -1; } - return a_count; - } - - stream out; - - private: - stream* _a; - stream* _b; - }; -} \ No newline at end of file diff --git a/core/src/dsp/measure.h b/core/src/dsp/measure.h deleted file mode 100644 index d2d26ae..0000000 --- a/core/src/dsp/measure.h +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include - -namespace dsp { - class LevelMeter : public generic_block { - public: - LevelMeter() {} - - LevelMeter(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - float maxL = 0, maxR = 0; - float absL, absR; - for (int i = 0; i < count; i++) { - absL = fabs(_in->readBuf[i].l); - absR = fabs(_in->readBuf[i].r); - if (absL > maxL) { maxL = absL; } - if (absR > maxR) { maxR = absR; } - } - - _in->flush(); - - float _lvlL = 10.0f * logf(maxL); - float _lvlR = 10.0f * logf(maxR); - - // Update max values - { - std::lock_guard lck(lvlMtx); - if (_lvlL > lvlL) { lvlL = _lvlL; } - if (_lvlR > lvlR) { lvlR = _lvlR; } - } - - - return count; - } - - float getLeftLevel() { - std::lock_guard lck(lvlMtx); - float ret = lvlL; - lvlL = -90.0f; - return ret; - } - - float getRightLevel() { - std::lock_guard lck(lvlMtx); - float ret = lvlR; - lvlR = -90.0f; - return ret; - } - - private: - float lvlL = -90.0f; - float lvlR = -90.0f; - stream* _in; - std::mutex lvlMtx; - }; -} \ No newline at end of file diff --git a/core/src/dsp/meteor/hrpt.h b/core/src/dsp/meteor/hrpt.h deleted file mode 100644 index f4c75a2..0000000 --- a/core/src/dsp/meteor/hrpt.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once -#include -#include - -namespace dsp { - namespace meteor { - class HRPTDemux : public generic_block { - public: - HRPTDemux() {} - - HRPTDemux(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&telemOut); - generic_block::registerOutput(&BISMout); - generic_block::registerOutput(&SSPDOut); - generic_block::registerOutput(&MTVZAOut); - generic_block::registerOutput(&MSUMROut); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - for (int i = 0; i < 4; i++) { - memcpy(telemOut.writeBuf + (i * 2), _in->readBuf + 4 + (i * 256), 2); - memcpy(BISMout.writeBuf + (i * 4), _in->readBuf + 4 + (i * 256) + 2, 4); - memcpy(SSPDOut.writeBuf + (i * 4), _in->readBuf + 4 + (i * 256) + 6, 4); - memcpy(MTVZAOut.writeBuf + (i * 8), _in->readBuf + 4 + (i * 256) + 10, 8); - memcpy(MSUMROut.writeBuf + (i * 238), _in->readBuf + 4 + (i * 256) + 18, (i == 3) ? 234 : 238); - } - - if (!telemOut.swap(8)) { return -1; } - if (!BISMout.swap(16)) { return -1; } - if (!SSPDOut.swap(16)) { return -1; } - if (!MTVZAOut.swap(32)) { return -1; } - if (!MSUMROut.swap(948)) { return -1; } - - _in->flush(); - return count; - } - - stream telemOut; - stream BISMout; - stream SSPDOut; - stream MTVZAOut; - stream MSUMROut; - - private: - stream* _in; - }; - } -} \ No newline at end of file diff --git a/core/src/dsp/meteor/msumr.h b/core/src/dsp/meteor/msumr.h deleted file mode 100644 index a3b2b67..0000000 --- a/core/src/dsp/meteor/msumr.h +++ /dev/null @@ -1,77 +0,0 @@ -#pragma once -#include -#include - -namespace dsp { - namespace meteor { - const uint64_t MSUMR_SYNC_WORD = 0x0218A7A392DD9ABF; - const uint8_t MSUMR_SYNC_BYTES[8] = { 0x02, 0x18, 0xA7, 0xA3, 0x92, 0xDD, 0x9A, 0xBF }; - - class MSUMRDemux : public generic_block { - public: - MSUMRDemux() {} - - MSUMRDemux(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&msumr1Out); - generic_block::registerOutput(&msumr2Out); - generic_block::registerOutput(&msumr3Out); - generic_block::registerOutput(&msumr4Out); - generic_block::registerOutput(&msumr5Out); - generic_block::registerOutput(&msumr6Out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - int pixels = 0; - for (int i = 0; i < 11790; i += 30) { - for (int j = 0; j < 4; j++) { - msumr1Out.writeBuf[pixels + j] = (uint16_t)readBits((50 * 8) + (i * 8) + (j * 10), 10, _in->readBuf); - msumr2Out.writeBuf[pixels + j] = (uint16_t)readBits((50 * 8) + (i * 8) + (j * 10) + (40 * 1), 10, _in->readBuf); - msumr3Out.writeBuf[pixels + j] = (uint16_t)readBits((50 * 8) + (i * 8) + (j * 10) + (40 * 2), 10, _in->readBuf); - msumr4Out.writeBuf[pixels + j] = (uint16_t)readBits((50 * 8) + (i * 8) + (j * 10) + (40 * 3), 10, _in->readBuf); - msumr5Out.writeBuf[pixels + j] = (uint16_t)readBits((50 * 8) + (i * 8) + (j * 10) + (40 * 4), 10, _in->readBuf); - msumr6Out.writeBuf[pixels + j] = (uint16_t)readBits((50 * 8) + (i * 8) + (j * 10) + (40 * 5), 10, _in->readBuf); - } - pixels += 4; - } - - if (!msumr1Out.swap(1572)) { return -1; } - if (!msumr2Out.swap(1572)) { return -1; } - if (!msumr3Out.swap(1572)) { return -1; } - if (!msumr4Out.swap(1572)) { return -1; } - if (!msumr5Out.swap(1572)) { return -1; } - if (!msumr6Out.swap(1572)) { return -1; } - - _in->flush(); - return count; - } - - stream msumr1Out; - stream msumr2Out; - stream msumr3Out; - stream msumr4Out; - stream msumr5Out; - stream msumr6Out; - - private: - stream* _in; - }; - } -} \ No newline at end of file diff --git a/core/src/dsp/noaa/hrpt.h b/core/src/dsp/noaa/hrpt.h deleted file mode 100644 index a7a08b3..0000000 --- a/core/src/dsp/noaa/hrpt.h +++ /dev/null @@ -1,110 +0,0 @@ -#pragma once -#include -#include - -namespace dsp { - namespace noaa { - inline uint16_t HRPTReadWord(int offset, uint8_t* buffer) { - return (uint16_t)readBits(offset * 10, 10, buffer); - } - - const uint8_t HRPTSyncWord[] = { - 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, - 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, - 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, - 0, 0, 1, 0, 0, 1, 0, 1, 0, 1 - }; - - class HRPTDemux : public generic_block { - public: - HRPTDemux() {} - - HRPTDemux(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&AVHRRChan1Out); - generic_block::registerOutput(&AVHRRChan2Out); - generic_block::registerOutput(&AVHRRChan3Out); - generic_block::registerOutput(&AVHRRChan4Out); - generic_block::registerOutput(&AVHRRChan5Out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - int minFrame = readBits(61, 2, _in->readBuf); - - // If GAC frame, reject - if (minFrame == 0) { - _in->flush(); - return count; - } - - // Extract TIP frames if present - if (minFrame == 1) { - for (int i = 0; i < 5; i++) { - for (int j = 0; j < 104; j++) { - TIPOut.writeBuf[j] = (HRPTReadWord(103 + (i * 104) + j, _in->readBuf) >> 2) & 0xFF; - } - if (!TIPOut.swap(104)) { return -1; }; - } - } - - // Exctact AIP otherwise - else if (minFrame == 3) { - for (int i = 0; i < 5; i++) { - for (int j = 0; j < 104; j++) { - AIPOut.writeBuf[j] = (HRPTReadWord(103 + (i * 104) + j, _in->readBuf) >> 2) & 0xFF; - } - if (!AIPOut.swap(104)) { return -1; }; - } - } - - // Extract AVHRR data - for (int i = 0; i < 2048; i++) { - AVHRRChan1Out.writeBuf[i] = HRPTReadWord(750 + (i * 5), _in->readBuf); - AVHRRChan2Out.writeBuf[i] = HRPTReadWord(750 + (i * 5) + 1, _in->readBuf); - AVHRRChan3Out.writeBuf[i] = HRPTReadWord(750 + (i * 5) + 2, _in->readBuf); - AVHRRChan4Out.writeBuf[i] = HRPTReadWord(750 + (i * 5) + 3, _in->readBuf); - AVHRRChan5Out.writeBuf[i] = HRPTReadWord(750 + (i * 5) + 4, _in->readBuf); - } - if (!AVHRRChan1Out.swap(2048)) { return -1; }; - if (!AVHRRChan2Out.swap(2048)) { return -1; }; - if (!AVHRRChan3Out.swap(2048)) { return -1; }; - if (!AVHRRChan4Out.swap(2048)) { return -1; }; - if (!AVHRRChan5Out.swap(2048)) { return -1; }; - - _in->flush(); - return count; - } - - stream TIPOut; - stream AIPOut; - - stream AVHRRChan1Out; - stream AVHRRChan2Out; - stream AVHRRChan3Out; - stream AVHRRChan4Out; - stream AVHRRChan5Out; - - private: - stream* _in; - }; - } -} diff --git a/core/src/dsp/noaa/tip.h b/core/src/dsp/noaa/tip.h deleted file mode 100644 index 77478be..0000000 --- a/core/src/dsp/noaa/tip.h +++ /dev/null @@ -1,240 +0,0 @@ -#pragma once -#include -#include - -namespace dsp { - namespace noaa { - class TIPDemux : public generic_block { - public: - TIPDemux() {} - - TIPDemux(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&HIRSOut); - generic_block::registerOutput(&SEMOut); - generic_block::registerOutput(&DCSOut); - generic_block::registerOutput(&SBUVOut); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - // Extract HIRS - HIRSOut.writeBuf[0] = _in->readBuf[16]; - HIRSOut.writeBuf[1] = _in->readBuf[17]; - HIRSOut.writeBuf[2] = _in->readBuf[22]; - HIRSOut.writeBuf[3] = _in->readBuf[23]; - HIRSOut.writeBuf[4] = _in->readBuf[26]; - HIRSOut.writeBuf[5] = _in->readBuf[27]; - HIRSOut.writeBuf[6] = _in->readBuf[30]; - HIRSOut.writeBuf[7] = _in->readBuf[31]; - HIRSOut.writeBuf[8] = _in->readBuf[34]; - HIRSOut.writeBuf[9] = _in->readBuf[35]; - HIRSOut.writeBuf[10] = _in->readBuf[38]; - HIRSOut.writeBuf[11] = _in->readBuf[39]; - HIRSOut.writeBuf[12] = _in->readBuf[42]; - HIRSOut.writeBuf[13] = _in->readBuf[43]; - HIRSOut.writeBuf[14] = _in->readBuf[54]; - HIRSOut.writeBuf[15] = _in->readBuf[55]; - HIRSOut.writeBuf[16] = _in->readBuf[58]; - HIRSOut.writeBuf[17] = _in->readBuf[59]; - HIRSOut.writeBuf[18] = _in->readBuf[62]; - HIRSOut.writeBuf[19] = _in->readBuf[63]; - HIRSOut.writeBuf[20] = _in->readBuf[66]; - HIRSOut.writeBuf[21] = _in->readBuf[67]; - HIRSOut.writeBuf[22] = _in->readBuf[70]; - HIRSOut.writeBuf[23] = _in->readBuf[71]; - HIRSOut.writeBuf[24] = _in->readBuf[74]; - HIRSOut.writeBuf[25] = _in->readBuf[75]; - HIRSOut.writeBuf[26] = _in->readBuf[78]; - HIRSOut.writeBuf[27] = _in->readBuf[79]; - HIRSOut.writeBuf[28] = _in->readBuf[82]; - HIRSOut.writeBuf[29] = _in->readBuf[83]; - HIRSOut.writeBuf[30] = _in->readBuf[84]; - HIRSOut.writeBuf[31] = _in->readBuf[85]; - HIRSOut.writeBuf[32] = _in->readBuf[88]; - HIRSOut.writeBuf[33] = _in->readBuf[89]; - HIRSOut.writeBuf[34] = _in->readBuf[92]; - HIRSOut.writeBuf[35] = _in->readBuf[93]; - if (!HIRSOut.swap(36)) { return -1; }; - - // Extract SEM - SEMOut.writeBuf[0] = _in->readBuf[20]; - SEMOut.writeBuf[1] = _in->readBuf[21]; - if (!SEMOut.swap(2)) { return -1; }; - - // Extract DCS - DCSOut.writeBuf[0] = _in->readBuf[18]; - DCSOut.writeBuf[1] = _in->readBuf[19]; - DCSOut.writeBuf[2] = _in->readBuf[24]; - DCSOut.writeBuf[3] = _in->readBuf[25]; - DCSOut.writeBuf[4] = _in->readBuf[28]; - DCSOut.writeBuf[5] = _in->readBuf[29]; - DCSOut.writeBuf[6] = _in->readBuf[32]; - DCSOut.writeBuf[7] = _in->readBuf[33]; - DCSOut.writeBuf[8] = _in->readBuf[40]; - DCSOut.writeBuf[9] = _in->readBuf[41]; - DCSOut.writeBuf[10] = _in->readBuf[44]; - DCSOut.writeBuf[11] = _in->readBuf[45]; - DCSOut.writeBuf[12] = _in->readBuf[52]; - DCSOut.writeBuf[13] = _in->readBuf[53]; - DCSOut.writeBuf[14] = _in->readBuf[56]; - DCSOut.writeBuf[15] = _in->readBuf[57]; - DCSOut.writeBuf[16] = _in->readBuf[60]; - DCSOut.writeBuf[17] = _in->readBuf[61]; - DCSOut.writeBuf[18] = _in->readBuf[64]; - DCSOut.writeBuf[19] = _in->readBuf[65]; - DCSOut.writeBuf[20] = _in->readBuf[68]; - DCSOut.writeBuf[21] = _in->readBuf[69]; - DCSOut.writeBuf[22] = _in->readBuf[72]; - DCSOut.writeBuf[23] = _in->readBuf[73]; - DCSOut.writeBuf[24] = _in->readBuf[76]; - DCSOut.writeBuf[25] = _in->readBuf[77]; - DCSOut.writeBuf[26] = _in->readBuf[86]; - DCSOut.writeBuf[27] = _in->readBuf[87]; - DCSOut.writeBuf[28] = _in->readBuf[90]; - DCSOut.writeBuf[29] = _in->readBuf[91]; - DCSOut.writeBuf[30] = _in->readBuf[94]; - DCSOut.writeBuf[31] = _in->readBuf[95]; - if (!DCSOut.swap(32)) { return -1; }; - - // Extract SBUV - SBUVOut.writeBuf[0] = _in->readBuf[36]; - SBUVOut.writeBuf[1] = _in->readBuf[37]; - SBUVOut.writeBuf[2] = _in->readBuf[80]; - SBUVOut.writeBuf[3] = _in->readBuf[81]; - if (!SBUVOut.swap(4)) { return -1; }; - - - _in->flush(); - return count; - } - - stream HIRSOut; - stream SEMOut; - stream DCSOut; - stream SBUVOut; - - private: - stream* _in; - }; - - inline uint16_t HIRSSignedToUnsigned(uint16_t n) { - return (n & 0x1000) ? (0x1000 + (n & 0xFFF)) : (0xFFF - (n & 0xFFF)); - } - - class HIRSDemux : public generic_block { - public: - HIRSDemux() {} - - HIRSDemux(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - for (int i = 0; i < 20; i++) { - generic_block::registerOutput(&radChannels[i]); - } - - // Clear buffers - for (int i = 0; i < 20; i++) { - for (int j = 0; j < 56; j++) { radChannels[i].writeBuf[j] = 0xFFF; } - } - } - - void setInput(stream* in) { - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - int element = readBits(19, 6, _in->readBuf); - - // If we've skipped or are on a non image element and there's data available, send it - if ((element < lastElement || element > 55) && newImageData) { - newImageData = false; - for (int i = 0; i < 20; i++) { - if (!radChannels[i].swap(56)) { return -1; } - } - - // Clear buffers - for (int i = 0; i < 20; i++) { - for (int j = 0; j < 56; j++) { radChannels[i].writeBuf[j] = 0xFFF; } - } - } - lastElement = element; - - // If data is part of a line, save it - if (element <= 55) { - newImageData = true; - - radChannels[0].writeBuf[element] = HIRSSignedToUnsigned(readBits(26, 13, _in->readBuf)); - radChannels[1].writeBuf[element] = HIRSSignedToUnsigned(readBits(52, 13, _in->readBuf)); - radChannels[2].writeBuf[element] = HIRSSignedToUnsigned(readBits(65, 13, _in->readBuf)); - radChannels[3].writeBuf[element] = HIRSSignedToUnsigned(readBits(91, 13, _in->readBuf)); - radChannels[4].writeBuf[element] = HIRSSignedToUnsigned(readBits(221, 13, _in->readBuf)); - radChannels[5].writeBuf[element] = HIRSSignedToUnsigned(readBits(208, 13, _in->readBuf)); - radChannels[6].writeBuf[element] = HIRSSignedToUnsigned(readBits(143, 13, _in->readBuf)); - radChannels[7].writeBuf[element] = HIRSSignedToUnsigned(readBits(156, 13, _in->readBuf)); - radChannels[8].writeBuf[element] = HIRSSignedToUnsigned(readBits(273, 13, _in->readBuf)); - radChannels[9].writeBuf[element] = HIRSSignedToUnsigned(readBits(182, 13, _in->readBuf)); - radChannels[10].writeBuf[element] = HIRSSignedToUnsigned(readBits(119, 13, _in->readBuf)); - radChannels[11].writeBuf[element] = HIRSSignedToUnsigned(readBits(247, 13, _in->readBuf)); - radChannels[12].writeBuf[element] = HIRSSignedToUnsigned(readBits(78, 13, _in->readBuf)); - radChannels[13].writeBuf[element] = HIRSSignedToUnsigned(readBits(195, 13, _in->readBuf)); - radChannels[14].writeBuf[element] = HIRSSignedToUnsigned(readBits(234, 13, _in->readBuf)); - radChannels[15].writeBuf[element] = HIRSSignedToUnsigned(readBits(260, 13, _in->readBuf)); - radChannels[16].writeBuf[element] = HIRSSignedToUnsigned(readBits(39, 13, _in->readBuf)); - radChannels[17].writeBuf[element] = HIRSSignedToUnsigned(readBits(104, 13, _in->readBuf)); - radChannels[18].writeBuf[element] = HIRSSignedToUnsigned(readBits(130, 13, _in->readBuf)); - radChannels[19].writeBuf[element] = HIRSSignedToUnsigned(readBits(169, 13, _in->readBuf)); - } - - // If we are writing the last pixel of a line, send it already - if (element == 55) { - newImageData = false; - for (int i = 0; i < 20; i++) { - if (!radChannels[i].swap(56)) { return -1; } - } - - // Clear buffers - for (int i = 0; i < 20; i++) { - for (int j = 0; j < 56; j++) { radChannels[i].writeBuf[j] = 0xFFF; } - } - } - - _in->flush(); - return count; - } - - stream radChannels[20]; - - private: - stream* _in; - int lastElement = 0; - bool newImageData = false; - }; - } -} diff --git a/core/src/dsp/noise_reduction.h b/core/src/dsp/noise_reduction.h deleted file mode 100644 index 08c35fe..0000000 --- a/core/src/dsp/noise_reduction.h +++ /dev/null @@ -1,462 +0,0 @@ -#pragma once -#include -#include -#include - -#define NR_TAP_COUNT 64 - -namespace dsp { - class FMIFNoiseReduction : public generic_block { - public: - FMIFNoiseReduction() {} - - FMIFNoiseReduction(stream* in, int tapCount) { init(in, tapCount); } - - ~FMIFNoiseReduction() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - fftwf_destroy_plan(forwardPlan); - fftwf_destroy_plan(backwardPlan); - fftwf_free(delay); - fftwf_free(fft_in); - fftwf_free(fft_window); - fftwf_free(amp_buf); - fftwf_free(fft_cout); - fftwf_free(fft_cin); - fftwf_free(fft_fcout); - } - - void init(stream* in, int tapCount) { - _in = in; - _tapCount = tapCount; - - delay = (complex_t*)fftwf_malloc(sizeof(complex_t) * STREAM_BUFFER_SIZE); - fft_in = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - fft_window = (float*)fftwf_malloc(sizeof(float) * _tapCount); - amp_buf = (float*)fftwf_malloc(sizeof(float) * _tapCount); - fft_cout = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - fft_cin = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - fft_fcout = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - delay_start = &delay[_tapCount]; - - memset(delay, 0, sizeof(complex_t) * STREAM_BUFFER_SIZE); - memset(fft_in, 0, sizeof(complex_t) * _tapCount); - memset(amp_buf, 0, sizeof(float) * _tapCount); - memset(fft_cout, 0, sizeof(complex_t) * _tapCount); - memset(fft_cin, 0, sizeof(complex_t) * _tapCount); - memset(fft_fcout, 0, sizeof(complex_t) * _tapCount); - - for (int i = 0; i < _tapCount; i++) { - fft_window[i] = window_function::blackman(i, _tapCount - 1); - } - - forwardPlan = fftwf_plan_dft_1d(_tapCount, (fftwf_complex*)fft_in, (fftwf_complex*)fft_cout, FFTW_FORWARD, FFTW_ESTIMATE); - backwardPlan = fftwf_plan_dft_1d(_tapCount, (fftwf_complex*)fft_cin, (fftwf_complex*)fft_fcout, FFTW_BACKWARD, FFTW_ESTIMATE); - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setTapCount(int tapCount) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - - _tapCount = tapCount; - - fftwf_destroy_plan(forwardPlan); - fftwf_destroy_plan(backwardPlan); - fftwf_free(delay); - fftwf_free(fft_in); - fftwf_free(fft_window); - fftwf_free(amp_buf); - fftwf_free(fft_cout); - fftwf_free(fft_cin); - fftwf_free(fft_fcout); - - delay = (complex_t*)fftwf_malloc(sizeof(complex_t) * STREAM_BUFFER_SIZE); - fft_in = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - fft_window = (float*)fftwf_malloc(sizeof(float) * _tapCount); - amp_buf = (float*)fftwf_malloc(sizeof(float) * _tapCount); - fft_cout = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - fft_cin = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - fft_fcout = (complex_t*)fftwf_malloc(sizeof(complex_t) * _tapCount); - delay_start = &delay[_tapCount]; - - memset(delay, 0, sizeof(complex_t) * STREAM_BUFFER_SIZE); - memset(fft_in, 0, sizeof(complex_t) * _tapCount); - memset(amp_buf, 0, sizeof(float) * _tapCount); - memset(fft_cout, 0, sizeof(complex_t) * _tapCount); - memset(fft_cin, 0, sizeof(complex_t) * _tapCount); - memset(fft_fcout, 0, sizeof(complex_t) * _tapCount); - - for (int i = 0; i < _tapCount; i++) { - fft_window[i] = window_function::blackman(i, _tapCount - 1); - } - - forwardPlan = fftwf_plan_dft_1d(_tapCount, (fftwf_complex*)fft_in, (fftwf_complex*)fft_cout, FFTW_FORWARD, FFTW_ESTIMATE); - backwardPlan = fftwf_plan_dft_1d(_tapCount, (fftwf_complex*)fft_cin, (fftwf_complex*)fft_fcout, FFTW_BACKWARD, FFTW_ESTIMATE); - - spdlog::info("FM IF Noise reduction set to {0} taps", _tapCount); - - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setLevel(float level) { - _level = powf(10.0f, level / 10.0f); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - // Bypass - if (!bypass) { - memcpy(out.writeBuf, _in->readBuf, count * sizeof(complex_t)); - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - // Write to delay buffer - memcpy(delay_start, _in->readBuf, count * sizeof(complex_t)); - - uint32_t idx = 0; - float actLevel = 0; - - // Iterate the FFT - for (int i = 0; i < count; i++) { - // Apply windows - volk_32fc_32f_multiply_32fc((lv_32fc_t*)fft_in, (lv_32fc_t*)&delay[i], fft_window, _tapCount); - - // Do forward FFT - fftwf_execute(forwardPlan); - - // Process bins here - volk_32fc_magnitude_32f(amp_buf, (lv_32fc_t*)fft_cout, _tapCount); - volk_32f_index_max_32u(&idx, amp_buf, _tapCount); - - // Keep only the bin of highest amplitude - fft_cin[idx] = fft_cout[idx]; - - // Do reverse FFT and get first element - fftwf_execute(backwardPlan); - out.writeBuf[i] = fft_fcout[_tapCount / 2]; - - // Reset the input buffer - fft_cin[idx] = { 0, 0 }; - } - - volk_32f_s32f_multiply_32f((float*)out.writeBuf, (float*)out.writeBuf, 1.0f / (float)_tapCount, count * 2); - - // Copy last values to delay - memmove(delay, &delay[count], _tapCount * sizeof(complex_t)); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - bool bypass = true; - stream out; - - float _level = 0.0f; - - private: - stream* _in; - fftwf_plan forwardPlan; - fftwf_plan backwardPlan; - complex_t* delay; - complex_t* fft_in; - float* fft_window; - float* amp_buf; - complex_t* delay_start; - complex_t* fft_cout; - complex_t* fft_cin; - complex_t* fft_fcout; - - int _tapCount; - }; - - class FFTNoiseReduction : public generic_block { - public: - FFTNoiseReduction() {} - - FFTNoiseReduction(stream* in) { init(in); } - - ~FFTNoiseReduction() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - fftwf_destroy_plan(forwardPlan); - fftwf_destroy_plan(backwardPlan); - fftwf_free(delay); - fftwf_free(fft_in); - fftwf_free(fft_window); - fftwf_free(amp_buf); - fftwf_free(fft_cout); - fftwf_free(fft_fout); - } - - void init(stream* in) { - _in = in; - - delay = (float*)fftwf_malloc(sizeof(float) * STREAM_BUFFER_SIZE); - fft_in = (float*)fftwf_malloc(sizeof(float) * NR_TAP_COUNT); - fft_window = (float*)fftwf_malloc(sizeof(float) * NR_TAP_COUNT); - amp_buf = (float*)fftwf_malloc(sizeof(float) * NR_TAP_COUNT); - fft_cout = (complex_t*)fftwf_malloc(sizeof(complex_t) * NR_TAP_COUNT); - fft_fout = (float*)fftwf_malloc(sizeof(float) * NR_TAP_COUNT); - delay_start = &delay[NR_TAP_COUNT]; - - memset(delay, 0, sizeof(float) * STREAM_BUFFER_SIZE); - memset(fft_in, 0, sizeof(float) * NR_TAP_COUNT); - memset(amp_buf, 0, sizeof(float) * NR_TAP_COUNT); - memset(fft_cout, 0, sizeof(complex_t) * NR_TAP_COUNT); - memset(fft_fout, 0, sizeof(float) * NR_TAP_COUNT); - - for (int i = 0; i < NR_TAP_COUNT; i++) { - fft_window[i] = window_function::blackman(i, NR_TAP_COUNT - 1); - } - - forwardPlan = fftwf_plan_dft_r2c_1d(NR_TAP_COUNT, fft_in, (fftwf_complex*)fft_cout, FFTW_ESTIMATE); - backwardPlan = fftwf_plan_dft_c2r_1d(NR_TAP_COUNT, (fftwf_complex*)fft_cout, fft_fout, FFTW_ESTIMATE); - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - // Bypass - if (!bypass) { - memcpy(out.writeBuf, _in->readBuf, count * sizeof(float)); - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - // Write to delay buffer - memcpy(delay_start, _in->readBuf, count * sizeof(float)); - - // Iterate the FFT - for (int i = 0; i < count; i++) { - // Apply windows - volk_32f_x2_multiply_32f(fft_in, &delay[i], fft_window, NR_TAP_COUNT); - - // Do forward FFT - fftwf_execute(forwardPlan); - - // Process bins here - volk_32fc_magnitude_32f(amp_buf, (lv_32fc_t*)fft_cout, NR_TAP_COUNT / 2); - for (int j = 1; j < NR_TAP_COUNT / 2; j++) { - if (log10f(amp_buf[0]) < level) { - fft_cout[j] = { 0, 0 }; - } - } - - // Do reverse FFT and get first element - fftwf_execute(backwardPlan); - out.writeBuf[i] = fft_fout[NR_TAP_COUNT / 2]; - } - - volk_32f_s32f_multiply_32f(out.writeBuf, out.writeBuf, 1.0f / (float)NR_TAP_COUNT, count); - - // Copy last values to delay - memmove(delay, &delay[count], NR_TAP_COUNT * sizeof(float)); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - bool bypass = true; - stream out; - - float level = 0.0f; - - private: - stream* _in; - fftwf_plan forwardPlan; - fftwf_plan backwardPlan; - float* delay; - float* fft_in; - float* fft_window; - float* amp_buf; - float* delay_start; - complex_t* fft_cout; - float* fft_fout; - }; - - class NoiseBlanker : public generic_block { - public: - NoiseBlanker() {} - - NoiseBlanker(stream* in, float level) { init(in, level); } - - ~NoiseBlanker() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - volk_free(ampBuf); - } - - void init(stream* in, float level) { - _in = in; - _level = powf(10.0f, level / 10.0f); - ; - - ampBuf = (float*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(float), volk_get_alignment()); - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setLevel(float level) { - _level = powf(10.0f, level / 10.0f); - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - // Get amplitudes - volk_32fc_magnitude_32f(ampBuf, (lv_32fc_t*)_in->readBuf, count); - - // Hard limit the amplitude - complex_t inVal; - for (int i = 0; i < count; i++) { - inVal = _in->readBuf[i]; - out.writeBuf[i] = (ampBuf[i] > _level) ? inVal * (_level / inVal.amplitude()) : inVal; - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float* ampBuf; - - float _level; - - stream* _in; - }; - - class NotchFilter : public generic_block { - public: - NotchFilter() {} - - NotchFilter(stream* in, float rate, float offset, float sampleRate) { init(in, rate, offset, sampleRate); } - - void init(stream* in, float rate, float offset, float sampleRate) { - _in = in; - correctionRate = rate; - _offset = offset; - _sampleRate = sampleRate; - - phaseDelta = lv_cmake(std::cos((-_offset / _sampleRate) * 2.0f * FL_M_PI), std::sin((-_offset / _sampleRate) * 2.0f * FL_M_PI)); - phaseDeltaConj = { phaseDelta.real(), -phaseDelta.imag() }; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setCorrectionRate(float rate) { - correctionRate = rate; - } - - void setOffset(float offset) { - _offset = offset; - phaseDelta = lv_cmake(std::cos((-_offset / _sampleRate) * 2.0f * FL_M_PI), std::sin((-_offset / _sampleRate) * 2.0f * FL_M_PI)); - phaseDeltaConj = { phaseDelta.real(), -phaseDelta.imag() }; - } - - void setSampleRate(float sampleRate) { - _sampleRate = sampleRate; - phaseDelta = lv_cmake(std::cos((-_offset / _sampleRate) * 2.0f * FL_M_PI), std::sin((-_offset / _sampleRate) * 2.0f * FL_M_PI)); - phaseDeltaConj = { phaseDelta.real(), -phaseDelta.imag() }; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t*)_in->readBuf, (lv_32fc_t*)_in->readBuf, phaseDelta, &inPhase, count); - - for (int i = 0; i < count; i++) { - out.writeBuf[i] = _in->readBuf[i] - offset; - offset = offset + (out.writeBuf[i] * correctionRate); - } - - volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t*)out.writeBuf, (lv_32fc_t*)out.writeBuf, phaseDeltaConj, &outPhase, count); - - _in->flush(); - - if (!out.swap(count)) { return -1; } - - return count; - } - - stream out; - - private: - stream* _in; - complex_t offset = { 0, 0 }; - lv_32fc_t inPhase = { 1, 0 }; - lv_32fc_t outPhase = { 4, 0 }; - lv_32fc_t phaseDelta; - lv_32fc_t phaseDeltaConj; - float _offset; - float _sampleRate; - float correctionRate; - }; -} \ No newline at end of file diff --git a/core/src/dsp/pll.h b/core/src/dsp/pll.h deleted file mode 100644 index 4b80169..0000000 --- a/core/src/dsp/pll.h +++ /dev/null @@ -1,332 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace dsp { - template - class CostasLoop : public generic_block> { - public: - CostasLoop() {} - - CostasLoop(stream* in, float loopBandwidth) { init(in, loopBandwidth); } - - void init(stream* in, float loopBandwidth) { - _in = in; - lastVCO.re = 1.0f; - lastVCO.im = 0.0f; - _loopBandwidth = loopBandwidth; - - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setLoopBandwidth(float loopBandwidth) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - _loopBandwidth = loopBandwidth; - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - complex_t outVal; - float error; - - for (int i = 0; i < count; i++) { - - // Mix the VFO with the input to create the output value - outVal.re = (lastVCO.re * _in->readBuf[i].re) - (lastVCO.im * _in->readBuf[i].im); - outVal.im = (lastVCO.im * _in->readBuf[i].re) + (lastVCO.re * _in->readBuf[i].im); - out.writeBuf[i] = outVal; - - // Calculate the phase error estimation - if constexpr (ORDER == 2) { - error = outVal.re * outVal.im; - } - if constexpr (ORDER == 4) { - error = (DSP_STEP(outVal.re) * outVal.im) - (DSP_STEP(outVal.im) * outVal.re); - } - if constexpr (ORDER == 8) { - // This is taken from GR, I have no idea how it works but it does... - const float K = (sqrtf(2.0) - 1); - if (fabsf(outVal.re) >= fabsf(outVal.im)) { - error = ((outVal.re > 0.0f ? 1.0f : -1.0f) * outVal.im - - (outVal.im > 0.0f ? 1.0f : -1.0f) * outVal.re * K); - } - else { - error = ((outVal.re > 0.0f ? 1.0f : -1.0f) * outVal.im * K - - (outVal.im > 0.0f ? 1.0f : -1.0f) * outVal.re); - } - } - - if (error > 1.0f) { error = 1.0f; } - else if (error < -1.0f) { - error = -1.0f; - } - - // Integrate frequency and clamp it - vcoFrequency += _beta * error; - if (vcoFrequency > 1.0f) { vcoFrequency = 1.0f; } - else if (vcoFrequency < -1.0f) { - vcoFrequency = -1.0f; - } - - // Calculate new phase and wrap it - vcoPhase += vcoFrequency + (_alpha * error); - while (vcoPhase > (2.0f * FL_M_PI)) { vcoPhase -= (2.0f * FL_M_PI); } - while (vcoPhase < (-2.0f * FL_M_PI)) { vcoPhase += (2.0f * FL_M_PI); } - - // Calculate output - lastVCO.re = cosf(-vcoPhase); - lastVCO.im = sinf(-vcoPhase); - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float _loopBandwidth = 1.0f; - - float _alpha; // Integral coefficient - float _beta; // Proportional coefficient - float vcoFrequency = 0.0f; - float vcoPhase = 0.0f; - complex_t lastVCO; - - stream* _in; - }; - - template - class CarrierTrackingPLL : public generic_block> { - public: - CarrierTrackingPLL() {} - - CarrierTrackingPLL(stream* in, float loopBandwidth) { init(in, loopBandwidth); } - - void init(stream* in, float loopBandwidth) { - _in = in; - lastVCO.re = 1.0f; - lastVCO.im = 0.0f; - _loopBandwidth = loopBandwidth; - - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setLoopBandwidth(float loopBandwidth) { - assert(generic_block>::_block_init); - generic_block>::tempStop(); - _loopBandwidth = loopBandwidth; - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - complex_t outVal; - float error; - - for (int i = 0; i < count; i++) { - - // Mix the VFO with the input to create the output value - outVal.re = (lastVCO.re * _in->readBuf[i].re) - ((-lastVCO.im) * _in->readBuf[i].im); - outVal.im = ((-lastVCO.im) * _in->readBuf[i].re) + (lastVCO.re * _in->readBuf[i].im); - - if constexpr (std::is_same_v) { - out.writeBuf[i] = outVal.fastPhase(); - } - if constexpr (std::is_same_v) { - out.writeBuf[i] = outVal; - } - - // Calculate the phase error estimation - // TODO: Figure out why fastPhase doesn't work - error = _in->readBuf[i].phase() - vcoPhase; - if (error > 3.1415926535f) { error -= 2.0f * 3.1415926535f; } - else if (error <= -3.1415926535f) { - error += 2.0f * 3.1415926535f; - } - - // if (error > 1.0f) { error = 1.0f; } - // else if (error < -1.0f) { error = -1.0f; } - - // Integrate frequency and clamp it - vcoFrequency += _beta * error; - if (vcoFrequency > 1.0f) { vcoFrequency = 1.0f; } - else if (vcoFrequency < -1.0f) { - vcoFrequency = -1.0f; - } - - // Calculate new phase and wrap it - vcoPhase += vcoFrequency + (_alpha * error); - while (vcoPhase > (2.0f * FL_M_PI)) { vcoPhase -= (2.0f * FL_M_PI); } - while (vcoPhase < (-2.0f * FL_M_PI)) { vcoPhase += (2.0f * FL_M_PI); } - - // Calculate output - lastVCO.re = cosf(vcoPhase); - lastVCO.im = sinf(vcoPhase); - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float _loopBandwidth = 1.0f; - - float _alpha; // Integral coefficient - float _beta; // Proportional coefficient - float vcoFrequency = 0.0f; - float vcoPhase = 0.0f; - complex_t lastVCO; - - stream* _in; - }; - - class PLL : public generic_block { - public: - PLL() {} - - PLL(stream* in, float loopBandwidth) { init(in, loopBandwidth); } - - void init(stream* in, float loopBandwidth) { - _in = in; - lastVCO.re = 1.0f; - lastVCO.im = 0.0f; - _loopBandwidth = loopBandwidth; - - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setLoopBandwidth(float loopBandwidth) { - assert(generic_block::_block_init); - generic_block::tempStop(); - _loopBandwidth = loopBandwidth; - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - complex_t outVal; - float error; - - for (int i = 0; i < count; i++) { - out.writeBuf[i] = lastVCO; - - // Calculate the phase error estimation - // TODO: Figure out why fastPhase doesn't work - error = _in->readBuf[i].phase() - vcoPhase; - if (error > 3.1415926535f) { error -= 2.0f * 3.1415926535f; } - else if (error <= -3.1415926535f) { - error += 2.0f * 3.1415926535f; - } - - // Integrate frequency and clamp it - vcoFrequency += _beta * error; - if (vcoFrequency > 1.0f) { vcoFrequency = 1.0f; } - else if (vcoFrequency < -1.0f) { - vcoFrequency = -1.0f; - } - - // Calculate new phase and wrap it - vcoPhase += vcoFrequency + (_alpha * error); - while (vcoPhase > (2.0f * FL_M_PI)) { vcoPhase -= (2.0f * FL_M_PI); } - while (vcoPhase < (-2.0f * FL_M_PI)) { vcoPhase += (2.0f * FL_M_PI); } - - // Calculate output - lastVCO.re = cosf(vcoPhase); - lastVCO.im = sinf(vcoPhase); - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float _loopBandwidth = 1.0f; - - float _alpha; // Integral coefficient - float _beta; // Proportional coefficient - float vcoFrequency = ((19000.0f / 250000.0f) * 2.0f * FL_M_PI); - float vcoPhase = 0.0f; - complex_t lastVCO; - - stream* _in; - }; -} \ No newline at end of file diff --git a/core/src/dsp/processing.h b/core/src/dsp/processing.h deleted file mode 100644 index 1cda025..0000000 --- a/core/src/dsp/processing.h +++ /dev/null @@ -1,609 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include - -namespace dsp { - template - class FrequencyXlator : public generic_block> { - public: - FrequencyXlator() {} - - FrequencyXlator(stream* in, float sampleRate, float freq) { init(in, sampleRate, freq); } - - void init(stream* in, float sampleRate, float freq) { - _in = in; - _sampleRate = sampleRate; - _freq = freq; - phase = lv_cmake(1.0f, 0.0f); - phaseDelta = lv_cmake(std::cos((_freq / _sampleRate) * 2.0f * FL_M_PI), std::sin((_freq / _sampleRate) * 2.0f * FL_M_PI)); - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setSampleRate(float sampleRate) { - assert(generic_block>::_block_init); - _sampleRate = sampleRate; - phaseDelta = lv_cmake(std::cos((_freq / _sampleRate) * 2.0f * FL_M_PI), std::sin((_freq / _sampleRate) * 2.0f * FL_M_PI)); - } - - float getSampleRate() { - assert(generic_block>::_block_init); - return _sampleRate; - } - - void setFrequency(float freq) { - assert(generic_block>::_block_init); - _freq = freq; - phaseDelta = lv_cmake(std::cos((_freq / _sampleRate) * 2.0f * FL_M_PI), std::sin((_freq / _sampleRate) * 2.0f * FL_M_PI)); - } - - float getFrequency() { - assert(generic_block>::_block_init); - return _freq; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - // TODO: Do float xlation - if constexpr (std::is_same_v) { - spdlog::error("XLATOR NOT IMPLEMENTED FOR FLOAT"); - } - if constexpr (std::is_same_v) { - volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t*)out.writeBuf, (lv_32fc_t*)_in->readBuf, phaseDelta, &phase, count); - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float _sampleRate; - float _freq; - lv_32fc_t phaseDelta; - lv_32fc_t phase; - stream* _in; - }; - - class AGC : public generic_block { - public: - AGC() {} - - AGC(stream* in, float fallRate, float sampleRate) { init(in, fallRate, sampleRate); } - - void init(stream* in, float fallRate, float sampleRate) { - _in = in; - _sampleRate = sampleRate; - _fallRate = fallRate; - _CorrectedFallRate = _fallRate / _sampleRate; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setSampleRate(float sampleRate) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - _sampleRate = sampleRate; - _CorrectedFallRate = _fallRate / _sampleRate; - } - - void setFallRate(float fallRate) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - _fallRate = fallRate; - _CorrectedFallRate = _fallRate / _sampleRate; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - level = pow(10, ((10.0f * log10f(level)) - (_CorrectedFallRate * count)) / 10.0f); - - if (level < 10e-14) { level = 10e-14; } - - float absVal; - for (int i = 0; i < count; i++) { - absVal = fabsf(_in->readBuf[i]); - if (absVal > level) { level = absVal; } - } - - - volk_32f_s32f_multiply_32f(out.writeBuf, _in->readBuf, 1.0f / level, count); - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float level = 0.0f; - float _fallRate; - float _CorrectedFallRate; - float _sampleRate; - stream* _in; - }; - - class ComplexAGC : public generic_block { - public: - ComplexAGC() {} - - ComplexAGC(stream* in, float setPoint, float maxGain, float rate) { init(in, setPoint, maxGain, rate); } - - void init(stream* in, float setPoint, float maxGain, float rate) { - _in = in; - _setPoint = setPoint; - _maxGain = maxGain; - _rate = rate; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setSetPoint(float setPoint) { - assert(generic_block::_block_init); - _setPoint = setPoint; - } - - void setMaxGain(float maxGain) { - assert(generic_block::_block_init); - _maxGain = maxGain; - } - - void setRate(float rate) { - assert(generic_block::_block_init); - _rate = rate; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - dsp::complex_t val; - for (int i = 0; i < count; i++) { - val = _in->readBuf[i] * _gain; - out.writeBuf[i] = val; - _gain += (_setPoint - val.amplitude()) * _rate; - if (_gain > _maxGain) { _gain = _maxGain; } - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float _gain = 1.0f; - float _setPoint = 1.0f; - float _maxGain = 10e4; - float _rate = 10e-4; - - stream* _in; - }; - - class DelayImag : public generic_block { - public: - DelayImag() {} - - DelayImag(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - dsp::complex_t val; - for (int i = 0; i < count; i++) { - val = _in->readBuf[i]; - out.writeBuf[i].re = val.re; - out.writeBuf[i].im = lastIm; - lastIm = val.im; - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float lastIm = 0.0f; - stream* _in; - }; - - - template - class Volume : public generic_block> { - public: - Volume() {} - - Volume(stream* in, float volume) { init(in, volume); } - - void init(stream* in, float volume) { - _in = in; - _volume = volume; - level = powf(_volume, 2); - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setVolume(float volume) { - assert(generic_block>::_block_init); - _volume = volume; - level = powf(_volume, 2); - } - - float getVolume() { - assert(generic_block>::_block_init); - return _volume; - } - - void setMuted(bool muted) { - assert(generic_block>::_block_init); - _muted = muted; - } - - bool getMuted() { - assert(generic_block>::_block_init); - return _muted; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - if (_muted) { - if constexpr (std::is_same_v) { - memset(out.writeBuf, 0, sizeof(stereo_t) * count); - } - else { - memset(out.writeBuf, 0, sizeof(float) * count); - } - } - else { - if constexpr (std::is_same_v) { - volk_32f_s32f_multiply_32f((float*)out.writeBuf, (float*)_in->readBuf, level, count * 2); - } - else { - volk_32f_s32f_multiply_32f((float*)out.writeBuf, (float*)_in->readBuf, level, count); - } - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - float level = 1.0f; - float _volume = 1.0f; - bool _muted = false; - stream* _in; - }; - - class Squelch : public generic_block { - public: - Squelch() {} - - Squelch(stream* in, float level) { init(in, level); } - - ~Squelch() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - delete[] normBuffer; - generic_block::_block_init = false; - } - - void init(stream* in, float level) { - _in = in; - _level = level; - normBuffer = new float[STREAM_BUFFER_SIZE]; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setLevel(float level) { - assert(generic_block::_block_init); - _level = level; - } - - float getLevel() { - assert(generic_block::_block_init); - return _level; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - float sum; - volk_32fc_magnitude_32f(normBuffer, (lv_32fc_t*)_in->readBuf, count); - volk_32f_accumulator_s32f(&sum, normBuffer, count); - sum /= (float)count; - - if (10.0f * log10f(sum) >= _level) { - memcpy(out.writeBuf, _in->readBuf, count * sizeof(complex_t)); - } - else { - memset(out.writeBuf, 0, count * sizeof(complex_t)); - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - - private: - float* normBuffer; - float _level = -50.0f; - stream* _in; - }; - - template - class Packer : public generic_block> { - public: - Packer() {} - - Packer(stream* in, int count) { init(in, count); } - - void init(stream* in, int count) { - _in = in; - samples = count; - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setSampleCount(int count) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - samples = count; - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { - read = 0; - return -1; - } - - for (int i = 0; i < count; i++) { - out.writeBuf[read++] = _in->readBuf[i]; - if (read >= samples) { - read = 0; - if (!out.swap(samples)) { - _in->flush(); - read = 0; - return -1; - } - } - } - - _in->flush(); - - return count; - } - - stream out; - - private: - int samples = 1; - int read = 0; - stream* _in; - }; - - class Threshold : public generic_block { - public: - Threshold() {} - - Threshold(stream* in) { init(in); } - - ~Threshold() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - delete[] normBuffer; - generic_block::_block_init = false; - } - - void init(stream* in) { - _in = in; - normBuffer = new float[STREAM_BUFFER_SIZE]; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void setLevel(float level) { - assert(generic_block::_block_init); - _level = level; - } - - float getLevel() { - assert(generic_block::_block_init); - return _level; - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - for (int i = 0; i < count; i++) { - out.writeBuf[i] = (_in->readBuf[i] > 0.0f); - } - - _in->flush(); - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - - private: - float* normBuffer; - float _level = -50.0f; - stream* _in; - }; - - class BFMPilotToStereo : public generic_block { - public: - BFMPilotToStereo() {} - - BFMPilotToStereo(stream* in) { init(in); } - - ~BFMPilotToStereo() { - generic_block::stop(); - delete[] buffer; - } - - void init(stream* in) { - _in = in; - - buffer = new complex_t[STREAM_BUFFER_SIZE]; - - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInputs(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - volk_32fc_x2_multiply_32fc((lv_32fc_t*)buffer, (lv_32fc_t*)_in->readBuf, (lv_32fc_t*)_in->readBuf, count); - _in->flush(); - - volk_32fc_conjugate_32fc((lv_32fc_t*)out.writeBuf, (lv_32fc_t*)buffer, count); - - if (!out.swap(count)) { return -1; } - return count; - } - - stream out; - - private: - stream* _in; - - complex_t* buffer; - }; -} \ No newline at end of file diff --git a/core/src/dsp/resampling.h b/core/src/dsp/resampling.h deleted file mode 100644 index ab6202f..0000000 --- a/core/src/dsp/resampling.h +++ /dev/null @@ -1,218 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace dsp { - template - class PolyphaseResampler : public generic_block> { - public: - PolyphaseResampler() {} - - PolyphaseResampler(stream* in, dsp::filter_window::generic_window* window, float inSampleRate, float outSampleRate) { init(in, window, inSampleRate, outSampleRate); } - - ~PolyphaseResampler() { - if (!generic_block>::_block_init) { return; } - generic_block>::stop(); - volk_free(buffer); - volk_free(taps); - freeTapPhases(); - generic_block>::_block_init = false; - } - - void init(stream* in, dsp::filter_window::generic_window* window, float inSampleRate, float outSampleRate) { - _in = in; - _window = window; - _inSampleRate = inSampleRate; - _outSampleRate = outSampleRate; - - int _gcd = std::gcd((int)_inSampleRate, (int)_outSampleRate); - _interp = _outSampleRate / _gcd; - _decim = _inSampleRate / _gcd; - - tapCount = _window->getTapCount(); - taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment()); - _window->createTaps(taps, tapCount, _interp); - - buildTapPhases(); - - buffer = (T*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(T) * 2, volk_get_alignment()); - memset(buffer, 0, STREAM_BUFFER_SIZE * sizeof(T) * 2); - counter = 0; - offset = 0; - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - counter = 0; - offset = 0; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setInSampleRate(float inSampleRate) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - _inSampleRate = inSampleRate; - int _gcd = std::gcd((int)_inSampleRate, (int)_outSampleRate); - _interp = _outSampleRate / _gcd; - _decim = _inSampleRate / _gcd; - buildTapPhases(); - counter = 0; - offset = 0; - generic_block>::tempStart(); - } - - void setOutSampleRate(float outSampleRate) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - _outSampleRate = outSampleRate; - int _gcd = std::gcd((int)_inSampleRate, (int)_outSampleRate); - _interp = _outSampleRate / _gcd; - _decim = _inSampleRate / _gcd; - buildTapPhases(); - counter = 0; - offset = 0; - generic_block>::tempStart(); - } - - int getInterpolation() { - assert(generic_block>::_block_init); - return _interp; - } - - int getDecimation() { - assert(generic_block>::_block_init); - return _decim; - } - - void updateWindow(dsp::filter_window::generic_window* window) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - _window = window; - volk_free(taps); - tapCount = window->getTapCount(); - taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment()); - window->createTaps(taps, tapCount, _interp); - buildTapPhases(); - counter = 0; - offset = 0; - generic_block>::tempStart(); - } - - int calcOutSize(int in) { - assert(generic_block>::_block_init); - return (in * _interp) / _decim; - } - - virtual int run() override { - int count = _in->read(); - if (count < 0) { - return -1; - } - - memcpy(&buffer[tapsPerPhase], _in->readBuf, count * sizeof(T)); - _in->flush(); - - // Write to output - int outIndex = 0; - int inOffset = offset; - int _counter = counter; - if constexpr (std::is_same_v) { - while (inOffset < count) { - volk_32f_x2_dot_prod_32f(&out.writeBuf[outIndex++], &buffer[inOffset], tapPhases[_counter], tapsPerPhase); - _counter += _decim; - inOffset += (_counter / _interp); - _counter = (_counter % _interp); - } - } - if constexpr (std::is_same_v || std::is_same_v) { - while (inOffset < count) { - volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&out.writeBuf[outIndex++], (lv_32fc_t*)&buffer[inOffset], tapPhases[_counter], tapsPerPhase); - _counter += _decim; - inOffset += (_counter / _interp); - _counter = (_counter % _interp); - } - } - - if (!out.swap(outIndex)) { return -1; } - - offset = inOffset - count; - counter = _counter; - - memmove(buffer, &buffer[count], tapsPerPhase * sizeof(T)); - - return count; - } - - stream out; - - private: - void buildTapPhases() { - if (!taps) { - return; - } - - if (!tapPhases.empty()) { - freeTapPhases(); - } - - int phases = _interp; - tapsPerPhase = (tapCount + phases - 1) / phases; //Integer division ceiling - - bufStart = &buffer[tapsPerPhase]; - - for (int i = 0; i < phases; i++) { - tapPhases.push_back((float*)volk_malloc(tapsPerPhase * sizeof(float), volk_get_alignment())); - } - - int currentTap = 0; - for (int tap = 0; tap < tapsPerPhase; tap++) { - for (int phase = 0; phase < phases; phase++) { - if (currentTap < tapCount) { - tapPhases[(_interp - 1) - phase][tap] = taps[currentTap++]; - } - else { - tapPhases[(_interp - 1) - phase][tap] = 0; - } - } - } - } - - void freeTapPhases() { - for (auto& tapPhase : tapPhases) { - volk_free(tapPhase); - } - tapPhases.clear(); - } - - stream* _in; - - dsp::filter_window::generic_window* _window; - - T* bufStart; - T* buffer; - int tapCount; - int _interp, _decim; - float _inSampleRate, _outSampleRate; - float* taps; - - int counter = 0; - int offset = 0; - - int tapsPerPhase; - std::vector tapPhases; - }; -} \ No newline at end of file diff --git a/core/src/dsp/routing.h b/core/src/dsp/routing.h deleted file mode 100644 index 761f2cd..0000000 --- a/core/src/dsp/routing.h +++ /dev/null @@ -1,243 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace dsp { - template - class Splitter : public generic_block> { - public: - Splitter() {} - - Splitter(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void bindStream(stream* stream) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - out.push_back(stream); - generic_block::registerOutput(stream); - generic_block::tempStart(); - } - - void unbindStream(stream* stream) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterOutput(stream); - out.erase(std::remove(out.begin(), out.end(), stream), out.end()); - generic_block::tempStart(); - } - - private: - int run() { - // TODO: If too slow, buffering might be necessary - int count = _in->read(); - if (count < 0) { return -1; } - for (const auto& stream : out) { - memcpy(stream->writeBuf, _in->readBuf, count * sizeof(T)); - if (!stream->swap(count)) { return -1; } - } - _in->flush(); - return count; - } - - stream* _in; - std::vector*> out; - }; - - template - class StreamDoubler : public generic_block> { - public: - StreamDoubler() {} - - StreamDoubler(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&outA); - generic_block::registerOutput(&outB); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - stream outA; - stream outB; - - private: - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - memcpy(outA.writeBuf, _in->readBuf, count * sizeof(T)); - memcpy(outB.writeBuf, _in->readBuf, count * sizeof(T)); - - _in->flush(); - - if (!outA.swap(count)) { return -1; } - if (!outB.swap(count)) { return -1; } - - return count; - } - - stream* _in; - }; - - - // NOTE: I'm not proud of this, it's BAD and just taken from the previous DSP, but it works... - template - class Reshaper : public generic_block> { - public: - Reshaper() {} - - Reshaper(stream* in, int keep, int skip) { init(in, keep, skip); } - - // NOTE: For some reason, the base class destructor doesn't get called.... this is a temporary fix I guess - // I also don't check for _block_init for the exact sample reason, something's weird - ~Reshaper() { - if (!generic_block>::_block_init) { return; } - generic_block>::stop(); - } - - void init(stream* in, int keep, int skip) { - _in = in; - _keep = keep; - _skip = skip; - ringBuf.init(keep * 2); - generic_block>::registerInput(_in); - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - void setKeep(int keep) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - _keep = keep; - ringBuf.setMaxLatency(keep * 2); - generic_block>::tempStart(); - } - - void setSkip(int skip) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - _skip = skip; - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - ringBuf.write(_in->readBuf, count); - _in->flush(); - return count; - } - - stream out; - - private: - void doStart() override { - workThread = std::thread(&Reshaper::loop, this); - bufferWorkerThread = std::thread(&Reshaper::bufferWorker, this); - } - - void loop() { - while (run() >= 0) - ; - } - - void doStop() override { - _in->stopReader(); - ringBuf.stopReader(); - out.stopWriter(); - ringBuf.stopWriter(); - - if (workThread.joinable()) { - workThread.join(); - } - if (bufferWorkerThread.joinable()) { - bufferWorkerThread.join(); - } - - _in->clearReadStop(); - ringBuf.clearReadStop(); - out.clearWriteStop(); - ringBuf.clearWriteStop(); - } - - void bufferWorker() { - T* buf = new T[_keep]; - bool delay = _skip < 0; - - int readCount = std::min(_keep + _skip, _keep); - int skip = std::max(_skip, 0); - int delaySize = (-_skip) * sizeof(T); - int delayCount = (-_skip); - - T* start = &buf[std::max(-_skip, 0)]; - T* delayStart = &buf[_keep + _skip]; - - while (true) { - if (delay) { - memmove(buf, delayStart, delaySize); - if constexpr (std::is_same_v || std::is_same_v) { - for (int i = 0; i < delayCount; i++) { - buf[i].re /= 10.0f; - buf[i].im /= 10.0f; - } - } - } - if (ringBuf.readAndSkip(start, readCount, skip) < 0) { break; }; - memcpy(out.writeBuf, buf, _keep * sizeof(T)); - if (!out.swap(_keep)) { break; } - } - delete[] buf; - } - - stream* _in; - int _outBlockSize; - RingBuffer ringBuf; - std::thread bufferWorkerThread; - std::thread workThread; - int _keep, _skip; - }; -} \ No newline at end of file diff --git a/core/src/dsp/sink.h b/core/src/dsp/sink.h index c17c58f..601b535 100644 --- a/core/src/dsp/sink.h +++ b/core/src/dsp/sink.h @@ -1,189 +1,35 @@ #pragma once -#include -#include -#include +#include "block.h" namespace dsp { template - class HandlerSink : public generic_block> { + class Sink : public block { public: - HandlerSink() {} + Sink() {} - HandlerSink(stream* in, void (*handler)(T* data, int count, void* ctx), void* ctx) { init(in, handler, ctx); } + Sink(stream* in) { init(in); } - void init(stream* in, void (*handler)(T* data, int count, void* ctx), void* ctx) { + virtual ~Sink() {} + + virtual void init(stream* in) { _in = in; - _handler = handler; - _ctx = ctx; - generic_block>::registerInput(_in); - generic_block>::_block_init = true; + registerInput(_in); + _block_init = true; } - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); + virtual void setInput(stream* in) { + assert(_block_init); + std::lock_guard lck(ctrlMtx); + tempStop(); + unregisterInput(_in); _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); + registerInput(_in); + tempStart(); } - void setHandler(void (*handler)(T* data, int count, void* ctx), void* ctx) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - _handler = handler; - _ctx = ctx; - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - _handler(_in->readBuf, count, _ctx); - _in->flush(); - return count; - } - - private: - stream* _in; - void (*_handler)(T* data, int count, void* ctx); - void* _ctx; - }; - - template - class RingBufferSink : public generic_block> { - public: - RingBufferSink() {} - - RingBufferSink(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - data.init(480); // TODO: Use an argument - generic_block>::registerInput(_in); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - if (data.write(_in->readBuf, count) < 0) { return -1; } - _in->flush(); - return count; - } - - RingBuffer data; - - private: - void doStop() { - _in->stopReader(); - data.stopWriter(); - if (generic_block>::workerThread.joinable()) { - generic_block>::workerThread.join(); - } - _in->clearReadStop(); - data.clearWriteStop(); - } + virtual int run() = 0; + protected: stream* _in; }; - - template - class NullSink : public generic_block> { - public: - NullSink() {} - - NullSink(stream* in) { init(in); } - - void init(stream* in) { - _in = in; - generic_block>::registerInput(_in); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - _in->flush(); - return count; - } - - private: - stream* _in; - }; - - template - class FileSink : public generic_block> { - public: - FileSink() {} - - FileSink(stream* in, std::string path) { init(in, path); } - - ~FileSink() { - if (!generic_block>::_block_init) { return; } - generic_block>::stop(); - if (file.is_open()) { file.close(); } - generic_block>::_block_init = false; - } - - void init(stream* in, std::string path) { - _in = in; - file = std::ofstream(path, std::ios::binary); - generic_block>::registerInput(_in); - generic_block>::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - generic_block>::unregisterInput(_in); - _in = in; - generic_block>::registerInput(_in); - generic_block>::tempStart(); - } - - bool isOpen() { - assert(generic_block>::_block_init); - return file.is_open(); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - if (file.is_open()) { - file.write((char*)_in->readBuf, count * sizeof(T)); - } - - _in->flush(); - return count; - } - - private: - stream* _in; - std::ofstream file; - }; -} \ No newline at end of file +} diff --git a/core/src/dsp/source.h b/core/src/dsp/source.h index 1efb4ae..24ed64c 100644 --- a/core/src/dsp/source.h +++ b/core/src/dsp/source.h @@ -1,114 +1,23 @@ #pragma once -#include -#include +#include "block.h" namespace dsp { - class SineSource : public generic_block { - public: - SineSource() {} - - SineSource(int blockSize, float sampleRate, float freq) { init(blockSize, sampleRate, freq); } - - void init(int blockSize, float sampleRate, float freq) { - _blockSize = blockSize; - _sampleRate = sampleRate; - _freq = freq; - zeroPhase = (lv_32fc_t*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(lv_32fc_t), volk_get_alignment()); - for (int i = 0; i < STREAM_BUFFER_SIZE; i++) { - zeroPhase[i] = lv_cmake(1.0f, 0.0f); - } - phase = lv_cmake(1.0f, 0.0f); - phaseDelta = lv_cmake(std::cos((_freq / _sampleRate) * 2.0f * FL_M_PI), std::sin((_freq / _sampleRate) * 2.0f * FL_M_PI)); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setBlockSize(int blockSize) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - _blockSize = blockSize; - generic_block::tempStart(); - } - - int getBlockSize() { - assert(generic_block::_block_init); - return _blockSize; - } - - void setSampleRate(float sampleRate) { - assert(generic_block::_block_init); - _sampleRate = sampleRate; - phaseDelta = lv_cmake(std::cos((_freq / _sampleRate) * 2.0f * FL_M_PI), std::sin((_freq / _sampleRate) * 2.0f * FL_M_PI)); - } - - float getSampleRate() { - assert(generic_block::_block_init); - return _sampleRate; - } - - void setFrequency(float freq) { - assert(generic_block::_block_init); - _freq = freq; - phaseDelta = lv_cmake(std::cos((_freq / _sampleRate) * 2.0f * FL_M_PI), std::sin((_freq / _sampleRate) * 2.0f * FL_M_PI)); - } - - float getFrequency() { - assert(generic_block::_block_init); - return _freq; - } - - int run() { - volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t*)out.writeBuf, zeroPhase, phaseDelta, &phase, _blockSize); - if (!out.swap(_blockSize)) { return -1; } - return _blockSize; - } - - stream out; - - private: - int _blockSize; - float _sampleRate; - float _freq; - lv_32fc_t phaseDelta; - lv_32fc_t phase; - lv_32fc_t* zeroPhase; - }; - template - class HandlerSource : public generic_block> { + class Source : public block { public: - HandlerSource() {} + Source() {} - HandlerSource(int (*handler)(T* data, void* ctx), void* ctx) { init(handler, ctx); } + Source() { init(); } - void init(int (*handler)(T* data, void* ctx), void* ctx) { - _handler = handler; - _ctx = ctx; - generic_block>::registerOutput(&out); - generic_block>::_block_init = true; + virtual ~Source() {} + + virtual void init() { + registerOutput(&out); + _block_init = true; } - void setHandler(int (*handler)(T* data, void* ctx), void* ctx) { - assert(generic_block>::_block_init); - std::lock_guard lck(generic_block>::ctrlMtx); - generic_block>::tempStop(); - _handler = handler; - _ctx = ctx; - generic_block>::tempStart(); - } - - int run() { - int count = _handler(out.writeBuf, _ctx); - if (count < 0) { return -1; } - out.swap(count); - return count; - } + virtual int run() = 0; stream out; - - private: - int (*_handler)(T* data, void* ctx); - void* _ctx; }; -} \ No newline at end of file +} diff --git a/core/src/dsp/stereo_fm.h b/core/src/dsp/stereo_fm.h deleted file mode 100644 index dc364e2..0000000 --- a/core/src/dsp/stereo_fm.h +++ /dev/null @@ -1,291 +0,0 @@ -#pragma once -#include -#include -#include - -namespace dsp { - - class FMStereoDemuxPilotFilter : public generic_block { - public: - FMStereoDemuxPilotFilter() {} - - FMStereoDemuxPilotFilter(stream* in, dsp::filter_window::generic_complex_window* window) { init(in, window); } - - ~FMStereoDemuxPilotFilter() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); - volk_free(buffer); - volk_free(taps); - generic_block::_block_init = false; - } - - void init(stream* in, dsp::filter_window::generic_complex_window* window) { - _in = in; - - tapCount = window->getTapCount(); - taps = (complex_t*)volk_malloc(tapCount * sizeof(complex_t), volk_get_alignment()); - window->createTaps(taps, tapCount); - - buffer = (complex_t*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(complex_t) * 2, volk_get_alignment()); - bufStart = &buffer[tapCount]; - generic_block::registerInput(_in); - generic_block::registerOutput(&dataOut); - generic_block::registerOutput(&pilotOut); - generic_block::_block_init = true; - } - - void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); - _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); - } - - void updateWindow(dsp::filter_window::generic_complex_window* window) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - std::lock_guard lck2(bufMtx); - _window = window; - volk_free(taps); - tapCount = window->getTapCount(); - taps = (complex_t*)volk_malloc(tapCount * sizeof(complex_t), volk_get_alignment()); - bufStart = &buffer[tapCount]; - window->createTaps(taps, tapCount); - } - - int run() { - int count = _in->read(); - if (count < 0) { return -1; } - - bufMtx.lock(); - - memcpy(bufStart, _in->readBuf, count * sizeof(complex_t)); - _in->flush(); - - for (int i = 0; i < count; i++) { - volk_32fc_x2_dot_prod_32fc((lv_32fc_t*)&pilotOut.writeBuf[i], (lv_32fc_t*)&buffer[i + 1], (lv_32fc_t*)taps, tapCount); - } - - memcpy(dataOut.writeBuf, &buffer[tapCount - ((tapCount - 1) / 2)], count * sizeof(complex_t)); - - if (!pilotOut.swap(count) || !dataOut.swap(count)) { - bufMtx.unlock(); - return -1; - } - - memmove(buffer, &buffer[count], tapCount * sizeof(complex_t)); - - bufMtx.unlock(); - - return count; - } - - stream dataOut; - stream pilotOut; - - - private: - stream* _in; - - dsp::filter_window::generic_complex_window* _window; - - std::mutex bufMtx; - - complex_t* bufStart; - complex_t* buffer; - int tapCount; - complex_t* taps; - }; - - class FMStereoDemux : public generic_block { - public: - FMStereoDemux() {} - - FMStereoDemux(stream* data, stream* pilot, float loopBandwidth) { init(data, pilot, loopBandwidth); } - - void init(stream* data, stream* pilot, float loopBandwidth) { - _data = data; - _pilot = pilot; - lastVCO.re = 1.0f; - lastVCO.im = 0.0f; - _loopBandwidth = loopBandwidth; - - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - - generic_block::registerInput(_data); - generic_block::registerInput(_pilot); - generic_block::registerOutput(&AplusBOut); - generic_block::registerOutput(&AminusBOut); - generic_block::_block_init = true; - } - - void setInput(stream* data, stream* pilot) { - assert(generic_block::_block_init); - generic_block::tempStop(); - generic_block::unregisterInput(_data); - generic_block::unregisterInput(_pilot); - _data = data; - _pilot = pilot; - generic_block::registerInput(_data); - generic_block::registerInput(_pilot); - generic_block::tempStart(); - } - - void setLoopBandwidth(float loopBandwidth) { - assert(generic_block::_block_init); - generic_block::tempStop(); - _loopBandwidth = loopBandwidth; - float dampningFactor = sqrtf(2.0f) / 2.0f; - float denominator = (1.0 + 2.0 * dampningFactor * _loopBandwidth + _loopBandwidth * _loopBandwidth); - _alpha = (4 * dampningFactor * _loopBandwidth) / denominator; - _beta = (4 * _loopBandwidth * _loopBandwidth) / denominator; - generic_block::tempStart(); - } - - int run() { - int count = _data->read(); - if (count < 0) { return -1; } - int pCount = _pilot->read(); - if (pCount < 0) { return -1; } - - complex_t doubledVCO; - float error; - - volk_32fc_deinterleave_real_32f(AplusBOut.writeBuf, (lv_32fc_t*)_data->readBuf, count); - - for (int i = 0; i < count; i++) { - // Double the VCO, then mix it with the input data. - // IMPORTANT: THERE SHOULDN'T BE A NEED FOR A GAIN HERE - doubledVCO = lastVCO * lastVCO; - AminusBOut.writeBuf[i] = (_data->readBuf[i].re * doubledVCO.re) * 2.0f; - - // Calculate the phase error estimation - error = _pilot->readBuf[i].phase() - vcoPhase; - if (error > 3.1415926535f) { error -= 2.0f * 3.1415926535f; } - else if (error <= -3.1415926535f) { - error += 2.0f * 3.1415926535f; - } - - // Integrate frequency and clamp it - vcoFrequency += _beta * error; - if (vcoFrequency > upperLimit) { vcoFrequency = upperLimit; } - else if (vcoFrequency < lowerLimit) { - vcoFrequency = lowerLimit; - } - - // Calculate new phase and wrap it - vcoPhase += vcoFrequency + (_alpha * error); - while (vcoPhase > (2.0f * FL_M_PI)) { vcoPhase -= (2.0f * FL_M_PI); } - while (vcoPhase < (-2.0f * FL_M_PI)) { vcoPhase += (2.0f * FL_M_PI); } - - // Calculate output - lastVCO.re = cosf(vcoPhase); - lastVCO.im = sinf(vcoPhase); - } - - _data->flush(); - _pilot->flush(); - - if (!AplusBOut.swap(count)) { return -1; } - if (!AminusBOut.swap(count)) { return -1; } - return count; - } - - stream AplusBOut; - stream AminusBOut; - - float gain = 2.0f; - - private: - float _loopBandwidth = 0.01f; - - const float expectedFreq = ((19000.0f / 250000.0f) * 2.0f * FL_M_PI); - const float upperLimit = ((19200.0f / 250000.0f) * 2.0f * FL_M_PI); - const float lowerLimit = ((18800.0f / 250000.0f) * 2.0f * FL_M_PI); - - float _alpha; // Integral coefficient - float _beta; // Proportional coefficient - float vcoFrequency = expectedFreq; - float vcoPhase = 0.0f; - complex_t lastVCO; - - stream* _data; - stream* _pilot; - }; - - class FMStereoReconstruct : public generic_block { - public: - FMStereoReconstruct() {} - - FMStereoReconstruct(stream* a, stream* b) { init(a, b); } - - ~FMStereoReconstruct() { - generic_block::stop(); - delete[] leftBuf; - delete[] rightBuf; - } - - void init(stream* aplusb, stream* aminusb) { - _aplusb = aplusb; - _aminusb = aminusb; - - leftBuf = new float[STREAM_BUFFER_SIZE]; - rightBuf = new float[STREAM_BUFFER_SIZE]; - - generic_block::registerInput(aplusb); - generic_block::registerInput(aminusb); - generic_block::registerOutput(&out); - generic_block::_block_init = true; - } - - void setInputs(stream* aplusb, stream* aminusb) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_aplusb); - generic_block::unregisterInput(_aminusb); - _aplusb = aplusb; - _aminusb = aminusb; - generic_block::registerInput(_aplusb); - generic_block::registerInput(_aminusb); - generic_block::tempStart(); - } - - int run() { - int a_count = _aplusb->read(); - if (a_count < 0) { return -1; } - int b_count = _aminusb->read(); - if (b_count < 0) { return -1; } - if (a_count != b_count) { - _aplusb->flush(); - _aminusb->flush(); - return 0; - } - - volk_32f_x2_add_32f(rightBuf, _aplusb->readBuf, _aminusb->readBuf, a_count); - volk_32f_x2_subtract_32f(leftBuf, _aplusb->readBuf, _aminusb->readBuf, a_count); - _aplusb->flush(); - _aminusb->flush(); - - volk_32f_x2_interleave_32fc((lv_32fc_t*)out.writeBuf, leftBuf, rightBuf, a_count); - - if (!out.swap(a_count)) { return -1; } - return a_count; - } - - stream out; - - private: - stream* _aplusb; - stream* _aminusb; - - float* leftBuf; - float* rightBuf; - }; -} \ No newline at end of file diff --git a/core/src/dsp/stream.h b/core/src/dsp/stream.h index f186d83..e72df92 100644 --- a/core/src/dsp/stream.h +++ b/core/src/dsp/stream.h @@ -1,9 +1,11 @@ #pragma once +#include #include #include #include +#include "buffer/buffer.h" -// 1MB buffer +// 1MSample buffer #define STREAM_BUFFER_SIZE 1000000 namespace dsp { @@ -22,23 +24,23 @@ namespace dsp { class stream : public untyped_stream { public: stream() { - writeBuf = (T*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(T), volk_get_alignment()); - readBuf = (T*)volk_malloc(STREAM_BUFFER_SIZE * sizeof(T), volk_get_alignment()); + writeBuf = buffer::alloc(STREAM_BUFFER_SIZE); + readBuf = buffer::alloc(STREAM_BUFFER_SIZE); } - ~stream() { - volk_free(writeBuf); - volk_free(readBuf); + virtual ~stream() { + buffer::free(writeBuf); + buffer::free(readBuf); } - void setBufferSize(int samples) { - volk_free(writeBuf); - volk_free(readBuf); - writeBuf = (T*)volk_malloc(samples * sizeof(T), volk_get_alignment()); - readBuf = (T*)volk_malloc(samples * sizeof(T), volk_get_alignment()); + virtual void setBufferSize(int samples) { + buffer::free(writeBuf); + buffer::free(readBuf); + writeBuf = buffer::alloc(samples); + readBuf = buffer::alloc(samples); } - bool swap(int size) { + virtual inline bool swap(int size) { { // Wait to either swap or stop std::unique_lock lck(swapMtx); @@ -65,7 +67,7 @@ namespace dsp { return true; } - int read() { + virtual inline int read() { // Wait for data to be ready or to be stopped std::unique_lock lck(rdyMtx); rdyCV.wait(lck, [this] { return (dataReady || readerStop); }); @@ -73,7 +75,7 @@ namespace dsp { return (readerStop ? -1 : dataSize); } - void flush() { + virtual inline void flush() { // Clear data ready { std::lock_guard lck(rdyMtx); @@ -89,7 +91,7 @@ namespace dsp { swapCV.notify_all(); } - void stopWriter() { + virtual void stopWriter() { { std::lock_guard lck(swapMtx); writerStop = true; @@ -97,11 +99,11 @@ namespace dsp { swapCV.notify_all(); } - void clearWriteStop() { + virtual void clearWriteStop() { writerStop = false; } - void stopReader() { + virtual void stopReader() { { std::lock_guard lck(rdyMtx); readerStop = true; @@ -109,7 +111,7 @@ namespace dsp { rdyCV.notify_all(); } - void clearReadStop() { + virtual void clearReadStop() { readerStop = false; } diff --git a/core/src/dsp/types.h b/core/src/dsp/types.h index 679ba96..3642e7f 100644 --- a/core/src/dsp/types.h +++ b/core/src/dsp/types.h @@ -1,6 +1,6 @@ #pragma once #include -#include +#include "math/constants.h" namespace dsp { struct complex_t { @@ -8,10 +8,18 @@ namespace dsp { return complex_t{ re * b, im * b }; } + complex_t operator*(const double b) { + return complex_t{ re * (float)b, im * (float)b }; + } + complex_t operator/(const float b) { return complex_t{ re / b, im / b }; } + complex_t operator/(const double b) { + return complex_t{ re / (float)b, im / (float)b }; + } + complex_t operator*(const complex_t& b) { return complex_t{ (re * b.re) - (im * b.im), (im * b.re) + (re * b.im) }; } @@ -24,6 +32,24 @@ namespace dsp { return complex_t{ re - b.re, im - b.im }; } + complex_t& operator+=(const complex_t& b) { + re += b.re; + im += b.im; + return *this; + } + + complex_t& operator-=(const complex_t& b) { + re -= b.re; + im -= b.im; + return *this; + } + + complex_t& operator*=(const float& b) { + re *= b; + im *= b; + return *this; + } + inline complex_t conj() { return complex_t{ re, -im }; } @@ -78,6 +104,24 @@ namespace dsp { return stereo_t{ l - b.l, r - b.r }; } + stereo_t& operator+=(const stereo_t& b) { + l += b.l; + r += b.r; + return *this; + } + + stereo_t& operator-=(const stereo_t& b) { + l -= b.l; + r -= b.r; + return *this; + } + + stereo_t& operator*=(const float& b) { + l *= b; + r *= b; + return *this; + } + float l; float r; }; diff --git a/core/src/dsp/utils/bitstream.h b/core/src/dsp/utils/bitstream.h deleted file mode 100644 index ebd73ba..0000000 --- a/core/src/dsp/utils/bitstream.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -namespace dsp { - inline uint64_t readBits(int offset, int length, uint8_t* buffer) { - uint64_t outputValue = 0; - - int lastBit = offset + (length - 1); - - int firstWord = offset / 8; - int lastWord = lastBit / 8; - int firstOffset = offset - (firstWord * 8); - int lastOffset = lastBit - (lastWord * 8); - - int wordCount = (lastWord - firstWord) + 1; - - // If the data fits in a single byte, just get it - if (wordCount == 1) { - return (buffer[firstWord] & (0xFF >> firstOffset)) >> (7 - lastOffset); - } - - int bitsRead = length; - for (int i = 0; i < wordCount; i++) { - // First word - if (i == 0) { - bitsRead -= 8 - firstOffset; - outputValue |= (uint64_t)(buffer[firstWord] & (0xFF >> firstOffset)) << bitsRead; - continue; - } - - // Last word - if (i == (wordCount - 1)) { - outputValue |= (uint64_t)buffer[lastWord] >> (7 - lastOffset); - break; - } - - // Just a normal byte - bitsRead -= 8; - outputValue |= (uint64_t)buffer[firstWord + i] << bitsRead; - } - - return outputValue; - } -} diff --git a/core/src/dsp/utils/ccsds.h b/core/src/dsp/utils/ccsds.h deleted file mode 100644 index 48db067..0000000 --- a/core/src/dsp/utils/ccsds.h +++ /dev/null @@ -1,120 +0,0 @@ -#pragma once -#include - -namespace dsp { - namespace ccsds { - const uint8_t TO_DUAL_BASIS[256] = { - 0x00, 0x7b, 0xaf, 0xd4, 0x99, 0xe2, 0x36, 0x4d, 0xfa, 0x81, 0x55, 0x2e, 0x63, 0x18, 0xcc, 0xb7, - 0x86, 0xfd, 0x29, 0x52, 0x1f, 0x64, 0xb0, 0xcb, 0x7c, 0x07, 0xd3, 0xa8, 0xe5, 0x9e, 0x4a, 0x31, - 0xec, 0x97, 0x43, 0x38, 0x75, 0x0e, 0xda, 0xa1, 0x16, 0x6d, 0xb9, 0xc2, 0x8f, 0xf4, 0x20, 0x5b, - 0x6a, 0x11, 0xc5, 0xbe, 0xf3, 0x88, 0x5c, 0x27, 0x90, 0xeb, 0x3f, 0x44, 0x09, 0x72, 0xa6, 0xdd, - 0xef, 0x94, 0x40, 0x3b, 0x76, 0x0d, 0xd9, 0xa2, 0x15, 0x6e, 0xba, 0xc1, 0x8c, 0xf7, 0x23, 0x58, - 0x69, 0x12, 0xc6, 0xbd, 0xf0, 0x8b, 0x5f, 0x24, 0x93, 0xe8, 0x3c, 0x47, 0x0a, 0x71, 0xa5, 0xde, - 0x03, 0x78, 0xac, 0xd7, 0x9a, 0xe1, 0x35, 0x4e, 0xf9, 0x82, 0x56, 0x2d, 0x60, 0x1b, 0xcf, 0xb4, - 0x85, 0xfe, 0x2a, 0x51, 0x1c, 0x67, 0xb3, 0xc8, 0x7f, 0x04, 0xd0, 0xab, 0xe6, 0x9d, 0x49, 0x32, - 0x8d, 0xf6, 0x22, 0x59, 0x14, 0x6f, 0xbb, 0xc0, 0x77, 0x0c, 0xd8, 0xa3, 0xee, 0x95, 0x41, 0x3a, - 0x0b, 0x70, 0xa4, 0xdf, 0x92, 0xe9, 0x3d, 0x46, 0xf1, 0x8a, 0x5e, 0x25, 0x68, 0x13, 0xc7, 0xbc, - 0x61, 0x1a, 0xce, 0xb5, 0xf8, 0x83, 0x57, 0x2c, 0x9b, 0xe0, 0x34, 0x4f, 0x02, 0x79, 0xad, 0xd6, - 0xe7, 0x9c, 0x48, 0x33, 0x7e, 0x05, 0xd1, 0xaa, 0x1d, 0x66, 0xb2, 0xc9, 0x84, 0xff, 0x2b, 0x50, - 0x62, 0x19, 0xcd, 0xb6, 0xfb, 0x80, 0x54, 0x2f, 0x98, 0xe3, 0x37, 0x4c, 0x01, 0x7a, 0xae, 0xd5, - 0xe4, 0x9f, 0x4b, 0x30, 0x7d, 0x06, 0xd2, 0xa9, 0x1e, 0x65, 0xb1, 0xca, 0x87, 0xfc, 0x28, 0x53, - 0x8e, 0xf5, 0x21, 0x5a, 0x17, 0x6c, 0xb8, 0xc3, 0x74, 0x0f, 0xdb, 0xa0, 0xed, 0x96, 0x42, 0x39, - 0x08, 0x73, 0xa7, 0xdc, 0x91, 0xea, 0x3e, 0x45, 0xf2, 0x89, 0x5d, 0x26, 0x6b, 0x10, 0xc4, 0xbf - }; - - const uint8_t FROM_DUAL_BASIS[256] = { - 0x00, 0xcc, 0xac, 0x60, 0x79, 0xb5, 0xd5, 0x19, 0xf0, 0x3c, 0x5c, 0x90, 0x89, 0x45, 0x25, 0xe9, - 0xfd, 0x31, 0x51, 0x9d, 0x84, 0x48, 0x28, 0xe4, 0x0d, 0xc1, 0xa1, 0x6d, 0x74, 0xb8, 0xd8, 0x14, - 0x2e, 0xe2, 0x82, 0x4e, 0x57, 0x9b, 0xfb, 0x37, 0xde, 0x12, 0x72, 0xbe, 0xa7, 0x6b, 0x0b, 0xc7, - 0xd3, 0x1f, 0x7f, 0xb3, 0xaa, 0x66, 0x06, 0xca, 0x23, 0xef, 0x8f, 0x43, 0x5a, 0x96, 0xf6, 0x3a, - 0x42, 0x8e, 0xee, 0x22, 0x3b, 0xf7, 0x97, 0x5b, 0xb2, 0x7e, 0x1e, 0xd2, 0xcb, 0x07, 0x67, 0xab, - 0xbf, 0x73, 0x13, 0xdf, 0xc6, 0x0a, 0x6a, 0xa6, 0x4f, 0x83, 0xe3, 0x2f, 0x36, 0xfa, 0x9a, 0x56, - 0x6c, 0xa0, 0xc0, 0x0c, 0x15, 0xd9, 0xb9, 0x75, 0x9c, 0x50, 0x30, 0xfc, 0xe5, 0x29, 0x49, 0x85, - 0x91, 0x5d, 0x3d, 0xf1, 0xe8, 0x24, 0x44, 0x88, 0x61, 0xad, 0xcd, 0x01, 0x18, 0xd4, 0xb4, 0x78, - 0xc5, 0x09, 0x69, 0xa5, 0xbc, 0x70, 0x10, 0xdc, 0x35, 0xf9, 0x99, 0x55, 0x4c, 0x80, 0xe0, 0x2c, - 0x38, 0xf4, 0x94, 0x58, 0x41, 0x8d, 0xed, 0x21, 0xc8, 0x04, 0x64, 0xa8, 0xb1, 0x7d, 0x1d, 0xd1, - 0xeb, 0x27, 0x47, 0x8b, 0x92, 0x5e, 0x3e, 0xf2, 0x1b, 0xd7, 0xb7, 0x7b, 0x62, 0xae, 0xce, 0x02, - 0x16, 0xda, 0xba, 0x76, 0x6f, 0xa3, 0xc3, 0x0f, 0xe6, 0x2a, 0x4a, 0x86, 0x9f, 0x53, 0x33, 0xff, - 0x87, 0x4b, 0x2b, 0xe7, 0xfe, 0x32, 0x52, 0x9e, 0x77, 0xbb, 0xdb, 0x17, 0x0e, 0xc2, 0xa2, 0x6e, - 0x7a, 0xb6, 0xd6, 0x1a, 0x03, 0xcf, 0xaf, 0x63, 0x8a, 0x46, 0x26, 0xea, 0xf3, 0x3f, 0x5f, 0x93, - 0xa9, 0x65, 0x05, 0xc9, 0xd0, 0x1c, 0x7c, 0xb0, 0x59, 0x95, 0xf5, 0x39, 0x20, 0xec, 0x8c, 0x40, - 0x54, 0x98, 0xf8, 0x34, 0x2d, 0xe1, 0x81, 0x4d, 0xa4, 0x68, 0x08, 0xc4, 0xdd, 0x11, 0x71, 0xbd - }; - - const uint8_t SCRAMBLING_SEQUENCE[255] = { - 0xFF, 0x48, 0x0E, 0xC0, 0x9A, 0x0D, 0x70, 0xBC, 0x8E, 0x2C, 0x93, 0xAD, 0xA7, 0xB7, 0x46, 0xCE, - 0x5A, 0x97, 0x7D, 0xCC, 0x32, 0xA2, 0xBF, 0x3E, 0x0A, 0x10, 0xF1, 0x88, 0x94, 0xCD, 0xEA, 0xB1, - 0xFE, 0x90, 0x1D, 0x81, 0x34, 0x1A, 0xE1, 0x79, 0x1C, 0x59, 0x27, 0x5B, 0x4F, 0x6E, 0x8D, 0x9C, - 0xB5, 0x2E, 0xFB, 0x98, 0x65, 0x45, 0x7E, 0x7C, 0x14, 0x21, 0xE3, 0x11, 0x29, 0x9B, 0xD5, 0x63, - 0xFD, 0x20, 0x3B, 0x02, 0x68, 0x35, 0xC2, 0xF2, 0x38, 0xB2, 0x4E, 0xB6, 0x9E, 0xDD, 0x1B, 0x39, - 0x6A, 0x5D, 0xF7, 0x30, 0xCA, 0x8A, 0xFC, 0xF8, 0x28, 0x43, 0xC6, 0x22, 0x53, 0x37, 0xAA, 0xC7, - 0xFA, 0x40, 0x76, 0x04, 0xD0, 0x6B, 0x85, 0xE4, 0x71, 0x64, 0x9D, 0x6D, 0x3D, 0xBA, 0x36, 0x72, - 0xD4, 0xBB, 0xEE, 0x61, 0x95, 0x15, 0xF9, 0xF0, 0x50, 0x87, 0x8C, 0x44, 0xA6, 0x6F, 0x55, 0x8F, - 0xF4, 0x80, 0xEC, 0x09, 0xA0, 0xD7, 0x0B, 0xC8, 0xE2, 0xC9, 0x3A, 0xDA, 0x7B, 0x74, 0x6C, 0xE5, - 0xA9, 0x77, 0xDC, 0xC3, 0x2A, 0x2B, 0xF3, 0xE0, 0xA1, 0x0F, 0x18, 0x89, 0x4C, 0xDE, 0xAB, 0x1F, - 0xE9, 0x01, 0xD8, 0x13, 0x41, 0xAE, 0x17, 0x91, 0xC5, 0x92, 0x75, 0xB4, 0xF6, 0xE8, 0xD9, 0xCB, - 0x52, 0xEF, 0xB9, 0x86, 0x54, 0x57, 0xE7, 0xC1, 0x42, 0x1E, 0x31, 0x12, 0x99, 0xBD, 0x56, 0x3F, - 0xD2, 0x03, 0xB0, 0x26, 0x83, 0x5C, 0x2F, 0x23, 0x8B, 0x24, 0xEB, 0x69, 0xED, 0xD1, 0xB3, 0x96, - 0xA5, 0xDF, 0x73, 0x0C, 0xA8, 0xAF, 0xCF, 0x82, 0x84, 0x3C, 0x62, 0x25, 0x33, 0x7A, 0xAC, 0x7F, - 0xA4, 0x07, 0x60, 0x4D, 0x06, 0xB8, 0x5E, 0x47, 0x16, 0x49, 0xD6, 0xD3, 0xDB, 0xA3, 0x67, 0x2D, - 0x4B, 0xBE, 0xE6, 0x19, 0x51, 0x5F, 0x9F, 0x05, 0x08, 0x78, 0xC4, 0x4A, 0x66, 0xF5, 0x58 - }; - - const uint32_t ASM_VALUE = 0x1ACFFC1D; - const uint8_t ASM_BYTES[4] = { 0x1A, 0xCF, 0xFC, 0x1D }; - const uint8_t ASM_SYMS[16] = { 0b00, 0b01, 0b10, 0b10, 0b11, 0b00, 0b11, 0b11, 0b11, 0b11, 0b11, 0b00, 0b00, 0b01, 0b11, 0b01 }; - const uint8_t ASM_BITS[32] = { 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1 }; - - class FrameDataDecoder { - public: - FrameDataDecoder(int interleaving, bool dualBasis, int rsBlockSize, int rsParitySize) { - _interleaving = interleaving; - _dualBasis = dualBasis; - _rsBlockSize = rsBlockSize; - _rsParitySize = rsParitySize; - } - - void decode(uint8_t* in, uint8_t* out, int count) { - // Deinterleave - if (_dualBasis) { - for (int i = 0; i < count; i++) { - workBuffer[i % _interleaving][i / _interleaving] = FROM_DUAL_BASIS[in[i]]; - } - } - else { - for (int i = 0; i < count; i++) { - workBuffer[i % _interleaving][i / _interleaving] = in[i]; - } - } - - // Reed solomon - - // Reinterleave and descramble if needed - if (_dualBasis) { - for (int i = 0; i < count; i++) { - out[i] = TO_DUAL_BASIS[workOutputBuffer[i % _interleaving][i / _interleaving]]; - } - } - else { - for (int i = 0; i < count; i++) { - out[i] = workOutputBuffer[i % _interleaving][i / _interleaving]; - } - } - } - - private: - uint8_t workBuffer[5][255]; - uint8_t workOutputBuffer[5][255]; - int _interleaving; - bool _dualBasis; - int _rsBlockSize; - int _rsParitySize; - }; - - inline void descramble(uint8_t* in, uint8_t* out, int count) { - for (int i = 0; i < count; i++) { - out[i] = in[i] ^ SCRAMBLING_SEQUENCE[i % 255]; - } - } - } -} \ No newline at end of file diff --git a/core/src/dsp/utils/macros.h b/core/src/dsp/utils/macros.h deleted file mode 100644 index 9400805..0000000 --- a/core/src/dsp/utils/macros.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include - -#define DSP_SIGN(n) ((n) >= 0) -#define DSP_STEP_CPLX(c) (complex_t{ (c.re > 0.0f) ? 1.0f : -1.0f, (c.im > 0.0f) ? 1.0f : -1.0f }) -#define DSP_STEP(n) (((n) > 0.0f) ? 1.0f : -1.0f) \ No newline at end of file diff --git a/core/src/dsp/utils/math.h b/core/src/dsp/utils/math.h deleted file mode 100644 index 44fca8a..0000000 --- a/core/src/dsp/utils/math.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once -#include - -#define FL_M_PI 3.1415926535f - -namespace dsp { - namespace math { - inline double sinc(double omega, double x, double norm) { - return (x == 0.0f) ? 1.0f : (sin(omega * x) / (norm * x)); - } - } -} \ No newline at end of file diff --git a/core/src/dsp/utils/window_functions.h b/core/src/dsp/utils/window_functions.h deleted file mode 100644 index 2283a68..0000000 --- a/core/src/dsp/utils/window_functions.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once -#include - -namespace dsp { - namespace window_function { - inline double blackman(double n, double N, double alpha = 0.16f) { - double a0 = (1.0f - alpha) / 2.0f; - double a2 = alpha / 2.0f; - return a0 - (0.5f * cos(2.0f * FL_M_PI * (n / N))) + (a2 * cos(4.0f * FL_M_PI * (n / N))); - } - - inline double blackmanThirdOrder(double n, double N, double a0, double a1, double a2, double a3) { - return a0 - (a1 * cos(2.0f * FL_M_PI * (n / N))) + (a2 * cos(4.0f * FL_M_PI * (n / N))) - (a3 * cos(6.0f * FL_M_PI * (n / N))); - } - - inline double nuttall(double n, double N) { - return blackmanThirdOrder(n, N, 0.3635819f, 0.4891775f, 0.1365995f, 0.0106411f); - } - - inline double blackmanNuttall(double n, double N) { - return blackmanThirdOrder(n, N, 0.3635819f, 0.4891775f, 0.1365995f, 0.0106411f); - } - - inline double blackmanHarris(double n, double N) { - return blackmanThirdOrder(n, N, 0.35875f, 0.48829f, 0.14128f, 0.01168f); - } - } -} \ No newline at end of file diff --git a/core/src/dsp/vfo.h b/core/src/dsp/vfo.h deleted file mode 100644 index 5aa5cfb..0000000 --- a/core/src/dsp/vfo.h +++ /dev/null @@ -1,133 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace dsp { - class VFO { - public: - VFO() {} - - ~VFO() { - if (!_init) { return; } - stop(); - _init = false; - } - - VFO(stream* in, float offset, float inSampleRate, float outSampleRate, float bandWidth) { - init(in, offset, inSampleRate, outSampleRate, bandWidth); - }; - - void init(stream* in, float offset, float inSampleRate, float outSampleRate, float bandWidth) { - _in = in; - _offset = offset; - _inSampleRate = inSampleRate; - _outSampleRate = outSampleRate; - _bandWidth = bandWidth; - - float realCutoff = std::min(_bandWidth, std::min(_inSampleRate, _outSampleRate)) / 2.0f; - - xlator.init(_in, _inSampleRate, -_offset); - win.init(realCutoff, realCutoff, inSampleRate); - resamp.init(&xlator.out, &win, _inSampleRate, _outSampleRate); - - win.setSampleRate(_inSampleRate * resamp.getInterpolation()); - resamp.updateWindow(&win); - - out = &resamp.out; - - _init = true; - } - - void start() { - assert(_init); - if (running) { return; } - xlator.start(); - resamp.start(); - running = true; - } - - void stop() { - assert(_init); - if (!running) { return; } - xlator.stop(); - resamp.stop(); - running = false; - } - - void setInSampleRate(float inSampleRate) { - assert(_init); - _inSampleRate = inSampleRate; - if (running) { - xlator.stop(); - resamp.stop(); - } - xlator.setSampleRate(_inSampleRate); - resamp.setInSampleRate(_inSampleRate); - float realCutoff = std::min(_bandWidth, std::min(_inSampleRate, _outSampleRate)) / 2.0f; - win.setSampleRate(_inSampleRate * resamp.getInterpolation()); - win.setCutoff(realCutoff); - win.setTransWidth(realCutoff); - resamp.updateWindow(&win); - if (running) { - xlator.start(); - resamp.start(); - } - } - - void setOutSampleRate(float outSampleRate) { - assert(_init); - _outSampleRate = outSampleRate; - if (running) { resamp.stop(); } - resamp.setOutSampleRate(_outSampleRate); - float realCutoff = std::min(_bandWidth, std::min(_inSampleRate, _outSampleRate)) / 2.0f; - win.setSampleRate(_inSampleRate * resamp.getInterpolation()); - win.setCutoff(realCutoff); - win.setTransWidth(realCutoff); - resamp.updateWindow(&win); - if (running) { resamp.start(); } - } - - void setOutSampleRate(float outSampleRate, float bandWidth) { - assert(_init); - _outSampleRate = outSampleRate; - _bandWidth = bandWidth; - if (running) { resamp.stop(); } - resamp.setOutSampleRate(_outSampleRate); - float realCutoff = std::min(_bandWidth, std::min(_inSampleRate, _outSampleRate)) / 2.0f; - win.setSampleRate(_inSampleRate * resamp.getInterpolation()); - win.setCutoff(realCutoff); - win.setTransWidth(realCutoff); - resamp.updateWindow(&win); - if (running) { resamp.start(); } - } - - void setOffset(float offset) { - assert(_init); - _offset = offset; - xlator.setFrequency(-_offset); - } - - void setBandwidth(float bandWidth) { - assert(_init); - _bandWidth = bandWidth; - float realCutoff = std::min(_bandWidth, std::min(_inSampleRate, _outSampleRate)) / 2.0f; - win.setCutoff(realCutoff); - win.setTransWidth(realCutoff); - resamp.updateWindow(&win); - } - - stream* out; - - private: - bool _init = false; - bool running = false; - float _offset, _inSampleRate, _outSampleRate, _bandWidth; - filter_window::BlackmanWindow win; - stream* _in; - FrequencyXlator xlator; - PolyphaseResampler resamp; - }; -} \ No newline at end of file diff --git a/core/src/dsp/window.h b/core/src/dsp/window.h deleted file mode 100644 index c479e20..0000000 --- a/core/src/dsp/window.h +++ /dev/null @@ -1,419 +0,0 @@ -#pragma once -#include -#include -#include -#include - -namespace dsp { - namespace filter_window { - class generic_window { - public: - virtual int getTapCount() { return -1; } - virtual void createTaps(float* taps, int tapCount, float factor = 1.0f) {} - }; - - class generic_complex_window { - public: - virtual int getTapCount() { return -1; } - virtual void createTaps(dsp::complex_t* taps, int tapCount, float factor = 1.0f) {} - }; - - class BlackmanWindow : public filter_window::generic_window { - public: - BlackmanWindow() {} - BlackmanWindow(float cutoff, float transWidth, float sampleRate) { init(cutoff, transWidth, sampleRate); } - - void init(float cutoff, float transWidth, float sampleRate) { - _cutoff = cutoff; - _transWidth = transWidth; - _sampleRate = sampleRate; - } - - void setSampleRate(float sampleRate) { - _sampleRate = sampleRate; - } - - void setCutoff(float cutoff) { - _cutoff = cutoff; - } - - void setTransWidth(float transWidth) { - _transWidth = transWidth; - } - - int getTapCount() { - float fc = _cutoff / _sampleRate; - if (fc > 1.0f) { - fc = 1.0f; - } - - int _M = 4.0f / (_transWidth / _sampleRate); - if (_M < 4) { - _M = 4; - } - - if (_M % 2 == 0) { _M++; } - - return _M; - } - - void createTaps(float* taps, int tapCount, float factor = 1.0f) { - // Calculate cuttoff frequency - float omega = 2.0f * FL_M_PI * (_cutoff / _sampleRate); - if (omega > FL_M_PI) { omega = FL_M_PI; } - - // Generate taps - float val; - float sum = 0.0f; - float tc = tapCount; - for (int i = 0; i < tapCount; i++) { - val = math::sinc(omega, (float)i - (tc / 2), FL_M_PI) * window_function::blackman(i, tc - 1); - taps[i] = val; - sum += val; - } - - // Normalize taps and multiply by supplied factor - for (int i = 0; i < tapCount; i++) { - taps[i] *= factor; - taps[i] /= sum; - } - } - - private: - float _cutoff, _transWidth, _sampleRate; - }; - - class BandPassBlackmanWindow : public filter_window::generic_complex_window { - public: - BandPassBlackmanWindow() {} - BandPassBlackmanWindow(float lowCutoff, float highCutoff, float transWidth, float sampleRate) { init(lowCutoff, highCutoff, transWidth, sampleRate); } - - void init(float lowCutoff, float highCutoff, float transWidth, float sampleRate) { - assert(lowCutoff <= highCutoff); - _lowCutoff = lowCutoff; - _highCutoff = highCutoff; - _transWidth = transWidth; - _sampleRate = sampleRate; - - // Calculate other values - _offset = (_lowCutoff + _highCutoff) / 2.0f; - _cutoff = fabs((_highCutoff - _lowCutoff) / 2.0f); - } - - void setSampleRate(float sampleRate) { - _sampleRate = sampleRate; - } - - void setCutoffs(float lowCutoff, float highCutoff) { - assert(lowCutoff <= highCutoff); - _lowCutoff = lowCutoff; - _highCutoff = highCutoff; - - // Calculate other values - _offset = (_lowCutoff + _highCutoff) / 2.0f; - _cutoff = fabs((_highCutoff - _lowCutoff) / 2.0f); - } - - void setLowCutoff(float lowCutoff) { - assert(lowCutoff <= _highCutoff); - _lowCutoff = lowCutoff; - - // Calculate other values - _offset = (_lowCutoff + _highCutoff) / 2.0f; - _cutoff = fabs((_highCutoff - _lowCutoff) / 2.0f); - } - - void setHighCutoff(float highCutoff) { - assert(_lowCutoff <= highCutoff); - _highCutoff = highCutoff; - - // Calculate other values - _offset = (_lowCutoff + _highCutoff) / 2.0f; - _cutoff = fabs((_highCutoff - _lowCutoff) / 2.0f); - } - - void setTransWidth(float transWidth) { - _transWidth = transWidth; - } - - int getTapCount() { - float fc = _cutoff / _sampleRate; - if (fc > 1.0f) { - fc = 1.0f; - } - - int _M = 4.0f / (_transWidth / _sampleRate); - if (_M < 4) { - _M = 4; - } - - if (_M % 2 == 0) { _M++; } - - return _M; - } - - void createTaps(dsp::complex_t* taps, int tapCount, float factor = 1.0f) { - // Calculate cuttoff frequency - float omega = 2.0f * FL_M_PI * (_cutoff / _sampleRate); - if (omega > FL_M_PI) { omega = FL_M_PI; } - - // Generate taps - float val; - float sum = 0.0f; - float tc = tapCount; - for (int i = 0; i < tapCount; i++) { - val = math::sinc(omega, (float)i - (tc / 2), FL_M_PI) * window_function::blackman(i, tc - 1); - taps[i].re = val; - taps[i].im = 0; - sum += val; - } - - // Normalize taps and multiply by supplied factor - for (int i = 0; i < tapCount; i++) { - taps[i] = taps[i] * factor; - taps[i] = taps[i] / sum; - } - - // Add offset - lv_32fc_t phase = lv_cmake(1.0f, 0.0f); - lv_32fc_t phaseDelta = lv_cmake(std::cos((-_offset / _sampleRate) * 2.0f * FL_M_PI), std::sin((-_offset / _sampleRate) * 2.0f * FL_M_PI)); - volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t*)taps, (lv_32fc_t*)taps, phaseDelta, &phase, tapCount); - } - - private: - float _lowCutoff, _highCutoff; - float _cutoff, _transWidth, _sampleRate, _offset; - }; - } - - class RRCTaps : public filter_window::generic_window { - public: - RRCTaps() {} - RRCTaps(int tapCount, float sampleRate, float baudRate, float alpha) { init(tapCount, sampleRate, baudRate, alpha); } - - void init(int tapCount, float sampleRate, float baudRate, float alpha) { - _tapCount = tapCount; - _sampleRate = sampleRate; - _baudRate = baudRate; - _alpha = alpha; - } - - int getTapCount() { - return _tapCount; - } - - void setSampleRate(float sampleRate) { - _sampleRate = sampleRate; - } - - void setBaudRate(float baudRate) { - _baudRate = baudRate; - } - - void setTapCount(int count) { - _tapCount = count; - } - - void setAlpha(float alpha) { - _alpha = alpha; - } - - void createTaps(float* taps, int tapCount, float factor = 1.0f) { - // ======== CREDIT: GNU Radio ========= - tapCount |= 1; // ensure that tapCount is odd - - double spb = _sampleRate / _baudRate; // samples per bit/symbol - double scale = 0; - for (int i = 0; i < tapCount; i++) { - double x1, x2, x3, num, den; - double xindx = i - tapCount / 2; - x1 = FL_M_PI * xindx / spb; - x2 = 4 * _alpha * xindx / spb; - x3 = x2 * x2 - 1; - - // Avoid Rounding errors... - if (fabs(x3) >= 0.000001) { - if (i != tapCount / 2) - num = cos((1 + _alpha) * x1) + - sin((1 - _alpha) * x1) / (4 * _alpha * xindx / spb); - else - num = cos((1 + _alpha) * x1) + (1 - _alpha) * FL_M_PI / (4 * _alpha); - den = x3 * FL_M_PI; - } - else { - if (_alpha == 1) { - taps[i] = -1; - scale += taps[i]; - continue; - } - x3 = (1 - _alpha) * x1; - x2 = (1 + _alpha) * x1; - num = (sin(x2) * (1 + _alpha) * FL_M_PI - - cos(x3) * ((1 - _alpha) * FL_M_PI * spb) / (4 * _alpha * xindx) + - sin(x3) * spb * spb / (4 * _alpha * xindx * xindx)); - den = -32 * FL_M_PI * _alpha * _alpha * xindx / spb; - } - taps[i] = 4 * _alpha * num / den; - scale += taps[i]; - } - - for (int i = 0; i < tapCount; i++) { - taps[i] = taps[i] / scale; - } - } - - private: - int _tapCount; - float _sampleRate, _baudRate, _alpha; - }; - - // class NotchWindow : public filter_window::generic_complex_window { - // public: - // NotchWindow() {} - - // NotchWindow(float frequency, float width, float sampleRate, int tapCount) { init(frequency, width, sampleRate, tapCount); } - - // ~NotchWindow() { - // if (fft_in) { fftwf_free(fft_in); } - // if (fft_out) { fftwf_free(fft_out); } - // fftwf_destroy_plan(fft_plan); - // } - - // void init(float frequency, float width, float sampleRate, int tapCount) { - // _frequency = frequency; - // _width = width; - // _sampleRate = sampleRate; - // _tapCount = tapCount; - - // // Ensure the number of taps is even - // if (_tapCount & 1) { _tapCount++; } - - // fft_in = (complex_t*)fftwf_malloc(_tapCount * sizeof(complex_t)); - // fft_out = (complex_t*)fftwf_malloc(_tapCount * sizeof(complex_t)); - - // fft_plan = fftwf_plan_dft_1d(_tapCount, (fftwf_complex*)fft_in, (fftwf_complex*)fft_out, FFTW_BACKWARD, FFTW_ESTIMATE); - // } - - // void setFrequency(float frequency) { - // _frequency = frequency; - // } - - // void setWidth(float width) { - // _width = width; - // } - - // void setSampleRate(float sampleRate) { - // _sampleRate = sampleRate; - // } - - // void setTapCount(int count) { - // _tapCount = count; - - // // Ensure the number of taps is even - - // // Free buffers - // if (fft_in) { fftwf_free(fft_in); } - // if (fft_out) { fftwf_free(fft_out); } - // fftwf_destroy_plan(fft_plan); - - // // Reallocate - // fft_in = (complex_t*)fftwf_malloc(_tapCount * sizeof(complex_t)); - // fft_out = (complex_t*)fftwf_malloc(_tapCount * sizeof(complex_t)); - - // // Create new plan - // fft_plan = fftwf_plan_dft_1d(_tapCount, (fftwf_complex*)fft_in, (fftwf_complex*)fft_out, FFTW_BACKWARD, FFTW_ESTIMATE); - // } - - // int getTapCount() { - // return _tapCount; - // } - - // void createTaps(complex_t* taps, int tapCount, float factor = 1.0f) { - // float ratio = _sampleRate / (float)tapCount; - // int thalf = tapCount / 2; - // float start = _frequency - (_width / 2.0f); - // float stop = _frequency + (_width / 2.0f); - - // // Fill taps - // float freq; - // float pratio = 2.0f * FL_M_PI / (float)tapCount; - // complex_t phaseDiff = {cosf(pratio), -sinf(pratio)}; - // complex_t phasor = {1, 0}; - // for (int i = 0; i < tapCount; i++) { - // freq = (i < thalf) ? ((float)i * ratio) : -((float)(tapCount - i) * ratio); - // if (freq >= start && freq <= stop) { - // fft_in[i] = {0, 0}; - // } - // else { - // fft_in[i] = phasor; - // } - // phasor = phasor * phaseDiff; - // } - - // // Run IFFT - // fftwf_execute(fft_plan); - - // // Apply window and copy to output - // for (int i = 0; i < tapCount; i++) { - // taps[tapCount - i - 1] = fft_out[i] / (float)tapCount; - // } - // } - - // private: - // complex_t* fft_in = NULL; - // complex_t* fft_out = NULL; - // float _frequency, _width, _sampleRate; - // int _tapCount; - - // fftwf_plan fft_plan; - - // }; - - class NotchWindow : public filter_window::generic_complex_window { - public: - NotchWindow() {} - - NotchWindow(float frequency, float width, float sampleRate, int tapCount) { init(frequency, width, sampleRate, tapCount); } - - void init(float frequency, float width, float sampleRate, int tapCount) { - _frequency = frequency; - _sampleRate = sampleRate; - _tapCount = tapCount; - } - - void setFrequency(float frequency) { - _frequency = frequency; - } - - void setWidth(float width) {} - - void setSampleRate(float sampleRate) { - _sampleRate = sampleRate; - } - - void setTapCount(int count) { - _tapCount = count; - } - - int getTapCount() { - return _tapCount; - } - - void createTaps(complex_t* taps, int tapCount, float factor = 1.0f) { - // Generate exponential decay - float fact = 1.0f / (float)tapCount; - for (int i = 0; i < tapCount; i++) { - taps[tapCount - i - 1] = { expf(-fact * i) * (float)window_function::blackman(i, tapCount - 1), 0 }; - } - - // Frequency translate it to the right place - lv_32fc_t phase = lv_cmake(1.0f, 0.0f); - lv_32fc_t phaseDelta = lv_cmake(std::cos((-_frequency / _sampleRate) * 2.0f * FL_M_PI), std::sin((-_frequency / _sampleRate) * 2.0f * FL_M_PI)); - volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t*)taps, (lv_32fc_t*)taps, phaseDelta, &phase, tapCount); - } - - private: - float _frequency, _sampleRate; - int _tapCount; - }; -} \ No newline at end of file diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index a684c41..2979dee 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include @@ -88,8 +88,8 @@ void MainWindow::init() { fft_out = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex) * fftSize); fftwPlan = fftwf_plan_dft_1d(fftSize, fft_in, fft_out, FFTW_FORWARD, FFTW_ESTIMATE); - sigpath::signalPath.init(8000000, 20, fftSize, &dummyStream, (dsp::complex_t*)fft_in, fftHandler, this); - sigpath::signalPath.start(); + sigpath::iqFrontEnd.init(&dummyStream, 8000000, true, 1, false, 1024, 20.0, IQFrontEnd::FFTWindow::NUTTALL, acquireFFTBuffer, releaseFFTBuffer, this); + sigpath::iqFrontEnd.start(); vfoCreatedHandler.handler = vfoAddedHandler; vfoCreatedHandler.ctx = this; @@ -227,37 +227,11 @@ void MainWindow::init() { core::moduleManager.doPostInitAll(); } -void MainWindow::fftHandler(dsp::complex_t* samples, int count, void* ctx) { - MainWindow* _this = (MainWindow*)ctx; - std::lock_guard lck(_this->fft_mtx); +float* MainWindow::acquireFFTBuffer(void* ctx) { + return gui::waterfall.getFFTBuffer(); +} - // Check if the count is valid - if (count > _this->fftSize) { - return; - } - - // Apply window - volk_32fc_32f_multiply_32fc((lv_32fc_t*)_this->fft_in, (lv_32fc_t*)samples, sigpath::signalPath.fftTaps, count); - - // Zero out the rest of the samples - if (count < _this->fftSize) { - memset(&_this->fft_in[count], 0, (_this->fftSize - count) * sizeof(dsp::complex_t)); - } - - // Execute FFT - fftwf_execute(_this->fftwPlan); - - // Get the FFT buffer - float* fftBuf = gui::waterfall.getFFTBuffer(); - if (fftBuf == NULL) { - gui::waterfall.pushFFT(); - return; - } - - // Take power of spectrum - volk_32fc_s32f_power_spectrum_32f(fftBuf, (lv_32fc_t*)_this->fft_out, _this->fftSize, _this->fftSize); - - // Push back data +void MainWindow::releaseFFTBuffer(void* ctx) { gui::waterfall.pushFFT(); } @@ -530,9 +504,9 @@ void MainWindow::draw() { ImGui::Checkbox("Show demo window", &demoWindow); ImGui::Text("ImGui version: %s", ImGui::GetVersion()); - ImGui::Checkbox("Bypass buffering", &sigpath::signalPath.inputBuffer.bypass); + // ImGui::Checkbox("Bypass buffering", &sigpath::iqFrontEnd.inputBuffer.bypass); - ImGui::Text("Buffering: %d", (sigpath::signalPath.inputBuffer.writeCur - sigpath::signalPath.inputBuffer.readCur + 32) % 32); + // ImGui::Text("Buffering: %d", (sigpath::iqFrontEnd.inputBuffer.writeCur - sigpath::iqFrontEnd.inputBuffer.readCur + 32) % 32); if (ImGui::Button("Test Bug")) { spdlog::error("Will this make the software crash?"); @@ -680,7 +654,7 @@ void MainWindow::draw() { void MainWindow::setPlayState(bool _playing) { if (_playing == playing) { return; } if (_playing) { - sigpath::signalPath.inputBuffer.flush(); + sigpath::iqFrontEnd.flushInputBuffer(); sigpath::sourceManager.start(); sigpath::sourceManager.tune(gui::waterfall.getCenterFrequency()); playing = true; @@ -690,7 +664,7 @@ void MainWindow::setPlayState(bool _playing) { playing = false; onPlayStateChange.emit(false); sigpath::sourceManager.stop(); - sigpath::signalPath.inputBuffer.flush(); + sigpath::iqFrontEnd.flushInputBuffer(); } } @@ -702,27 +676,6 @@ bool MainWindow::sdrIsRunning() { return playing; } -void MainWindow::setFFTSize(int size) { - std::lock_guard lck(fft_mtx); - fftSize = size; - - gui::waterfall.setRawFFTSize(fftSize); - sigpath::signalPath.setFFTSize(fftSize); - - fftwf_destroy_plan(fftwPlan); - fftwf_free(fft_in); - fftwf_free(fft_out); - - fft_in = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex) * fftSize); - fft_out = (fftwf_complex*)fftwf_malloc(sizeof(fftwf_complex) * fftSize); - fftwPlan = fftwf_plan_dft_1d(fftSize, fft_in, fft_out, FFTW_FORWARD, FFTW_ESTIMATE); -} - -void MainWindow::setFFTWindow(int win) { - std::lock_guard lck(fft_mtx); - sigpath::signalPath.setFFTWindow(win); -} - bool MainWindow::isPlaying() { return playing; } diff --git a/core/src/gui/main_window.h b/core/src/gui/main_window.h index e7aaee8..0c4578a 100644 --- a/core/src/gui/main_window.h +++ b/core/src/gui/main_window.h @@ -17,10 +17,11 @@ public: void draw(); void setViewBandwidthSlider(float bandwidth); bool sdrIsRunning(); - void setFFTSize(int size); - void setFFTWindow(int win); void setFirstMenuRender(); + static float* acquireFFTBuffer(void* ctx); + static void releaseFFTBuffer(void* ctx); + // TODO: Replace with it's own class void setVFO(double freq); @@ -33,7 +34,6 @@ public: Event onPlayStateChange; private: - static void fftHandler(dsp::complex_t* samples, int count, void* ctx); static void vfoAddedHandler(VFOManager::VFO* vfo, void* ctx); // FFT Variables diff --git a/core/src/gui/menus/display.cpp b/core/src/gui/menus/display.cpp index 40a6c52..3a65db4 100644 --- a/core/src/gui/menus/display.cpp +++ b/core/src/gui/menus/display.cpp @@ -52,6 +52,12 @@ namespace displaymenu { int fftSizeId = 0; + const IQFrontEnd::FFTWindow fftWindowList[] = { + IQFrontEnd::FFTWindow::RECTANGULAR, + IQFrontEnd::FFTWindow::BLACKMAN, + IQFrontEnd::FFTWindow::NUTTALL + }; + void updateFFTHoldSpeed() { gui::waterfall.setFFTHoldSpeed(fftHoldSpeed / (fftRate * 10.0f)); } @@ -89,13 +95,13 @@ namespace displaymenu { break; } } - gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]); + sigpath::iqFrontEnd.setFFTSize(FFTSizes[fftSizeId]); fftRate = core::configManager.conf["fftRate"]; - sigpath::signalPath.setFFTRate(fftRate); + sigpath::iqFrontEnd.setFFTRate(fftRate); - selectedWindow = std::clamp((int)core::configManager.conf["fftWindow"], 0, _FFT_WINDOW_COUNT - 1); - gui::mainWindow.setFFTWindow(selectedWindow); + selectedWindow = std::clamp((int)core::configManager.conf["fftWindow"], 0, (sizeof(fftWindowList) / sizeof(IQFrontEnd::FFTWindow)) - 1); + sigpath::iqFrontEnd.setFFTWindow(fftWindowList[selectedWindow]); gui::menu.locked = core::configManager.conf["lockMenuOrder"]; @@ -172,7 +178,7 @@ namespace displaymenu { ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::InputInt("##sdrpp_fft_rate", &fftRate, 1, 10)) { fftRate = std::max(1, fftRate); - sigpath::signalPath.setFFTRate(fftRate); + sigpath::iqFrontEnd.setFFTRate(fftRate); updateFFTHoldSpeed(); core::configManager.acquire(); core::configManager.conf["fftRate"] = fftRate; @@ -182,7 +188,7 @@ namespace displaymenu { ImGui::LeftLabel("FFT Size"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) { - gui::mainWindow.setFFTSize(FFTSizes[fftSizeId]); + sigpath::iqFrontEnd.setFFTSize(FFTSizes[fftSizeId]); core::configManager.acquire(); core::configManager.conf["fftSize"] = FFTSizes[fftSizeId]; core::configManager.release(true); @@ -190,8 +196,8 @@ namespace displaymenu { ImGui::LeftLabel("FFT Window"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0")) { - gui::mainWindow.setFFTWindow(selectedWindow); + if (ImGui::Combo("##sdrpp_fft_window", &selectedWindow, "Rectangular\0Blackman\0Nuttall\0")) { + sigpath::iqFrontEnd.setFFTWindow(fftWindowList[selectedWindow]); core::configManager.acquire(); core::configManager.conf["fftWindow"] = selectedWindow; core::configManager.release(true); diff --git a/core/src/gui/menus/source.cpp b/core/src/gui/menus/source.cpp index c4809de..94f14f8 100644 --- a/core/src/gui/menus/source.cpp +++ b/core/src/gui/menus/source.cpp @@ -138,12 +138,12 @@ namespace sourcemenu { offsetMode = core::configManager.conf["offsetMode"]; decimationPower = core::configManager.conf["decimationPower"]; iqCorrection = core::configManager.conf["iqCorrection"]; - sigpath::signalPath.setIQCorrection(iqCorrection); + sigpath::iqFrontEnd.setDCBlocking(iqCorrection); updateOffset(); refreshSources(); selectSource(selected); - sigpath::signalPath.setDecimation(decimationPower); + sigpath::iqFrontEnd.setDecimation(1 << decimationPower); sourceRegisteredHandler.handler = onSourceRegistered; sourceUnregisterHandler.handler = onSourceUnregister; @@ -174,7 +174,7 @@ namespace sourcemenu { sigpath::sourceManager.showSelectedMenu(); if (ImGui::Checkbox("IQ Correction##_sdrpp_iq_corr", &iqCorrection)) { - sigpath::signalPath.setIQCorrection(iqCorrection); + sigpath::iqFrontEnd.setDCBlocking(iqCorrection); core::configManager.acquire(); core::configManager.conf["iqCorrection"] = iqCorrection; core::configManager.release(true); @@ -209,7 +209,7 @@ namespace sourcemenu { ImGui::LeftLabel("Decimation"); ImGui::SetNextItemWidth(itemWidth - ImGui::GetCursorPosX()); if (ImGui::Combo("##source_decim", &decimationPower, decimationStages)) { - sigpath::signalPath.setDecimation(decimationPower); + sigpath::iqFrontEnd.setDecimation(1 << decimationPower); core::configManager.acquire(); core::configManager.conf["decimationPower"] = decimationPower; core::configManager.release(true); diff --git a/core/src/server.cpp b/core/src/server.cpp index 8ad9fb7..d6e668b 100644 --- a/core/src/server.cpp +++ b/core/src/server.cpp @@ -8,13 +8,14 @@ #include #include #include -#include +#include "dsp/compression/sample_stream_compressor.h" +#include "dsp/sink/handler_sink.h" #include namespace server { dsp::stream dummyInput; - dsp::DynamicRangeCompressor comp; - dsp::HandlerSink hnd; + dsp::compression::SampleStreamCompressor comp; + dsp::sink::Handler hnd; net::Conn client; uint8_t* rbuf = NULL; uint8_t* sbuf = NULL; @@ -49,7 +50,7 @@ namespace server { spdlog::info("=====| SERVER MODE |====="); // Init DSP - comp.init(&dummyInput, dsp::PCM_TYPE_I8); + comp.init(&dummyInput, dsp::compression::PCM_TYPE_I8); hnd.init(&comp.out, _testServerHandler, NULL); rbuf = new uint8_t[SERVER_MAX_PACKET_SIZE]; sbuf = new uint8_t[SERVER_MAX_PACKET_SIZE]; @@ -189,7 +190,7 @@ namespace server { // Perform settings reset sigpath::sourceManager.stop(); - comp.setPCMType(dsp::PCM_TYPE_I16); + comp.setPCMType(dsp::compression::PCM_TYPE_I16); compression = false; sendSampleRate(sampleRate); @@ -291,7 +292,7 @@ namespace server { sendCommandAck(COMMAND_SET_FREQUENCY, 0); } else if (cmd == COMMAND_SET_SAMPLE_TYPE && len == 1) { - dsp::PCMType type = (dsp::PCMType)*(uint8_t*)data; + dsp::compression::PCMType type = (dsp::compression::PCMType)*(uint8_t*)data; comp.setPCMType(type); } else if (cmd == COMMAND_SET_COMPRESSION && len == 1) { diff --git a/core/src/signal_path/dsp.cpp b/core/src/signal_path/dsp.cpp deleted file mode 100644 index 54c476d..0000000 --- a/core/src/signal_path/dsp.cpp +++ /dev/null @@ -1,278 +0,0 @@ -#include -#include - -SignalPath::SignalPath() { -} - -void SignalPath::init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*, int, void*), void* fftHandlerCtx) { - this->sampleRate = sampleRate; - this->sourceSampleRate = sampleRate; - this->fftRate = fftRate; - this->fftSize = fftSize; - inputBlockSize = sampleRate / 200.0f; - - halfBandWindow.init(1000000, 200000, 4000000); - - inputBuffer.init(input); - corrector.init(&inputBuffer.out, 50.0f / sampleRate); - split.init(&inputBuffer.out); - - // Allocate the fft taps - fftTaps = new float[fftSize]; - - // Calculate the parameters for the reshaper - int fftInterval = sampleRate / fftRate; - fftOutputSampleCount = std::min(fftInterval, fftSize); - int fftSkip = fftInterval - fftOutputSampleCount; - - // Generate FFT Windows - generateFFTWindow(fftWindow, fftTaps, fftOutputSampleCount); - - reshape.init(&fftStream, fftSize, fftSkip); - split.bindStream(&fftStream); - fftHandlerSink.init(&reshape.out, fftHandler, fftHandlerCtx); -} - -void SignalPath::setSampleRate(double sampleRate) { - this->sampleRate = sampleRate; - - // Stop the splitter - split.stop(); - reshape.stop(); - - // Stop all VFOs - for (auto const& [name, vfo] : vfos) { - vfo.vfo->stop(); - } - - updateFFTDSP(); - - // Update the sample rate for all VFOs and start them up - for (auto const& [name, vfo] : vfos) { - vfo.vfo->setInSampleRate(sampleRate); - vfo.vfo->start(); - } - - // Update correction rate on the IQ corrector - corrector.setCorrectionRate(50.0f / sampleRate); - - // Start the splitter - split.start(); - reshape.start(); -} - -double SignalPath::getSampleRate() { - return sampleRate; -} - -void SignalPath::start() { - for (auto& decimator : decimators) { - decimator->start(); - } - inputBuffer.start(); - if (iqCorrection) { corrector.start(); } - split.start(); - reshape.start(); - fftHandlerSink.start(); - running = true; -} - -void SignalPath::stop() { - for (auto& decimator : decimators) { - decimator->stop(); - } - inputBuffer.stop(); - if (iqCorrection) { corrector.stop(); } - split.stop(); - reshape.stop(); - fftHandlerSink.stop(); - running = false; -} - -dsp::VFO* SignalPath::addVFO(std::string name, double outSampleRate, double bandwidth, double offset) { - if (vfos.find(name) != vfos.end()) { - return NULL; - } - VFO_t vfo; - vfo.inputStream = new dsp::stream; - split.bindStream(vfo.inputStream); - vfo.vfo = new dsp::VFO(); - vfo.vfo->init(vfo.inputStream, offset, sampleRate, outSampleRate, bandwidth); - vfo.vfo->start(); - vfos[name] = vfo; - return vfo.vfo; -} - -void SignalPath::removeVFO(std::string name) { - if (vfos.find(name) == vfos.end()) { - return; - } - VFO_t vfo = vfos[name]; - vfo.vfo->stop(); - split.unbindStream(vfo.inputStream); - delete vfo.vfo; - delete vfo.inputStream; - vfos.erase(name); -} - -void SignalPath::setInput(dsp::stream* input) { - inputBuffer.setInput(input); -} - -void SignalPath::bindIQStream(dsp::stream* stream) { - split.bindStream(stream); -} - -void SignalPath::unbindIQStream(dsp::stream* stream) { - split.unbindStream(stream); -} - -void SignalPath::setFFTSize(int size) { - fftSize = size; - reshape.stop(); - updateFFTDSP(); - reshape.start(); -} - -void SignalPath::setFFTRate(double rate) { - fftRate = rate; - reshape.stop(); - updateFFTDSP(); - reshape.start(); -} - -void SignalPath::startFFT() { - reshape.start(); - fftHandlerSink.start(); -} - -void SignalPath::stopFFT() { - reshape.stop(); - fftHandlerSink.stop(); -} - -void SignalPath::setBuffering(bool enabled) { - inputBuffer.bypass = !enabled; -} - -void SignalPath::setDecimation(int dec) { - decimation = dec; - if (running) { split.stop(); } - - // Stop existing decimators - if (!decimators.empty()) { - for (auto& decimator : decimators) { - decimator->stop(); - } - for (auto& decimator : decimators) { - delete decimator; - } - } - decimators.clear(); - - // If no decimation, reconnect - if (!dec) { - if (iqCorrection) { - split.setInput(&corrector.out); - } - else { - split.setInput(&inputBuffer.out); - } - - if (running) { split.start(); } - core::setInputSampleRate(sourceSampleRate); - return; - } - - // Create new decimators - for (int i = 0; i < dec; i++) { - dsp::HalfDecimator* decimator; - if (iqCorrection && i == 0) { - decimator = new dsp::HalfDecimator(&corrector.out, &halfBandWindow); - } - else if (i == 0) { - decimator = new dsp::HalfDecimator(&inputBuffer.out, &halfBandWindow); - } - else { - decimator = new dsp::HalfDecimator(&decimators[i - 1]->out, &halfBandWindow); - } - - if (running) { decimator->start(); } - decimators.push_back(decimator); - } - split.setInput(&decimators[decimators.size() - 1]->out); - if (running) { split.start(); } - - // Update the DSP sample rate - core::setInputSampleRate(sourceSampleRate); -} - -void SignalPath::setIQCorrection(bool enabled) { - if (iqCorrection == enabled) { return; } - - if (!iqCorrection && enabled) { - if (decimation) { - decimators[0]->setInput(&corrector.out); - } - else { - split.setInput(&corrector.out); - } - if (running) { corrector.start(); } - } - else if (iqCorrection && !enabled) { - if (running) { corrector.stop(); } - if (decimation) { - decimators[0]->setInput(&inputBuffer.out); - } - else { - split.setInput(&inputBuffer.out); - } - } - - iqCorrection = enabled; - if (!enabled) { - corrector.offset.re = 0; - corrector.offset.im = 0; - } -} - -void SignalPath::setFFTWindow(int win) { - fftWindow = win; - reshape.stop(); - updateFFTDSP(); - reshape.start(); -} - -void SignalPath::generateFFTWindow(int win, float* taps, int size) { - if (win == FFT_WINDOW_RECTANGULAR) { - for (int i = 0; i < size; i++) { - taps[i] = (i % 2) ? 1 : -1; - } - } - else if (win == FFT_WINDOW_BLACKMAN) { - for (int i = 0; i < size; i++) { - taps[i] = ((i % 2) ? dsp::window_function::blackman(i, size) : -dsp::window_function::blackman(i, size)) * 2; - } - } -} - -void SignalPath::updateFFTDSP() { - - // Allocate the fft taps - if (fftTaps != NULL) { delete[] fftTaps; } - fftTaps = new float[fftSize]; - - // Calculate the parameters for the reshaper - int fftInterval = sampleRate / fftRate; - fftOutputSampleCount = std::min(fftInterval, fftSize); - int fftSkip = fftInterval - fftOutputSampleCount; - - // Generate FFT Windows - generateFFTWindow(fftWindow, fftTaps, fftOutputSampleCount); - - // Update parameters of the reshaper - reshape.setKeep(fftOutputSampleCount); - reshape.setSkip(fftSkip); - - spdlog::info("Updating FFT DSP settings: Keep: {0}, Skip: {1}", fftOutputSampleCount, fftSkip); -} \ No newline at end of file diff --git a/core/src/signal_path/dsp.h b/core/src/signal_path/dsp.h deleted file mode 100644 index 30fe46b..0000000 --- a/core/src/signal_path/dsp.h +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include - -enum { - FFT_WINDOW_RECTANGULAR, - FFT_WINDOW_BLACKMAN, - _FFT_WINDOW_COUNT -}; - -class SignalPath { -public: - SignalPath(); - void init(uint64_t sampleRate, int fftRate, int fftSize, dsp::stream* input, dsp::complex_t* fftBuffer, void fftHandler(dsp::complex_t*, int, void*), void* fftHandlerCtx); - void start(); - void stop(); - void setSampleRate(double sampleRate); - double getSampleRate(); - dsp::VFO* addVFO(std::string name, double outSampleRate, double bandwidth, double offset); - void removeVFO(std::string name); - void setInput(dsp::stream* input); - void bindIQStream(dsp::stream* stream); - void unbindIQStream(dsp::stream* stream); - void setFFTSize(int size); - void setFFTRate(double rate); - void startFFT(); - void stopFFT(); - void setBuffering(bool enabled); - void setDecimation(int dec); - void setIQCorrection(bool enabled); - void setFFTWindow(int win); - - dsp::SampleFrameBuffer inputBuffer; - double sourceSampleRate = 0; - int decimation = 0; - - float* fftTaps = NULL; - -private: - void generateFFTWindow(int win, float* taps, int size); - void updateFFTDSP(); - - struct VFO_t { - dsp::stream* inputStream; - dsp::VFO* vfo; - }; - - dsp::Splitter split; - dsp::IQCorrector corrector; - - // FFT - dsp::stream fftStream; - dsp::Reshaper reshape; - dsp::HandlerSink fftHandlerSink; - - // VFO - std::map vfos; - std::vector*> decimators; - dsp::filter_window::BlackmanWindow halfBandWindow; - - int fftOutputSampleCount = 0; - double sampleRate; - double fftRate; - int fftSize; - int inputBlockSize; - int fftWindow = FFT_WINDOW_RECTANGULAR; - bool bufferingEnabled = false; - bool running = false; - bool iqCorrection = false; -}; \ No newline at end of file diff --git a/core/src/signal_path/signal_path.cpp b/core/src/signal_path/signal_path.cpp index 89c10d1..a669523 100644 --- a/core/src/signal_path/signal_path.cpp +++ b/core/src/signal_path/signal_path.cpp @@ -1,7 +1,7 @@ #include namespace sigpath { - SignalPath signalPath; + IQFrontEnd iqFrontEnd; VFOManager vfoManager; SourceManager sourceManager; SinkManager sinkManager; diff --git a/core/src/signal_path/signal_path.h b/core/src/signal_path/signal_path.h index 4969327..0c71938 100644 --- a/core/src/signal_path/signal_path.h +++ b/core/src/signal_path/signal_path.h @@ -1,12 +1,12 @@ #pragma once -#include -#include -#include -#include +#include "iq_frontend.h" +#include "vfo_manager.h" +#include "source.h" +#include "sink.h" #include namespace sigpath { - SDRPP_EXPORT SignalPath signalPath; + SDRPP_EXPORT IQFrontEnd iqFrontEnd; SDRPP_EXPORT VFOManager vfoManager; SDRPP_EXPORT SourceManager sourceManager; SDRPP_EXPORT SinkManager sinkManager; diff --git a/core/src/signal_path/sink.cpp b/core/src/signal_path/sink.cpp index 729f60a..8f513a4 100644 --- a/core/src/signal_path/sink.cpp +++ b/core/src/signal_path/sink.cpp @@ -24,7 +24,7 @@ void SinkManager::Stream::init(dsp::stream* in, EventHandler #include #include -#include -#include -#include +#include "../dsp/routing/splitter.h" +#include "../dsp/audio/volume.h" +#include "../dsp/sink/null_sink.h" #include #include #include @@ -52,10 +52,10 @@ public: private: dsp::stream* _in; - dsp::Splitter splitter; + dsp::routing::Splitter splitter; SinkManager::Sink* sink; dsp::stream volumeInput; - dsp::Volume volumeAjust; + dsp::audio::Volume volumeAjust; std::mutex ctrlMtx; float _sampleRate; int providerId = 0; @@ -85,7 +85,7 @@ public: } private: - dsp::NullSink ns; + dsp::sink::Null ns; }; void registerSinkProvider(std::string name, SinkProvider provider); diff --git a/core/src/signal_path/source.cpp b/core/src/signal_path/source.cpp index 7dc495f..6b29702 100644 --- a/core/src/signal_path/source.cpp +++ b/core/src/signal_path/source.cpp @@ -26,7 +26,7 @@ void SourceManager::unregisterSource(std::string name) { if (selectedHandler != NULL) { sources[selectedName]->deselectHandler(sources[selectedName]->ctx); } - sigpath::signalPath.setInput(&nullSource); + sigpath::iqFrontEnd.setInput(&nullSource); selectedHandler = NULL; } sources.erase(name); @@ -54,7 +54,7 @@ void SourceManager::selectSource(std::string name) { server::setInput(selectedHandler->stream); } else { - sigpath::signalPath.setInput(selectedHandler->stream); + sigpath::iqFrontEnd.setInput(selectedHandler->stream); } // Set server input here } diff --git a/core/src/signal_path/vfo_manager.cpp b/core/src/signal_path/vfo_manager.cpp index 5fe8df6..85f236c 100644 --- a/core/src/signal_path/vfo_manager.cpp +++ b/core/src/signal_path/vfo_manager.cpp @@ -4,7 +4,7 @@ VFOManager::VFO::VFO(std::string name, int reference, double offset, double bandwidth, double sampleRate, double minBandwidth, double maxBandwidth, bool bandwidthLocked) { this->name = name; - dspVFO = sigpath::signalPath.addVFO(name, sampleRate, bandwidth, offset); + dspVFO = sigpath::iqFrontEnd.addVFO(name, sampleRate, bandwidth, offset); wtfVFO = new ImGui::WaterfallVFO; wtfVFO->setReference(reference); wtfVFO->setBandwidth(bandwidth); @@ -12,7 +12,7 @@ VFOManager::VFO::VFO(std::string name, int reference, double offset, double band wtfVFO->minBandwidth = minBandwidth; wtfVFO->maxBandwidth = maxBandwidth; wtfVFO->bandwidthLocked = bandwidthLocked; - output = dspVFO->out; + output = &dspVFO->out; gui::waterfall.vfos[name] = wtfVFO; } @@ -22,7 +22,7 @@ VFOManager::VFO::~VFO() { if (gui::waterfall.selectedVFO == name) { gui::waterfall.selectFirstVFO(); } - sigpath::signalPath.removeVFO(name); + sigpath::iqFrontEnd.removeVFO(name); delete wtfVFO; } @@ -46,7 +46,7 @@ void VFOManager::VFO::setBandwidth(double bandwidth, bool updateWaterfall) { } void VFOManager::VFO::setSampleRate(double sampleRate, double bandwidth) { - dspVFO->setOutSampleRate(sampleRate, bandwidth); + dspVFO->setOutSamplerate(sampleRate, bandwidth); wtfVFO->setBandwidth(bandwidth); } diff --git a/core/src/signal_path/vfo_manager.h b/core/src/signal_path/vfo_manager.h index 6a0d176..d8a65d8 100644 --- a/core/src/signal_path/vfo_manager.h +++ b/core/src/signal_path/vfo_manager.h @@ -1,5 +1,5 @@ #pragma once -#include +#include "../dsp/channel/rx_vfo.h" #include #include @@ -30,7 +30,7 @@ public: friend class VFOManager; - dsp::VFO* dspVFO; + dsp::channel::RxVFO* dspVFO; ImGui::WaterfallVFO* wtfVFO; private: diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index 564a0cf..a80cd04 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -1,7 +1,7 @@ #pragma once #include "../demod.h" -#include -#include +#include +#include namespace demod { class AM : public Demodulator { @@ -20,20 +20,17 @@ namespace demod { this->name = name; // Define structure - demod.init(input); - agc.init(&demod.out, 20.0f, getIFSampleRate()); - m2s.init(&agc.out); + demod.init(input, dsp::demod::AM::AGCMode::CARRIER, 200000.0 / getIFSampleRate()); + m2s.init(&demod.out); } void start() { demod.start(); - agc.start(); m2s.start(); } void stop() { demod.stop(); - agc.stop(); m2s.stop(); } @@ -71,9 +68,8 @@ namespace demod { dsp::stream* getOutput() { return &m2s.out; } private: - dsp::AMDemod demod; - dsp::AGC agc; - dsp::MonoToStereo m2s; + dsp::demod::AM demod; + dsp::convert::MonoToStereo m2s; std::string name; }; diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index 999c73c..11c953c 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -1,7 +1,9 @@ #pragma once #include "../demod.h" -#include -#include +#include +#include +#include +#include namespace demod { class CW : public Demodulator { @@ -30,9 +32,9 @@ namespace demod { config->release(); // Define structure - xlator.init(input, getIFSampleRate(), tone); + xlator.init(input, tone, getIFSampleRate()); c2r.init(&xlator.out); - agc.init(&c2r.out, 20.0f, getIFSampleRate()); + agc.init(&c2r.out, 1.0, 200000.0 / getIFSampleRate()); m2s.init(&agc.out); } @@ -55,7 +57,7 @@ namespace demod { ImGui::FillWidth(); if (ImGui::InputInt(("Stereo##_radio_cw_tone_" + name).c_str(), &tone, 10, 100)) { tone = std::clamp(tone, 250, 1250); - xlator.setFrequency(tone); + xlator.setOffset(tone, getIFSampleRate()); afbwChangeHandler.handler(getAFBandwidth(_bandwidth), afbwChangeHandler.ctx); _config->acquire(); _config->conf[name][getName()]["tone"] = tone; @@ -94,10 +96,10 @@ namespace demod { private: ConfigManager* _config = NULL; - dsp::FrequencyXlator xlator; - dsp::ComplexToReal c2r; - dsp::AGC agc; - dsp::MonoToStereo m2s; + dsp::channel::FrequencyXlator xlator; + dsp::convert::ComplexToReal c2r; + dsp::loop::AGC agc; + dsp::convert::MonoToStereo m2s; std::string name; diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index 79d574c..dac1d10 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -1,7 +1,7 @@ #pragma once #include "../demod.h" -#include -#include +#include +#include namespace demod { class DSB : public Demodulator { @@ -20,20 +20,17 @@ namespace demod { this->name = name; // Define structure - demod.init(input, getIFSampleRate(), bandwidth, dsp::SSBDemod::MODE_DSB); - agc.init(&demod.out, 20.0f, getIFSampleRate()); - m2s.init(&agc.out); + demod.init(input, dsp::demod::SSB::Mode::DSB, bandwidth, getIFSampleRate(), 200000.0 / getIFSampleRate()); + m2s.init(&demod.out); } void start() { demod.start(); - agc.start(); m2s.start(); } void stop() { demod.stop(); - agc.stop(); m2s.stop(); } @@ -42,7 +39,7 @@ namespace demod { } void setBandwidth(double bandwidth) { - demod.setBandWidth(bandwidth); + demod.setBandwidth(bandwidth); } void setInput(dsp::stream* input) { @@ -73,9 +70,8 @@ namespace demod { dsp::stream* getOutput() { return &m2s.out; } private: - dsp::SSBDemod demod; - dsp::AGC agc; - dsp::MonoToStereo m2s; + dsp::demod::SSB demod; + dsp::convert::MonoToStereo m2s; std::string name; }; diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index 07a4c50..53a39b1 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -1,7 +1,7 @@ #pragma once #include "../demod.h" -#include -#include +#include +#include namespace demod { class LSB : public Demodulator { @@ -20,20 +20,17 @@ namespace demod { this->name = name; // Define structure - demod.init(input, getIFSampleRate(), bandwidth, dsp::SSBDemod::MODE_LSB); - agc.init(&demod.out, 20.0f, getIFSampleRate()); - m2s.init(&agc.out); + demod.init(input, dsp::demod::SSB::Mode::LSB, bandwidth, getIFSampleRate(), 200000.0 / getIFSampleRate()); + m2s.init(&demod.out); } void start() { demod.start(); - agc.start(); m2s.start(); } void stop() { demod.stop(); - agc.stop(); m2s.stop(); } @@ -42,7 +39,7 @@ namespace demod { } void setBandwidth(double bandwidth) { - demod.setBandWidth(bandwidth); + demod.setBandwidth(bandwidth); } void setInput(dsp::stream* input) { @@ -73,9 +70,8 @@ namespace demod { dsp::stream* getOutput() { return &m2s.out; } private: - dsp::SSBDemod demod; - dsp::AGC agc; - dsp::MonoToStereo m2s; + dsp::demod::SSB demod; + dsp::convert::MonoToStereo m2s; std::string name; }; diff --git a/decoder_modules/radio/src/demodulators/nfm.h b/decoder_modules/radio/src/demodulators/nfm.h index 898917e..f7315d3 100644 --- a/decoder_modules/radio/src/demodulators/nfm.h +++ b/decoder_modules/radio/src/demodulators/nfm.h @@ -1,7 +1,7 @@ #pragma once #include "../demod.h" -#include -#include +#include +#include namespace demod { class NFM : public Demodulator { @@ -20,21 +20,24 @@ namespace demod { this->name = name; // Define structure - demod.init(input, getIFSampleRate(), bandwidth / 2.0f); + demod.init(input, bandwidth / 2.0, getIFSampleRate()); + m2s.init(&demod.out); } void start() { demod.start(); + m2s.start(); } void stop() { demod.stop(); + m2s.stop(); } void showMenu() {} void setBandwidth(double bandwidth) { - demod.setDeviation(bandwidth / 2.0f); + demod.setDeviation(bandwidth / 2.0, getIFSampleRate()); } void setInput(dsp::stream* input) { @@ -62,10 +65,11 @@ namespace demod { bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return true; } bool getNBAllowed() { return false; } - dsp::stream* getOutput() { return &demod.out; } + dsp::stream* getOutput() { return &m2s.out; } private: - dsp::FMDemod demod; + dsp::demod::FM demod; + dsp::convert::MonoToStereo m2s; std::string name; }; diff --git a/decoder_modules/radio/src/demodulators/raw.h b/decoder_modules/radio/src/demodulators/raw.h index 1e66c41..8860fee 100644 --- a/decoder_modules/radio/src/demodulators/raw.h +++ b/decoder_modules/radio/src/demodulators/raw.h @@ -1,7 +1,6 @@ #pragma once #include "../demod.h" -#include -#include +#include namespace demod { class RAW : public Demodulator { @@ -67,7 +66,7 @@ namespace demod { private: double audioSampleRate; - dsp::ComplexToStereo c2s; + dsp::convert::ComplexToStereo c2s; std::string name; }; diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index 155117c..eeb35ce 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -1,7 +1,7 @@ #pragma once #include "../demod.h" -#include -#include +#include +#include namespace demod { class USB : public Demodulator { @@ -20,20 +20,17 @@ namespace demod { this->name = name; // Define structure - demod.init(input, getIFSampleRate(), bandwidth, dsp::SSBDemod::MODE_USB); - agc.init(&demod.out, 20.0f, getIFSampleRate()); - m2s.init(&agc.out); + demod.init(input, dsp::demod::SSB::Mode::USB, bandwidth, getIFSampleRate(), 200000.0 / getIFSampleRate()); + m2s.init(&demod.out); } void start() { demod.start(); - agc.start(); m2s.start(); } void stop() { demod.stop(); - agc.stop(); m2s.stop(); } @@ -42,7 +39,7 @@ namespace demod { } void setBandwidth(double bandwidth) { - demod.setBandWidth(bandwidth); + demod.setBandwidth(bandwidth); } void setInput(dsp::stream* input) { @@ -73,9 +70,8 @@ namespace demod { dsp::stream* getOutput() { return &m2s.out; } private: - dsp::SSBDemod demod; - dsp::AGC agc; - dsp::MonoToStereo m2s; + dsp::demod::SSB demod; + dsp::convert::MonoToStereo m2s; std::string name; }; diff --git a/decoder_modules/radio/src/demodulators/wfm.h b/decoder_modules/radio/src/demodulators/wfm.h index 88bb28e..2291bcb 100644 --- a/decoder_modules/radio/src/demodulators/wfm.h +++ b/decoder_modules/radio/src/demodulators/wfm.h @@ -1,7 +1,6 @@ #pragma once #include "../demod.h" -#include -#include +#include namespace demod { class WFM : public Demodulator { @@ -25,41 +24,37 @@ namespace demod { _config->acquire(); bool modified = false; if (config->conf[name][getName()].contains("stereo")) { - stereo = config->conf[name][getName()]["stereo"]; + _stereo = config->conf[name][getName()]["stereo"]; } _config->release(modified); // Define structure - demod.init(input, getIFSampleRate(), bandwidth / 2.0f); - demodStereo.init(input, getIFSampleRate(), bandwidth / 2.0f); + demod.init(input, bandwidth / 2.0f, getIFSampleRate(), _stereo); } void start() { - stereo ? demodStereo.start() : demod.start(); + demod.start(); } void stop() { demod.stop(); - demodStereo.stop(); } void showMenu() { - if (ImGui::Checkbox(("Stereo##_radio_wfm_stereo_" + name).c_str(), &stereo)) { - setStereo(stereo); + if (ImGui::Checkbox(("Stereo##_radio_wfm_stereo_" + name).c_str(), &_stereo)) { + setStereo(_stereo); _config->acquire(); - _config->conf[name][getName()]["stereo"] = stereo; + _config->conf[name][getName()]["stereo"] = _stereo; _config->release(true); } } void setBandwidth(double bandwidth) { demod.setDeviation(bandwidth / 2.0f); - demodStereo.setDeviation(bandwidth / 2.0f); } void setInput(dsp::stream* input) { demod.setInput(input); - demodStereo.setInput(input); } void AFSampRateChanged(double newSR) {} @@ -83,31 +78,21 @@ namespace demod { bool getDynamicAFBandwidth() { return false; } bool getFMIFNRAllowed() { return true; } bool getNBAllowed() { return false; } - dsp::stream* getOutput() { return stereo ? demodStereo.out : &demod.out; } + dsp::stream* getOutput() { return &demod.out; } // ============= DEDICATED FUNCTIONS ============= - void setStereo(bool _stereo) { - stereo = _stereo; - if (stereo) { - demod.stop(); - outputChangeHandler.handler(demodStereo.out, outputChangeHandler.ctx); - demodStereo.start(); - } - else { - demodStereo.stop(); - outputChangeHandler.handler(&demod.out, outputChangeHandler.ctx); - demod.start(); - } + void setStereo(bool stereo) { + _stereo = stereo; + demod.setStereo(_stereo); } private: - dsp::FMDemod demod; - dsp::StereoFMDemod demodStereo; + dsp::demod::BroadcastFM demod; ConfigManager* _config = NULL; - bool stereo = false; + bool _stereo = false; std::string name; EventHandler*> outputChangeHandler; diff --git a/decoder_modules/radio/src/radio_module.h b/decoder_modules/radio/src/radio_module.h index e1ffea9..e07becc 100644 --- a/decoder_modules/radio/src/radio_module.h +++ b/decoder_modules/radio/src/radio_module.h @@ -6,7 +6,10 @@ #include #include #include -#include +#include +#include +#include +#include #include #include #include "radio_interface.h" @@ -74,17 +77,13 @@ public: // Initialize IF DSP chain ifChainOutputChanged.ctx = this; ifChainOutputChanged.handler = ifChainOutputChangeHandler; - ifChain.init(vfo->output, &ifChainOutputChanged); + ifChain.init(vfo->output); - fmnr.block.init(NULL, 32); - notch.block.init(NULL, 0.5, 0, 250000); // TODO: The rate has to depend on IF sample rate so the width is always the same - squelch.block.init(NULL, MIN_SQUELCH); - nb.block.init(NULL, -100.0f); + fmnr.init(NULL, 32); + squelch.init(NULL, MIN_SQUELCH); - ifChain.add(¬ch); - ifChain.add(&squelch); - ifChain.add(&fmnr); - ifChain.add(&nb); + ifChain.addBlock(&squelch, false); + ifChain.addBlock(&fmnr, false); // Load configuration for and enabled all demodulators EventHandler*> _demodOutputChangeHandler; @@ -107,26 +106,22 @@ public: bw = std::clamp(bw, demod->getMinBandwidth(), demod->getMaxBandwidth()); // Initialize - demod->init(name, &config, ifChain.getOutput(), bw, _demodOutputChangeHandler, _demodAfbwChangedHandler, stream.getSampleRate()); + demod->init(name, &config, ifChain.out, bw, _demodOutputChangeHandler, _demodAfbwChangedHandler, stream.getSampleRate()); } // Initialize audio DSP chain - afChainOutputChanged.ctx = this; - afChainOutputChanged.handler = afChainOutputChangeHandler; - afChain.init(&dummyAudioStream, &afChainOutputChanged); + afChain.init(&dummyAudioStream); - win.init(24000, 24000, 48000); - resamp.block.init(NULL, &win, 250000, 48000); - deemp.block.init(NULL, 48000, 50e-6); - deemp.block.bypass = false; + resamp.init(NULL, 250000.0, 48000.0); + deemp.init(NULL, 50e-6, 48000.0); - afChain.add(&resamp); - afChain.add(&deemp); + afChain.addBlock(&resamp, true); + afChain.addBlock(&deemp, false); // Initialize the sink srChangeHandler.ctx = this; srChangeHandler.handler = sampleRateChangeHandler; - stream.init(afChain.getOutput(), &srChangeHandler, audioSampleRate); + stream.init(afChain.out, &srChangeHandler, audioSampleRate); sigpath::sinkManager.registerStream(name, &stream); // Select the demodulator @@ -165,7 +160,7 @@ public: vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 200000, 200000, 50000, 200000, false); vfo->wtfVFO->onUserChangedBandwidth.bindHandler(&onUserChangedBandwidthHandler); } - ifChain.setInput(vfo->output); + ifChain.setInput(vfo->output, [=](dsp::stream* out){ ifChainOutputChangeHandler(out, this); }); ifChain.start(); selectDemodByID((DemodID)selectedDemodID); afChain.start(); @@ -280,32 +275,6 @@ private: } if (!_this->squelchEnabled && _this->enabled) { style::endDisabled(); } - // Noise blanker - if (_this->nbAllowed) { - if (ImGui::Checkbox(("Noise Blanker##_radio_nb_ena_" + _this->name).c_str(), &_this->nbEnabled)) { - _this->setNoiseBlankerEnabled(_this->nbEnabled); - } - if (!_this->nbEnabled && _this->enabled) { style::beginDisabled(); } - ImGui::SameLine(); - ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_nb_lvl_" + _this->name).c_str(), &_this->nbLevel, 0.0f, -100.0f, "%.3fdB")) { - _this->setNoiseBlankerLevel(_this->nbLevel); - } - if (!_this->nbEnabled && _this->enabled) { style::endDisabled(); } - } - - - // // Notch filter - // if (ImGui::Checkbox("Notch##_radio_notch_ena_", &_this->notchEnabled)) { - // _this->ifChain.setState(&_this->notch, _this->notchEnabled); - // } - // if (ImGui::SliderFloat(("NF##_radio_notch_freq_" + _this->name).c_str(), &_this->notchPos, -7500, 7500)) { - // _this->notch.block.setOffset(_this->notchPos); - // } - // if (ImGui::SliderFloat(("NW##_radio_notch_width_" + _this->name).c_str(), &_this->notchWidth, 0, 1000)) { - // // TODO: Implement - // } - // FM IF Noise Reduction if (_this->FMIFNRAllowed) { if (ImGui::Checkbox(("IF Noise Reduction##_radio_fmifnr_ena_" + _this->name).c_str(), &_this->FMIFNREnabled)) { @@ -352,10 +321,10 @@ private: selectedDemod->AFSampRateChanged(audioSampleRate); // Set the demodulator's input - selectedDemod->setInput(ifChain.getOutput()); + selectedDemod->setInput(ifChain.out); // Set AF chain's input - afChain.setInput(selectedDemod->getOutput()); + afChain.setInput(selectedDemod->getOutput(), [=](dsp::stream* out){ stream.setInput(out); }); // Load config bandwidth = selectedDemod->getDefaultBandwidth(); @@ -433,31 +402,24 @@ private: setIFNRPreset((selectedDemodID == RADIO_DEMOD_NFM) ? ifnrPresets[fmIFPresetId] : IFNR_PRESET_BROADCAST); setFMIFNREnabled(FMIFNRAllowed ? FMIFNREnabled : false); - // Configure notch - notch.block.setSampleRate(selectedDemod->getIFSampleRate()); - // Configure squelch - squelch.block.setLevel(squelchLevel); + squelch.setLevel(squelchLevel); setSquelchEnabled(squelchEnabled); - // Configure noise blanker - nb.block.setLevel(nbLevel); - setNoiseBlankerEnabled(nbEnabled); - // Configure AF chain if (postProcEnabled) { // Configure resampler afChain.stop(); - resamp.block.setInSampleRate(selectedDemod->getAFSampleRate()); + resamp.setInSamplerate(selectedDemod->getAFSampleRate()); setAudioSampleRate(audioSampleRate); - afChain.enable(&resamp); + afChain.enableBlock(&resamp, [=](dsp::stream* out){ stream.setInput(out); }); // Configure deemphasis setDeemphasisMode(deempModes[deempId]); } else { // Disable everything if post processing is disabled - afChain.disableAll(); + afChain.disableAllBlocks([=](dsp::stream* out){ stream.setInput(out); }); } // Start new demodulator @@ -474,12 +436,12 @@ private: vfo->setBandwidth(bandwidth); selectedDemod->setBandwidth(bandwidth); - // Only bother with setting the resampling setting if we're actually post processing and dynamic bw is enabled - if (selectedDemod->getDynamicAFBandwidth() && postProcEnabled) { - win.setCutoff(audioBW); - win.setTransWidth(audioBW); - resamp.block.updateWindow(&win); - } + // // Only bother with setting the resampling setting if we're actually post processing and dynamic bw is enabled + // if (selectedDemod->getDynamicAFBandwidth() && postProcEnabled) { + // win.setCutoff(audioBW); + // win.setTransWidth(audioBW); + // resamp.block.updateWindow(&win); + // } config.acquire(); config.conf[name][selectedDemod->getName()]["bandwidth"] = bandwidth; @@ -504,15 +466,16 @@ private: afChain.stop(); - // Configure resampler - resamp.block.setOutSampleRate(audioSampleRate); - win.setSampleRate(selectedDemod->getAFSampleRate() * resamp.block.getInterpolation()); - win.setCutoff(audioBW); - win.setTransWidth(audioBW); - resamp.block.updateWindow(&win); + // // Configure resampler + // resamp.block.setOutSampleRate(audioSampleRate); + // win.setSampleRate(selectedDemod->getAFSampleRate() * resamp.block.getInterpolation()); + // win.setCutoff(audioBW); + // win.setTransWidth(audioBW); + // resamp.block.updateWindow(&win); + resamp.setOutSamplerate(audioSampleRate); // Configure deemphasis sample rate - deemp.block.setSampleRate(audioSampleRate); + deemp.setSamplerate(audioSampleRate); afChain.start(); } @@ -521,8 +484,8 @@ private: deempId = deempModes.valueId(mode); if (!postProcEnabled || !selectedDemod) { return; } bool deempEnabled = (mode != DEEMP_MODE_NONE); - if (deempEnabled) { deemp.block.setTau(deempTaus[mode]); } - afChain.setState(&deemp, deempEnabled); + if (deempEnabled) { deemp.setTau(deempTaus[mode]); } + afChain.setBlockEnabled(&deemp, deempEnabled, [=](dsp::stream* out){ stream.setInput(out); }); // Save config config.acquire(); @@ -533,7 +496,7 @@ private: void setSquelchEnabled(bool enable) { squelchEnabled = enable; if (!selectedDemod) { return; } - ifChain.setState(&squelch, squelchEnabled); + ifChain.setBlockEnabled(&squelch, squelchEnabled, [=](dsp::stream* out){ selectedDemod->setInput(out); }); // Save config config.acquire(); @@ -543,7 +506,7 @@ private: void setSquelchLevel(float level) { squelchLevel = std::clamp(level, MIN_SQUELCH, MAX_SQUELCH); - squelch.block.setLevel(squelchLevel); + squelch.setLevel(squelchLevel); // Save config config.acquire(); @@ -554,7 +517,7 @@ private: void setFMIFNREnabled(bool enabled) { FMIFNREnabled = enabled; if (!selectedDemod) { return; } - ifChain.setState(&fmnr, FMIFNREnabled); + ifChain.setBlockEnabled(&fmnr, FMIFNREnabled, [=](dsp::stream* out){ selectedDemod->setInput(out); }); // Save config config.acquire(); @@ -562,39 +525,17 @@ private: config.release(true); } - void setNoiseBlankerEnabled(bool enabled) { - nbEnabled = enabled; - if (!selectedDemod) { return; } - ifChain.setState(&nb, nbEnabled); - - // Save config - config.acquire(); - config.conf[name][selectedDemod->getName()]["noiseBlankerEnabled"] = nbEnabled; - config.release(true); - } - - void setNoiseBlankerLevel(float level) { - nbLevel = level; - if (!selectedDemod) { return; } - nb.block.setLevel(nbLevel); - - // Save config - config.acquire(); - config.conf[name][selectedDemod->getName()]["noiseBlankerLevel"] = nbLevel; - config.release(true); - } - void setIFNRPreset(IFNRPreset preset) { // Don't save if in broadcast mode if (preset == IFNR_PRESET_BROADCAST) { if (!selectedDemod) { return; } - fmnr.block.setTapCount(ifnrTaps[preset]); + fmnr.setBins(ifnrTaps[preset]); return; } fmIFPresetId = ifnrPresets.valueId(preset); if (!selectedDemod) { return; } - fmnr.block.setTapCount(ifnrTaps[preset]); + fmnr.setBins(ifnrTaps[preset]); // Save config config.acquire(); @@ -614,7 +555,7 @@ private: static void demodOutputChangeHandler(dsp::stream* output, void* ctx) { RadioModule* _this = (RadioModule*)ctx; - _this->afChain.setInput(output); + _this->afChain.setInput(output, [=](dsp::stream* out){ _this->stream.setInput(out); }); } static void demodAfbwChangedHandler(float output, void* ctx) { @@ -623,9 +564,9 @@ private: float audioBW = std::min(_this->selectedDemod->getMaxAFBandwidth(), _this->selectedDemod->getAFBandwidth(_this->bandwidth)); audioBW = std::min(audioBW, _this->audioSampleRate / 2.0); - _this->win.setCutoff(audioBW); - _this->win.setTransWidth(audioBW); - _this->resamp.block.updateWindow(&_this->win); + // _this->win.setCutoff(audioBW); + // _this->win.setTransWidth(audioBW); + // _this->resamp.block.updateWindow(&_this->win); } static void ifChainOutputChangeHandler(dsp::stream* output, void* ctx) { @@ -634,11 +575,6 @@ private: _this->selectedDemod->setInput(output); } - static void afChainOutputChangeHandler(dsp::stream* output, void* ctx) { - RadioModule* _this = (RadioModule*)ctx; - _this->stream.setInput(output); - } - static void moduleInterfaceHandler(int code, void* in, void* out, void* ctx) { RadioModule* _this = (RadioModule*)ctx; if (!_this->enabled || !_this->selectedDemod) { return; } @@ -694,18 +630,15 @@ private: VFOManager::VFO* vfo = NULL; // IF chain - dsp::Chain ifChain; - dsp::ChainLink fmnr; - dsp::ChainLink notch; - dsp::ChainLink squelch; - dsp::ChainLink nb; + dsp::chain ifChain; + dsp::noise_reduction::FMIF fmnr; + dsp::noise_reduction::Squelch squelch; // Audio chain dsp::stream dummyAudioStream; - dsp::Chain afChain; - dsp::filter_window::BlackmanWindow win; - dsp::ChainLink, dsp::stereo_t> resamp; - dsp::ChainLink deemp; + dsp::chain afChain; + dsp::multirate::RationalResampler resamp; + dsp::filter::Deemphasis deemp; SinkManager::Stream stream; diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index f196d80..320172d 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -346,11 +346,11 @@ private: if (recMode == RECORDER_MODE_BASEBAND) { samplesWritten = 0; std::string expandedPath = expandString(folderSelect.path + genFileName("/baseband_", false)); - sampleRate = sigpath::signalPath.getSampleRate(); - basebandWriter = new WavWriter(expandedPath, 16, 2, sigpath::signalPath.getSampleRate()); + sampleRate = sigpath::iqFrontEnd.getSampleRate(); + basebandWriter = new WavWriter(expandedPath, 16, 2, sigpath::iqFrontEnd.getSampleRate()); if (basebandWriter->isOpen()) { basebandHandler.start(); - sigpath::signalPath.bindIQStream(&basebandStream); + sigpath::iqFrontEnd.bindIQStream(&basebandStream); recording = true; spdlog::info("Recording to '{0}'", expandedPath); } @@ -381,7 +381,7 @@ private: void stopRecording() { if (recMode == 0) { recording = false; - sigpath::signalPath.unbindIQStream(&basebandStream); + sigpath::iqFrontEnd.unbindIQStream(&basebandStream); basebandHandler.stop(); basebandWriter->close(); delete basebandWriter; diff --git a/sink_modules/audio_sink/src/main.cpp b/sink_modules/audio_sink/src/main.cpp index c86102f..5ed4cb5 100644 --- a/sink_modules/audio_sink/src/main.cpp +++ b/sink_modules/audio_sink/src/main.cpp @@ -3,8 +3,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -211,9 +211,9 @@ private: } SinkManager::Stream* _stream; - dsp::StereoToMono s2m; - dsp::Packer monoPacker; - dsp::Packer stereoPacker; + dsp::convert::StereoToMono s2m; + dsp::buffer::Packer monoPacker; + dsp::buffer::Packer stereoPacker; std::string _streamName; diff --git a/source_modules/bladerf_source/src/main.cpp b/source_modules/bladerf_source/src/main.cpp index f368fb3..2b2d2af 100644 --- a/source_modules/bladerf_source/src/main.cpp +++ b/source_modules/bladerf_source/src/main.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/source_modules/file_source/src/main.cpp b/source_modules/file_source/src/main.cpp index 0d104ae..d7bd307 100644 --- a/source_modules/file_source/src/main.cpp +++ b/source_modules/file_source/src/main.cpp @@ -68,7 +68,7 @@ private: FileSourceModule* _this = (FileSourceModule*)ctx; core::setInputSampleRate(_this->sampleRate); tuner::tune(tuner::TUNER_MODE_IQ_ONLY, "", _this->centerFreq); - sigpath::signalPath.setBuffering(false); + sigpath::iqFrontEnd.setBuffering(false); gui::waterfall.centerFrequencyLocked = true; //gui::freqSelect.minFreq = _this->centerFreq - (_this->sampleRate/2); //gui::freqSelect.maxFreq = _this->centerFreq + (_this->sampleRate/2); @@ -78,7 +78,7 @@ private: static void menuDeselected(void* ctx) { FileSourceModule* _this = (FileSourceModule*)ctx; - sigpath::signalPath.setBuffering(true); + sigpath::iqFrontEnd.setBuffering(true); //gui::freqSelect.limitFreq = false; gui::waterfall.centerFrequencyLocked = false; spdlog::info("FileSourceModule '{0}': Menu Deselect!", _this->name); From d1318d3a0fc5f7737c29bcffdea9fb4c905fe831 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 15 Jun 2022 16:08:54 +0200 Subject: [PATCH 02/39] even more stuff --- core/src/dsp/audio/volume.h | 93 ++ core/src/dsp/bench/peak_level_meter.h | 62 + core/src/dsp/bench/speed_tester.h | 105 ++ core/src/dsp/buffer/buffer.h | 18 + core/src/dsp/buffer/frame_buffer.h | 136 ++ core/src/dsp/buffer/packer.h | 69 + core/src/dsp/buffer/reshaper.h | 137 ++ core/src/dsp/buffer/ring_buffer.h | 239 ++++ core/src/dsp/channel/frequency_xlator.h | 63 + core/src/dsp/channel/rx_vfo.h | 127 ++ core/src/dsp/compression/pcm_type.h | 9 + .../compression/sample_stream_compressor.h | 79 ++ .../compression/sample_stream_decompressor.h | 50 + core/src/dsp/convert/complex_to_real.h | 30 + core/src/dsp/convert/complex_to_stereo.h | 25 + core/src/dsp/convert/l_r_to_stereo.h | 44 + core/src/dsp/convert/mono_to_stereo.h | 28 + core/src/dsp/convert/real_to_complex.h | 44 + core/src/dsp/convert/stereo_to_mono.h | 30 + core/src/dsp/correction/dc_blocker.h | 72 ++ core/src/dsp/demod/am.h | 88 ++ core/src/dsp/demod/broadcast_fm.h | 156 +++ core/src/dsp/demod/fm.h | 69 + core/src/dsp/demod/ssb.h | 133 ++ core/src/dsp/filter/decimating_fir.h | 88 ++ core/src/dsp/filter/deephasis.h | 102 ++ core/src/dsp/filter/fir.h | 92 ++ core/src/dsp/hier_block.h | 83 ++ core/src/dsp/loop/agc.h | 81 ++ core/src/dsp/loop/phase_control_loop.h | 85 ++ core/src/dsp/loop/pll.h | 80 ++ core/src/dsp/math/add.h | 42 + core/src/dsp/math/conjugate.h | 28 + core/src/dsp/math/constants.h | 7 + core/src/dsp/math/delay.h | 76 ++ core/src/dsp/math/fast_atan2.h | 26 + core/src/dsp/math/freq_to_omega.h | 9 + core/src/dsp/math/multiply.h | 42 + core/src/dsp/math/norm_phase_diff.h | 11 + core/src/dsp/math/phasor.h | 10 + core/src/dsp/math/sinc.h | 8 + core/src/dsp/math/subtract.h | 42 + core/src/dsp/multirate/.old_decim/plans.h | 206 +++ .../multirate/.old_decim/taps/fir_1024_128.h | 577 +++++++++ .../multirate/.old_decim/taps/fir_1024_32.h | 139 ++ .../multirate/.old_decim/taps/fir_1024_64.h | 317 +++++ .../multirate/.old_decim/taps/fir_128_16.h | 83 ++ .../multirate/.old_decim/taps/fir_128_32.h | 192 +++ .../dsp/multirate/.old_decim/taps/fir_128_4.h | 28 + .../multirate/.old_decim/taps/fir_128_64.h | 519 ++++++++ .../dsp/multirate/.old_decim/taps/fir_128_8.h | 45 + .../dsp/multirate/.old_decim/taps/fir_16_16.h | 564 +++++++++ .../dsp/multirate/.old_decim/taps/fir_16_2.h | 18 + .../dsp/multirate/.old_decim/taps/fir_16_4.h | 34 + .../dsp/multirate/.old_decim/taps/fir_16_8.h | 76 ++ .../multirate/.old_decim/taps/fir_2048_128.h | 526 ++++++++ .../multirate/.old_decim/taps/fir_2048_64.h | 265 ++++ .../multirate/.old_decim/taps/fir_256_128.h | 1024 +++++++++++++++ .../multirate/.old_decim/taps/fir_256_16.h | 88 ++ .../multirate/.old_decim/taps/fir_256_32.h | 154 +++ .../multirate/.old_decim/taps/fir_256_64.h | 368 ++++++ .../dsp/multirate/.old_decim/taps/fir_256_8.h | 44 + .../dsp/multirate/.old_decim/taps/fir_2_2.h | 81 ++ .../dsp/multirate/.old_decim/taps/fir_32_16.h | 140 +++ .../dsp/multirate/.old_decim/taps/fir_32_2.h | 18 + .../dsp/multirate/.old_decim/taps/fir_32_32.h | 1115 +++++++++++++++++ .../dsp/multirate/.old_decim/taps/fir_32_4.h | 29 + .../dsp/multirate/.old_decim/taps/fir_32_8.h | 57 + .../multirate/.old_decim/taps/fir_4096_128.h | 699 +++++++++++ .../dsp/multirate/.old_decim/taps/fir_4_2.h | 27 + .../dsp/multirate/.old_decim/taps/fir_4_4.h | 151 +++ .../multirate/.old_decim/taps/fir_512_128.h | 723 +++++++++++ .../multirate/.old_decim/taps/fir_512_16.h | 76 ++ .../multirate/.old_decim/taps/fir_512_32.h | 163 +++ .../multirate/.old_decim/taps/fir_512_64.h | 296 +++++ .../dsp/multirate/.old_decim/taps/fir_64_16.h | 102 ++ .../dsp/multirate/.old_decim/taps/fir_64_2.h | 16 + .../dsp/multirate/.old_decim/taps/fir_64_32.h | 266 ++++ .../dsp/multirate/.old_decim/taps/fir_64_4.h | 31 + .../dsp/multirate/.old_decim/taps/fir_64_8.h | 48 + .../dsp/multirate/.old_decim/taps/fir_8_2.h | 21 + .../dsp/multirate/.old_decim/taps/fir_8_4.h | 44 + .../dsp/multirate/.old_decim/taps/fir_8_8.h | 292 +++++ core/src/dsp/multirate/decim/plans.h | 138 ++ .../dsp/multirate/decim/taps/fir_1024_128.h | 577 +++++++++ .../dsp/multirate/decim/taps/fir_1024_32.h | 139 ++ .../dsp/multirate/decim/taps/fir_1024_64.h | 269 ++++ .../src/dsp/multirate/decim/taps/fir_128_16.h | 84 ++ .../src/dsp/multirate/decim/taps/fir_128_32.h | 192 +++ core/src/dsp/multirate/decim/taps/fir_128_4.h | 28 + .../src/dsp/multirate/decim/taps/fir_128_64.h | 519 ++++++++ core/src/dsp/multirate/decim/taps/fir_128_8.h | 45 + core/src/dsp/multirate/decim/taps/fir_16_16.h | 564 +++++++++ core/src/dsp/multirate/decim/taps/fir_16_2.h | 18 + core/src/dsp/multirate/decim/taps/fir_16_4.h | 34 + core/src/dsp/multirate/decim/taps/fir_16_8.h | 66 + .../dsp/multirate/decim/taps/fir_2048_128.h | 526 ++++++++ .../dsp/multirate/decim/taps/fir_2048_64.h | 341 +++++ .../dsp/multirate/decim/taps/fir_256_128.h | 1024 +++++++++++++++ .../src/dsp/multirate/decim/taps/fir_256_16.h | 88 ++ .../src/dsp/multirate/decim/taps/fir_256_32.h | 155 +++ .../src/dsp/multirate/decim/taps/fir_256_64.h | 368 ++++++ core/src/dsp/multirate/decim/taps/fir_256_8.h | 44 + core/src/dsp/multirate/decim/taps/fir_2_2.h | 81 ++ core/src/dsp/multirate/decim/taps/fir_32_16.h | 140 +++ core/src/dsp/multirate/decim/taps/fir_32_2.h | 18 + core/src/dsp/multirate/decim/taps/fir_32_32.h | 1115 +++++++++++++++++ core/src/dsp/multirate/decim/taps/fir_32_4.h | 29 + core/src/dsp/multirate/decim/taps/fir_32_8.h | 56 + .../dsp/multirate/decim/taps/fir_4096_128.h | 699 +++++++++++ .../dsp/multirate/decim/taps/fir_4096_64.h | 412 ++++++ core/src/dsp/multirate/decim/taps/fir_4_2.h | 24 + core/src/dsp/multirate/decim/taps/fir_4_4.h | 151 +++ .../dsp/multirate/decim/taps/fir_512_128.h | 723 +++++++++++ .../src/dsp/multirate/decim/taps/fir_512_16.h | 76 ++ .../src/dsp/multirate/decim/taps/fir_512_32.h | 141 +++ .../src/dsp/multirate/decim/taps/fir_512_64.h | 296 +++++ core/src/dsp/multirate/decim/taps/fir_64_16.h | 102 ++ core/src/dsp/multirate/decim/taps/fir_64_2.h | 16 + core/src/dsp/multirate/decim/taps/fir_64_32.h | 266 ++++ core/src/dsp/multirate/decim/taps/fir_64_4.h | 31 + core/src/dsp/multirate/decim/taps/fir_64_8.h | 48 + .../dsp/multirate/decim/taps/fir_8192_128.h | 738 +++++++++++ core/src/dsp/multirate/decim/taps/fir_8_2.h | 21 + core/src/dsp/multirate/decim/taps/fir_8_4.h | 39 + core/src/dsp/multirate/decim/taps/fir_8_8.h | 292 +++++ core/src/dsp/multirate/polyphase_bank.h | 62 + core/src/dsp/multirate/polyphase_resampler.h | 126 ++ core/src/dsp/multirate/power_decimator.h | 119 ++ core/src/dsp/multirate/rational_resampler.h | 155 +++ core/src/dsp/noise_reduction/fm_if.h | 149 +++ core/src/dsp/noise_reduction/squelch.h | 56 + core/src/dsp/operator.h | 63 + core/src/dsp/processor.h | 74 ++ core/src/dsp/routing/splitter.h | 65 + core/src/dsp/sink/handler_sink.h | 34 + core/src/dsp/sink/null_sink.h | 20 + core/src/dsp/taps/band_pass.h | 23 + core/src/dsp/taps/estimate_tap_count.h | 7 + core/src/dsp/taps/from_array.h | 18 + core/src/dsp/taps/high_pass.h | 12 + core/src/dsp/taps/low_pass.h | 10 + core/src/dsp/taps/raised_cosine.h | 33 + core/src/dsp/taps/root_raised_cosine.h | 35 + core/src/dsp/taps/tap.h | 29 + core/src/dsp/taps/windowed_sinc.h | 35 + core/src/dsp/window/blackman.h | 9 + core/src/dsp/window/blackman_harris.h | 10 + core/src/dsp/window/blackman_nuttall.h | 10 + core/src/dsp/window/cosine.h | 17 + core/src/dsp/window/hamming.h | 9 + core/src/dsp/window/hann.h | 9 + core/src/dsp/window/nuttall.h | 9 + core/src/dsp/window/rectangular.h | 8 + core/src/signal_path/iq_frontend.cpp | 303 +++++ core/src/signal_path/iq_frontend.h | 104 ++ 156 files changed, 24826 insertions(+) create mode 100644 core/src/dsp/audio/volume.h create mode 100644 core/src/dsp/bench/peak_level_meter.h create mode 100644 core/src/dsp/bench/speed_tester.h create mode 100644 core/src/dsp/buffer/buffer.h create mode 100644 core/src/dsp/buffer/frame_buffer.h create mode 100644 core/src/dsp/buffer/packer.h create mode 100644 core/src/dsp/buffer/reshaper.h create mode 100644 core/src/dsp/buffer/ring_buffer.h create mode 100644 core/src/dsp/channel/frequency_xlator.h create mode 100644 core/src/dsp/channel/rx_vfo.h create mode 100644 core/src/dsp/compression/pcm_type.h create mode 100644 core/src/dsp/compression/sample_stream_compressor.h create mode 100644 core/src/dsp/compression/sample_stream_decompressor.h create mode 100644 core/src/dsp/convert/complex_to_real.h create mode 100644 core/src/dsp/convert/complex_to_stereo.h create mode 100644 core/src/dsp/convert/l_r_to_stereo.h create mode 100644 core/src/dsp/convert/mono_to_stereo.h create mode 100644 core/src/dsp/convert/real_to_complex.h create mode 100644 core/src/dsp/convert/stereo_to_mono.h create mode 100644 core/src/dsp/correction/dc_blocker.h create mode 100644 core/src/dsp/demod/am.h create mode 100644 core/src/dsp/demod/broadcast_fm.h create mode 100644 core/src/dsp/demod/fm.h create mode 100644 core/src/dsp/demod/ssb.h create mode 100644 core/src/dsp/filter/decimating_fir.h create mode 100644 core/src/dsp/filter/deephasis.h create mode 100644 core/src/dsp/filter/fir.h create mode 100644 core/src/dsp/hier_block.h create mode 100644 core/src/dsp/loop/agc.h create mode 100644 core/src/dsp/loop/phase_control_loop.h create mode 100644 core/src/dsp/loop/pll.h create mode 100644 core/src/dsp/math/add.h create mode 100644 core/src/dsp/math/conjugate.h create mode 100644 core/src/dsp/math/constants.h create mode 100644 core/src/dsp/math/delay.h create mode 100644 core/src/dsp/math/fast_atan2.h create mode 100644 core/src/dsp/math/freq_to_omega.h create mode 100644 core/src/dsp/math/multiply.h create mode 100644 core/src/dsp/math/norm_phase_diff.h create mode 100644 core/src/dsp/math/phasor.h create mode 100644 core/src/dsp/math/sinc.h create mode 100644 core/src/dsp/math/subtract.h create mode 100644 core/src/dsp/multirate/.old_decim/plans.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_1024_128.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_1024_32.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_1024_64.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_128_16.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_128_32.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_128_4.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_128_64.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_128_8.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_16_16.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_16_2.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_16_4.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_16_8.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_2048_128.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_2048_64.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_256_128.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_256_16.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_256_32.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_256_64.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_256_8.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_2_2.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_32_16.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_32_2.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_32_32.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_32_4.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_32_8.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_4096_128.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_4_2.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_4_4.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_512_128.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_512_16.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_512_32.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_512_64.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_64_16.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_64_2.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_64_32.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_64_4.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_64_8.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_8_2.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_8_4.h create mode 100644 core/src/dsp/multirate/.old_decim/taps/fir_8_8.h create mode 100644 core/src/dsp/multirate/decim/plans.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_1024_128.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_1024_32.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_1024_64.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_128_16.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_128_32.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_128_4.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_128_64.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_128_8.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_16_16.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_16_2.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_16_4.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_16_8.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_2048_128.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_2048_64.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_256_128.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_256_16.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_256_32.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_256_64.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_256_8.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_2_2.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_32_16.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_32_2.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_32_32.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_32_4.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_32_8.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_4096_128.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_4096_64.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_4_2.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_4_4.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_512_128.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_512_16.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_512_32.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_512_64.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_64_16.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_64_2.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_64_32.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_64_4.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_64_8.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_8192_128.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_8_2.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_8_4.h create mode 100644 core/src/dsp/multirate/decim/taps/fir_8_8.h create mode 100644 core/src/dsp/multirate/polyphase_bank.h create mode 100644 core/src/dsp/multirate/polyphase_resampler.h create mode 100644 core/src/dsp/multirate/power_decimator.h create mode 100644 core/src/dsp/multirate/rational_resampler.h create mode 100644 core/src/dsp/noise_reduction/fm_if.h create mode 100644 core/src/dsp/noise_reduction/squelch.h create mode 100644 core/src/dsp/operator.h create mode 100644 core/src/dsp/processor.h create mode 100644 core/src/dsp/routing/splitter.h create mode 100644 core/src/dsp/sink/handler_sink.h create mode 100644 core/src/dsp/sink/null_sink.h create mode 100644 core/src/dsp/taps/band_pass.h create mode 100644 core/src/dsp/taps/estimate_tap_count.h create mode 100644 core/src/dsp/taps/from_array.h create mode 100644 core/src/dsp/taps/high_pass.h create mode 100644 core/src/dsp/taps/low_pass.h create mode 100644 core/src/dsp/taps/raised_cosine.h create mode 100644 core/src/dsp/taps/root_raised_cosine.h create mode 100644 core/src/dsp/taps/tap.h create mode 100644 core/src/dsp/taps/windowed_sinc.h create mode 100644 core/src/dsp/window/blackman.h create mode 100644 core/src/dsp/window/blackman_harris.h create mode 100644 core/src/dsp/window/blackman_nuttall.h create mode 100644 core/src/dsp/window/cosine.h create mode 100644 core/src/dsp/window/hamming.h create mode 100644 core/src/dsp/window/hann.h create mode 100644 core/src/dsp/window/nuttall.h create mode 100644 core/src/dsp/window/rectangular.h create mode 100644 core/src/signal_path/iq_frontend.cpp create mode 100644 core/src/signal_path/iq_frontend.h diff --git a/core/src/dsp/audio/volume.h b/core/src/dsp/audio/volume.h new file mode 100644 index 0000000..3b7f2e7 --- /dev/null +++ b/core/src/dsp/audio/volume.h @@ -0,0 +1,93 @@ +#pragma once +#include "../processor.h" + +// TODO: This block is useless and weird, get rid of it +namespace dsp::audio { + class Volume : public Processor { + using base_type = Processor; + public: + Volume() {} + + Volume(stream* in, double volume, bool muted) { init(in, volume, muted); } + + void init(stream* in, double volume, bool muted) { + _volume = powf(volume, 2); + level = { -150.0f, -150.0f }; + base_type::init(in); + } + + void setVolume(double volume) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _volume = powf(volume, 2); + } + + void setMuted(bool muted) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _muted = muted; + } + + bool getMuted() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + return _muted; + } + + stereo_t getOutputLevel() { + assert(base_type::_block_init); + std::lock_guard lck0(base_type::ctrlMtx); + std::lock_guard lck1(lvlMtx); + stereo_t lvl = level; + level = { -150.0f, -150.0f }; + return lvl; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + level = { -150.0f, -150.0f }; + } + + inline int process(int count, const stereo_t* in, stereo_t* out) { + // Apply volume factor + volk_32f_s32f_multiply_32f((float*)out, (float*)in, _muted ? 0.0f : _volume, count * 2); + + // Measure block level + stereo_t maxLvl = { 0, 0 }; + for (int i = 0; i < count; i++) { + stereo_t lvl = { fabsf(out[i].l), fabsf(out[i].r) }; + if (lvl.l > maxLvl.l) { maxLvl.l = lvl.l; } + if (lvl.r > maxLvl.r) { maxLvl.r = lvl.r; } + } + stereo_t maxLvlDB = { 20.0 * log10f(maxLvl.l), 20.0 * log10f(maxLvl.r) }; + + // Update max level + { + std::lock_guard lck(lvlMtx); + if (maxLvlDB.l > level.l) { level.l = maxLvlDB.l; } + if (maxLvlDB.r > level.r) { level.r = maxLvlDB.r; } + } + + return count; + } + + virtual int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + private: + float _volume; + bool _muted; + std::mutex lvlMtx; + stereo_t level; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/bench/peak_level_meter.h b/core/src/dsp/bench/peak_level_meter.h new file mode 100644 index 0000000..64817d1 --- /dev/null +++ b/core/src/dsp/bench/peak_level_meter.h @@ -0,0 +1,62 @@ +#pragma once +#include "../sink.h" + +namespace dsp::bench { + template + class PeakLevelMeter : Sink { + using base_type = Sink; + public: + PeakLevelMeter() {} + + PeakLevelMeter(stream* in) { base_type::init(in); } + + T getLevel() { + return level; + } + + void resetLevel() { + assert(base_type::_block_init); + if constexpr (std::is_same_v) { + level = 0.0f; + } + if constexpr (std::is_same_v || std::is_same_v) { + level = { 0.0f, 0.0f }; + } + } + + int process(int count, T* in) { + for (int i = 0; i < count; i++) { + if constexpr (std::is_same_v) { + float lvl = fabsf(in[i]); + if (lvl > level) { level = lvl; } + } + if constexpr (std::is_same_v) { + float lvlre = fabsf(in[i].re); + float lvlim = fabsf(in[i].im); + if (lvlre > level.re) { level.re = lvlre; } + if (lvlim > level.im) { level.im = lvlim; } + } + if constexpr (std::is_same_v) { + float lvll = fabsf(in[i].l); + float lvlr = fabsf(in[i].r); + if (lvll > level.l) { level.l = lvll; } + if (lvlr > level.r) { level.r = lvlr; } + } + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf); + + base_type::_in->flush(); + return count; + } + + protected: + T level; + }; +} \ No newline at end of file diff --git a/core/src/dsp/bench/speed_tester.h b/core/src/dsp/bench/speed_tester.h new file mode 100644 index 0000000..9624cd9 --- /dev/null +++ b/core/src/dsp/bench/speed_tester.h @@ -0,0 +1,105 @@ +#pragma once +#include +#include +#include "../stream.h" +#include "../types.h" + +namespace dsp::bench { + template + class SpeedTester { + public: + SpeedTester() {} + + SpeedTester(stream* in, stream* out) { init(in, out); } + + void init(stream* in, stream* out) { + _in = in; + _out = out; + _init = true; + } + + void setInput(stream* in) { + assert(_init); + _in = in; + } + + void setOutput(stream* out) { + assert(_init); + _out = out; + } + + double benchmark(int durationMs, int bufferSize) { + assert(_init); + + // Allocate and fill buffer + inCount = bufferSize; + randBuf = buffer::alloc(inCount); + for (int i = 0; i < inCount; i++) { + if constexpr (std::is_same_v) { + randBuf[i].re = (2.0f * (float)rand() / (float)RAND_MAX) - 1.0f; + randBuf[i].im = (2.0f * (float)rand() / (float)RAND_MAX) - 1.0f; + } + else if constexpr (std::is_same_v) { + randBuf[i] = (2.0f * (float)rand() / (float)RAND_MAX) - 1.0f; + } + else { + randBuf[i] = rand(); + } + } + + // Run test + start(); + std::this_thread::sleep_for(std::chrono::milliseconds(durationMs)); + stop(); + buffer::free(randBuf); + return (double)sampCount * 1000.0 / (double)durationMs; + } + + protected: + void start() { + if (running) { return; } + running = true; + sampCount = 0; + wthr = std::thread(&SpeedTester::writeWorker, this); + rthr = std::thread(&SpeedTester::readWorker, this); + } + + void stop() { + if (!running) { return; } + running = false; + _in->stopWriter(); + _out->stopReader(); + if (wthr.joinable()) { wthr.join(); } + if (rthr.joinable()) { rthr.join(); } + _in->clearWriteStop(); + _out->clearReadStop(); + } + + void writeWorker() { + while (true) { + memcpy(_in->writeBuf, randBuf, inCount * sizeof(I)); + if (!_in->swap(inCount)) { return; } + sampCount += inCount; + } + } + + void readWorker() { + while (true) { + int count = _out->read(); + _out->flush(); + if (count < 0) { return; } + } + } + + bool _init = false; + bool running = false; + int inCount; + stream* _in; + stream* _out; + I* randBuf; + std::thread wthr; + std::thread rthr; + uint64_t sampCount; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/buffer/buffer.h b/core/src/dsp/buffer/buffer.h new file mode 100644 index 0000000..192eb31 --- /dev/null +++ b/core/src/dsp/buffer/buffer.h @@ -0,0 +1,18 @@ +#pragma once +#include + +namespace dsp::buffer { + template + inline T* alloc(int count) { + return (T*)volk_malloc(count * sizeof(T), volk_get_alignment()); + } + + template + inline void clear(T* buffer, int count, int offset = 0) { + memset(&buffer[offset], 0, count * sizeof(T)); + } + + inline void free(void* buffer) { + volk_free(buffer); + } +} \ No newline at end of file diff --git a/core/src/dsp/buffer/frame_buffer.h b/core/src/dsp/buffer/frame_buffer.h new file mode 100644 index 0000000..85b3bba --- /dev/null +++ b/core/src/dsp/buffer/frame_buffer.h @@ -0,0 +1,136 @@ +#pragma once +#include "../block.h" +#define TEST_BUFFER_SIZE 32 + +// IMPORTANT: THIS IS TRASH AND MUST BE REWRITTEN IN THE FUTURE + +namespace dsp::buffer { + template + class SampleFrameBuffer : public block { + using base_type = block; + public: + SampleFrameBuffer() {} + + SampleFrameBuffer(stream* in) { init(in); } + + ~SampleFrameBuffer() { + if (!base_type::_block_init) { return; } + base_type::stop(); + for (int i = 0; i < TEST_BUFFER_SIZE; i++) { + buffer::free(buffers[i]); + } + } + + void init(stream* in) { + _in = in; + + for (int i = 0; i < TEST_BUFFER_SIZE; i++) { + buffers[i] = buffer::alloc(STREAM_BUFFER_SIZE); + } + + base_type::registerInput(in); + base_type::registerOutput(&out); + base_type::_block_init = true; + } + + void setInput(stream* in) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + base_type::unregisterInput(_in); + _in = in; + base_type::registerInput(_in); + base_type::tempStart(); + } + + void flush() { + std::unique_lock lck(bufMtx); + readCur = writeCur; + } + + int run() { + // Wait for data + int count = _in->read(); + if (count < 0) { return -1; } + + if (bypass) { + memcpy(out.writeBuf, _in->readBuf, count * sizeof(T)); + _in->flush(); + if (!out.swap(count)) { return -1; } + return count; + } + + // Push it on the ring buffer + { + std::lock_guard lck(bufMtx); + memcpy(buffers[writeCur], _in->readBuf, count * sizeof(T)); + sizes[writeCur] = count; + writeCur++; + writeCur = ((writeCur) % TEST_BUFFER_SIZE); + + // if (((writeCur - readCur + TEST_BUFFER_SIZE) % TEST_BUFFER_SIZE) >= (TEST_BUFFER_SIZE-2)) { + // spdlog::warn("Overflow"); + // } + } + cnd.notify_all(); + _in->flush(); + return count; + } + + void worker() { + while (true) { + // Wait for data + std::unique_lock lck(bufMtx); + cnd.wait(lck, [this]() { return (((writeCur - readCur + TEST_BUFFER_SIZE) % TEST_BUFFER_SIZE) > 0) || stopWorker; }); + if (stopWorker) { break; } + + // Write one to output buffer and unlock in preparation to swap buffers + int count = sizes[readCur]; + memcpy(out.writeBuf, buffers[readCur], count * sizeof(T)); + readCur++; + readCur = ((readCur) % TEST_BUFFER_SIZE); + lck.unlock(); + + // Swap + if (!out.swap(count)) { break; } + } + } + + stream out; + + int writeCur = 0; + int readCur = 0; + + bool bypass = false; + + private: + void doStart() { + base_type::workerThread = std::thread(&SampleFrameBuffer::workerLoop, this); + readWorkerThread = std::thread(&SampleFrameBuffer::worker, this); + } + + void doStop() { + _in->stopReader(); + out.stopWriter(); + stopWorker = true; + cnd.notify_all(); + + if (base_type::workerThread.joinable()) { base_type::workerThread.join(); } + if (readWorkerThread.joinable()) { readWorkerThread.join(); } + + _in->clearReadStop(); + out.clearWriteStop(); + stopWorker = false; + } + + stream* _in; + + std::thread readWorkerThread; + std::mutex bufMtx; + std::condition_variable cnd; + T* buffers[TEST_BUFFER_SIZE]; + int sizes[TEST_BUFFER_SIZE]; + + bool stopWorker = false; + }; +} \ No newline at end of file diff --git a/core/src/dsp/buffer/packer.h b/core/src/dsp/buffer/packer.h new file mode 100644 index 0000000..556ac76 --- /dev/null +++ b/core/src/dsp/buffer/packer.h @@ -0,0 +1,69 @@ +#include "../block.h" + + +namespace dsp::buffer { + template + class Packer : public block { + public: + Packer() {} + + Packer(stream* in, int count) { init(in, count); } + + void init(stream* in, int count) { + _in = in; + samples = count; + block::registerInput(_in); + block::registerOutput(&out); + block::_block_init = true; + } + + void setInput(stream* in) { + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + block::unregisterInput(_in); + _in = in; + block::registerInput(_in); + block::tempStart(); + } + + void setSampleCount(int count) { + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + samples = count; + block::tempStart(); + } + + int run() { + int count = _in->read(); + if (count < 0) { + read = 0; + return -1; + } + + for (int i = 0; i < count; i++) { + out.writeBuf[read++] = _in->readBuf[i]; + if (read >= samples) { + read = 0; + if (!out.swap(samples)) { + _in->flush(); + read = 0; + return -1; + } + } + } + + _in->flush(); + + return count; + } + + stream out; + + private: + int samples = 1; + int read = 0; + stream* _in; + }; +} \ No newline at end of file diff --git a/core/src/dsp/buffer/reshaper.h b/core/src/dsp/buffer/reshaper.h new file mode 100644 index 0000000..9689a06 --- /dev/null +++ b/core/src/dsp/buffer/reshaper.h @@ -0,0 +1,137 @@ +#pragma once +#include "../block.h" +#include "ring_buffer.h" + +// IMPORTANT: THIS IS TRASH AND MUST BE REWRITTEN IN THE FUTURE + +namespace dsp::buffer { + // NOTE: I'm not proud of this, it's BAD and just taken from the previous DSP, but it works... + template + class Reshaper : public block { + using base_type = block; + public: + Reshaper() {} + + Reshaper(stream* in, int keep, int skip) { init(in, keep, skip); } + + // NOTE: For some reason, the base class destructor doesn't get called.... this is a temporary fix I guess + // I also don't check for _block_init for the exact sample reason, something's weird + ~Reshaper() { + if (!base_type::_block_init) { return; } + base_type::stop(); + } + + void init(stream* in, int keep, int skip) { + _in = in; + _keep = keep; + _skip = skip; + ringBuf.init(keep * 2); + base_type::registerInput(_in); + base_type::registerOutput(&out); + base_type::_block_init = true; + } + + void setInput(stream* in) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + base_type::unregisterInput(_in); + _in = in; + base_type::registerInput(_in); + base_type::tempStart(); + } + + void setKeep(int keep) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _keep = keep; + ringBuf.setMaxLatency(keep * 2); + base_type::tempStart(); + } + + void setSkip(int skip) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _skip = skip; + base_type::tempStart(); + } + + int run() { + int count = _in->read(); + if (count < 0) { return -1; } + ringBuf.write(_in->readBuf, count); + _in->flush(); + return count; + } + + stream out; + + private: + void doStart() override { + workThread = std::thread(&Reshaper::loop, this); + bufferWorkerThread = std::thread(&Reshaper::bufferWorker, this); + } + + void loop() { + while (run() >= 0) + ; + } + + void doStop() override { + _in->stopReader(); + ringBuf.stopReader(); + out.stopWriter(); + ringBuf.stopWriter(); + + if (workThread.joinable()) { + workThread.join(); + } + if (bufferWorkerThread.joinable()) { + bufferWorkerThread.join(); + } + + _in->clearReadStop(); + ringBuf.clearReadStop(); + out.clearWriteStop(); + ringBuf.clearWriteStop(); + } + + void bufferWorker() { + T* buf = new T[_keep]; + bool delay = _skip < 0; + + int readCount = std::min(_keep + _skip, _keep); + int skip = std::max(_skip, 0); + int delaySize = (-_skip) * sizeof(T); + int delayCount = (-_skip); + + T* start = &buf[std::max(-_skip, 0)]; + T* delayStart = &buf[_keep + _skip]; + + while (true) { + if (delay) { + memmove(buf, delayStart, delaySize); + if constexpr (std::is_same_v || std::is_same_v) { + for (int i = 0; i < delayCount; i++) { + buf[i].re /= 10.0f; + buf[i].im /= 10.0f; + } + } + } + if (ringBuf.readAndSkip(start, readCount, skip) < 0) { break; }; + memcpy(out.writeBuf, buf, _keep * sizeof(T)); + if (!out.swap(_keep)) { break; } + } + delete[] buf; + } + + stream* _in; + int _outBlockSize; + RingBuffer ringBuf; + std::thread bufferWorkerThread; + std::thread workThread; + int _keep, _skip; + }; +} \ No newline at end of file diff --git a/core/src/dsp/buffer/ring_buffer.h b/core/src/dsp/buffer/ring_buffer.h new file mode 100644 index 0000000..c09a5b3 --- /dev/null +++ b/core/src/dsp/buffer/ring_buffer.h @@ -0,0 +1,239 @@ +#pragma once +#include "buffer.h" + +#define RING_BUF_SZ 1000000 + +// IMPORTANT: THIS IS TRASH AND MUST BE REWRITTEN IN THE FUTURE + +namespace dsp::buffer { + template + class RingBuffer { + public: + RingBuffer() {} + + RingBuffer(int maxLatency) { init(maxLatency); } + + ~RingBuffer() { + if (!_init) { return; } + buffer::free(_buffer); + _init = false; + } + + void init(int maxLatency) { + size = RING_BUF_SZ; + _stopReader = false; + _stopWriter = false; + this->maxLatency = maxLatency; + writec = 0; + readc = 0; + readable = 0; + writable = size; + _buffer = buffer::alloc(size); + buffer::clear(_buffer, size); + _init = true; + } + + int read(T* data, int len) { + assert(_init); + int dataRead = 0; + int toRead = 0; + while (dataRead < len) { + toRead = std::min(waitUntilReadable(), len - dataRead); + if (toRead < 0) { return -1; }; + + if ((toRead + readc) > size) { + memcpy(&data[dataRead], &_buffer[readc], (size - readc) * sizeof(T)); + memcpy(&data[dataRead + (size - readc)], &_buffer[0], (toRead - (size - readc)) * sizeof(T)); + } + else { + memcpy(&data[dataRead], &_buffer[readc], toRead * sizeof(T)); + } + + dataRead += toRead; + + _readable_mtx.lock(); + readable -= toRead; + _readable_mtx.unlock(); + _writable_mtx.lock(); + writable += toRead; + _writable_mtx.unlock(); + readc = (readc + toRead) % size; + canWriteVar.notify_one(); + } + return len; + } + + int readAndSkip(T* data, int len, int skip) { + assert(_init); + int dataRead = 0; + int toRead = 0; + while (dataRead < len) { + toRead = std::min(waitUntilReadable(), len - dataRead); + if (toRead < 0) { return -1; }; + + if ((toRead + readc) > size) { + memcpy(&data[dataRead], &_buffer[readc], (size - readc) * sizeof(T)); + memcpy(&data[dataRead + (size - readc)], &_buffer[0], (toRead - (size - readc)) * sizeof(T)); + } + else { + memcpy(&data[dataRead], &_buffer[readc], toRead * sizeof(T)); + } + + dataRead += toRead; + + _readable_mtx.lock(); + readable -= toRead; + _readable_mtx.unlock(); + _writable_mtx.lock(); + writable += toRead; + _writable_mtx.unlock(); + readc = (readc + toRead) % size; + canWriteVar.notify_one(); + } + dataRead = 0; + while (dataRead < skip) { + toRead = std::min(waitUntilReadable(), skip - dataRead); + if (toRead < 0) { return -1; }; + + dataRead += toRead; + + _readable_mtx.lock(); + readable -= toRead; + _readable_mtx.unlock(); + _writable_mtx.lock(); + writable += toRead; + _writable_mtx.unlock(); + readc = (readc + toRead) % size; + canWriteVar.notify_one(); + } + return len; + } + + int waitUntilReadable() { + assert(_init); + if (_stopReader) { return -1; } + int _r = getReadable(); + if (_r != 0) { return _r; } + std::unique_lock lck(_readable_mtx); + canReadVar.wait(lck, [=]() { return ((this->getReadable(false) > 0) || this->getReadStop()); }); + if (_stopReader) { return -1; } + return getReadable(false); + } + + int getReadable(bool lock = true) { + assert(_init); + if (lock) { _readable_mtx.lock(); }; + int _r = readable; + if (lock) { _readable_mtx.unlock(); }; + return _r; + } + + int write(T* data, int len) { + assert(_init); + int dataWritten = 0; + int toWrite = 0; + while (dataWritten < len) { + toWrite = std::min(waitUntilwritable(), len - dataWritten); + if (toWrite < 0) { return -1; }; + + if ((toWrite + writec) > size) { + memcpy(&_buffer[writec], &data[dataWritten], (size - writec) * sizeof(T)); + memcpy(&_buffer[0], &data[dataWritten + (size - writec)], (toWrite - (size - writec)) * sizeof(T)); + } + else { + memcpy(&_buffer[writec], &data[dataWritten], toWrite * sizeof(T)); + } + + dataWritten += toWrite; + + _readable_mtx.lock(); + readable += toWrite; + _readable_mtx.unlock(); + _writable_mtx.lock(); + writable -= toWrite; + _writable_mtx.unlock(); + writec = (writec + toWrite) % size; + + canReadVar.notify_one(); + } + return len; + } + + int waitUntilwritable() { + assert(_init); + if (_stopWriter) { return -1; } + int _w = getWritable(); + if (_w != 0) { return _w; } + std::unique_lock lck(_writable_mtx); + canWriteVar.wait(lck, [=]() { return ((this->getWritable(false) > 0) || this->getWriteStop()); }); + if (_stopWriter) { return -1; } + return getWritable(false); + } + + int getWritable(bool lock = true) { + assert(_init); + if (lock) { _writable_mtx.lock(); }; + int _w = writable; + if (lock) { + _writable_mtx.unlock(); + _readable_mtx.lock(); + }; + int _r = readable; + if (lock) { _readable_mtx.unlock(); }; + return std::max(std::min(_w, maxLatency - _r), 0); + } + + void stopReader() { + assert(_init); + _stopReader = true; + canReadVar.notify_one(); + } + + void stopWriter() { + assert(_init); + _stopWriter = true; + canWriteVar.notify_one(); + } + + bool getReadStop() { + assert(_init); + return _stopReader; + } + + bool getWriteStop() { + assert(_init); + return _stopWriter; + } + + void clearReadStop() { + assert(_init); + _stopReader = false; + } + + void clearWriteStop() { + assert(_init); + _stopWriter = false; + } + + void setMaxLatency(int maxLatency) { + assert(_init); + this->maxLatency = maxLatency; + } + + private: + bool _init = false; + T* _buffer; + int size; + int readc; + int writec; + int readable; + int writable; + int maxLatency; + bool _stopReader; + bool _stopWriter; + std::mutex _readable_mtx; + std::mutex _writable_mtx; + std::condition_variable canReadVar; + std::condition_variable canWriteVar; + }; +} \ No newline at end of file diff --git a/core/src/dsp/channel/frequency_xlator.h b/core/src/dsp/channel/frequency_xlator.h new file mode 100644 index 0000000..70c33a5 --- /dev/null +++ b/core/src/dsp/channel/frequency_xlator.h @@ -0,0 +1,63 @@ +#pragma once +#include "../processor.h" +#include "../math/freq_to_omega.h" + +namespace dsp::channel { + class FrequencyXlator : public Processor { + using base_type = Processor; + public: + FrequencyXlator() {} + + FrequencyXlator(stream* in, double offset) { init(in, offset); } + + FrequencyXlator(stream* in, double offset, double samplerate) { init(in, offset, samplerate); } + + void init(stream* in, double offset) { + phase = lv_cmake(1.0f, 0.0f); + phaseDelta = lv_cmake(cos(offset), sin(offset)); + base_type::init(in); + } + + void init(stream* in, double offset, double samplerate) { + init(in, math::freqToOmega(offset, samplerate)); + } + + void setOffset(double offset) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + phaseDelta = lv_cmake(cos(offset), sin(offset)); + } + + void setOffset(double offset, double samplerate) { + setOffset(math::freqToOmega(offset, samplerate)); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + tempStop(); + phase = lv_cmake(1.0f, 0.0f); + tempStart(); + } + + inline int process(int count, const complex_t* in, complex_t* out) { + volk_32fc_s32fc_x2_rotator_32fc((lv_32fc_t*)out, (lv_32fc_t*)in, phaseDelta, &phase, count); + return count; + } + + virtual int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + lv_32fc_t phase; + lv_32fc_t phaseDelta; + }; +} \ No newline at end of file diff --git a/core/src/dsp/channel/rx_vfo.h b/core/src/dsp/channel/rx_vfo.h new file mode 100644 index 0000000..e1c6a20 --- /dev/null +++ b/core/src/dsp/channel/rx_vfo.h @@ -0,0 +1,127 @@ +#pragma once +#include "frequency_xlator.h" +#include "../multirate/rational_resampler.h" + +namespace dsp::channel { + class RxVFO : public Processor { + using base_type = Processor; + public: + RxVFO() {} + + RxVFO(stream* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) { init(in, inSamplerate, outSamplerate, bandwidth, offset); } + + void init(stream* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) { + _inSamplerate = inSamplerate; + _outSamplerate = outSamplerate; + _bandwidth = bandwidth; + _offset = offset; + filterNeeded = (_bandwidth != _outSamplerate); + ftaps.taps = NULL; + + xlator.init(NULL, -_offset, _inSamplerate); + resamp.init(NULL, _inSamplerate, _outSamplerate); + generateTaps(); + filter.init(NULL, ftaps); + + base_type::init(in); + } + + void setInSamplerate(double inSamplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _inSamplerate = inSamplerate; + xlator.setOffset(-_offset, _inSamplerate); + resamp.setInSamplerate(_inSamplerate); + base_type::tempStart(); + } + + void setOutSamplerate(double outSamplerate, double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _outSamplerate = outSamplerate; + _bandwidth = bandwidth; + filterNeeded = (_bandwidth != _outSamplerate); + resamp.setOutSamplerate(_outSamplerate); + if (filterNeeded) { + generateTaps(); + filter.setTaps(ftaps); + } + base_type::tempStart(); + } + + void setBandwidth(double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _bandwidth = bandwidth; + filterNeeded = (_bandwidth != _outSamplerate); + if (filterNeeded) { + generateTaps(); + filter.setTaps(ftaps); + } + base_type::tempStart(); + } + + void setOffset(double offset) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _offset = offset; + xlator.setOffset(-_offset, _inSamplerate); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + xlator.reset(); + resamp.reset(); + filter.reset(); + base_type::tempStart(); + } + + inline int process(int count, const complex_t* in, complex_t* out) { + xlator.process(count, in, xlator.out.writeBuf); + if (!filterNeeded) { + return resamp.process(count, xlator.out.writeBuf, out); + } + count = resamp.process(count, xlator.out.writeBuf, resamp.out.writeBuf); + filter.process(count, resamp.out.writeBuf, out); + return count; + } + + int run() { + int count = _in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, _in->readBuf, out.writeBuf); + + // Swap if some data was generated + _in->flush(); + if (outCount) { + if (!out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + void generateTaps() { + taps::free(ftaps); + double filterWidth = _bandwidth / 2.0; + ftaps = taps::lowPass(filterWidth, filterWidth * 0.1, _outSamplerate); + printf("New taps just dropped: %lf %lf %lf\n", filterWidth, filterWidth*0.1, _outSamplerate); + } + + FrequencyXlator xlator; + multirate::RationalResampler resamp; + filter::FIR filter; + tap ftaps; + bool filterNeeded; + + double _inSamplerate; + double _outSamplerate; + double _bandwidth; + double _offset; + }; +} \ No newline at end of file diff --git a/core/src/dsp/compression/pcm_type.h b/core/src/dsp/compression/pcm_type.h new file mode 100644 index 0000000..2a94616 --- /dev/null +++ b/core/src/dsp/compression/pcm_type.h @@ -0,0 +1,9 @@ +#pragma once + +namespace dsp::compression { + enum PCMType { + PCM_TYPE_I8, + PCM_TYPE_I16, + PCM_TYPE_F32 + }; +} \ No newline at end of file diff --git a/core/src/dsp/compression/sample_stream_compressor.h b/core/src/dsp/compression/sample_stream_compressor.h new file mode 100644 index 0000000..1eeb107 --- /dev/null +++ b/core/src/dsp/compression/sample_stream_compressor.h @@ -0,0 +1,79 @@ +#pragma once +#include "../processor.h" +#include "pcm_type.h" + +namespace dsp::compression { + class SampleStreamCompressor : public Processor { + using base_type = Processor; + public: + SampleStreamCompressor() {} + + SampleStreamCompressor(stream* in, PCMType pcmType) { init(in, pcmType); } + + void init(stream* in, PCMType pcmType) { + _pcmType = pcmType; + base_type::init(in); + } + + void setPCMType(PCMType pcmType) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _pcmType = pcmType; + base_type::tempStart(); + } + + inline static int process(int count, PCMType pcmType, const complex_t* in, uint8_t* out) { + uint16_t* compressionType = (uint16_t*)out; + uint16_t* sampleType = (uint16_t*)&out[2]; + float* scaler = (float*)&out[4]; + void* dataBuf = &out[8]; + + // Write options and leave blank space for compression + *compressionType = 0; + *sampleType = pcmType; + + // If type is float32, no compression is needed + if (pcmType == PCMType::PCM_TYPE_F32) { + *scaler = 0; + memcpy(dataBuf, in, count * sizeof(complex_t)); + return count; + } + + // Find maximum value + uint32_t maxIdx; + volk_32f_index_max_32u(&maxIdx, (float*)in, count * 2); + float maxVal = ((float*)in)[maxIdx]; + *scaler = maxVal; + + // Convert to the right type and send it out (sign bit determines pcm type) + if (pcmType == PCMType::PCM_TYPE_I8) { + volk_32f_s32f_convert_8i((int8_t*)dataBuf, (float*)in, 128.0f / maxVal, count * 2); + return 8 + (count * sizeof(int8_t) * 2); + } + else if (pcmType == PCMType::PCM_TYPE_I16) { + volk_32f_s32f_convert_16i((int16_t*)dataBuf, (float*)in, 32768.0f / maxVal, count * 2); + return 8 + (count * sizeof(int16_t) * 2); + } + + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, _pcmType, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + PCMType _pcmType; + }; +} \ No newline at end of file diff --git a/core/src/dsp/compression/sample_stream_decompressor.h b/core/src/dsp/compression/sample_stream_decompressor.h new file mode 100644 index 0000000..c794acf --- /dev/null +++ b/core/src/dsp/compression/sample_stream_decompressor.h @@ -0,0 +1,50 @@ +#pragma once +#include "../processor.h" +#include "pcm_type.h" + +namespace dsp::compression { + class SampleStreamDecompressor : public Processor { + using base_type = Processor; + public: + SampleStreamDecompressor() {} + + SampleStreamDecompressor(stream* in) { base_type::init(in); } + + inline int process(int count, const uint8_t* in, complex_t* out) { + uint16_t sampleType = *(uint16_t*)&in[2]; + float scaler = *(float*)&in[4]; + const void* dataBuf = &in[8]; + + if (sampleType == PCMType::PCM_TYPE_F32) { + memcpy(out, dataBuf, count - 8); + return (count - 8) / sizeof(complex_t); + } + else if (sampleType == PCMType::PCM_TYPE_I16) { + int outCount = (count - 8) / (sizeof(int16_t) * 2); + volk_16i_s32f_convert_32f((float*)out, (int16_t*)dataBuf, 32768.0f / scaler, outCount * 2); + return outCount; + } + else if (sampleType == PCMType::PCM_TYPE_I8) { + int outCount = (count - 8) / (sizeof(int8_t) * 2); + volk_8i_s32f_convert_32f((float*)out, (int8_t*)dataBuf, 128.0f / scaler, outCount * 2); + return outCount; + } + + return 0; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/convert/complex_to_real.h b/core/src/dsp/convert/complex_to_real.h new file mode 100644 index 0000000..3df844b --- /dev/null +++ b/core/src/dsp/convert/complex_to_real.h @@ -0,0 +1,30 @@ +#pragma once +#include "../processor.h" + +namespace dsp::convert { + class ComplexToReal : public Processor { + using base_type = Processor; + public: + ComplexToReal() {} + + ComplexToReal(stream* in) { init(in); } + + void init(stream* in) { base_type::init(in); } + + inline static int process(int count, const complex_t* in, float* out) { + volk_32fc_deinterleave_real_32f(out, (lv_32fc_t*)in, count); + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/convert/complex_to_stereo.h b/core/src/dsp/convert/complex_to_stereo.h new file mode 100644 index 0000000..3107118 --- /dev/null +++ b/core/src/dsp/convert/complex_to_stereo.h @@ -0,0 +1,25 @@ +#pragma once +#include "../processor.h" + +namespace dsp::convert { + class ComplexToStereo : public Processor { + using base_type = Processor; + public: + ComplexToStereo() {} + + ComplexToStereo(stream* in) { init(in); } + + void init(stream* in) { base_type::init(in); } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + memcpy(base_type::out.writeBuf, base_type::_in->readBuf, count * sizeof(complex_t)); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/convert/l_r_to_stereo.h b/core/src/dsp/convert/l_r_to_stereo.h new file mode 100644 index 0000000..c7de89e --- /dev/null +++ b/core/src/dsp/convert/l_r_to_stereo.h @@ -0,0 +1,44 @@ +#pragma once +#include "../operator.h" + +namespace dsp::convert { + class LRToStereo : public Operator { + using base_type = Operator; + public: + LRToStereo() {} + + LRToStereo(stream* l, stream* r) { init(l, r); } + + void init(stream* l, stream* r) { base_type::init(l, r); } + + void setInputs(stream* l, stream* r) { base_type::setInputs(l, r); } + + void setInputL(stream* l) { base_type::setInputA(l); } + + void setInputR(stream* r) { base_type::setInputB(r); } + + static inline int process(int count, const float* l, const float* r, stereo_t* out) { + volk_32f_x2_interleave_32fc((lv_32fc_t*)out, l, r, count); + return count; + } + + int run() { + int a_count = base_type::_a->read(); + if (a_count < 0) { return -1; } + int b_count = base_type::_b->read(); + if (b_count < 0) { return -1; } + if (a_count != b_count) { + base_type::_a->flush(); + base_type::_b->flush(); + return 0; + } + + process(a_count, base_type::_a->readBuf, base_type::_b->readBuf, base_type::out.writeBuf); + + base_type::_a->flush(); + base_type::_b->flush(); + if (!base_type::out.swap(a_count)) { return -1; } + return a_count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/convert/mono_to_stereo.h b/core/src/dsp/convert/mono_to_stereo.h new file mode 100644 index 0000000..4f14961 --- /dev/null +++ b/core/src/dsp/convert/mono_to_stereo.h @@ -0,0 +1,28 @@ +#pragma once +#include "../processor.h" + +namespace dsp::convert { + class MonoToStereo : public Processor { + using base_type = Processor; + public: + MonoToStereo() {} + + MonoToStereo(stream* in) { base_type::init(in); } + + inline static int process(int count, const float* in, stereo_t* out) { + volk_32f_x2_interleave_32fc((lv_32fc_t*)out, in, in, count); + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/convert/real_to_complex.h b/core/src/dsp/convert/real_to_complex.h new file mode 100644 index 0000000..9fc039e --- /dev/null +++ b/core/src/dsp/convert/real_to_complex.h @@ -0,0 +1,44 @@ +#pragma once +#include "../processor.h" + +namespace dsp::convert { + class RealToComplex : public Processor { + using base_type = Processor; + public: + RealToComplex() {} + + RealToComplex(stream* in) { init(in); } + + ~RealToComplex() { + if (!base_type::_block_init) { return; } + base_type::stop(); + buffer::free(nullBuf); + } + + void init(stream* in) { + nullBuf = buffer::alloc(STREAM_BUFFER_SIZE); + buffer::clear(nullBuf, STREAM_BUFFER_SIZE); + base_type::init(in); + } + + inline int process(int count, const float* in, complex_t* out) { + volk_32f_x2_interleave_32fc((lv_32fc_t*)out, in, nullBuf, count); + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + private: + float* nullBuf; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/convert/stereo_to_mono.h b/core/src/dsp/convert/stereo_to_mono.h new file mode 100644 index 0000000..b3857c9 --- /dev/null +++ b/core/src/dsp/convert/stereo_to_mono.h @@ -0,0 +1,30 @@ +#pragma once +#include "../processor.h" + +namespace dsp::convert { + class StereoToMono : public Processor { + using base_type = Processor; + public: + StereoToMono() {} + + StereoToMono(stream* in) { base_type::init(in); } + + inline int process(int count, const stereo_t* in, float* out) { + for (int i = 0; i < count; i++) { + out[i] = (in[i].l + in[i].r) / 2.0f; + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/correction/dc_blocker.h b/core/src/dsp/correction/dc_blocker.h new file mode 100644 index 0000000..7fcd497 --- /dev/null +++ b/core/src/dsp/correction/dc_blocker.h @@ -0,0 +1,72 @@ +#pragma once +#include "../processor.h" + +namespace dsp::correction { + template + class DCBlocker : public Processor { + using base_type = Processor; + public: + DCBlocker() {} + + DCBlocker(stream* in, double rate) { init(in, rate); } + + DCBlocker(stream* in, double rate, double samplerate) { init(in, rate, samplerate); } + + void init(stream* in, double rate) { + _rate = rate; + reset(); + base_type::init(in); + } + + void init(stream* in, double rate, double samplerate) { + init(in, rate / samplerate); + } + + void setRate(double rate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _rate = rate; + } + + void setRate(double rate, double samplerate) { + setRate(rate / samplerate); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + if constexpr (std::is_same_v) { + offset = 0.0f; + } + if constexpr (std::is_same_v || std::is_same_v) { + offset = { 0.0f, 0.0f }; + } + base_type::tempStart(); + } + + // TODO: Add back the const + int process(int count, T* in, T* out) { + for (int i = 0; i < count; i++) { + out[i] = in[i] - offset; + offset += out[i] * _rate; + } + return count; + } + + virtual int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + float _rate; + T offset; + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/am.h b/core/src/dsp/demod/am.h new file mode 100644 index 0000000..a7949e7 --- /dev/null +++ b/core/src/dsp/demod/am.h @@ -0,0 +1,88 @@ +#pragma once +#include "../processor.h" +#include "../loop/agc.h" + +namespace dsp::demod { + class AM : public Processor { + using base_type = Processor; + public: + enum AGCMode { + CARRIER, + AUDIO, + }; + + AM() {} + + AM(stream* in, AGCMode agcMode, double agcRate) { init(in, agcMode, agcRate); } + + void init(stream* in, AGCMode agcMode, double agcRate) { + _agcMode = agcMode; + + carrierAgc.init(NULL, 1.0, agcRate); + audioAgc.init(NULL, 1.0, agcRate); + + base_type::init(in); + } + + void setAGCMode(AGCMode agcMode) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _agcMode = agcMode; + reset(); + base_type::tempStart(); + } + + void setAGCRate(double agcRate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + carrierAgc.setRate(agcRate); + audioAgc.setRate(agcRate); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + carrierAgc.reset(); + audioAgc.reset(); + base_type::tempStart(); + } + + int process(int count, complex_t* in, float* out) { + // Apply carrier AGC if needed + if (_agcMode == AGCMode::CARRIER) { + carrierAgc.process(count, in, carrierAgc.out.writeBuf); + in = carrierAgc.out.writeBuf; + } + + // Get magnitude of each sample (TODO: use block instead) + volk_32fc_magnitude_32f(out, (lv_32fc_t*)in, count); + + // Apply audio AGC if needed + if (_agcMode == AGCMode::AUDIO) { + audioAgc.process(count, out, out); + } + + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + AGCMode _agcMode; + + loop::AGC carrierAgc; + loop::AGC audioAgc; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/broadcast_fm.h b/core/src/dsp/demod/broadcast_fm.h new file mode 100644 index 0000000..81061c1 --- /dev/null +++ b/core/src/dsp/demod/broadcast_fm.h @@ -0,0 +1,156 @@ +#pragma once +#include "fm.h" +#include "../taps/band_pass.h" +#include "../filter/fir.h" +#include "../loop/pll.h" +#include "../convert/l_r_to_stereo.h" +#include "../convert/real_to_complex.h" +#include "../convert/complex_to_real.h" +#include "../math/conjugate.h" +#include "../math/delay.h" +#include "../math/multiply.h" +#include "../math/add.h" +#include "../math/subtract.h" + +namespace dsp::demod { + class BroadcastFM : public Processor { + using base_type = Processor; + public: + BroadcastFM() {} + + BroadcastFM(stream* in, double deviation, double samplerate, bool stereo = true) { init(in, deviation, samplerate, stereo); } + + ~BroadcastFM() { + if (!base_type::_block_init) { return; } + base_type::stop(); + buffer::free(lmr); + buffer::free(l); + buffer::free(r); + } + + virtual void init(stream* in, double deviation, double samplerate, bool stereo = true) { + _deviation = deviation; + _samplerate = samplerate; + _stereo = stereo; + + demod.init(NULL, _deviation, _samplerate); + pilotFirTaps = taps::bandPass(18750.0, 19250.0, 3000.0, _samplerate); + pilotFir.init(NULL, pilotFirTaps); + rtoc.init(NULL); + pilotPLL.init(NULL, 0.1/*TODO: adapt to samplerate*/, 0.0, math::freqToOmega(19000.0, _samplerate), math::freqToOmega(18750.0, _samplerate), math::freqToOmega(19250.0, _samplerate)); + delay.init(NULL, pilotFirTaps.size / 2.0); + + lmr = buffer::alloc(STREAM_BUFFER_SIZE); + l = buffer::alloc(STREAM_BUFFER_SIZE); + r = buffer::alloc(STREAM_BUFFER_SIZE); + + base_type::init(in); + } + + void setDeviation(double deviation) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _deviation = deviation; + demod.setDeviation(_deviation, _samplerate); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _samplerate = samplerate; + + demod.setDeviation(_deviation, _samplerate); + taps::free(pilotFirTaps); + pilotFirTaps = taps::bandPass(18750.0, 19250.0, 3000.0, samplerate); + pilotFir.setTaps(pilotFirTaps); + pilotPLL.setFrequencyLimits(math::freqToOmega(18750.0, _samplerate), math::freqToOmega(19250.0, _samplerate)); + pilotPLL.setInitialFreq(math::freqToOmega(19000.0, _samplerate)); + delay.setDelay(pilotFirTaps.size / 2); + + reset(); + base_type::tempStart(); + } + + void setStereo(bool stereo) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _stereo = stereo; + reset(); + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + demod.reset(); + pilotFir.reset(); + pilotPLL.reset(); + delay.reset(); + base_type::tempStart(); + } + + inline int process(int count, complex_t* in, stereo_t* out) { + // Demodulate + demod.process(count, in, demod.out.writeBuf); + if (_stereo) { + // Convert to complex + rtoc.process(count, demod.out.writeBuf, rtoc.out.writeBuf); + + // Filter out pilot and run through PLL + pilotFir.process(count, rtoc.out.writeBuf, pilotFir.out.writeBuf); + pilotPLL.process(count, pilotFir.out.writeBuf, pilotPLL.out.writeBuf); + + // Conjugate PLL output to down convert the L-R signal + math::Conjugate::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); + math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf); + + // Convert output back to real for further processing + convert::ComplexToReal::process(count, rtoc.out.writeBuf, lmr); + + // Do L = (L+R) + (L-R), R = (L+R) - (L-R) + math::Add::process(count, demod.out.writeBuf, lmr, l); + math::Subtract::process(count, demod.out.writeBuf, lmr, r); + + // Interleave into stereo + convert::LRToStereo::process(count, l, r, out); + } + else { + // Interleave raw MPX to stereo + convert::LRToStereo::process(count, demod.out.writeBuf, demod.out.writeBuf, out); + } + + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + double _deviation; + double _samplerate; + bool _stereo; + + FM demod; + tap pilotFirTaps; + filter::FIR pilotFir; + convert::RealToComplex rtoc; + loop::PLL pilotPLL; + math::Delay delay; + + float* lmr; + float* l; + float* r; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/fm.h b/core/src/dsp/demod/fm.h new file mode 100644 index 0000000..efda274 --- /dev/null +++ b/core/src/dsp/demod/fm.h @@ -0,0 +1,69 @@ +#pragma once +#include "../processor.h" +#include "../math/fast_atan2.h" +#include "../math/freq_to_omega.h" +#include "../math/norm_phase_diff.h" + +namespace dsp::demod { + class FM : public Processor { + using base_type = Processor; + public: + FM() {} + + FM(stream* in, double deviation) { init(in, deviation); } + + FM(stream* in, double deviation, double samplerate) { init(in, deviation, samplerate); } + + + virtual void init(stream* in, double deviation) { + _invDeviation = 1.0 / deviation; + base_type::init(in); + } + + virtual void init(stream* in, double deviation, double samplerate) { + init(in, math::freqToOmega(deviation, samplerate)); + } + + void setDeviation(double deviation) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _invDeviation = 1.0 / deviation; + } + + void setDeviation(double deviation, double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _invDeviation = 1.0 / math::freqToOmega(deviation, samplerate); + } + + inline int process(int count, complex_t* in, float* out) { + for (int i = 0; i < count; i++) { + float cphase = in[i].phase(); + out[i] = math::normPhaseDiff(cphase - phase) * _invDeviation; + phase = cphase; + } + return count; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + phase = 0.0f; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + float _invDeviation; + float phase = 0.0f; + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/ssb.h b/core/src/dsp/demod/ssb.h new file mode 100644 index 0000000..fd7e21c --- /dev/null +++ b/core/src/dsp/demod/ssb.h @@ -0,0 +1,133 @@ +#pragma once +#include "../processor.h" +#include "../channel/frequency_xlator.h" +#include "../convert/complex_to_real.h" +#include "../loop/agc.h" + +namespace dsp::demod { + class SSB : public Processor { + using base_type = Processor; + public: + enum Mode { + USB, + LSB, + DSB + }; + + SSB() {} + + /** Calls the init function + */ + SSB(stream* in, Mode mode, double bandwidth, double samplerate, double agcRate) { init(in, mode, bandwidth, samplerate, agcRate); } + + /** Initialize the SSB/DSB Demodulator + * \param in Input stream + * \param mode Demodulation mode, can be USB, LSB or DSB + * \param bandwidth Bandwidth needed to shift back the IQ correctly + * \param samplerate Samplerate of the IQ data + * \param agcRate Speed at which the AGC corrects the audio level. This is NOT automatically scaled to the samplerate. + */ + void init(stream* in, Mode mode, double bandwidth, double samplerate, double agcRate) { + _mode = mode; + _bandwidth = bandwidth; + _samplerate = samplerate; + xlator.init(NULL, getTranslation(), _samplerate); + agc.init(NULL, 1.0, agcRate); + base_type::init(in); + } + + /** Set demodulation mode + * \param mode Either USB, LSB or DSB + */ + void setMode(Mode mode) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _mode = mode; + xlator.setOffset(getTranslation(), _samplerate); + base_type::tempStart(); + } + + /** Set bandwidth + * \param bandwidth Bandwidth in Hz + */ + void setBandwidth(double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _bandwidth = bandwidth; + xlator.setOffset(getTranslation(), _samplerate); + base_type::tempStart(); + } + + /** Set samplerate + * \param samplerate Samplerate in Hz + */ + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _samplerate = samplerate; + xlator.setOffset(getTranslation(), _samplerate); + base_type::tempStart(); + } + + /** Set AGC rate + * \param agcRate AGC rate in units per second + */ + void setAGCRate(double agcRate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + agc.setRate(agcRate); + } + + /** Process data + * \param count Number of samples + * \param in Input buffer + * \param out Output buffer + */ + int process(int count, const complex_t* in, float* out) { + // Move back sideband + xlator.process(count, in, xlator.out.writeBuf); + + // Extract the real component + convert::ComplexToReal::process(count, xlator.out.writeBuf, out); + + // Apply AGC + agc.process(count, out, out); + + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + double getTranslation() { + if (_mode == Mode::USB) { + return _bandwidth / 2.0; + } + else if (_mode == Mode::LSB) { + return -_bandwidth / 2.0; + } + else if (_mode == Mode::DSB) { + return 0.0; + } + } + + Mode _mode; + double _bandwidth; + double _samplerate; + channel::FrequencyXlator xlator; + loop::AGC agc; + + }; +}; \ No newline at end of file diff --git a/core/src/dsp/filter/decimating_fir.h b/core/src/dsp/filter/decimating_fir.h new file mode 100644 index 0000000..de58f1e --- /dev/null +++ b/core/src/dsp/filter/decimating_fir.h @@ -0,0 +1,88 @@ +#pragma once +#include "fir.h" + +namespace dsp::filter { + template + class DecimatingFIR : public FIR { + using base_type = FIR; + public: + DecimatingFIR() {} + + DecimatingFIR(stream* in, tap& taps, int decimation) { init(in, taps, decimation); } + + void init(stream* in, tap& taps, int decimation) { + _decimation = decimation; + base_type::init(in, taps); + } + + void setTaps(tap& taps) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + offset = 0; + base_type::setTaps(taps); + base_type::tempStart(); + } + + void setDecimation(int decimation) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _decimation = decimation; + offset = 0; + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + offset = 0; + base_type::reset(); + base_type::tempStart(); + } + + inline int process(int count, const D* in, D* out) { + // Copy data to work buffer + memcpy(base_type::bufStart, in, count * sizeof(D)); + + // Do convolution + int outCount = 0; + for (; offset < count; offset += _decimation) { + if constexpr (std::is_same_v && std::is_same_v) { + volk_32f_x2_dot_prod_32f(&out[outCount++], &base_type::buffer[offset], base_type::_taps.taps, base_type::_taps.size); + } + if constexpr ((std::is_same_v || std::is_same_v) && std::is_same_v) { + volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&out[outCount++], (lv_32fc_t*)&base_type::buffer[offset], base_type::_taps.taps, base_type::_taps.size); + } + if constexpr ((std::is_same_v || std::is_same_v) && std::is_same_v) { + volk_32fc_x2_dot_prod_32fc((lv_32fc_t*)&out[outCount++], (lv_32fc_t*)&base_type::buffer[offset], (lv_32fc_t*)base_type::_taps.taps, base_type::_taps.size); + } + } + offset -= count; + + // Move unused data + memmove(base_type::buffer, &base_type::buffer[count], (base_type::_taps.size - 1) * sizeof(D)); + + return outCount; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + int _decimation; + int offset = 0; + }; +} \ No newline at end of file diff --git a/core/src/dsp/filter/deephasis.h b/core/src/dsp/filter/deephasis.h new file mode 100644 index 0000000..daabae0 --- /dev/null +++ b/core/src/dsp/filter/deephasis.h @@ -0,0 +1,102 @@ +#pragma once +#include "../processor.h" + + +namespace dsp::filter { + template + class Deemphasis : public Processor { + using base_type = Processor; + public: + Deemphasis() {} + + Deemphasis(stream* in, double tau, double samplerate) {} + + void init(stream* in, double tau, double samplerate) { + _tau = tau; + _samplerate = samplerate; + + updateAlpha(); + + // Initialize state + if constexpr (std::is_same_v) { + lastOut = 0; + } + if constexpr (std::is_same_v) { + lastOut = { 0, 0 }; + } + + base_type::init(in); + } + + void setTau(double tau) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _tau = tau; + updateAlpha(); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _samplerate = samplerate; + updateAlpha(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + if constexpr (std::is_same_v) { + lastOut = 0; + } + if constexpr (std::is_same_v) { + lastOut = { 0, 0 }; + } + base_type::tempStart(); + } + + inline int process(int count, const T* in, T* out) { + if constexpr (std::is_same_v) { + out[0] = (alpha * in[0]) + ((1 - alpha) * lastOut); + for (int i = 1; i < count; i++) { + out[i] = (alpha * in[i]) + ((1 - alpha) * out[i - 1]); + } + lastOut = out[count - 1]; + } + if constexpr (std::is_same_v) { + out[0].l = (alpha * in[0].l) + ((1 - alpha) * lastOut.l); + out[0].r = (alpha * in[0].r) + ((1 - alpha) * lastOut.r); + for (int i = 1; i < count; i++) { + out[i].l = (alpha * in[i].l) + ((1 - alpha) * out[i - 1].l); + out[i].r = (alpha * in[i].r) + ((1 - alpha) * out[i - 1].r); + } + lastOut.l = out[count - 1].l; + lastOut.r = out[count - 1].r; + } + return count; + } + + //DEFAULT_PROC_RUN(); + + int run() { + int count = _in->read(); + if (count < 0) { return -1; } + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + private: + void updateAlpha() { + float dt = 1.0f / _samplerate; + alpha = dt / (_tau + dt); + } + + double _tau; + double _samplerate; + + float alpha; + T lastOut; + }; +} \ No newline at end of file diff --git a/core/src/dsp/filter/fir.h b/core/src/dsp/filter/fir.h new file mode 100644 index 0000000..020aeb7 --- /dev/null +++ b/core/src/dsp/filter/fir.h @@ -0,0 +1,92 @@ +#pragma once +#include "../processor.h" +#include "../taps/tap.h" + +namespace dsp::filter { + template + class FIR : public Processor { + using base_type = Processor; + public: + FIR() {} + + FIR(stream* in, tap& taps) { init(in, taps); } + + ~FIR() { + if (!base_type::_block_init) { return; } + base_type::stop(); + buffer::free(buffer); + } + + virtual void init(stream* in, tap& taps) { + _taps = taps; + + // Allocate and clear buffer + buffer = buffer::alloc(STREAM_BUFFER_SIZE + 64000); + bufStart = &buffer[_taps.size - 1]; + buffer::clear(buffer, _taps.size - 1); + + base_type::init(in); + } + + virtual void setTaps(tap& taps) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + + _taps = taps; + + // Reset buffer + bufStart = &buffer[_taps.size - 1]; + buffer::clear(buffer, _taps.size - 1); + + base_type::tempStart(); + } + + virtual void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + buffer::clear(buffer, _taps.size - 1); + base_type::tempStart(); + } + + inline int process(int count, const D* in, D* out) { + // Copy data to work buffer + memcpy(bufStart, in, count * sizeof(D)); + + // Do convolution + for (int i = 0; i < count; i++) { + if constexpr (std::is_same_v && std::is_same_v) { + volk_32f_x2_dot_prod_32f(&out[i], &buffer[i], _taps.taps, _taps.size); + } + if constexpr ((std::is_same_v || std::is_same_v) && std::is_same_v) { + volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&out[i], (lv_32fc_t*)&buffer[i], _taps.taps, _taps.size); + } + if constexpr ((std::is_same_v || std::is_same_v) && std::is_same_v) { + volk_32fc_x2_dot_prod_32fc((lv_32fc_t*)&out[i], (lv_32fc_t*)&buffer[i], (lv_32fc_t*)_taps.taps, _taps.size); + } + } + + // Move unused data + memmove(buffer, &buffer[count], (_taps.size - 1) * sizeof(D)); + + return count; + } + + virtual int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + tap _taps; + D* buffer; + D* bufStart; + }; +} \ No newline at end of file diff --git a/core/src/dsp/hier_block.h b/core/src/dsp/hier_block.h new file mode 100644 index 0000000..f5ba592 --- /dev/null +++ b/core/src/dsp/hier_block.h @@ -0,0 +1,83 @@ +#pragma once +#include "block.h" + +namespace dsp { + class hier_block : public generic_block { + public: + virtual void init() {} + + virtual ~hier_block() { + if (!_block_init) { return; } + stop(); + _block_init = false; + } + + virtual void start() { + assert(_block_init); + std::lock_guard lck(ctrlMtx); + if (running) { + return; + } + running = true; + doStart(); + } + + virtual void stop() { + assert(_block_init); + std::lock_guard lck(ctrlMtx); + if (!running) { + return; + } + doStop(); + running = false; + } + + void tempStart() { + assert(_block_init); + if (!tempStopDepth || --tempStopDepth) { return; } + if (tempStopped) { + doStart(); + tempStopped = false; + } + } + + void tempStop() { + assert(_block_init); + if (tempStopDepth++) { return; } + if (running && !tempStopped) { + doStop(); + tempStopped = true; + } + } + + private: + virtual void doStart() { + for (auto& block : blocks) { + block->start(); + } + } + + virtual void doStop() { + for (auto& block : blocks) { + block->stop(); + } + } + + std::vector blocks; + bool tempStopped = false; + bool running = false; + int tempStopDepth = 0; + + protected: + void registerBlock(generic_block* block) { + blocks.push_back(block); + } + + void unregisterBlock(generic_block* block) { + blocks.erase(std::remove(blocks.begin(), blocks.end(), block), blocks.end()); + } + + bool _block_init = false; + std::recursive_mutex ctrlMtx; + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/agc.h b/core/src/dsp/loop/agc.h new file mode 100644 index 0000000..0463132 --- /dev/null +++ b/core/src/dsp/loop/agc.h @@ -0,0 +1,81 @@ +#pragma once +#include "../processor.h" + +namespace dsp::loop { + template + class AGC : public Processor { + using base_type = Processor; + public: + AGC() {} + + AGC(stream* in) { init(in); } + + void init(stream* in, double setPoint, double rate, double initGain = 1.0) { + _setPoint = setPoint; + _rate = rate; + _initGain = initGain; + gain = _initGain; + base_type::init(in); + } + + void setSetPoint(double setPoint) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _setPoint = setPoint; + } + + void setRate(double rate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _rate = rate; + } + + void setInitialGain(double initGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _initGain = initGain; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + gain = _initGain; + } + + inline int process(int count, T* in, T* out) { + for (int i = 0; i < count; i++) { + // Scale output by gain + out[i] = in[i] * gain; + + // Update gain according to setpoint and rate + if constexpr (std::is_same_v) { + gain += (_setPoint - out[i].amplitude()) * _rate; + } + if constexpr (std::is_same_v) { + gain += (_setPoint - fabsf(out[i])) * _rate; + } + } + printf("%f\n", gain); + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + float _setPoint; + float _rate; + float _initGain; + + float gain; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/phase_control_loop.h b/core/src/dsp/loop/phase_control_loop.h new file mode 100644 index 0000000..7c9063d --- /dev/null +++ b/core/src/dsp/loop/phase_control_loop.h @@ -0,0 +1,85 @@ +#pragma once +#include +#include +#include "../types.h" + +namespace dsp::loop { + template + class PhaseControlLoop { + public: + PhaseControlLoop() {} + + PhaseControlLoop(T alpha, T beta, T phase, T minPhase, T maxPhase, T freq, T minFreq, T maxFreq) { + init(alpha, beta, phase, minPhase, maxPhase, freq, minFreq, maxFreq); + } + + void init(T alpha, T beta, T phase, T minPhase, T maxPhase, T freq, T minFreq, T maxFreq) { + assert(maxPhase > minPhase); + assert(maxFreq > minFreq); + _alpha = alpha; + _beta = beta; + this->phase = phase; + _minPhase = minPhase; + _maxPhase = maxPhase; + this->freq = freq; + _minFreq = minFreq; + _maxFreq = maxFreq; + + phaseDelta = _maxPhase - _minPhase; + } + + static inline void criticallyDamped(T bandwidth, T& alpha, T& beta) { + T dampningFactor = sqrt(2.0) / 2.0; + T denominator = (1.0 + 2.0*dampningFactor*bandwidth + bandwidth*bandwidth); + alpha = (4 * dampningFactor * bandwidth) / denominator; + beta = (4 * bandwidth * bandwidth) / denominator; + } + + void setPhaseLimits(T minPhase, T maxPhase) { + assert(maxPhase > minPhase); + _minPhase = minPhase; + _maxPhase = maxPhase; + phaseDelta = _maxPhase - _minPhase; + clampPhase(); + } + + void setFreqLimits(T minFreq, T maxFreq) { + assert(maxFreq > minFreq); + _minFreq = minFreq; + _maxFreq = maxFreq; + clampFreq(); + } + + inline void advance(T error) { + // Increment and clamp frequency + freq += _beta * error; + clampFreq(); + + // Increment and clamp phase + phase += freq + (_alpha * error); + clampPhase(); + } + + T freq; + T phase; + + protected: + inline void clampFreq() { + if (freq > _maxFreq) { freq = _maxFreq; } + else if (freq < _minFreq) { freq = _minFreq; } + } + + inline void clampPhase() { + while (phase > _maxPhase) { phase -= phaseDelta; } + while (phase < _minPhase) { phase += phaseDelta; } + } + + T _alpha; + T _beta; + T _minPhase; + T _maxPhase; + T _minFreq; + T _maxFreq; + T phaseDelta; + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/pll.h b/core/src/dsp/loop/pll.h new file mode 100644 index 0000000..afb98f4 --- /dev/null +++ b/core/src/dsp/loop/pll.h @@ -0,0 +1,80 @@ +#pragma once +#include "../processor.h" +#include "../math/norm_phase_diff.h" +#include "../math/phasor.h" +#include "phase_control_loop.h" + +namespace dsp::loop { + class PLL : public Processor { + using base_type = Processor; + public: + PLL() {} + + PLL(stream* in, double bandwidth, double initPhase = 0.0, double initFreq = 0.0, double minFreq = -FL_M_PI, double maxFreq = FL_M_PI) { init(in, bandwidth, initFreq, initPhase, minFreq, maxFreq); } + + void init(stream* in, double bandwidth, double initPhase = 0.0, double initFreq = 0.0, double minFreq = -FL_M_PI, double maxFreq = FL_M_PI) { + _initPhase = initPhase; + _initFreq = initFreq; + + // Init phase control loop + float alpha, beta; + PhaseControlLoop::criticallyDamped(bandwidth, alpha, beta); + pcl.init(alpha, beta, initPhase, -FL_M_PI, FL_M_PI, initFreq, minFreq, maxFreq); + + base_type::init(in); + } + + void setInitialPhase(double initPhase) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _initPhase = initPhase; + } + + void setInitialFreq(double initFreq) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _initFreq = initFreq; + } + + void setFrequencyLimits(double minFreq, double maxFreq) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + pcl.setFreqLimits(minFreq, maxFreq); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + pcl.phase = _initPhase; + pcl.freq = _initFreq; + base_type::tempStart(); + } + + inline int process(int count, complex_t* in, complex_t* out) { + for (int i = 0; i < count; i++) { + out[i] = math::phasor(pcl.phase); + pcl.advance(math::normPhaseDiff(in[i].phase() - pcl.phase)); + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + PhaseControlLoop pcl; + float _initPhase; + float _initFreq; + complex_t lastVCO = { 1.0f, 0.0f }; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/math/add.h b/core/src/dsp/math/add.h new file mode 100644 index 0000000..eeae067 --- /dev/null +++ b/core/src/dsp/math/add.h @@ -0,0 +1,42 @@ +#pragma once +#include "../operator.h" + +namespace dsp::math { + template + class Add : public Operator { + using base_type = Operator; + public: + Add() {} + + Add(stream* a, stream* b) { base_type::init(a, b); } + + static inline int process(int count, const T* a, const T*b, T* out) { + if constexpr (std::is_same_v || std::is_same_v) { + volk_32f_x2_add_32f((float*)out, (float*)a, (float*)b, count * 2); + } + else { + volk_32f_x2_add_32f(out, a, b, count); + } + return count; + } + + int run() { + int a_count = base_type::_a->read(); + if (a_count < 0) { return -1; } + int b_count = base_type::_b->read(); + if (b_count < 0) { return -1; } + if (a_count != b_count) { + base_type::_a->flush(); + base_type::_b->flush(); + return 0; + } + + process(a_count, base_type::_a->readBuf, base_type::_b->readBuf, base_type::out.writeBuf); + + base_type::_a->flush(); + base_type::_b->flush(); + if (!base_type::out.swap(a_count)) { return -1; } + return a_count; + } + }; +} diff --git a/core/src/dsp/math/conjugate.h b/core/src/dsp/math/conjugate.h new file mode 100644 index 0000000..6808064 --- /dev/null +++ b/core/src/dsp/math/conjugate.h @@ -0,0 +1,28 @@ +#pragma once +#include "../processor.h" + +namespace dsp::math { + class Conjugate : public Processor { + using base_type = Processor; + public: + Conjugate() {} + + Conjugate(stream* in) { base_type::init(in); } + + inline static int process(int count, const complex_t* in, complex_t* out) { + volk_32fc_conjugate_32fc((lv_32fc_t*)out, (lv_32fc_t*)in, count); + return count; + } + + virtual int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/math/constants.h b/core/src/dsp/math/constants.h new file mode 100644 index 0000000..2801d6f --- /dev/null +++ b/core/src/dsp/math/constants.h @@ -0,0 +1,7 @@ +#pragma once + +#define DB_M_PI 3.14159265358979323846 +#define FL_M_PI 3.1415926535f + +#define DB_M_SQRT2 1.4142135623730951 +#define FL_M_SQRT2 1.4142135623f \ No newline at end of file diff --git a/core/src/dsp/math/delay.h b/core/src/dsp/math/delay.h new file mode 100644 index 0000000..508e8e9 --- /dev/null +++ b/core/src/dsp/math/delay.h @@ -0,0 +1,76 @@ +#pragma once +#include "../processor.h" + +namespace dsp::math { + template + class Delay : public Processor { + using base_type = Processor; + public: + Delay() {} + + Delay(stream* in, int delay) { init(in, delay); } + + ~Delay() { + if (!base_type::_block_init) { return; } + base_type::stop(); + buffer::free(buffer); + } + + void init(stream* in, int delay) { + _delay = delay; + + buffer = buffer::alloc(STREAM_BUFFER_SIZE + 64000); + bufStart = &buffer[_delay]; + buffer::clear(buffer, _delay); + + base_type::init(in); + } + + void setDelay(int delay) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _delay = delay; + bufStart = &buffer[_delay]; + reset(); + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + buffer::clear(buffer, _delay); + base_type::tempStart(); + } + + inline int process(int count, const T* in, T* out) { + // Copy data into delay buffer + memcpy(bufStart, in, count * sizeof(T)); + + // Copy data out of the delay buffer + memcpy(out, buffer, count * sizeof(T)); + + // Move end of the delay buffer to the front + memmove(buffer, &buffer[count], _delay * sizeof(T)); + + return count; + } + + virtual int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + private: + int _delay; + T* buffer; + T* bufStart; + }; +} \ No newline at end of file diff --git a/core/src/dsp/math/fast_atan2.h b/core/src/dsp/math/fast_atan2.h new file mode 100644 index 0000000..aeab552 --- /dev/null +++ b/core/src/dsp/math/fast_atan2.h @@ -0,0 +1,26 @@ +#pragma once +#include +#include "constants.h" + +#define FAST_ATAN2_COEF1 FL_M_PI / 4.0f +#define FAST_ATAN2_COEF2 3.0f * FAST_ATAN2_COEF1 + +namespace dsp::math { + inline float fastAtan2(float x, float y) { + float abs_y = fabsf(y); + float r, angle; + if (x == 0.0f && y == 0.0f) { return 0.0f; } + if (x >= 0.0f) { + r = (x - abs_y) / (x + abs_y); + angle = FAST_ATAN2_COEF1 - FAST_ATAN2_COEF1 * r; + } + else { + r = (x + abs_y) / (abs_y - x); + angle = FAST_ATAN2_COEF2 - FAST_ATAN2_COEF1 * r; + } + if (y < 0.0f) { + return -angle; + } + return angle; + } +} \ No newline at end of file diff --git a/core/src/dsp/math/freq_to_omega.h b/core/src/dsp/math/freq_to_omega.h new file mode 100644 index 0000000..4e1a35d --- /dev/null +++ b/core/src/dsp/math/freq_to_omega.h @@ -0,0 +1,9 @@ +#pragma once +#include +#include "constants.h" + +namespace dsp::math { + inline double freqToOmega(double freq, double samplerate) { + return 2.0 * DB_M_PI * (freq / samplerate); + } +} \ No newline at end of file diff --git a/core/src/dsp/math/multiply.h b/core/src/dsp/math/multiply.h new file mode 100644 index 0000000..979c590 --- /dev/null +++ b/core/src/dsp/math/multiply.h @@ -0,0 +1,42 @@ +#pragma once +#include "../operator.h" + +namespace dsp::math { + template + class Multiply : public Operator { + using base_type = Operator; + public: + Multiply() {} + + Multiply(stream* a, stream* b) { base_type::init(a, b); } + + inline static int process(int count, const T* a, const T* b, T* out) { + if constexpr (std::is_same_v) { + volk_32fc_x2_multiply_32fc((lv_32fc_t*)out, (lv_32fc_t*)a, (lv_32fc_t*)b, count); + } + else { + volk_32f_x2_multiply_32f(out, a, b, count); + } + return count; + } + + int run() { + int a_count = base_type::_a->read(); + if (a_count < 0) { return -1; } + int b_count = base_type::_b->read(); + if (b_count < 0) { return -1; } + if (a_count != b_count) { + base_type::_a->flush(); + base_type::_b->flush(); + return 0; + } + + process(a_count, base_type::_a->readBuf, base_type::_b->readBuf, base_type::out.writeBuf); + + base_type::_a->flush(); + base_type::_b->flush(); + if (!base_type::out.swap(a_count)) { return -1; } + return a_count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/math/norm_phase_diff.h b/core/src/dsp/math/norm_phase_diff.h new file mode 100644 index 0000000..b07baca --- /dev/null +++ b/core/src/dsp/math/norm_phase_diff.h @@ -0,0 +1,11 @@ +#pragma once +#include "constants.h" + +namespace dsp::math { + template + T normPhaseDiff(T diff) { + if (diff > FL_M_PI) { diff -= 2.0f * FL_M_PI; } + else if (diff <= -FL_M_PI) { diff += 2.0f * FL_M_PI; } + return diff; + } +} \ No newline at end of file diff --git a/core/src/dsp/math/phasor.h b/core/src/dsp/math/phasor.h new file mode 100644 index 0000000..0ba2edf --- /dev/null +++ b/core/src/dsp/math/phasor.h @@ -0,0 +1,10 @@ +#pragma once +#include +#include "../types.h" + +namespace dsp::math { + inline complex_t phasor(float x) { + complex_t cplx = { cosf(x), sinf(x) }; + return cplx; + } +} \ No newline at end of file diff --git a/core/src/dsp/math/sinc.h b/core/src/dsp/math/sinc.h new file mode 100644 index 0000000..f0b4d79 --- /dev/null +++ b/core/src/dsp/math/sinc.h @@ -0,0 +1,8 @@ +#pragma once +#include + +namespace dsp::math { + inline double sinc(double x) { + return (x == 0.0) ? 1.0 : (sin(x) / x); + } +} \ No newline at end of file diff --git a/core/src/dsp/math/subtract.h b/core/src/dsp/math/subtract.h new file mode 100644 index 0000000..c3062d1 --- /dev/null +++ b/core/src/dsp/math/subtract.h @@ -0,0 +1,42 @@ +#pragma once +#include "../operator.h" + +namespace dsp::math { + template + class Subtract : public Operator { + using base_type = Operator; + public: + Subtract() {} + + Subtract(stream* a, stream* b) { init(a, b); } + + inline static int process(int count, const T* a, const T* b, T* out) { + if constexpr (std::is_same_v || std::is_same_v) { + volk_32f_x2_subtract_32f((float*)out, (float*)a, (float*)b, count * 2); + } + else { + volk_32f_x2_subtract_32f(out, a, b, count); + } + return count; + } + + int run() { + int a_count = base_type::_a->read(); + if (a_count < 0) { return -1; } + int b_count = base_type::_b->read(); + if (b_count < 0) { return -1; } + if (a_count != b_count) { + base_type::_a->flush(); + base_type::_b->flush(); + return 0; + } + + process(a_count, base_type::_a->readBuf, base_type::_b->readBuf, base_type::out.writeBuf); + + base_type::_a->flush(); + base_type::_b->flush(); + if (!base_type::out.swap(a_count)) { return -1; } + return a_count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/multirate/.old_decim/plans.h b/core/src/dsp/multirate/.old_decim/plans.h new file mode 100644 index 0000000..e577cd8 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/plans.h @@ -0,0 +1,206 @@ +#pragma once +#include "taps/fir_2_2.h" +#include "taps/fir_4_4.h" +#include "taps/fir_8_4.h" +#include "taps/fir_16_8.h" +#include "taps/fir_32_16.h" +#include "taps/fir_64_32.h" +#include "taps/fir_128_32.h" +#include "taps/fir_256_64.h" +#include "taps/fir_512_128.h" +#include "taps/fir_1024_128.h" +#include "taps/fir_2048_128.h" + +namespace dsp::multirate::decim { + struct stage { + unsigned int decimation; + unsigned int tapcount; + const float* taps; + }; + + const unsigned int plan_2_len = 1; + const stage plan_2[] = { + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_4_len = 1; + const stage plan_4[] = { + { 4, fir_4_4_len, fir_4_4_taps } + }; + + const unsigned int plan_8_len = 2; + const stage plan_8[] = { + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_16_len = 2; + const stage plan_16[] = { + { 8, fir_16_8_len, fir_16_8_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_32_len = 2; + const stage plan_32[] = { + { 16, fir_32_16_len, fir_32_16_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_64_len = 2; + const stage plan_64[] = { + { 32, fir_64_32_len, fir_64_32_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_128_len = 2; + const stage plan_128[] = { + { 32, fir_128_32_len, fir_128_32_taps }, + { 4, fir_4_4_len, fir_4_4_taps } + }; + + const unsigned int plan_256_len = 2; + const stage plan_256[] = { + { 64, fir_256_64_len, fir_256_64_taps }, + { 4, fir_4_4_len, fir_4_4_taps } + }; + + const unsigned int plan_512_len = 2; + const stage plan_512[] = { + { 128, fir_512_128_len, fir_512_128_taps }, + { 4, fir_4_4_len, fir_4_4_taps } + }; + + const unsigned int plan_1024_len = 3; + const stage plan_1024[] = { + { 128, fir_1024_128_len, fir_1024_128_taps }, + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_2048_len = 3; + const stage plan_2048[] = { + { 128, fir_2048_128_len, fir_2048_128_taps }, + { 8, fir_16_8_len, fir_16_8_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_4096_len = 3; + const stage plan_4096[] = { + { 128, fir_2048_128_len, fir_2048_128_taps }, + { 16, fir_32_16_len, fir_32_16_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + const unsigned int plan_8192_len = 3; + const stage plan_8192[] = { + { 128, fir_2048_128_len, fir_2048_128_taps }, + { 32, fir_64_32_len, fir_64_32_taps }, + { 2, fir_2_2_len, fir_2_2_taps } + }; + + struct plan { + unsigned int stageCount; + const stage* stages; + }; + + const unsigned int plans_len = 13; + const plan plans[] { + { plan_2_len, plan_2 }, + { plan_4_len, plan_4 }, + { plan_8_len, plan_8 }, + { plan_16_len, plan_16 }, + { plan_32_len, plan_32 }, + { plan_64_len, plan_64 }, + { plan_128_len, plan_128 }, + { plan_256_len, plan_256 }, + { plan_512_len, plan_512 }, + { plan_1024_len, plan_1024 }, + { plan_2048_len, plan_2048 }, + { plan_4096_len, plan_4096 }, + { plan_8192_len, plan_8192 }, + }; +} + +/* + +Desired ratio: 2 +<====== BEST ======> +Stage 0 : 2 : 2 ( 69 taps) +<==================> 4.5464 + +Desired ratio: 4 +<====== BEST ======> +Stage 0 : 4 : 4 ( 139 taps) +<==================> 4.0912 + +Desired ratio: 8 +<====== BEST ======> +Stage 0 : 8 : 4 ( 32 taps) +Stage 1 : 2 : 2 ( 69 taps) +<==================> 2.5073 + +Desired ratio: 16 +<====== BEST ======> +Stage 0 : 16 : 8 ( 64 taps) +Stage 1 : 2 : 2 ( 69 taps) +<==================> 1.417775 + +Desired ratio: 32 +<====== BEST ======> +Stage 0 : 32 : 16 ( 128 taps) +Stage 1 : 2 : 2 ( 69 taps) +<==================> 0.897 + +Desired ratio: 64 +<====== BEST ======> +Stage 0 : 64 : 32 ( 254 taps) +Stage 1 : 2 : 2 ( 69 taps) +<==================> 0.6991562499999999 + +Desired ratio: 128 +<====== BEST ======> +Stage 0 : 128 : 32 ( 180 taps) +Stage 1 : 4 : 4 ( 139 taps) +<==================> 0.61851875 + +Desired ratio: 256 +<====== BEST ======> +Stage 0 : 256 : 64 ( 356 taps) +Stage 1 : 4 : 4 ( 139 taps) +<==================> 0.4696125 + +Desired ratio: 512 +<====== BEST ======> +Stage 0 : 512 : 128 ( 711 taps) +Stage 1 : 4 : 4 ( 139 taps) +<==================> 0.38787734375 + +Desired ratio: 1024 +<====== BEST ======> +Stage 0 : 1024 : 128 ( 565 taps) +Stage 1 : 8 : 4 ( 32 taps) +Stage 2 : 2 : 2 ( 69 taps) +<==================> 0.30618515625 + +Desired ratio: 2048 +<====== BEST ======> +Stage 0 : 2048 : 128 ( 514 taps) +Stage 1 : 16 : 8 ( 64 taps) +Stage 2 : 2 : 2 ( 69 taps) +<==================> 0.2665748046875 + +Desired ratio: 4096 +<====== BEST ======> +Stage 0 : 2048 : 128 ( 514 taps) +Stage 1 : 32 : 16 ( 128 taps) +Stage 2 : 2 : 2 ( 69 taps) +<==================> 0.26250625 + +Desired ratio: 8192 +<====== BEST ======> +Stage 0 : 2048 : 128 ( 514 taps) +Stage 1 : 64 : 32 ( 254 taps) +Stage 2 : 2 : 2 ( 69 taps) +<==================> 0.260960595703125 + +*/ \ No newline at end of file diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_1024_128.h b/core/src/dsp/multirate/.old_decim/taps/fir_1024_128.h new file mode 100644 index 0000000..d088a9d --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_1024_128.h @@ -0,0 +1,577 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_1024_128_len = 565; + const float fir_1024_128_taps[] = { + -0.0000004327587f, + 0.0000026997780f, + 0.0000011158244f, + 0.0000009851064f, + 0.0000010818484f, + 0.0000012233487f, + 0.0000013829611f, + 0.0000015574122f, + 0.0000017469545f, + 0.0000019523988f, + 0.0000021746708f, + 0.0000024147452f, + 0.0000026736369f, + 0.0000029524002f, + 0.0000032521294f, + 0.0000035739593f, + 0.0000039190664f, + 0.0000042886691f, + 0.0000046840291f, + 0.0000051064513f, + 0.0000055572854f, + 0.0000060379258f, + 0.0000065498127f, + 0.0000070944329f, + 0.0000076733199f, + 0.0000082880550f, + 0.0000089402676f, + 0.0000096316359f, + 0.0000103638874f, + 0.0000111387995f, + 0.0000119581996f, + 0.0000128239662f, + 0.0000137380287f, + 0.0000147023683f, + 0.0000157190179f, + 0.0000167900628f, + 0.0000179176408f, + 0.0000191039423f, + 0.0000203512110f, + 0.0000216617435f, + 0.0000230378899f, + 0.0000244820535f, + 0.0000259966913f, + 0.0000275843135f, + 0.0000292474837f, + 0.0000309888191f, + 0.0000328109897f, + 0.0000347167188f, + 0.0000367087824f, + 0.0000387900088f, + 0.0000409632787f, + 0.0000432315243f, + 0.0000455977293f, + 0.0000480649281f, + 0.0000506362055f, + 0.0000533146957f, + 0.0000561035822f, + 0.0000590060964f, + 0.0000620255175f, + 0.0000651651712f, + 0.0000684284288f, + 0.0000718187066f, + 0.0000753394644f, + 0.0000789942048f, + 0.0000827864719f, + 0.0000867198500f, + 0.0000907979625f, + 0.0000950244704f, + 0.0000994030710f, + 0.0001039374965f, + 0.0001086315122f, + 0.0001134889152f, + 0.0001185135326f, + 0.0001237092199f, + 0.0001290798590f, + 0.0001346293565f, + 0.0001403616418f, + 0.0001462806650f, + 0.0001523903952f, + 0.0001586948179f, + 0.0001651979332f, + 0.0001719037534f, + 0.0001788163010f, + 0.0001859396059f, + 0.0001932777035f, + 0.0002008346317f, + 0.0002086144290f, + 0.0002166211315f, + 0.0002248587702f, + 0.0002333313688f, + 0.0002420429405f, + 0.0002509974854f, + 0.0002601989878f, + 0.0002696514131f, + 0.0002793587049f, + 0.0002893247820f, + 0.0002995535358f, + 0.0003100488266f, + 0.0003208144809f, + 0.0003318542882f, + 0.0003431719977f, + 0.0003547713152f, + 0.0003666559000f, + 0.0003788293613f, + 0.0003912952551f, + 0.0004040570809f, + 0.0004171182782f, + 0.0004304822235f, + 0.0004441522261f, + 0.0004581315258f, + 0.0004724232886f, + 0.0004870306035f, + 0.0005019564795f, + 0.0005172038413f, + 0.0005327755266f, + 0.0005486742825f, + 0.0005649027617f, + 0.0005814635194f, + 0.0005983590097f, + 0.0006155915822f, + 0.0006331634787f, + 0.0006510768296f, + 0.0006693336508f, + 0.0006879358399f, + 0.0007068851735f, + 0.0007261833032f, + 0.0007458317529f, + 0.0007658319153f, + 0.0007861850487f, + 0.0008068922738f, + 0.0008279545709f, + 0.0008493727764f, + 0.0008711475801f, + 0.0008932795221f, + 0.0009157689899f, + 0.0009386162156f, + 0.0009618212732f, + 0.0009853840755f, + 0.0010093043719f, + 0.0010335817458f, + 0.0010582156116f, + 0.0010832052129f, + 0.0011085496198f, + 0.0011342477266f, + 0.0011602982499f, + 0.0011866997262f, + 0.0012134505102f, + 0.0012405487727f, + 0.0012679924989f, + 0.0012957794865f, + 0.0013239073445f, + 0.0013523734912f, + 0.0013811751533f, + 0.0014103093644f, + 0.0014397729637f, + 0.0014695625952f, + 0.0014996747065f, + 0.0015301055485f, + 0.0015608511740f, + 0.0015919074376f, + 0.0016232699954f, + 0.0016549343039f, + 0.0016868956210f, + 0.0017191490046f, + 0.0017516893140f, + 0.0017845112089f, + 0.0018176091508f, + 0.0018509774026f, + 0.0018846100298f, + 0.0019185009010f, + 0.0019526436887f, + 0.0019870318707f, + 0.0020216587307f, + 0.0020565173602f, + 0.0020916006596f, + 0.0021269013399f, + 0.0021624119242f, + 0.0021981247499f, + 0.0022340319707f, + 0.0022701255585f, + 0.0023063973058f, + 0.0023428388283f, + 0.0023794415672f, + 0.0024161967921f, + 0.0024530956039f, + 0.0024901289377f, + 0.0025272875658f, + 0.0025645621012f, + 0.0026019430011f, + 0.0026394205698f, + 0.0026769849632f, + 0.0027146261921f, + 0.0027523341262f, + 0.0027900984982f, + 0.0028279089079f, + 0.0028657548267f, + 0.0029036256018f, + 0.0029415104608f, + 0.0029793985165f, + 0.0030172787713f, + 0.0030551401225f, + 0.0030929713673f, + 0.0031307612072f, + 0.0031684982542f, + 0.0032061710353f, + 0.0032437679982f, + 0.0032812775168f, + 0.0033186878969f, + 0.0033559873813f, + 0.0033931641562f, + 0.0034302063567f, + 0.0034671020727f, + 0.0035038393549f, + 0.0035404062207f, + 0.0035767906605f, + 0.0036129806440f, + 0.0036489641257f, + 0.0036847290520f, + 0.0037202633668f, + 0.0037555550186f, + 0.0037905919660f, + 0.0038253621849f, + 0.0038598536743f, + 0.0038940544635f, + 0.0039279526178f, + 0.0039615362454f, + 0.0039947935041f, + 0.0040277126075f, + 0.0040602818315f, + 0.0040924895211f, + 0.0041243240966f, + 0.0041557740604f, + 0.0041868280032f, + 0.0042174746106f, + 0.0042477026695f, + 0.0042775010745f, + 0.0043068588342f, + 0.0043357650775f, + 0.0043642090601f, + 0.0043921801703f, + 0.0044196679357f, + 0.0044466620287f, + 0.0044731522730f, + 0.0044991286493f, + 0.0045245813014f, + 0.0045495005417f, + 0.0045738768574f, + 0.0045977009155f, + 0.0046209635689f, + 0.0046436558617f, + 0.0046657690344f, + 0.0046872945291f, + 0.0047082239951f, + 0.0047285492933f, + 0.0047482625015f, + 0.0047673559190f, + 0.0047858220715f, + 0.0048036537152f, + 0.0048208438417f, + 0.0048373856818f, + 0.0048532727100f, + 0.0048684986482f, + 0.0048830574697f, + 0.0048969434029f, + 0.0049101509346f, + 0.0049226748137f, + 0.0049345100543f, + 0.0049456519385f, + 0.0049560960197f, + 0.0049658381254f, + 0.0049748743591f, + 0.0049832011036f, + 0.0049908150224f, + 0.0049977130625f, + 0.0050038924557f, + 0.0050093507207f, + 0.0050140856644f, + 0.0050180953834f, + 0.0050213782651f, + 0.0050239329888f, + 0.0050257585263f, + 0.0050268541429f, + 0.0050272193974f, + 0.0050268541429f, + 0.0050257585263f, + 0.0050239329888f, + 0.0050213782651f, + 0.0050180953834f, + 0.0050140856644f, + 0.0050093507207f, + 0.0050038924557f, + 0.0049977130625f, + 0.0049908150224f, + 0.0049832011036f, + 0.0049748743591f, + 0.0049658381254f, + 0.0049560960197f, + 0.0049456519385f, + 0.0049345100543f, + 0.0049226748137f, + 0.0049101509346f, + 0.0048969434029f, + 0.0048830574697f, + 0.0048684986482f, + 0.0048532727100f, + 0.0048373856818f, + 0.0048208438417f, + 0.0048036537152f, + 0.0047858220715f, + 0.0047673559190f, + 0.0047482625015f, + 0.0047285492933f, + 0.0047082239951f, + 0.0046872945291f, + 0.0046657690344f, + 0.0046436558617f, + 0.0046209635689f, + 0.0045977009155f, + 0.0045738768574f, + 0.0045495005417f, + 0.0045245813014f, + 0.0044991286493f, + 0.0044731522730f, + 0.0044466620287f, + 0.0044196679357f, + 0.0043921801703f, + 0.0043642090601f, + 0.0043357650775f, + 0.0043068588342f, + 0.0042775010745f, + 0.0042477026695f, + 0.0042174746106f, + 0.0041868280032f, + 0.0041557740604f, + 0.0041243240966f, + 0.0040924895211f, + 0.0040602818315f, + 0.0040277126075f, + 0.0039947935041f, + 0.0039615362454f, + 0.0039279526178f, + 0.0038940544635f, + 0.0038598536743f, + 0.0038253621849f, + 0.0037905919660f, + 0.0037555550186f, + 0.0037202633668f, + 0.0036847290520f, + 0.0036489641257f, + 0.0036129806440f, + 0.0035767906605f, + 0.0035404062207f, + 0.0035038393549f, + 0.0034671020727f, + 0.0034302063567f, + 0.0033931641562f, + 0.0033559873813f, + 0.0033186878969f, + 0.0032812775168f, + 0.0032437679982f, + 0.0032061710353f, + 0.0031684982542f, + 0.0031307612072f, + 0.0030929713673f, + 0.0030551401225f, + 0.0030172787713f, + 0.0029793985165f, + 0.0029415104608f, + 0.0029036256018f, + 0.0028657548267f, + 0.0028279089079f, + 0.0027900984982f, + 0.0027523341262f, + 0.0027146261921f, + 0.0026769849632f, + 0.0026394205698f, + 0.0026019430011f, + 0.0025645621012f, + 0.0025272875658f, + 0.0024901289377f, + 0.0024530956039f, + 0.0024161967921f, + 0.0023794415672f, + 0.0023428388283f, + 0.0023063973058f, + 0.0022701255585f, + 0.0022340319707f, + 0.0021981247499f, + 0.0021624119242f, + 0.0021269013399f, + 0.0020916006596f, + 0.0020565173602f, + 0.0020216587307f, + 0.0019870318707f, + 0.0019526436887f, + 0.0019185009010f, + 0.0018846100298f, + 0.0018509774026f, + 0.0018176091508f, + 0.0017845112089f, + 0.0017516893140f, + 0.0017191490046f, + 0.0016868956210f, + 0.0016549343039f, + 0.0016232699954f, + 0.0015919074376f, + 0.0015608511740f, + 0.0015301055485f, + 0.0014996747065f, + 0.0014695625952f, + 0.0014397729637f, + 0.0014103093644f, + 0.0013811751533f, + 0.0013523734912f, + 0.0013239073445f, + 0.0012957794865f, + 0.0012679924989f, + 0.0012405487727f, + 0.0012134505102f, + 0.0011866997262f, + 0.0011602982499f, + 0.0011342477266f, + 0.0011085496198f, + 0.0010832052129f, + 0.0010582156116f, + 0.0010335817458f, + 0.0010093043719f, + 0.0009853840755f, + 0.0009618212732f, + 0.0009386162156f, + 0.0009157689899f, + 0.0008932795221f, + 0.0008711475801f, + 0.0008493727764f, + 0.0008279545709f, + 0.0008068922738f, + 0.0007861850487f, + 0.0007658319153f, + 0.0007458317529f, + 0.0007261833032f, + 0.0007068851735f, + 0.0006879358399f, + 0.0006693336508f, + 0.0006510768296f, + 0.0006331634787f, + 0.0006155915822f, + 0.0005983590097f, + 0.0005814635194f, + 0.0005649027617f, + 0.0005486742825f, + 0.0005327755266f, + 0.0005172038413f, + 0.0005019564795f, + 0.0004870306035f, + 0.0004724232886f, + 0.0004581315258f, + 0.0004441522261f, + 0.0004304822235f, + 0.0004171182782f, + 0.0004040570809f, + 0.0003912952551f, + 0.0003788293613f, + 0.0003666559000f, + 0.0003547713152f, + 0.0003431719977f, + 0.0003318542882f, + 0.0003208144809f, + 0.0003100488266f, + 0.0002995535358f, + 0.0002893247820f, + 0.0002793587049f, + 0.0002696514131f, + 0.0002601989878f, + 0.0002509974854f, + 0.0002420429405f, + 0.0002333313688f, + 0.0002248587702f, + 0.0002166211315f, + 0.0002086144290f, + 0.0002008346317f, + 0.0001932777035f, + 0.0001859396059f, + 0.0001788163010f, + 0.0001719037534f, + 0.0001651979332f, + 0.0001586948179f, + 0.0001523903952f, + 0.0001462806650f, + 0.0001403616418f, + 0.0001346293565f, + 0.0001290798590f, + 0.0001237092199f, + 0.0001185135326f, + 0.0001134889152f, + 0.0001086315122f, + 0.0001039374965f, + 0.0000994030710f, + 0.0000950244704f, + 0.0000907979625f, + 0.0000867198500f, + 0.0000827864719f, + 0.0000789942048f, + 0.0000753394644f, + 0.0000718187066f, + 0.0000684284288f, + 0.0000651651712f, + 0.0000620255175f, + 0.0000590060964f, + 0.0000561035822f, + 0.0000533146957f, + 0.0000506362055f, + 0.0000480649281f, + 0.0000455977293f, + 0.0000432315243f, + 0.0000409632787f, + 0.0000387900088f, + 0.0000367087824f, + 0.0000347167188f, + 0.0000328109897f, + 0.0000309888191f, + 0.0000292474837f, + 0.0000275843135f, + 0.0000259966913f, + 0.0000244820535f, + 0.0000230378899f, + 0.0000216617435f, + 0.0000203512110f, + 0.0000191039423f, + 0.0000179176408f, + 0.0000167900628f, + 0.0000157190179f, + 0.0000147023683f, + 0.0000137380287f, + 0.0000128239662f, + 0.0000119581996f, + 0.0000111387995f, + 0.0000103638874f, + 0.0000096316359f, + 0.0000089402676f, + 0.0000082880550f, + 0.0000076733199f, + 0.0000070944329f, + 0.0000065498127f, + 0.0000060379258f, + 0.0000055572854f, + 0.0000051064513f, + 0.0000046840291f, + 0.0000042886691f, + 0.0000039190664f, + 0.0000035739593f, + 0.0000032521294f, + 0.0000029524002f, + 0.0000026736369f, + 0.0000024147452f, + 0.0000021746708f, + 0.0000019523988f, + 0.0000017469545f, + 0.0000015574122f, + 0.0000013829611f, + 0.0000012233487f, + 0.0000010818484f, + 0.0000009851064f, + 0.0000011158244f, + 0.0000026997780f, + -0.0000004327587f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_1024_32.h b/core/src/dsp/multirate/.old_decim/taps/fir_1024_32.h new file mode 100644 index 0000000..90dc634 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_1024_32.h @@ -0,0 +1,139 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_1024_32_len = 127; + const float fir_1024_32_taps[] = { + 0.0000088623347f, + 0.0000103966907f, + 0.0000163498386f, + 0.0000244235766f, + 0.0000351129776f, + 0.0000489833599f, + 0.0000666735323f, + 0.0000888982223f, + 0.0001164495403f, + 0.0001501973386f, + 0.0001910883324f, + 0.0002401438579f, + 0.0002984561609f, + 0.0003671831240f, + 0.0004475413632f, + 0.0005407976486f, + 0.0006482586323f, + 0.0007712588932f, + 0.0009111473429f, + 0.0010692720689f, + 0.0012469637247f, + 0.0014455176106f, + 0.0016661746238f, + 0.0019101012879f, + 0.0021783691022f, + 0.0024719334814f, + 0.0027916125787f, + 0.0031380663077f, + 0.0035117758952f, + 0.0039130243058f, + 0.0043418778893f, + 0.0047981695968f, + 0.0052814841081f, + 0.0057911451996f, + 0.0063262056615f, + 0.0068854400478f, + 0.0074673405131f, + 0.0080701159494f, + 0.0086916945938f, + 0.0093297302355f, + 0.0099816120904f, + 0.0106444783655f, + 0.0113152334735f, + 0.0119905688011f, + 0.0126669868781f, + 0.0133408287327f, + 0.0140083041674f, + 0.0146655246349f, + 0.0153085383440f, + 0.0159333671827f, + 0.0165360450080f, + 0.0171126568203f, + 0.0176593783140f, + 0.0181725152845f, + 0.0186485423586f, + 0.0190841405193f, + 0.0194762329058f, + 0.0198220183835f, + 0.0201190024112f, + 0.0203650247621f, + 0.0205582836996f, + 0.0206973562585f, + 0.0207812143359f, + 0.0208092363555f, + 0.0207812143359f, + 0.0206973562585f, + 0.0205582836996f, + 0.0203650247621f, + 0.0201190024112f, + 0.0198220183835f, + 0.0194762329058f, + 0.0190841405193f, + 0.0186485423586f, + 0.0181725152845f, + 0.0176593783140f, + 0.0171126568203f, + 0.0165360450080f, + 0.0159333671827f, + 0.0153085383440f, + 0.0146655246349f, + 0.0140083041674f, + 0.0133408287327f, + 0.0126669868781f, + 0.0119905688011f, + 0.0113152334735f, + 0.0106444783655f, + 0.0099816120904f, + 0.0093297302355f, + 0.0086916945938f, + 0.0080701159494f, + 0.0074673405131f, + 0.0068854400478f, + 0.0063262056615f, + 0.0057911451996f, + 0.0052814841081f, + 0.0047981695968f, + 0.0043418778893f, + 0.0039130243058f, + 0.0035117758952f, + 0.0031380663077f, + 0.0027916125787f, + 0.0024719334814f, + 0.0021783691022f, + 0.0019101012879f, + 0.0016661746238f, + 0.0014455176106f, + 0.0012469637247f, + 0.0010692720689f, + 0.0009111473429f, + 0.0007712588932f, + 0.0006482586323f, + 0.0005407976486f, + 0.0004475413632f, + 0.0003671831240f, + 0.0002984561609f, + 0.0002401438579f, + 0.0001910883324f, + 0.0001501973386f, + 0.0001164495403f, + 0.0000888982223f, + 0.0000666735323f, + 0.0000489833599f, + 0.0000351129776f, + 0.0000244235766f, + 0.0000163498386f, + 0.0000103966907f, + 0.0000088623347f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_1024_64.h b/core/src/dsp/multirate/.old_decim/taps/fir_1024_64.h new file mode 100644 index 0000000..dd82a80 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_1024_64.h @@ -0,0 +1,317 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_1024_64_len = 305; + const float fir_1024_64_taps[] = { + -0.0000003266961f, + 0.0000005644686f, + 0.0000005207559f, + 0.0000006201056f, + 0.0000007969193f, + 0.0000010314179f, + 0.0000013207983f, + 0.0000016688347f, + 0.0000020821477f, + 0.0000025688841f, + 0.0000031382689f, + 0.0000038004715f, + 0.0000045665874f, + 0.0000054486602f, + 0.0000064597188f, + 0.0000076138203f, + 0.0000089260936f, + 0.0000104127838f, + 0.0000120912955f, + 0.0000139802356f, + 0.0000160994544f, + 0.0000184700853f, + 0.0000211145831f, + 0.0000240567590f, + 0.0000273218150f, + 0.0000309363737f, + 0.0000349285069f, + 0.0000393277598f, + 0.0000441651722f, + 0.0000494732958f, + 0.0000552862073f, + 0.0000616395176f, + 0.0000685703757f, + 0.0000761174680f, + 0.0000843210124f, + 0.0000932227473f, + 0.0001028659142f, + 0.0001132952349f, + 0.0001245568823f, + 0.0001366984450f, + 0.0001497688854f, + 0.0001638184908f, + 0.0001788988175f, + 0.0001950626288f, + 0.0002123638243f, + 0.0002308573636f, + 0.0002505991815f, + 0.0002716460964f, + 0.0002940557114f, + 0.0003178863073f, + 0.0003431967298f, + 0.0003700462674f, + 0.0003984945244f, + 0.0004286012850f, + 0.0004604263715f, + 0.0004940294961f, + 0.0005294701054f, + 0.0005668072195f, + 0.0006060992649f, + 0.0006474039021f, + 0.0006907778476f, + 0.0007362766917f, + 0.0007839547115f, + 0.0008338646804f, + 0.0008860576734f, + 0.0009405828709f, + 0.0009974873584f, + 0.0010568159258f, + 0.0011186108652f, + 0.0011829117671f, + 0.0012497553185f, + 0.0013191750998f, + 0.0013912013845f, + 0.0014658609399f, + 0.0015431768319f, + 0.0016231682316f, + 0.0017058502277f, + 0.0017912336426f, + 0.0018793248552f, + 0.0019701256291f, + 0.0020636329490f, + 0.0021598388638f, + 0.0022587303394f, + 0.0023602891198f, + 0.0024644915987f, + 0.0025713087020f, + 0.0026807057805f, + 0.0027926425160f, + 0.0029070728383f, + 0.0030239448570f, + 0.0031432008054f, + 0.0032647769995f, + 0.0033886038113f, + 0.0035146056570f, + 0.0036427010010f, + 0.0037728023754f, + 0.0039048164157f, + 0.0040386439125f, + 0.0041741798805f, + 0.0043113136430f, + 0.0044499289348f, + 0.0045899040199f, + 0.0047311118279f, + 0.0048734201058f, + 0.0050166915869f, + 0.0051607841763f, + 0.0053055511521f, + 0.0054508413827f, + 0.0055964995596f, + 0.0057423664451f, + 0.0058882791347f, + 0.0060340713337f, + 0.0061795736469f, + 0.0063246138814f, + 0.0064690173614f, + 0.0066126072545f, + 0.0067552049086f, + 0.0068966301982f, + 0.0070367018801f, + 0.0071752379566f, + 0.0073120560462f, + 0.0074469737596f, + 0.0075798090815f, + 0.0077103807554f, + 0.0078385086722f, + 0.0079640142599f, + 0.0080867208743f, + 0.0082064541886f, + 0.0083230425826f, + 0.0084363175276f, + 0.0085461139687f, + 0.0086522707012f, + 0.0087546307414f, + 0.0088530416894f, + 0.0089473560847f, + 0.0090374317506f, + 0.0091231321298f, + 0.0092043266071f, + 0.0092808908203f, + 0.0093527069569f, + 0.0094196640373f, + 0.0094816581810f, + 0.0095385928587f, + 0.0095903791253f, + 0.0096369358365f, + 0.0096781898465f, + 0.0097140761868f, + 0.0097445382248f, + 0.0097695278031f, + 0.0097890053575f, + 0.0098029400143f, + 0.0098113096665f, + 0.0098141010281f, + 0.0098113096665f, + 0.0098029400143f, + 0.0097890053575f, + 0.0097695278031f, + 0.0097445382248f, + 0.0097140761868f, + 0.0096781898465f, + 0.0096369358365f, + 0.0095903791253f, + 0.0095385928587f, + 0.0094816581810f, + 0.0094196640373f, + 0.0093527069569f, + 0.0092808908203f, + 0.0092043266071f, + 0.0091231321298f, + 0.0090374317506f, + 0.0089473560847f, + 0.0088530416894f, + 0.0087546307414f, + 0.0086522707012f, + 0.0085461139687f, + 0.0084363175276f, + 0.0083230425826f, + 0.0082064541886f, + 0.0080867208743f, + 0.0079640142599f, + 0.0078385086722f, + 0.0077103807554f, + 0.0075798090815f, + 0.0074469737596f, + 0.0073120560462f, + 0.0071752379566f, + 0.0070367018801f, + 0.0068966301982f, + 0.0067552049086f, + 0.0066126072545f, + 0.0064690173614f, + 0.0063246138814f, + 0.0061795736469f, + 0.0060340713337f, + 0.0058882791347f, + 0.0057423664451f, + 0.0055964995596f, + 0.0054508413827f, + 0.0053055511521f, + 0.0051607841763f, + 0.0050166915869f, + 0.0048734201058f, + 0.0047311118279f, + 0.0045899040199f, + 0.0044499289348f, + 0.0043113136430f, + 0.0041741798805f, + 0.0040386439125f, + 0.0039048164157f, + 0.0037728023754f, + 0.0036427010010f, + 0.0035146056570f, + 0.0033886038113f, + 0.0032647769995f, + 0.0031432008054f, + 0.0030239448570f, + 0.0029070728383f, + 0.0027926425160f, + 0.0026807057805f, + 0.0025713087020f, + 0.0024644915987f, + 0.0023602891198f, + 0.0022587303394f, + 0.0021598388638f, + 0.0020636329490f, + 0.0019701256291f, + 0.0018793248552f, + 0.0017912336426f, + 0.0017058502277f, + 0.0016231682316f, + 0.0015431768319f, + 0.0014658609399f, + 0.0013912013845f, + 0.0013191750998f, + 0.0012497553185f, + 0.0011829117671f, + 0.0011186108652f, + 0.0010568159258f, + 0.0009974873584f, + 0.0009405828709f, + 0.0008860576734f, + 0.0008338646804f, + 0.0007839547115f, + 0.0007362766917f, + 0.0006907778476f, + 0.0006474039021f, + 0.0006060992649f, + 0.0005668072195f, + 0.0005294701054f, + 0.0004940294961f, + 0.0004604263715f, + 0.0004286012850f, + 0.0003984945244f, + 0.0003700462674f, + 0.0003431967298f, + 0.0003178863073f, + 0.0002940557114f, + 0.0002716460964f, + 0.0002505991815f, + 0.0002308573636f, + 0.0002123638243f, + 0.0001950626288f, + 0.0001788988175f, + 0.0001638184908f, + 0.0001497688854f, + 0.0001366984450f, + 0.0001245568823f, + 0.0001132952349f, + 0.0001028659142f, + 0.0000932227473f, + 0.0000843210124f, + 0.0000761174680f, + 0.0000685703757f, + 0.0000616395176f, + 0.0000552862073f, + 0.0000494732958f, + 0.0000441651722f, + 0.0000393277598f, + 0.0000349285069f, + 0.0000309363737f, + 0.0000273218150f, + 0.0000240567590f, + 0.0000211145831f, + 0.0000184700853f, + 0.0000160994544f, + 0.0000139802356f, + 0.0000120912955f, + 0.0000104127838f, + 0.0000089260936f, + 0.0000076138203f, + 0.0000064597188f, + 0.0000054486602f, + 0.0000045665874f, + 0.0000038004715f, + 0.0000031382689f, + 0.0000025688841f, + 0.0000020821477f, + 0.0000016688347f, + 0.0000013207983f, + 0.0000010314179f, + 0.0000007969193f, + 0.0000006201056f, + 0.0000005207559f, + 0.0000005644686f, + -0.0000003266961f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_128_16.h b/core/src/dsp/multirate/.old_decim/taps/fir_128_16.h new file mode 100644 index 0000000..c8fd1f7 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_128_16.h @@ -0,0 +1,83 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_16_len = 71; + const float fir_128_16_taps[] = { + 0.0000064694540f, + 0.0000182067578f, + 0.0000368085722f, + 0.0000719935366f, + 0.0001252867548f, + 0.0002081925226f, + 0.0003273131837f, + 0.0004962053053f, + 0.0007259672049f, + 0.0010324295967f, + 0.0014300214273f, + 0.0019359256876f, + 0.0025658768245f, + 0.0033363360449f, + 0.0042614372892f, + 0.0053539132757f, + 0.0066227902827f, + 0.0080736193595f, + 0.0097067738877f, + 0.0115174330954f, + 0.0134944842883f, + 0.0156206149876f, + 0.0178718768069f, + 0.0202181371097f, + 0.0226233377697f, + 0.0250464274976f, + 0.0274422678072f, + 0.0297630224211f, + 0.0319595549880f, + 0.0339831151557f, + 0.0357869729439f, + 0.0373281403598f, + 0.0385689282047f, + 0.0394784014454f, + 0.0400335473450f, + 0.0402201936432f, + 0.0400335473450f, + 0.0394784014454f, + 0.0385689282047f, + 0.0373281403598f, + 0.0357869729439f, + 0.0339831151557f, + 0.0319595549880f, + 0.0297630224211f, + 0.0274422678072f, + 0.0250464274976f, + 0.0226233377697f, + 0.0202181371097f, + 0.0178718768069f, + 0.0156206149876f, + 0.0134944842883f, + 0.0115174330954f, + 0.0097067738877f, + 0.0080736193595f, + 0.0066227902827f, + 0.0053539132757f, + 0.0042614372892f, + 0.0033363360449f, + 0.0025658768245f, + 0.0019359256876f, + 0.0014300214273f, + 0.0010324295967f, + 0.0007259672049f, + 0.0004962053053f, + 0.0003273131837f, + 0.0002081925226f, + 0.0001252867548f, + 0.0000719935366f, + 0.0000368085722f, + 0.0000182067578f, + 0.0000064694540f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_128_32.h b/core/src/dsp/multirate/.old_decim/taps/fir_128_32.h new file mode 100644 index 0000000..101e8ed --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_128_32.h @@ -0,0 +1,192 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_32_len = 180; + const float fir_128_32_taps[] = { + -0.0000073470522f, + -0.0000069110271f, + -0.0000100675012f, + -0.0000140912235f, + -0.0000191269472f, + -0.0000253238429f, + -0.0000328428415f, + -0.0000418456044f, + -0.0000525009779f, + -0.0000649731010f, + -0.0000794269134f, + -0.0000960153923f, + -0.0001148841160f, + -0.0001361576878f, + -0.0001599434282f, + -0.0001863171187f, + -0.0002153259738f, + -0.0002469739186f, + -0.0002812240728f, + -0.0003179838558f, + -0.0003571072928f, + -0.0003983803151f, + -0.0004415232676f, + -0.0004861768325f, + -0.0005319051695f, + -0.0005781829346f, + -0.0006243995153f, + -0.0006698476317f, + -0.0007137291329f, + -0.0007551456568f, + -0.0007931064250f, + -0.0008265213926f, + -0.0008542114175f, + -0.0008749042532f, + -0.0008872473744f, + -0.0008898070530f, + -0.0008810839958f, + -0.0008595156045f, + -0.0008234944283f, + -0.0007713735444f, + -0.0007014876566f, + -0.0006121613543f, + -0.0005017325051f, + -0.0003685629664f, + -0.0002110637384f, + -0.0000277075239f, + 0.0001829450626f, + 0.0004222318502f, + 0.0006913626978f, + 0.0009914056595f, + 0.0013232613264f, + 0.0016876497890f, + 0.0020850867621f, + 0.0025158723705f, + 0.0029800700983f, + 0.0034774984108f, + 0.0040077135249f, + 0.0045700048063f, + 0.0051633822546f, + 0.0057865764825f, + 0.0064380316487f, + 0.0071159106399f, + 0.0078180939705f, + 0.0085421905540f, + 0.0092855428368f, + 0.0100452432731f, + 0.0108181456753f, + 0.0116008872163f, + 0.0123899056779f, + 0.0131814665052f, + 0.0139716853391f, + 0.0147565593567f, + 0.0155319941959f, + 0.0162938385551f, + 0.0170379143753f, + 0.0177600534535f, + 0.0184561295564f, + 0.0191220956422f, + 0.0197540164501f, + 0.0203481048339f, + 0.0209007533176f, + 0.0214085680250f, + 0.0218683977139f, + 0.0222773638505f, + 0.0226328857338f, + 0.0229327054015f, + 0.0231749076307f, + 0.0233579385724f, + 0.0234806196554f, + 0.0235421591137f, + 0.0235421591137f, + 0.0234806196554f, + 0.0233579385724f, + 0.0231749076307f, + 0.0229327054015f, + 0.0226328857338f, + 0.0222773638505f, + 0.0218683977139f, + 0.0214085680250f, + 0.0209007533176f, + 0.0203481048339f, + 0.0197540164501f, + 0.0191220956422f, + 0.0184561295564f, + 0.0177600534535f, + 0.0170379143753f, + 0.0162938385551f, + 0.0155319941959f, + 0.0147565593567f, + 0.0139716853391f, + 0.0131814665052f, + 0.0123899056779f, + 0.0116008872163f, + 0.0108181456753f, + 0.0100452432731f, + 0.0092855428368f, + 0.0085421905540f, + 0.0078180939705f, + 0.0071159106399f, + 0.0064380316487f, + 0.0057865764825f, + 0.0051633822546f, + 0.0045700048063f, + 0.0040077135249f, + 0.0034774984108f, + 0.0029800700983f, + 0.0025158723705f, + 0.0020850867621f, + 0.0016876497890f, + 0.0013232613264f, + 0.0009914056595f, + 0.0006913626978f, + 0.0004222318502f, + 0.0001829450626f, + -0.0000277075239f, + -0.0002110637384f, + -0.0003685629664f, + -0.0005017325051f, + -0.0006121613543f, + -0.0007014876566f, + -0.0007713735444f, + -0.0008234944283f, + -0.0008595156045f, + -0.0008810839958f, + -0.0008898070530f, + -0.0008872473744f, + -0.0008749042532f, + -0.0008542114175f, + -0.0008265213926f, + -0.0007931064250f, + -0.0007551456568f, + -0.0007137291329f, + -0.0006698476317f, + -0.0006243995153f, + -0.0005781829346f, + -0.0005319051695f, + -0.0004861768325f, + -0.0004415232676f, + -0.0003983803151f, + -0.0003571072928f, + -0.0003179838558f, + -0.0002812240728f, + -0.0002469739186f, + -0.0002153259738f, + -0.0001863171187f, + -0.0001599434282f, + -0.0001361576878f, + -0.0001148841160f, + -0.0000960153923f, + -0.0000794269134f, + -0.0000649731010f, + -0.0000525009779f, + -0.0000418456044f, + -0.0000328428415f, + -0.0000253238429f, + -0.0000191269472f, + -0.0000140912235f, + -0.0000100675012f, + -0.0000069110271f, + -0.0000073470522f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_128_4.h b/core/src/dsp/multirate/.old_decim/taps/fir_128_4.h new file mode 100644 index 0000000..289c966 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_128_4.h @@ -0,0 +1,28 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_4_len = 16; + const float fir_128_4_taps[] = { + 0.0003502294673f, + 0.0025622621714f, + 0.0100604175711f, + 0.0274832811630f, + 0.0576540582560f, + 0.0975667617613f, + 0.1368722747794f, + 0.1615718864375f, + 0.1615718864375f, + 0.1368722747794f, + 0.0975667617613f, + 0.0576540582560f, + 0.0274832811630f, + 0.0100604175711f, + 0.0025622621714f, + 0.0003502294673f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_128_64.h b/core/src/dsp/multirate/.old_decim/taps/fir_128_64.h new file mode 100644 index 0000000..786cc1e --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_128_64.h @@ -0,0 +1,519 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_64_len = 507; + const float fir_128_64_taps[] = { + 0.0000059328143f, + 0.0000021865747f, + 0.0000025830027f, + 0.0000030222125f, + 0.0000035067628f, + 0.0000040392284f, + 0.0000046221895f, + 0.0000052582199f, + 0.0000059498747f, + 0.0000066996765f, + 0.0000075101016f, + 0.0000083835652f, + 0.0000093224054f, + 0.0000103288670f, + 0.0000114050841f, + 0.0000125530626f, + 0.0000137746613f, + 0.0000150715728f, + 0.0000164453038f, + 0.0000178971548f, + 0.0000194281990f, + 0.0000210392611f, + 0.0000227308957f, + 0.0000245033648f, + 0.0000263566159f, + 0.0000282902593f, + 0.0000303035451f, + 0.0000323953405f, + 0.0000345641075f, + 0.0000368078793f, + 0.0000391242389f, + 0.0000415102957f, + 0.0000439626648f, + 0.0000464774447f, + 0.0000490501970f, + 0.0000516759262f, + 0.0000543490601f, + 0.0000570634318f, + 0.0000598122618f, + 0.0000625881417f, + 0.0000653830194f, + 0.0000681881850f, + 0.0000709942585f, + 0.0000737911790f, + 0.0000765681960f, + 0.0000793138614f, + 0.0000820160247f, + 0.0000846618292f, + 0.0000872377109f, + 0.0000897293998f, + 0.0000921219225f, + 0.0000943996085f, + 0.0000965460984f, + 0.0000985443543f, + 0.0001003766741f, + 0.0001020247075f, + 0.0001034694753f, + 0.0001046913914f, + 0.0001056702886f, + 0.0001063854463f, + 0.0001068156220f, + 0.0001069390861f, + 0.0001067336594f, + 0.0001061767539f, + 0.0001052454174f, + 0.0001039163805f, + 0.0001021661074f, + 0.0000999708498f, + 0.0000973067041f, + 0.0000941496711f, + 0.0000904757201f, + 0.0000862608548f, + 0.0000814811826f, + 0.0000761129878f, + 0.0000701328055f, + 0.0000635175006f, + 0.0000562443479f, + 0.0000482911149f, + 0.0000396361475f, + 0.0000302584574f, + 0.0000201378119f, + 0.0000092548251f, + -0.0000024089487f, + -0.0000148709202f, + -0.0000281473694f, + -0.0000422533485f, + -0.0000572025836f, + -0.0000730073769f, + -0.0000896785070f, + -0.0001072251303f, + -0.0001256546823f, + -0.0001449727787f, + -0.0001651831180f, + -0.0001862873844f, + -0.0002082851526f, + -0.0002311737938f, + -0.0002549483834f, + -0.0002796016114f, + -0.0003051236947f, + -0.0003315022928f, + -0.0003587224261f, + -0.0003867663977f, + -0.0004156137196f, + -0.0004452410417f, + -0.0004756220865f, + -0.0005067275876f, + -0.0005385252334f, + -0.0005709796161f, + -0.0006040521866f, + -0.0006377012146f, + -0.0006718817554f, + -0.0007065456227f, + -0.0007416413688f, + -0.0007771142706f, + -0.0008129063239f, + -0.0008489562441f, + -0.0008851994755f, + -0.0009215682077f, + -0.0009579914002f, + -0.0009943948149f, + -0.0010307010577f, + -0.0010668296278f, + -0.0011026969756f, + -0.0011382165698f, + -0.0011732989726f, + -0.0012078519242f, + -0.0012417804357f, + -0.0012749868911f, + -0.0013073711584f, + -0.0013388307085f, + -0.0013692607440f, + -0.0013985543359f, + -0.0014266025695f, + -0.0014532946976f, + -0.0014785183035f, + -0.0015021594706f, + -0.0015241029610f, + -0.0015442324013f, + -0.0015624304759f, + -0.0015785791272f, + -0.0015925597630f, + -0.0016042534706f, + -0.0016135412362f, + -0.0016203041714f, + -0.0016244237439f, + -0.0016257820138f, + -0.0016242618751f, + -0.0016197472998f, + -0.0016121235873f, + -0.0016012776158f, + -0.0015870980974f, + -0.0015694758340f, + -0.0015483039764f, + -0.0015234782833f, + -0.0014948973813f, + -0.0014624630249f, + -0.0014260803553f, + -0.0013856581588f, + -0.0013411091226f, + -0.0012923500886f, + -0.0012393023038f, + -0.0011818916675f, + -0.0011200489733f, + -0.0010537101473f, + -0.0009828164799f, + -0.0009073148519f, + -0.0008271579535f, + -0.0007423044962f, + -0.0006527194165f, + -0.0005583740715f, + -0.0004592464247f, + -0.0003553212224f, + -0.0002465901604f, + -0.0001330520388f, + -0.0000147129070f, + 0.0001084138051f, + 0.0002363071656f, + 0.0003689386344f, + 0.0005062719681f, + 0.0006482631397f, + 0.0007948602715f, + 0.0009460035829f, + 0.0011016253518f, + 0.0012616498923f, + 0.0014259935461f, + 0.0015945646903f, + 0.0017672637604f, + 0.0019439832887f, + 0.0021246079593f, + 0.0023090146782f, + 0.0024970726603f, + 0.0026886435316f, + 0.0028835814481f, + 0.0030817332298f, + 0.0032829385117f, + 0.0034870299096f, + 0.0036938332018f, + 0.0039031675262f, + 0.0041148455925f, + 0.0043286739091f, + 0.0045444530249f, + 0.0047619777845f, + 0.0049810375985f, + 0.0052014167253f, + 0.0054228945678f, + 0.0056452459812f, + 0.0058682415926f, + 0.0060916481332f, + 0.0063152287796f, + 0.0065387435067f, + 0.0067619494488f, + 0.0069846012704f, + 0.0072064515449f, + 0.0074272511403f, + 0.0076467496121f, + 0.0078646956013f, + 0.0080808372388f, + 0.0082949225525f, + 0.0085066998790f, + 0.0087159182778f, + 0.0089223279466f, + 0.0091256806387f, + 0.0093257300791f, + 0.0095222323814f, + 0.0097149464619f, + 0.0099036344516f, + 0.0100880621047f, + 0.0102679992034f, + 0.0104432199569f, + 0.0106135033952f, + 0.0107786337550f, + 0.0109384008597f, + 0.0110926004890f, + 0.0112410347414f, + 0.0113835123847f, + 0.0115198491970f, + 0.0116498682958f, + 0.0117734004551f, + 0.0118902844090f, + 0.0120003671424f, + 0.0121035041671f, + 0.0121995597832f, + 0.0122884073249f, + 0.0123699293904f, + 0.0124440180558f, + 0.0125105750712f, + 0.0125695120403f, + 0.0126207505817f, + 0.0126642224718f, + 0.0126998697703f, + 0.0127276449258f, + 0.0127475108633f, + 0.0127594410518f, + 0.0127634195532f, + 0.0127594410518f, + 0.0127475108633f, + 0.0127276449258f, + 0.0126998697703f, + 0.0126642224718f, + 0.0126207505817f, + 0.0125695120403f, + 0.0125105750712f, + 0.0124440180558f, + 0.0123699293904f, + 0.0122884073249f, + 0.0121995597832f, + 0.0121035041671f, + 0.0120003671424f, + 0.0118902844090f, + 0.0117734004551f, + 0.0116498682958f, + 0.0115198491970f, + 0.0113835123847f, + 0.0112410347414f, + 0.0110926004890f, + 0.0109384008597f, + 0.0107786337550f, + 0.0106135033952f, + 0.0104432199569f, + 0.0102679992034f, + 0.0100880621047f, + 0.0099036344516f, + 0.0097149464619f, + 0.0095222323814f, + 0.0093257300791f, + 0.0091256806387f, + 0.0089223279466f, + 0.0087159182778f, + 0.0085066998790f, + 0.0082949225525f, + 0.0080808372388f, + 0.0078646956013f, + 0.0076467496121f, + 0.0074272511403f, + 0.0072064515449f, + 0.0069846012704f, + 0.0067619494488f, + 0.0065387435067f, + 0.0063152287796f, + 0.0060916481332f, + 0.0058682415926f, + 0.0056452459812f, + 0.0054228945678f, + 0.0052014167253f, + 0.0049810375985f, + 0.0047619777845f, + 0.0045444530249f, + 0.0043286739091f, + 0.0041148455925f, + 0.0039031675262f, + 0.0036938332018f, + 0.0034870299096f, + 0.0032829385117f, + 0.0030817332298f, + 0.0028835814481f, + 0.0026886435316f, + 0.0024970726603f, + 0.0023090146782f, + 0.0021246079593f, + 0.0019439832887f, + 0.0017672637604f, + 0.0015945646903f, + 0.0014259935461f, + 0.0012616498923f, + 0.0011016253518f, + 0.0009460035829f, + 0.0007948602715f, + 0.0006482631397f, + 0.0005062719681f, + 0.0003689386344f, + 0.0002363071656f, + 0.0001084138051f, + -0.0000147129070f, + -0.0001330520388f, + -0.0002465901604f, + -0.0003553212224f, + -0.0004592464247f, + -0.0005583740715f, + -0.0006527194165f, + -0.0007423044962f, + -0.0008271579535f, + -0.0009073148519f, + -0.0009828164799f, + -0.0010537101473f, + -0.0011200489733f, + -0.0011818916675f, + -0.0012393023038f, + -0.0012923500886f, + -0.0013411091226f, + -0.0013856581588f, + -0.0014260803553f, + -0.0014624630249f, + -0.0014948973813f, + -0.0015234782833f, + -0.0015483039764f, + -0.0015694758340f, + -0.0015870980974f, + -0.0016012776158f, + -0.0016121235873f, + -0.0016197472998f, + -0.0016242618751f, + -0.0016257820138f, + -0.0016244237439f, + -0.0016203041714f, + -0.0016135412362f, + -0.0016042534706f, + -0.0015925597630f, + -0.0015785791272f, + -0.0015624304759f, + -0.0015442324013f, + -0.0015241029610f, + -0.0015021594706f, + -0.0014785183035f, + -0.0014532946976f, + -0.0014266025695f, + -0.0013985543359f, + -0.0013692607440f, + -0.0013388307085f, + -0.0013073711584f, + -0.0012749868911f, + -0.0012417804357f, + -0.0012078519242f, + -0.0011732989726f, + -0.0011382165698f, + -0.0011026969756f, + -0.0010668296278f, + -0.0010307010577f, + -0.0009943948149f, + -0.0009579914002f, + -0.0009215682077f, + -0.0008851994755f, + -0.0008489562441f, + -0.0008129063239f, + -0.0007771142706f, + -0.0007416413688f, + -0.0007065456227f, + -0.0006718817554f, + -0.0006377012146f, + -0.0006040521866f, + -0.0005709796161f, + -0.0005385252334f, + -0.0005067275876f, + -0.0004756220865f, + -0.0004452410417f, + -0.0004156137196f, + -0.0003867663977f, + -0.0003587224261f, + -0.0003315022928f, + -0.0003051236947f, + -0.0002796016114f, + -0.0002549483834f, + -0.0002311737938f, + -0.0002082851526f, + -0.0001862873844f, + -0.0001651831180f, + -0.0001449727787f, + -0.0001256546823f, + -0.0001072251303f, + -0.0000896785070f, + -0.0000730073769f, + -0.0000572025836f, + -0.0000422533485f, + -0.0000281473694f, + -0.0000148709202f, + -0.0000024089487f, + 0.0000092548251f, + 0.0000201378119f, + 0.0000302584574f, + 0.0000396361475f, + 0.0000482911149f, + 0.0000562443479f, + 0.0000635175006f, + 0.0000701328055f, + 0.0000761129878f, + 0.0000814811826f, + 0.0000862608548f, + 0.0000904757201f, + 0.0000941496711f, + 0.0000973067041f, + 0.0000999708498f, + 0.0001021661074f, + 0.0001039163805f, + 0.0001052454174f, + 0.0001061767539f, + 0.0001067336594f, + 0.0001069390861f, + 0.0001068156220f, + 0.0001063854463f, + 0.0001056702886f, + 0.0001046913914f, + 0.0001034694753f, + 0.0001020247075f, + 0.0001003766741f, + 0.0000985443543f, + 0.0000965460984f, + 0.0000943996085f, + 0.0000921219225f, + 0.0000897293998f, + 0.0000872377109f, + 0.0000846618292f, + 0.0000820160247f, + 0.0000793138614f, + 0.0000765681960f, + 0.0000737911790f, + 0.0000709942585f, + 0.0000681881850f, + 0.0000653830194f, + 0.0000625881417f, + 0.0000598122618f, + 0.0000570634318f, + 0.0000543490601f, + 0.0000516759262f, + 0.0000490501970f, + 0.0000464774447f, + 0.0000439626648f, + 0.0000415102957f, + 0.0000391242389f, + 0.0000368078793f, + 0.0000345641075f, + 0.0000323953405f, + 0.0000303035451f, + 0.0000282902593f, + 0.0000263566159f, + 0.0000245033648f, + 0.0000227308957f, + 0.0000210392611f, + 0.0000194281990f, + 0.0000178971548f, + 0.0000164453038f, + 0.0000150715728f, + 0.0000137746613f, + 0.0000125530626f, + 0.0000114050841f, + 0.0000103288670f, + 0.0000093224054f, + 0.0000083835652f, + 0.0000075101016f, + 0.0000066996765f, + 0.0000059498747f, + 0.0000052582199f, + 0.0000046221895f, + 0.0000040392284f, + 0.0000035067628f, + 0.0000030222125f, + 0.0000025830027f, + 0.0000021865747f, + 0.0000059328143f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_128_8.h b/core/src/dsp/multirate/.old_decim/taps/fir_128_8.h new file mode 100644 index 0000000..3acd642 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_128_8.h @@ -0,0 +1,45 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_8_len = 33; + const float fir_128_8_taps[] = { + 0.0000402645396f, + 0.0001776497260f, + 0.0005328099895f, + 0.0012889952275f, + 0.0026955140465f, + 0.0050490564879f, + 0.0086535181818f, + 0.0137600626254f, + 0.0204960424230f, + 0.0287971941582f, + 0.0383605456257f, + 0.0486341848839f, + 0.0588539901422f, + 0.0681275795918f, + 0.0755543850679f, + 0.0803608914008f, + 0.0820245881555f, + 0.0803608914008f, + 0.0755543850679f, + 0.0681275795918f, + 0.0588539901422f, + 0.0486341848839f, + 0.0383605456257f, + 0.0287971941582f, + 0.0204960424230f, + 0.0137600626254f, + 0.0086535181818f, + 0.0050490564879f, + 0.0026955140465f, + 0.0012889952275f, + 0.0005328099895f, + 0.0001776497260f, + 0.0000402645396f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_16_16.h b/core/src/dsp/multirate/.old_decim/taps/fir_16_16.h new file mode 100644 index 0000000..1bd95f9 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_16_16.h @@ -0,0 +1,564 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_16_len = 552; + const float fir_16_16_taps[] = { + 0.0000083199827f, + 0.0000084881676f, + 0.0000125885567f, + 0.0000177804634f, + 0.0000241852833f, + 0.0000319042337f, + 0.0000410140885f, + 0.0000515556971f, + 0.0000635293624f, + 0.0000768836058f, + 0.0000915114120f, + 0.0001072405937f, + 0.0001238323243f, + 0.0001409745652f, + 0.0001582843174f, + 0.0001753054713f, + 0.0001915159849f, + 0.0002063311677f, + 0.0002191165223f, + 0.0002291968856f, + 0.0002358749754f, + 0.0002384460258f, + 0.0002362212252f, + 0.0002285465848f, + 0.0002148295414f, + 0.0001945599050f, + 0.0001673370635f, + 0.0001328901081f, + 0.0000911024573f, + 0.0000420277999f, + -0.0000140913087f, + -0.0000768150927f, + -0.0001454972457f, + -0.0002192871274f, + -0.0002971322962f, + -0.0003777932686f, + -0.0004598592590f, + -0.0005417761096f, + -0.0006218750188f, + -0.0006984125260f, + -0.0007696102015f, + -0.0008337037348f, + -0.0008889897559f, + -0.0009338793741f, + -0.0009669467668f, + -0.0009869812183f, + -0.0009930311084f, + -0.0009844478476f, + -0.0009609186466f, + -0.0009224959242f, + -0.0008696128718f, + -0.0008030930096f, + -0.0007241441121f, + -0.0006343445666f, + -0.0005356135898f, + -0.0004301737349f, + -0.0003204982716f, + -0.0002092522968f, + -0.0000992213271f, + 0.0000067633979f, + 0.0001059080771f, + 0.0001955385388f, + 0.0002731857749f, + 0.0003366654366f, + 0.0003841550469f, + 0.0004142599400f, + 0.0004260714830f, + 0.0004192093552f, + 0.0003938516106f, + 0.0003507454223f, + 0.0002912027367f, + 0.0002170751467f, + 0.0001307129555f, + 0.0000349043239f, + -0.0000671996814f, + -0.0001721766401f, + -0.0002764343270f, + -0.0003763233051f, + -0.0004682533995f, + -0.0005488139662f, + -0.0006148906121f, + -0.0006637776003f, + -0.0006932789118f, + -0.0007017970554f, + -0.0006884034538f, + -0.0006528899123f, + -0.0005957963722f, + -0.0005184153646f, + -0.0004227701586f, + -0.0003115682847f, + -0.0001881294675f, + -0.0000562910721f, + 0.0000797078370f, + 0.0002153593731f, + 0.0003460336990f, + 0.0004671344133f, + 0.0005742581225f, + 0.0006633522280f, + 0.0007308658562f, + 0.0007738881585f, + 0.0007902689274f, + 0.0007787167083f, + 0.0007388701444f, + 0.0006713394034f, + 0.0005777148960f, + 0.0004605423719f, + 0.0003232635598f, + 0.0001701240020f, + 0.0000060494092f, + -0.0001635052308f, + -0.0003327304257f, + -0.0004956543392f, + -0.0006463473881f, + -0.0007791311572f, + -0.0008887858391f, + -0.0009707473406f, + -0.0010212883637f, + -0.0010376748928f, + -0.0010182935142f, + -0.0009627423256f, + -0.0008718829334f, + -0.0007478485121f, + -0.0005940082363f, + -0.0004148858953f, + -0.0002160362179f, + -0.0000038797853f, + 0.0002144967369f, + 0.0004315713068f, + 0.0006396386805f, + 0.0008310780982f, + 0.0009986251377f, + 0.0011356405836f, + 0.0012363642899f, + 0.0012961469552f, + 0.0013116484677f, + 0.0012809971563f, + 0.0012039006285f, + 0.0010817051861f, + 0.0009173976585f, + 0.0007155502328f, + 0.0004822060361f, + 0.0002247101187f, + -0.0000485122542f, + -0.0003282213579f, + -0.0006046670924f, + -0.0008679194122f, + -0.0011082164816f, + -0.0013163164160f, + -0.0014838424648f, + -0.0016036069166f, + -0.0016699037326f, + -0.0016787563734f, + -0.0016281127287f, + -0.0015179765142f, + -0.0013504705242f, + -0.0011298254200f, + -0.0008622940855f, + -0.0005559904445f, + -0.0002206579656f, + 0.0001326278146f, + 0.0004918125002f, + 0.0008442625446f, + 0.0011771971009f, + 0.0014781391329f, + 0.0017353688983f, + 0.0019383651103f, + 0.0020782164138f, + 0.0021479888549f, + 0.0021430337774f, + 0.0020612244406f, + 0.0019031097610f, + 0.0016719780803f, + 0.0013738250803f, + 0.0010172247913f, + 0.0006131045972f, + 0.0001744298610f, + -0.0002841939575f, + -0.0007469896914f, + -0.0011975333012f, + -0.0016193180225f, + -0.0019963392576f, + -0.0023136800202f, + -0.0025580762604f, + -0.0027184414762f, + -0.0027863306535f, + -0.0027563254360f, + -0.0026263241476f, + -0.0023977237973f, + -0.0020754837838f, + -0.0016680658389f, + -0.0011872477991f, + -0.0006478144405f, + -0.0000671315905f, + 0.0005353843889f, + 0.0011388873506f, + 0.0017217924441f, + 0.0022625165854f, + 0.0027402428016f, + 0.0031356836285f, + 0.0034318155224f, + 0.0036145589782f, + 0.0036733773953f, + 0.0036017725718f, + 0.0033976546025f, + 0.0030635707180f, + 0.0026067787615f, + 0.0020391592667f, + 0.0013769620179f, + 0.0006403921219f, + -0.0001469573694f, + -0.0009588099622f, + -0.0017670296747f, + -0.0025425381258f, + -0.0032562984671f, + -0.0038803325839f, + -0.0043887399877f, + -0.0047586814357f, + -0.0049712946658f, + -0.0050125064331f, + -0.0048737118489f, + -0.0045522909896f, + -0.0040519418186f, + -0.0033828092770f, + -0.0025614012271f, + -0.0016102839965f, + -0.0005575620934f, + 0.0005638508289f, + 0.0017171507753f, + 0.0028627309673f, + 0.0039594061171f, + 0.0049657407264f, + 0.0058414394672f, + 0.0065487591885f, + 0.0070538953140f, + 0.0073282995418f, + 0.0073498818543f, + 0.0071040568482f, + 0.0065845934106f, + 0.0057942364555f, + 0.0047450710480f, + 0.0034586110723f, + 0.0019655981535f, + 0.0003055096637f, + -0.0014742207991f, + -0.0033192537092f, + -0.0051696434604f, + -0.0069613540836f, + -0.0086279538448f, + -0.0101024412833f, + -0.0113191540820f, + -0.0122157045903f, + -0.0127348875124f, + -0.0128265011561f, + -0.0124490285360f, + -0.0115711241461f, + -0.0101728602554f, + -0.0082466894895f, + -0.0057980911592f, + -0.0028458744398f, + 0.0005778759911f, + 0.0044282188570f, + 0.0086481335451f, + 0.0131696415938f, + 0.0179152456807f, + 0.0227996521306f, + 0.0277317322133f, + 0.0326166721023f, + 0.0373582535356f, + 0.0418612046008f, + 0.0460335559188f, + 0.0497889382248f, + 0.0530487572435f, + 0.0557441859425f, + 0.0578179180988f, + 0.0592256344327f, + 0.0599371398233f, + 0.0599371398233f, + 0.0592256344327f, + 0.0578179180988f, + 0.0557441859425f, + 0.0530487572435f, + 0.0497889382248f, + 0.0460335559188f, + 0.0418612046008f, + 0.0373582535356f, + 0.0326166721023f, + 0.0277317322133f, + 0.0227996521306f, + 0.0179152456807f, + 0.0131696415938f, + 0.0086481335451f, + 0.0044282188570f, + 0.0005778759911f, + -0.0028458744398f, + -0.0057980911592f, + -0.0082466894895f, + -0.0101728602554f, + -0.0115711241461f, + -0.0124490285360f, + -0.0128265011561f, + -0.0127348875124f, + -0.0122157045903f, + -0.0113191540820f, + -0.0101024412833f, + -0.0086279538448f, + -0.0069613540836f, + -0.0051696434604f, + -0.0033192537092f, + -0.0014742207991f, + 0.0003055096637f, + 0.0019655981535f, + 0.0034586110723f, + 0.0047450710480f, + 0.0057942364555f, + 0.0065845934106f, + 0.0071040568482f, + 0.0073498818543f, + 0.0073282995418f, + 0.0070538953140f, + 0.0065487591885f, + 0.0058414394672f, + 0.0049657407264f, + 0.0039594061171f, + 0.0028627309673f, + 0.0017171507753f, + 0.0005638508289f, + -0.0005575620934f, + -0.0016102839965f, + -0.0025614012271f, + -0.0033828092770f, + -0.0040519418186f, + -0.0045522909896f, + -0.0048737118489f, + -0.0050125064331f, + -0.0049712946658f, + -0.0047586814357f, + -0.0043887399877f, + -0.0038803325839f, + -0.0032562984671f, + -0.0025425381258f, + -0.0017670296747f, + -0.0009588099622f, + -0.0001469573694f, + 0.0006403921219f, + 0.0013769620179f, + 0.0020391592667f, + 0.0026067787615f, + 0.0030635707180f, + 0.0033976546025f, + 0.0036017725718f, + 0.0036733773953f, + 0.0036145589782f, + 0.0034318155224f, + 0.0031356836285f, + 0.0027402428016f, + 0.0022625165854f, + 0.0017217924441f, + 0.0011388873506f, + 0.0005353843889f, + -0.0000671315905f, + -0.0006478144405f, + -0.0011872477991f, + -0.0016680658389f, + -0.0020754837838f, + -0.0023977237973f, + -0.0026263241476f, + -0.0027563254360f, + -0.0027863306535f, + -0.0027184414762f, + -0.0025580762604f, + -0.0023136800202f, + -0.0019963392576f, + -0.0016193180225f, + -0.0011975333012f, + -0.0007469896914f, + -0.0002841939575f, + 0.0001744298610f, + 0.0006131045972f, + 0.0010172247913f, + 0.0013738250803f, + 0.0016719780803f, + 0.0019031097610f, + 0.0020612244406f, + 0.0021430337774f, + 0.0021479888549f, + 0.0020782164138f, + 0.0019383651103f, + 0.0017353688983f, + 0.0014781391329f, + 0.0011771971009f, + 0.0008442625446f, + 0.0004918125002f, + 0.0001326278146f, + -0.0002206579656f, + -0.0005559904445f, + -0.0008622940855f, + -0.0011298254200f, + -0.0013504705242f, + -0.0015179765142f, + -0.0016281127287f, + -0.0016787563734f, + -0.0016699037326f, + -0.0016036069166f, + -0.0014838424648f, + -0.0013163164160f, + -0.0011082164816f, + -0.0008679194122f, + -0.0006046670924f, + -0.0003282213579f, + -0.0000485122542f, + 0.0002247101187f, + 0.0004822060361f, + 0.0007155502328f, + 0.0009173976585f, + 0.0010817051861f, + 0.0012039006285f, + 0.0012809971563f, + 0.0013116484677f, + 0.0012961469552f, + 0.0012363642899f, + 0.0011356405836f, + 0.0009986251377f, + 0.0008310780982f, + 0.0006396386805f, + 0.0004315713068f, + 0.0002144967369f, + -0.0000038797853f, + -0.0002160362179f, + -0.0004148858953f, + -0.0005940082363f, + -0.0007478485121f, + -0.0008718829334f, + -0.0009627423256f, + -0.0010182935142f, + -0.0010376748928f, + -0.0010212883637f, + -0.0009707473406f, + -0.0008887858391f, + -0.0007791311572f, + -0.0006463473881f, + -0.0004956543392f, + -0.0003327304257f, + -0.0001635052308f, + 0.0000060494092f, + 0.0001701240020f, + 0.0003232635598f, + 0.0004605423719f, + 0.0005777148960f, + 0.0006713394034f, + 0.0007388701444f, + 0.0007787167083f, + 0.0007902689274f, + 0.0007738881585f, + 0.0007308658562f, + 0.0006633522280f, + 0.0005742581225f, + 0.0004671344133f, + 0.0003460336990f, + 0.0002153593731f, + 0.0000797078370f, + -0.0000562910721f, + -0.0001881294675f, + -0.0003115682847f, + -0.0004227701586f, + -0.0005184153646f, + -0.0005957963722f, + -0.0006528899123f, + -0.0006884034538f, + -0.0007017970554f, + -0.0006932789118f, + -0.0006637776003f, + -0.0006148906121f, + -0.0005488139662f, + -0.0004682533995f, + -0.0003763233051f, + -0.0002764343270f, + -0.0001721766401f, + -0.0000671996814f, + 0.0000349043239f, + 0.0001307129555f, + 0.0002170751467f, + 0.0002912027367f, + 0.0003507454223f, + 0.0003938516106f, + 0.0004192093552f, + 0.0004260714830f, + 0.0004142599400f, + 0.0003841550469f, + 0.0003366654366f, + 0.0002731857749f, + 0.0001955385388f, + 0.0001059080771f, + 0.0000067633979f, + -0.0000992213271f, + -0.0002092522968f, + -0.0003204982716f, + -0.0004301737349f, + -0.0005356135898f, + -0.0006343445666f, + -0.0007241441121f, + -0.0008030930096f, + -0.0008696128718f, + -0.0009224959242f, + -0.0009609186466f, + -0.0009844478476f, + -0.0009930311084f, + -0.0009869812183f, + -0.0009669467668f, + -0.0009338793741f, + -0.0008889897559f, + -0.0008337037348f, + -0.0007696102015f, + -0.0006984125260f, + -0.0006218750188f, + -0.0005417761096f, + -0.0004598592590f, + -0.0003777932686f, + -0.0002971322962f, + -0.0002192871274f, + -0.0001454972457f, + -0.0000768150927f, + -0.0000140913087f, + 0.0000420277999f, + 0.0000911024573f, + 0.0001328901081f, + 0.0001673370635f, + 0.0001945599050f, + 0.0002148295414f, + 0.0002285465848f, + 0.0002362212252f, + 0.0002384460258f, + 0.0002358749754f, + 0.0002291968856f, + 0.0002191165223f, + 0.0002063311677f, + 0.0001915159849f, + 0.0001753054713f, + 0.0001582843174f, + 0.0001409745652f, + 0.0001238323243f, + 0.0001072405937f, + 0.0000915114120f, + 0.0000768836058f, + 0.0000635293624f, + 0.0000515556971f, + 0.0000410140885f, + 0.0000319042337f, + 0.0000241852833f, + 0.0000177804634f, + 0.0000125885567f, + 0.0000084881676f, + 0.0000083199827f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_16_2.h b/core/src/dsp/multirate/.old_decim/taps/fir_16_2.h new file mode 100644 index 0000000..c5d4d18 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_16_2.h @@ -0,0 +1,18 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_2_len = 6; + const float fir_16_2_taps[] = { + 0.0314633937131f, + 0.1579813285983f, + 0.3165763689208f, + 0.3165763689208f, + 0.1579813285983f, + 0.0314633937131f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_16_4.h b/core/src/dsp/multirate/.old_decim/taps/fir_16_4.h new file mode 100644 index 0000000..749c982 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_16_4.h @@ -0,0 +1,34 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_4_len = 22; + const float fir_16_4_taps[] = { + -0.0002023708919f, + -0.0011062368313f, + -0.0032163920847f, + -0.0059942384543f, + -0.0065224236296f, + 0.0007775124540f, + 0.0220383093327f, + 0.0596819563778f, + 0.1084838507550f, + 0.1553460280327f, + 0.1842685402388f, + 0.1842685402388f, + 0.1553460280327f, + 0.1084838507550f, + 0.0596819563778f, + 0.0220383093327f, + 0.0007775124540f, + -0.0065224236296f, + -0.0059942384543f, + -0.0032163920847f, + -0.0011062368313f, + -0.0002023708919f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_16_8.h b/core/src/dsp/multirate/.old_decim/taps/fir_16_8.h new file mode 100644 index 0000000..fb4e449 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_16_8.h @@ -0,0 +1,76 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_8_len = 64; + const float fir_16_8_taps[] = { + 0.0000212056278f, + 0.0000592989663f, + 0.0001311135234f, + 0.0002438111297f, + 0.0003985063745f, + 0.0005834891258f, + 0.0007686964633f, + 0.0009019314371f, + 0.0009086374568f, + 0.0006969087115f, + 0.0001688400440f, + -0.0007617044022f, + -0.0021461871891f, + -0.0039761281907f, + -0.0061595555220f, + -0.0085040839445f, + -0.0107115695084f, + -0.0123883739229f, + -0.0130733894948f, + -0.0122833118289f, + -0.0095715783432f, + -0.0045944308163f, + 0.0028247220059f, + 0.0126425561455f, + 0.0245641604270f, + 0.0380398062836f, + 0.0522939777968f, + 0.0663859606669f, + 0.0792964905438f, + 0.0900306798861f, + 0.0977244326410f, + 0.1017403886275f, + 0.1017403886275f, + 0.0977244326410f, + 0.0900306798861f, + 0.0792964905438f, + 0.0663859606669f, + 0.0522939777968f, + 0.0380398062836f, + 0.0245641604270f, + 0.0126425561455f, + 0.0028247220059f, + -0.0045944308163f, + -0.0095715783432f, + -0.0122833118289f, + -0.0130733894948f, + -0.0123883739229f, + -0.0107115695084f, + -0.0085040839445f, + -0.0061595555220f, + -0.0039761281907f, + -0.0021461871891f, + -0.0007617044022f, + 0.0001688400440f, + 0.0006969087115f, + 0.0009086374568f, + 0.0009019314371f, + 0.0007686964633f, + 0.0005834891258f, + 0.0003985063745f, + 0.0002438111297f, + 0.0001311135234f, + 0.0000592989663f, + 0.0000212056278f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_2048_128.h b/core/src/dsp/multirate/.old_decim/taps/fir_2048_128.h new file mode 100644 index 0000000..756db6c --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_2048_128.h @@ -0,0 +1,526 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_2048_128_len = 514; + const float fir_2048_128_taps[] = { + 0.0000056977543f, + 0.0000016519060f, + 0.0000018900898f, + 0.0000021498690f, + 0.0000024330160f, + 0.0000027405173f, + 0.0000030742515f, + 0.0000034353223f, + 0.0000038257163f, + 0.0000042466607f, + 0.0000047002521f, + 0.0000051878472f, + 0.0000057116542f, + 0.0000062731650f, + 0.0000068747009f, + 0.0000075178944f, + 0.0000082051812f, + 0.0000089383392f, + 0.0000097199199f, + 0.0000105518511f, + 0.0000114368007f, + 0.0000123768507f, + 0.0000133747862f, + 0.0000144328464f, + 0.0000155539344f, + 0.0000167404496f, + 0.0000179954131f, + 0.0000193213868f, + 0.0000207215097f, + 0.0000221985076f, + 0.0000237556374f, + 0.0000253957896f, + 0.0000271223379f, + 0.0000289383380f, + 0.0000308472794f, + 0.0000328523820f, + 0.0000349572499f, + 0.0000371652659f, + 0.0000394801467f, + 0.0000419054357f, + 0.0000444449599f, + 0.0000471024204f, + 0.0000498817519f, + 0.0000527868089f, + 0.0000558216304f, + 0.0000589902202f, + 0.0000622967176f, + 0.0000657452697f, + 0.0000693401121f, + 0.0000730855287f, + 0.0000769858465f, + 0.0000810454789f, + 0.0000852688387f, + 0.0000896604605f, + 0.0000942248370f, + 0.0000989666149f, + 0.0001038903598f, + 0.0001090008210f, + 0.0001143026296f, + 0.0001198006263f, + 0.0001254994998f, + 0.0001314041710f, + 0.0001375193773f, + 0.0001438501072f, + 0.0001504011376f, + 0.0001571775115f, + 0.0001641840351f, + 0.0001714257921f, + 0.0001789076072f, + 0.0001866345903f, + 0.0001946115730f, + 0.0002028436762f, + 0.0002113357263f, + 0.0002200928393f, + 0.0002291198237f, + 0.0002384217741f, + 0.0002480034673f, + 0.0002578699598f, + 0.0002680259827f, + 0.0002784765367f, + 0.0002892262923f, + 0.0003002801771f, + 0.0003116427850f, + 0.0003233189523f, + 0.0003353131809f, + 0.0003476301967f, + 0.0003602743932f, + 0.0003732503673f, + 0.0003865623868f, + 0.0004002149008f, + 0.0004142120341f, + 0.0004285580685f, + 0.0004432569680f, + 0.0004583128281f, + 0.0004737294337f, + 0.0004895106749f, + 0.0005056601389f, + 0.0005221814910f, + 0.0005390781024f, + 0.0005563533944f, + 0.0005740105034f, + 0.0005920525879f, + 0.0006104825303f, + 0.0006293032077f, + 0.0006485172300f, + 0.0006681271742f, + 0.0006881353590f, + 0.0007085440434f, + 0.0007293552362f, + 0.0007505708607f, + 0.0007721925977f, + 0.0007942220177f, + 0.0008166604553f, + 0.0008395091117f, + 0.0008627689581f, + 0.0008864408102f, + 0.0009105252585f, + 0.0009350227185f, + 0.0009599333834f, + 0.0009852572538f, + 0.0010109941099f, + 0.0010371435239f, + 0.0010637048482f, + 0.0010906772135f, + 0.0011180595302f, + 0.0011458504759f, + 0.0011740485059f, + 0.0012026518338f, + 0.0012316584473f, + 0.0012610660863f, + 0.0012908722603f, + 0.0013210742267f, + 0.0013516690064f, + 0.0013826533670f, + 0.0014140238326f, + 0.0014457766743f, + 0.0014779079120f, + 0.0015104133153f, + 0.0015432883942f, + 0.0015765284129f, + 0.0016101283668f, + 0.0016440830124f, + 0.0016783868277f, + 0.0017130340602f, + 0.0017480186691f, + 0.0017833343933f, + 0.0018189746732f, + 0.0018549327411f, + 0.0018912015203f, + 0.0019277737394f, + 0.0019646418086f, + 0.0020017979573f, + 0.0020392340874f, + 0.0020769419357f, + 0.0021149129027f, + 0.0021531382398f, + 0.0021916088550f, + 0.0022303155238f, + 0.0022692486717f, + 0.0023083986089f, + 0.0023477552904f, + 0.0023873085737f, + 0.0024270479569f, + 0.0024669628584f, + 0.0025070423351f, + 0.0025472753813f, + 0.0025876506298f, + 0.0026281566678f, + 0.0026687817225f, + 0.0027095139925f, + 0.0027503413194f, + 0.0027912515330f, + 0.0028322321111f, + 0.0028732705358f, + 0.0029143539447f, + 0.0029554694944f, + 0.0029966040069f, + 0.0030377443376f, + 0.0030788770187f, + 0.0031199886295f, + 0.0031610654399f, + 0.0032020937793f, + 0.0032430596841f, + 0.0032839492614f, + 0.0033247483433f, + 0.0033654428438f, + 0.0034060184215f, + 0.0034464608266f, + 0.0034867555758f, + 0.0035268882866f, + 0.0035668443662f, + 0.0036066093308f, + 0.0036461685116f, + 0.0036855073558f, + 0.0037246111522f, + 0.0037634653125f, + 0.0038020551175f, + 0.0038403659769f, + 0.0038783831984f, + 0.0039160922239f, + 0.0039534784232f, + 0.0039905273052f, + 0.0040272243371f, + 0.0040635551298f, + 0.0040995052831f, + 0.0041350605451f, + 0.0041702066839f, + 0.0042049296200f, + 0.0042392153249f, + 0.0042730499268f, + 0.0043064196357f, + 0.0043393108225f, + 0.0043717099704f, + 0.0044036037280f, + 0.0044349788856f, + 0.0044658224039f, + 0.0044961214142f, + 0.0045258632233f, + 0.0045550353360f, + 0.0045836254386f, + 0.0046116214419f, + 0.0046390114441f, + 0.0046657837931f, + 0.0046919270308f, + 0.0047174299722f, + 0.0047422816340f, + 0.0047664713274f, + 0.0047899885734f, + 0.0048128232074f, + 0.0048349652830f, + 0.0048564051867f, + 0.0048771335320f, + 0.0048971412812f, + 0.0049164196340f, + 0.0049349601525f, + 0.0049527546463f, + 0.0049697952998f, + 0.0049860745555f, + 0.0050015852406f, + 0.0050163204516f, + 0.0050302736774f, + 0.0050434386878f, + 0.0050558096508f, + 0.0050673810271f, + 0.0050781476793f, + 0.0050881047743f, + 0.0050972478830f, + 0.0051055728926f, + 0.0051130760938f, + 0.0051197541055f, + 0.0051256039484f, + 0.0051306229828f, + 0.0051348089672f, + 0.0051381600106f, + 0.0051406746155f, + 0.0051423516450f, + 0.0051431903494f, + 0.0051431903494f, + 0.0051423516450f, + 0.0051406746155f, + 0.0051381600106f, + 0.0051348089672f, + 0.0051306229828f, + 0.0051256039484f, + 0.0051197541055f, + 0.0051130760938f, + 0.0051055728926f, + 0.0050972478830f, + 0.0050881047743f, + 0.0050781476793f, + 0.0050673810271f, + 0.0050558096508f, + 0.0050434386878f, + 0.0050302736774f, + 0.0050163204516f, + 0.0050015852406f, + 0.0049860745555f, + 0.0049697952998f, + 0.0049527546463f, + 0.0049349601525f, + 0.0049164196340f, + 0.0048971412812f, + 0.0048771335320f, + 0.0048564051867f, + 0.0048349652830f, + 0.0048128232074f, + 0.0047899885734f, + 0.0047664713274f, + 0.0047422816340f, + 0.0047174299722f, + 0.0046919270308f, + 0.0046657837931f, + 0.0046390114441f, + 0.0046116214419f, + 0.0045836254386f, + 0.0045550353360f, + 0.0045258632233f, + 0.0044961214142f, + 0.0044658224039f, + 0.0044349788856f, + 0.0044036037280f, + 0.0043717099704f, + 0.0043393108225f, + 0.0043064196357f, + 0.0042730499268f, + 0.0042392153249f, + 0.0042049296200f, + 0.0041702066839f, + 0.0041350605451f, + 0.0040995052831f, + 0.0040635551298f, + 0.0040272243371f, + 0.0039905273052f, + 0.0039534784232f, + 0.0039160922239f, + 0.0038783831984f, + 0.0038403659769f, + 0.0038020551175f, + 0.0037634653125f, + 0.0037246111522f, + 0.0036855073558f, + 0.0036461685116f, + 0.0036066093308f, + 0.0035668443662f, + 0.0035268882866f, + 0.0034867555758f, + 0.0034464608266f, + 0.0034060184215f, + 0.0033654428438f, + 0.0033247483433f, + 0.0032839492614f, + 0.0032430596841f, + 0.0032020937793f, + 0.0031610654399f, + 0.0031199886295f, + 0.0030788770187f, + 0.0030377443376f, + 0.0029966040069f, + 0.0029554694944f, + 0.0029143539447f, + 0.0028732705358f, + 0.0028322321111f, + 0.0027912515330f, + 0.0027503413194f, + 0.0027095139925f, + 0.0026687817225f, + 0.0026281566678f, + 0.0025876506298f, + 0.0025472753813f, + 0.0025070423351f, + 0.0024669628584f, + 0.0024270479569f, + 0.0023873085737f, + 0.0023477552904f, + 0.0023083986089f, + 0.0022692486717f, + 0.0022303155238f, + 0.0021916088550f, + 0.0021531382398f, + 0.0021149129027f, + 0.0020769419357f, + 0.0020392340874f, + 0.0020017979573f, + 0.0019646418086f, + 0.0019277737394f, + 0.0018912015203f, + 0.0018549327411f, + 0.0018189746732f, + 0.0017833343933f, + 0.0017480186691f, + 0.0017130340602f, + 0.0016783868277f, + 0.0016440830124f, + 0.0016101283668f, + 0.0015765284129f, + 0.0015432883942f, + 0.0015104133153f, + 0.0014779079120f, + 0.0014457766743f, + 0.0014140238326f, + 0.0013826533670f, + 0.0013516690064f, + 0.0013210742267f, + 0.0012908722603f, + 0.0012610660863f, + 0.0012316584473f, + 0.0012026518338f, + 0.0011740485059f, + 0.0011458504759f, + 0.0011180595302f, + 0.0010906772135f, + 0.0010637048482f, + 0.0010371435239f, + 0.0010109941099f, + 0.0009852572538f, + 0.0009599333834f, + 0.0009350227185f, + 0.0009105252585f, + 0.0008864408102f, + 0.0008627689581f, + 0.0008395091117f, + 0.0008166604553f, + 0.0007942220177f, + 0.0007721925977f, + 0.0007505708607f, + 0.0007293552362f, + 0.0007085440434f, + 0.0006881353590f, + 0.0006681271742f, + 0.0006485172300f, + 0.0006293032077f, + 0.0006104825303f, + 0.0005920525879f, + 0.0005740105034f, + 0.0005563533944f, + 0.0005390781024f, + 0.0005221814910f, + 0.0005056601389f, + 0.0004895106749f, + 0.0004737294337f, + 0.0004583128281f, + 0.0004432569680f, + 0.0004285580685f, + 0.0004142120341f, + 0.0004002149008f, + 0.0003865623868f, + 0.0003732503673f, + 0.0003602743932f, + 0.0003476301967f, + 0.0003353131809f, + 0.0003233189523f, + 0.0003116427850f, + 0.0003002801771f, + 0.0002892262923f, + 0.0002784765367f, + 0.0002680259827f, + 0.0002578699598f, + 0.0002480034673f, + 0.0002384217741f, + 0.0002291198237f, + 0.0002200928393f, + 0.0002113357263f, + 0.0002028436762f, + 0.0001946115730f, + 0.0001866345903f, + 0.0001789076072f, + 0.0001714257921f, + 0.0001641840351f, + 0.0001571775115f, + 0.0001504011376f, + 0.0001438501072f, + 0.0001375193773f, + 0.0001314041710f, + 0.0001254994998f, + 0.0001198006263f, + 0.0001143026296f, + 0.0001090008210f, + 0.0001038903598f, + 0.0000989666149f, + 0.0000942248370f, + 0.0000896604605f, + 0.0000852688387f, + 0.0000810454789f, + 0.0000769858465f, + 0.0000730855287f, + 0.0000693401121f, + 0.0000657452697f, + 0.0000622967176f, + 0.0000589902202f, + 0.0000558216304f, + 0.0000527868089f, + 0.0000498817519f, + 0.0000471024204f, + 0.0000444449599f, + 0.0000419054357f, + 0.0000394801467f, + 0.0000371652659f, + 0.0000349572499f, + 0.0000328523820f, + 0.0000308472794f, + 0.0000289383380f, + 0.0000271223379f, + 0.0000253957896f, + 0.0000237556374f, + 0.0000221985076f, + 0.0000207215097f, + 0.0000193213868f, + 0.0000179954131f, + 0.0000167404496f, + 0.0000155539344f, + 0.0000144328464f, + 0.0000133747862f, + 0.0000123768507f, + 0.0000114368007f, + 0.0000105518511f, + 0.0000097199199f, + 0.0000089383392f, + 0.0000082051812f, + 0.0000075178944f, + 0.0000068747009f, + 0.0000062731650f, + 0.0000057116542f, + 0.0000051878472f, + 0.0000047002521f, + 0.0000042466607f, + 0.0000038257163f, + 0.0000034353223f, + 0.0000030742515f, + 0.0000027405173f, + 0.0000024330160f, + 0.0000021498690f, + 0.0000018900898f, + 0.0000016519060f, + 0.0000056977543f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_2048_64.h b/core/src/dsp/multirate/.old_decim/taps/fir_2048_64.h new file mode 100644 index 0000000..2ba231a --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_2048_64.h @@ -0,0 +1,265 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_2048_64_len = 253; + const float fir_2048_64_taps[] = { + 0.0000066902983f, + 0.0000039334795f, + 0.0000050760344f, + 0.0000064280051f, + 0.0000080150883f, + 0.0000098649890f, + 0.0000120074887f, + 0.0000144745098f, + 0.0000173001750f, + 0.0000205208620f, + 0.0000241752518f, + 0.0000283043713f, + 0.0000329516280f, + 0.0000381628381f, + 0.0000439862461f, + 0.0000504725357f, + 0.0000576748313f, + 0.0000656486906f, + 0.0000744520862f, + 0.0000841453767f, + 0.0000947912669f, + 0.0001064547563f, + 0.0001192030760f, + 0.0001331056125f, + 0.0001482338200f, + 0.0001646611193f, + 0.0001824627837f, + 0.0002017158118f, + 0.0002224987872f, + 0.0002448917247f, + 0.0002689759031f, + 0.0002948336849f, + 0.0003225483233f, + 0.0003522037550f, + 0.0003838843823f, + 0.0004176748409f, + 0.0004536597574f, + 0.0004919234940f, + 0.0005325498835f, + 0.0005756219531f, + 0.0006212216387f, + 0.0006694294907f, + 0.0007203243711f, + 0.0007739831434f, + 0.0008304803565f, + 0.0008898879232f, + 0.0009522747932f, + 0.0010177066247f, + 0.0010862454523f, + 0.0011579493544f, + 0.0012328721212f, + 0.0013110629237f, + 0.0013925659858f, + 0.0014774202601f, + 0.0015656591097f, + 0.0016573099965f, + 0.0017523941775f, + 0.0018509264108f, + 0.0019529146726f, + 0.0020583598864f, + 0.0021672556657f, + 0.0022795880718f, + 0.0023953353879f, + 0.0025144679106f, + 0.0026369477603f, + 0.0027627287116f, + 0.0028917560447f, + 0.0030239664192f, + 0.0031592877711f, + 0.0032976392339f, + 0.0034389310850f, + 0.0035830647179f, + 0.0037299326406f, + 0.0038794185025f, + 0.0040313971475f, + 0.0041857346968f, + 0.0043422886590f, + 0.0045009080704f, + 0.0046614336629f, + 0.0048236980620f, + 0.0049875260128f, + 0.0051527346356f, + 0.0053191337090f, + 0.0054865259818f, + 0.0056547075111f, + 0.0058234680287f, + 0.0059925913320f, + 0.0061618557011f, + 0.0063310343392f, + 0.0064998958364f, + 0.0066682046550f, + 0.0068357216352f, + 0.0070022045210f, + 0.0071674085013f, + 0.0073310867697f, + 0.0074929910962f, + 0.0076528724136f, + 0.0078104814129f, + 0.0079655691490f, + 0.0081178876519f, + 0.0082671905449f, + 0.0084132336638f, + 0.0085557756782f, + 0.0086945787115f, + 0.0088294089578f, + 0.0089600372929f, + 0.0090862398788f, + 0.0092077987584f, + 0.0093245024384f, + 0.0094361464590f, + 0.0095425339481f, + 0.0096434761582f, + 0.0097387929827f, + 0.0098283134530f, + 0.0099118762107f, + 0.0099893299564f, + 0.0100605338714f, + 0.0101253580118f, + 0.0101836836737f, + 0.0102354037271f, + 0.0102804229187f, + 0.0103186581413f, + 0.0103500386692f, + 0.0103745063596f, + 0.0103920158177f, + 0.0104025345256f, + 0.0104060429356f, + 0.0104025345256f, + 0.0103920158177f, + 0.0103745063596f, + 0.0103500386692f, + 0.0103186581413f, + 0.0102804229187f, + 0.0102354037271f, + 0.0101836836737f, + 0.0101253580118f, + 0.0100605338714f, + 0.0099893299564f, + 0.0099118762107f, + 0.0098283134530f, + 0.0097387929827f, + 0.0096434761582f, + 0.0095425339481f, + 0.0094361464590f, + 0.0093245024384f, + 0.0092077987584f, + 0.0090862398788f, + 0.0089600372929f, + 0.0088294089578f, + 0.0086945787115f, + 0.0085557756782f, + 0.0084132336638f, + 0.0082671905449f, + 0.0081178876519f, + 0.0079655691490f, + 0.0078104814129f, + 0.0076528724136f, + 0.0074929910962f, + 0.0073310867697f, + 0.0071674085013f, + 0.0070022045210f, + 0.0068357216352f, + 0.0066682046550f, + 0.0064998958364f, + 0.0063310343392f, + 0.0061618557011f, + 0.0059925913320f, + 0.0058234680287f, + 0.0056547075111f, + 0.0054865259818f, + 0.0053191337090f, + 0.0051527346356f, + 0.0049875260128f, + 0.0048236980620f, + 0.0046614336629f, + 0.0045009080704f, + 0.0043422886590f, + 0.0041857346968f, + 0.0040313971475f, + 0.0038794185025f, + 0.0037299326406f, + 0.0035830647179f, + 0.0034389310850f, + 0.0032976392339f, + 0.0031592877711f, + 0.0030239664192f, + 0.0028917560447f, + 0.0027627287116f, + 0.0026369477603f, + 0.0025144679106f, + 0.0023953353879f, + 0.0022795880718f, + 0.0021672556657f, + 0.0020583598864f, + 0.0019529146726f, + 0.0018509264108f, + 0.0017523941775f, + 0.0016573099965f, + 0.0015656591097f, + 0.0014774202601f, + 0.0013925659858f, + 0.0013110629237f, + 0.0012328721212f, + 0.0011579493544f, + 0.0010862454523f, + 0.0010177066247f, + 0.0009522747932f, + 0.0008898879232f, + 0.0008304803565f, + 0.0007739831434f, + 0.0007203243711f, + 0.0006694294907f, + 0.0006212216387f, + 0.0005756219531f, + 0.0005325498835f, + 0.0004919234940f, + 0.0004536597574f, + 0.0004176748409f, + 0.0003838843823f, + 0.0003522037550f, + 0.0003225483233f, + 0.0002948336849f, + 0.0002689759031f, + 0.0002448917247f, + 0.0002224987872f, + 0.0002017158118f, + 0.0001824627837f, + 0.0001646611193f, + 0.0001482338200f, + 0.0001331056125f, + 0.0001192030760f, + 0.0001064547563f, + 0.0000947912669f, + 0.0000841453767f, + 0.0000744520862f, + 0.0000656486906f, + 0.0000576748313f, + 0.0000504725357f, + 0.0000439862461f, + 0.0000381628381f, + 0.0000329516280f, + 0.0000283043713f, + 0.0000241752518f, + 0.0000205208620f, + 0.0000173001750f, + 0.0000144745098f, + 0.0000120074887f, + 0.0000098649890f, + 0.0000080150883f, + 0.0000064280051f, + 0.0000050760344f, + 0.0000039334795f, + 0.0000066902983f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_256_128.h b/core/src/dsp/multirate/.old_decim/taps/fir_256_128.h new file mode 100644 index 0000000..ee5bb60 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_256_128.h @@ -0,0 +1,1024 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_128_len = 1012; + const float fir_256_128_taps[] = { + 0.0000054617197f, + 0.0000010039987f, + 0.0000010956039f, + 0.0000011920904f, + 0.0000012938865f, + 0.0000014008804f, + 0.0000015134951f, + 0.0000016316288f, + 0.0000017556952f, + 0.0000018856055f, + 0.0000020217596f, + 0.0000021640841f, + 0.0000023129618f, + 0.0000024683369f, + 0.0000026305712f, + 0.0000027996282f, + 0.0000029758459f, + 0.0000031592080f, + 0.0000033500265f, + 0.0000035483053f, + 0.0000037543287f, + 0.0000039681205f, + 0.0000041899359f, + 0.0000044198178f, + 0.0000046579914f, + 0.0000049045172f, + 0.0000051595901f, + 0.0000054232859f, + 0.0000056957697f, + 0.0000059771297f, + 0.0000062675020f, + 0.0000065669838f, + 0.0000068756832f, + 0.0000071937032f, + 0.0000075211250f, + 0.0000078580532f, + 0.0000082045440f, + 0.0000085606992f, + 0.0000089265516f, + 0.0000093021962f, + 0.0000096876440f, + 0.0000100829787f, + 0.0000104881911f, + 0.0000109033494f, + 0.0000113284258f, + 0.0000117634690f, + 0.0000122084333f, + 0.0000126633440f, + 0.0000131281391f, + 0.0000136028167f, + 0.0000140872987f, + 0.0000145815531f, + 0.0000150854857f, + 0.0000155990318f, + 0.0000161220807f, + 0.0000166545325f, + 0.0000171962598f, + 0.0000177471253f, + 0.0000183069836f, + 0.0000188756586f, + 0.0000194529856f, + 0.0000200387487f, + 0.0000206327617f, + 0.0000212347684f, + 0.0000218445591f, + 0.0000224618368f, + 0.0000230863658f, + 0.0000237178084f, + 0.0000243559001f, + 0.0000250002630f, + 0.0000256506012f, + 0.0000263064966f, + 0.0000269676192f, + 0.0000276335113f, + 0.0000283038060f, + 0.0000289780068f, + 0.0000296557072f, + 0.0000303363724f, + 0.0000310195537f, + 0.0000317046787f, + 0.0000323912545f, + 0.0000330786713f, + 0.0000337663900f, + 0.0000344537638f, + 0.0000351402059f, + 0.0000358250326f, + 0.0000365076083f, + 0.0000371872122f, + 0.0000378631590f, + 0.0000385346910f, + 0.0000392010726f, + 0.0000398615087f, + 0.0000405152136f, + 0.0000411613543f, + 0.0000417990953f, + 0.0000424275651f, + 0.0000430458793f, + 0.0000436531270f, + 0.0000442483761f, + 0.0000448306757f, + 0.0000453990473f, + 0.0000459524996f, + 0.0000464900089f, + 0.0000470105429f, + 0.0000475130351f, + 0.0000479964116f, + 0.0000484595649f, + 0.0000489013793f, + 0.0000493207086f, + 0.0000497163952f, + 0.0000500872564f, + 0.0000504320934f, + 0.0000507496888f, + 0.0000510388032f, + 0.0000512981874f, + 0.0000515265621f, + 0.0000517226482f, + 0.0000518851286f, + 0.0000520126964f, + 0.0000521039980f, + 0.0000521577014f, + 0.0000521724191f, + 0.0000521467956f, + 0.0000520794123f, + 0.0000519688928f, + 0.0000518137901f, + 0.0000516127093f, + 0.0000513641784f, + 0.0000510667862f, + 0.0000507190397f, + 0.0000503195135f, + 0.0000498666979f, + 0.0000493591558f, + 0.0000487953650f, + 0.0000481738794f, + 0.0000474931688f, + 0.0000467517812f, + 0.0000459481829f, + 0.0000450809190f, + 0.0000441484575f, + 0.0000431493437f, + 0.0000420820523f, + 0.0000409451326f, + 0.0000397370709f, + 0.0000384564242f, + 0.0000371016959f, + 0.0000356714551f, + 0.0000341642269f, + 0.0000325785972f, + 0.0000309131181f, + 0.0000291663973f, + 0.0000273370189f, + 0.0000254236173f, + 0.0000234248141f, + 0.0000213392762f, + 0.0000191656671f, + 0.0000169026922f, + 0.0000145490624f, + 0.0000121035277f, + 0.0000095648509f, + 0.0000069318331f, + 0.0000042032944f, + 0.0000013780933f, + -0.0000015448876f, + -0.0000045667258f, + -0.0000076884710f, + -0.0000109111299f, + -0.0000142356795f, + -0.0000176630487f, + -0.0000211941363f, + -0.0000248297868f, + -0.0000285708153f, + -0.0000324179752f, + -0.0000363719922f, + -0.0000404335221f, + -0.0000446031954f, + -0.0000488815635f, + -0.0000532691560f, + -0.0000577664138f, + -0.0000623737594f, + -0.0000670915167f, + -0.0000719199952f, + -0.0000768593961f, + -0.0000819099094f, + -0.0000870716076f, + -0.0000923445550f, + -0.0000977286901f, + -0.0001032239450f, + -0.0001088301187f, + -0.0001145470050f, + -0.0001203742580f, + -0.0001263115271f, + -0.0001323583166f, + -0.0001385141249f, + -0.0001447783020f, + -0.0001511501895f, + -0.0001576289781f, + -0.0001642138471f, + -0.0001709038232f, + -0.0001776979177f, + -0.0001845949894f, + -0.0001915938761f, + -0.0001986932647f, + -0.0002058918142f, + -0.0002131880358f, + -0.0002205804055f, + -0.0002280672545f, + -0.0002356468714f, + -0.0002433174043f, + -0.0002510769507f, + -0.0002589234716f, + -0.0002668548703f, + -0.0002748689175f, + -0.0002829633193f, + -0.0002911356534f, + -0.0002993834261f, + -0.0003077040191f, + -0.0003160947374f, + -0.0003245527639f, + -0.0003330752009f, + -0.0003416590306f, + -0.0003503011513f, + -0.0003589983429f, + -0.0003677472992f, + -0.0003765445962f, + -0.0003853867235f, + -0.0003942700520f, + -0.0004031908675f, + -0.0004121453355f, + -0.0004211295386f, + -0.0004301394370f, + -0.0004391709117f, + -0.0004482197180f, + -0.0004572815366f, + -0.0004663519194f, + -0.0004754263492f, + -0.0004845001759f, + -0.0004935686869f, + -0.0005026270327f, + -0.0005116703080f, + -0.0005206934671f, + -0.0005296914154f, + -0.0005386589147f, + -0.0005475906847f, + -0.0005564812990f, + -0.0005653252961f, + -0.0005741170662f, + -0.0005828509711f, + -0.0005915212236f, + -0.0006001220139f, + -0.0006086473832f, + -0.0006170913558f, + -0.0006254478087f, + -0.0006337106061f, + -0.0006418734679f, + -0.0006499301053f, + -0.0006578740890f, + -0.0006656989842f, + -0.0006733982212f, + -0.0006809652268f, + -0.0006883933000f, + -0.0006956757374f, + -0.0007028057162f, + -0.0007097764122f, + -0.0007165808902f, + -0.0007232122149f, + -0.0007296633493f, + -0.0007359272569f, + -0.0007419968098f, + -0.0007478648811f, + -0.0007535242631f, + -0.0007589677498f, + -0.0007641880653f, + -0.0007691779366f, + -0.0007739300312f, + -0.0007784370217f, + -0.0007826915315f, + -0.0007866861914f, + -0.0007904135933f, + -0.0007938663403f, + -0.0007970370052f, + -0.0007999181773f, + -0.0008025024239f, + -0.0008047823347f, + -0.0008067504850f, + -0.0008083994801f, + -0.0008097219168f, + -0.0008107104310f, + -0.0008113576556f, + -0.0008116562723f, + -0.0008115989647f, + -0.0008111784758f, + -0.0008103875548f, + -0.0008092190219f, + -0.0008076657071f, + -0.0008057205234f, + -0.0008033763972f, + -0.0008006263506f, + -0.0007974634219f, + -0.0007938807581f, + -0.0007898715256f, + -0.0007854290126f, + -0.0007805465296f, + -0.0007752175217f, + -0.0007694354603f, + -0.0007631939632f, + -0.0007564866791f, + -0.0007493074146f, + -0.0007416500121f, + -0.0007335084828f, + -0.0007248768797f, + -0.0007157494339f, + -0.0007061204255f, + -0.0006959843215f, + -0.0006853356454f, + -0.0006741691151f, + -0.0006624795144f, + -0.0006502618271f, + -0.0006375111133f, + -0.0006242226379f, + -0.0006103917530f, + -0.0005960140195f, + -0.0005810850973f, + -0.0005656008577f, + -0.0005495572834f, + -0.0005329505706f, + -0.0005157770396f, + -0.0004980332255f, + -0.0004797158006f, + -0.0004608216523f, + -0.0004413478190f, + -0.0004212915539f, + -0.0004006502744f, + -0.0003794216126f, + -0.0003576033774f, + -0.0003351935927f, + -0.0003121904710f, + -0.0002885924395f, + -0.0002643981260f, + -0.0002396063730f, + -0.0002142162337f, + -0.0001882269770f, + -0.0001616380917f, + -0.0001344492837f, + -0.0001066604864f, + -0.0000782718524f, + -0.0000492837685f, + -0.0000196968430f, + 0.0000104880762f, + 0.0000412699167f, + 0.0000726473624f, + 0.0001046188693f, + 0.0001371826468f, + 0.0001703366727f, + 0.0002040786763f, + 0.0002384061515f, + 0.0002733163427f, + 0.0003088062548f, + 0.0003448726437f, + 0.0003815120213f, + 0.0004187206518f, + 0.0004564945514f, + 0.0004948294900f, + 0.0005337209861f, + 0.0005731643140f, + 0.0006131544939f, + 0.0006536863036f, + 0.0006947542648f, + 0.0007363526596f, + 0.0007784755123f, + 0.0008211166104f, + 0.0008642694829f, + 0.0009079274248f, + 0.0009520834733f, + 0.0009967304337f, + 0.0010418608557f, + 0.0010874670591f, + 0.0011335411113f, + 0.0011800748517f, + 0.0012270598713f, + 0.0012744875354f, + 0.0013223489661f, + 0.0013706350614f, + 0.0014193364826f, + 0.0014684436687f, + 0.0015179468293f, + 0.0015678359536f, + 0.0016181008094f, + 0.0016687309465f, + 0.0017197157018f, + 0.0017710441970f, + 0.0018227053500f, + 0.0018746878666f, + 0.0019269802582f, + 0.0019795708285f, + 0.0020324476959f, + 0.0020855987758f, + 0.0021390118086f, + 0.0021926743367f, + 0.0022465737373f, + 0.0023006971965f, + 0.0023550317442f, + 0.0024095642271f, + 0.0024642813451f, + 0.0025191696234f, + 0.0025742154495f, + 0.0026294050460f, + 0.0026847245064f, + 0.0027401597701f, + 0.0027956966562f, + 0.0028513208414f, + 0.0029070178900f, + 0.0029627732367f, + 0.0030185722124f, + 0.0030744000312f, + 0.0031302418118f, + 0.0031860825701f, + 0.0032419072346f, + 0.0032977006457f, + 0.0033534475647f, + 0.0034091326794f, + 0.0034647406073f, + 0.0035202559073f, + 0.0035756630769f, + 0.0036309465703f, + 0.0036860907892f, + 0.0037410801073f, + 0.0037958988559f, + 0.0038505313527f, + 0.0039049618835f, + 0.0039591747350f, + 0.0040131541736f, + 0.0040668844797f, + 0.0041203499262f, + 0.0041735348127f, + 0.0042264234446f, + 0.0042790001663f, + 0.0043312493419f, + 0.0043831553862f, + 0.0044347027481f, + 0.0044858759388f, + 0.0045366595183f, + 0.0045870381197f, + 0.0046369964405f, + 0.0046865192616f, + 0.0047355914438f, + 0.0047841979416f, + 0.0048323238052f, + 0.0048799541881f, + 0.0049270743557f, + 0.0049736696861f, + 0.0050197256849f, + 0.0050652279802f, + 0.0051101623431f, + 0.0051545146765f, + 0.0051982710415f, + 0.0052414176408f, + 0.0052839408493f, + 0.0053258271941f, + 0.0053670633876f, + 0.0054076363051f, + 0.0054475330196f, + 0.0054867407779f, + 0.0055252470364f, + 0.0055630394362f, + 0.0056001058389f, + 0.0056364343024f, + 0.0056720131146f, + 0.0057068307715f, + 0.0057408760083f, + 0.0057741377800f, + 0.0058066052887f, + 0.0058382679685f, + 0.0058691155076f, + 0.0058991378384f, + 0.0059283251534f, + 0.0059566679018f, + 0.0059841567980f, + 0.0060107828250f, + 0.0060365372360f, + 0.0060614115641f, + 0.0060853976175f, + 0.0061084874942f, + 0.0061306735723f, + 0.0061519485294f, + 0.0061723053272f, + 0.0061917372361f, + 0.0062102378145f, + 0.0062278009372f, + 0.0062444207718f, + 0.0062600918085f, + 0.0062748088344f, + 0.0062885669652f, + 0.0063013616175f, + 0.0063131885409f, + 0.0063240437903f, + 0.0063339237566f, + 0.0063428251405f, + 0.0063507449805f, + 0.0063576806296f, + 0.0063636297789f, + 0.0063685904388f, + 0.0063725609572f, + 0.0063755400055f, + 0.0063775265914f, + 0.0063785200498f, + 0.0063785200498f, + 0.0063775265914f, + 0.0063755400055f, + 0.0063725609572f, + 0.0063685904388f, + 0.0063636297789f, + 0.0063576806296f, + 0.0063507449805f, + 0.0063428251405f, + 0.0063339237566f, + 0.0063240437903f, + 0.0063131885409f, + 0.0063013616175f, + 0.0062885669652f, + 0.0062748088344f, + 0.0062600918085f, + 0.0062444207718f, + 0.0062278009372f, + 0.0062102378145f, + 0.0061917372361f, + 0.0061723053272f, + 0.0061519485294f, + 0.0061306735723f, + 0.0061084874942f, + 0.0060853976175f, + 0.0060614115641f, + 0.0060365372360f, + 0.0060107828250f, + 0.0059841567980f, + 0.0059566679018f, + 0.0059283251534f, + 0.0058991378384f, + 0.0058691155076f, + 0.0058382679685f, + 0.0058066052887f, + 0.0057741377800f, + 0.0057408760083f, + 0.0057068307715f, + 0.0056720131146f, + 0.0056364343024f, + 0.0056001058389f, + 0.0055630394362f, + 0.0055252470364f, + 0.0054867407779f, + 0.0054475330196f, + 0.0054076363051f, + 0.0053670633876f, + 0.0053258271941f, + 0.0052839408493f, + 0.0052414176408f, + 0.0051982710415f, + 0.0051545146765f, + 0.0051101623431f, + 0.0050652279802f, + 0.0050197256849f, + 0.0049736696861f, + 0.0049270743557f, + 0.0048799541881f, + 0.0048323238052f, + 0.0047841979416f, + 0.0047355914438f, + 0.0046865192616f, + 0.0046369964405f, + 0.0045870381197f, + 0.0045366595183f, + 0.0044858759388f, + 0.0044347027481f, + 0.0043831553862f, + 0.0043312493419f, + 0.0042790001663f, + 0.0042264234446f, + 0.0041735348127f, + 0.0041203499262f, + 0.0040668844797f, + 0.0040131541736f, + 0.0039591747350f, + 0.0039049618835f, + 0.0038505313527f, + 0.0037958988559f, + 0.0037410801073f, + 0.0036860907892f, + 0.0036309465703f, + 0.0035756630769f, + 0.0035202559073f, + 0.0034647406073f, + 0.0034091326794f, + 0.0033534475647f, + 0.0032977006457f, + 0.0032419072346f, + 0.0031860825701f, + 0.0031302418118f, + 0.0030744000312f, + 0.0030185722124f, + 0.0029627732367f, + 0.0029070178900f, + 0.0028513208414f, + 0.0027956966562f, + 0.0027401597701f, + 0.0026847245064f, + 0.0026294050460f, + 0.0025742154495f, + 0.0025191696234f, + 0.0024642813451f, + 0.0024095642271f, + 0.0023550317442f, + 0.0023006971965f, + 0.0022465737373f, + 0.0021926743367f, + 0.0021390118086f, + 0.0020855987758f, + 0.0020324476959f, + 0.0019795708285f, + 0.0019269802582f, + 0.0018746878666f, + 0.0018227053500f, + 0.0017710441970f, + 0.0017197157018f, + 0.0016687309465f, + 0.0016181008094f, + 0.0015678359536f, + 0.0015179468293f, + 0.0014684436687f, + 0.0014193364826f, + 0.0013706350614f, + 0.0013223489661f, + 0.0012744875354f, + 0.0012270598713f, + 0.0011800748517f, + 0.0011335411113f, + 0.0010874670591f, + 0.0010418608557f, + 0.0009967304337f, + 0.0009520834733f, + 0.0009079274248f, + 0.0008642694829f, + 0.0008211166104f, + 0.0007784755123f, + 0.0007363526596f, + 0.0006947542648f, + 0.0006536863036f, + 0.0006131544939f, + 0.0005731643140f, + 0.0005337209861f, + 0.0004948294900f, + 0.0004564945514f, + 0.0004187206518f, + 0.0003815120213f, + 0.0003448726437f, + 0.0003088062548f, + 0.0002733163427f, + 0.0002384061515f, + 0.0002040786763f, + 0.0001703366727f, + 0.0001371826468f, + 0.0001046188693f, + 0.0000726473624f, + 0.0000412699167f, + 0.0000104880762f, + -0.0000196968430f, + -0.0000492837685f, + -0.0000782718524f, + -0.0001066604864f, + -0.0001344492837f, + -0.0001616380917f, + -0.0001882269770f, + -0.0002142162337f, + -0.0002396063730f, + -0.0002643981260f, + -0.0002885924395f, + -0.0003121904710f, + -0.0003351935927f, + -0.0003576033774f, + -0.0003794216126f, + -0.0004006502744f, + -0.0004212915539f, + -0.0004413478190f, + -0.0004608216523f, + -0.0004797158006f, + -0.0004980332255f, + -0.0005157770396f, + -0.0005329505706f, + -0.0005495572834f, + -0.0005656008577f, + -0.0005810850973f, + -0.0005960140195f, + -0.0006103917530f, + -0.0006242226379f, + -0.0006375111133f, + -0.0006502618271f, + -0.0006624795144f, + -0.0006741691151f, + -0.0006853356454f, + -0.0006959843215f, + -0.0007061204255f, + -0.0007157494339f, + -0.0007248768797f, + -0.0007335084828f, + -0.0007416500121f, + -0.0007493074146f, + -0.0007564866791f, + -0.0007631939632f, + -0.0007694354603f, + -0.0007752175217f, + -0.0007805465296f, + -0.0007854290126f, + -0.0007898715256f, + -0.0007938807581f, + -0.0007974634219f, + -0.0008006263506f, + -0.0008033763972f, + -0.0008057205234f, + -0.0008076657071f, + -0.0008092190219f, + -0.0008103875548f, + -0.0008111784758f, + -0.0008115989647f, + -0.0008116562723f, + -0.0008113576556f, + -0.0008107104310f, + -0.0008097219168f, + -0.0008083994801f, + -0.0008067504850f, + -0.0008047823347f, + -0.0008025024239f, + -0.0007999181773f, + -0.0007970370052f, + -0.0007938663403f, + -0.0007904135933f, + -0.0007866861914f, + -0.0007826915315f, + -0.0007784370217f, + -0.0007739300312f, + -0.0007691779366f, + -0.0007641880653f, + -0.0007589677498f, + -0.0007535242631f, + -0.0007478648811f, + -0.0007419968098f, + -0.0007359272569f, + -0.0007296633493f, + -0.0007232122149f, + -0.0007165808902f, + -0.0007097764122f, + -0.0007028057162f, + -0.0006956757374f, + -0.0006883933000f, + -0.0006809652268f, + -0.0006733982212f, + -0.0006656989842f, + -0.0006578740890f, + -0.0006499301053f, + -0.0006418734679f, + -0.0006337106061f, + -0.0006254478087f, + -0.0006170913558f, + -0.0006086473832f, + -0.0006001220139f, + -0.0005915212236f, + -0.0005828509711f, + -0.0005741170662f, + -0.0005653252961f, + -0.0005564812990f, + -0.0005475906847f, + -0.0005386589147f, + -0.0005296914154f, + -0.0005206934671f, + -0.0005116703080f, + -0.0005026270327f, + -0.0004935686869f, + -0.0004845001759f, + -0.0004754263492f, + -0.0004663519194f, + -0.0004572815366f, + -0.0004482197180f, + -0.0004391709117f, + -0.0004301394370f, + -0.0004211295386f, + -0.0004121453355f, + -0.0004031908675f, + -0.0003942700520f, + -0.0003853867235f, + -0.0003765445962f, + -0.0003677472992f, + -0.0003589983429f, + -0.0003503011513f, + -0.0003416590306f, + -0.0003330752009f, + -0.0003245527639f, + -0.0003160947374f, + -0.0003077040191f, + -0.0002993834261f, + -0.0002911356534f, + -0.0002829633193f, + -0.0002748689175f, + -0.0002668548703f, + -0.0002589234716f, + -0.0002510769507f, + -0.0002433174043f, + -0.0002356468714f, + -0.0002280672545f, + -0.0002205804055f, + -0.0002131880358f, + -0.0002058918142f, + -0.0001986932647f, + -0.0001915938761f, + -0.0001845949894f, + -0.0001776979177f, + -0.0001709038232f, + -0.0001642138471f, + -0.0001576289781f, + -0.0001511501895f, + -0.0001447783020f, + -0.0001385141249f, + -0.0001323583166f, + -0.0001263115271f, + -0.0001203742580f, + -0.0001145470050f, + -0.0001088301187f, + -0.0001032239450f, + -0.0000977286901f, + -0.0000923445550f, + -0.0000870716076f, + -0.0000819099094f, + -0.0000768593961f, + -0.0000719199952f, + -0.0000670915167f, + -0.0000623737594f, + -0.0000577664138f, + -0.0000532691560f, + -0.0000488815635f, + -0.0000446031954f, + -0.0000404335221f, + -0.0000363719922f, + -0.0000324179752f, + -0.0000285708153f, + -0.0000248297868f, + -0.0000211941363f, + -0.0000176630487f, + -0.0000142356795f, + -0.0000109111299f, + -0.0000076884710f, + -0.0000045667258f, + -0.0000015448876f, + 0.0000013780933f, + 0.0000042032944f, + 0.0000069318331f, + 0.0000095648509f, + 0.0000121035277f, + 0.0000145490624f, + 0.0000169026922f, + 0.0000191656671f, + 0.0000213392762f, + 0.0000234248141f, + 0.0000254236173f, + 0.0000273370189f, + 0.0000291663973f, + 0.0000309131181f, + 0.0000325785972f, + 0.0000341642269f, + 0.0000356714551f, + 0.0000371016959f, + 0.0000384564242f, + 0.0000397370709f, + 0.0000409451326f, + 0.0000420820523f, + 0.0000431493437f, + 0.0000441484575f, + 0.0000450809190f, + 0.0000459481829f, + 0.0000467517812f, + 0.0000474931688f, + 0.0000481738794f, + 0.0000487953650f, + 0.0000493591558f, + 0.0000498666979f, + 0.0000503195135f, + 0.0000507190397f, + 0.0000510667862f, + 0.0000513641784f, + 0.0000516127093f, + 0.0000518137901f, + 0.0000519688928f, + 0.0000520794123f, + 0.0000521467956f, + 0.0000521724191f, + 0.0000521577014f, + 0.0000521039980f, + 0.0000520126964f, + 0.0000518851286f, + 0.0000517226482f, + 0.0000515265621f, + 0.0000512981874f, + 0.0000510388032f, + 0.0000507496888f, + 0.0000504320934f, + 0.0000500872564f, + 0.0000497163952f, + 0.0000493207086f, + 0.0000489013793f, + 0.0000484595649f, + 0.0000479964116f, + 0.0000475130351f, + 0.0000470105429f, + 0.0000464900089f, + 0.0000459524996f, + 0.0000453990473f, + 0.0000448306757f, + 0.0000442483761f, + 0.0000436531270f, + 0.0000430458793f, + 0.0000424275651f, + 0.0000417990953f, + 0.0000411613543f, + 0.0000405152136f, + 0.0000398615087f, + 0.0000392010726f, + 0.0000385346910f, + 0.0000378631590f, + 0.0000371872122f, + 0.0000365076083f, + 0.0000358250326f, + 0.0000351402059f, + 0.0000344537638f, + 0.0000337663900f, + 0.0000330786713f, + 0.0000323912545f, + 0.0000317046787f, + 0.0000310195537f, + 0.0000303363724f, + 0.0000296557072f, + 0.0000289780068f, + 0.0000283038060f, + 0.0000276335113f, + 0.0000269676192f, + 0.0000263064966f, + 0.0000256506012f, + 0.0000250002630f, + 0.0000243559001f, + 0.0000237178084f, + 0.0000230863658f, + 0.0000224618368f, + 0.0000218445591f, + 0.0000212347684f, + 0.0000206327617f, + 0.0000200387487f, + 0.0000194529856f, + 0.0000188756586f, + 0.0000183069836f, + 0.0000177471253f, + 0.0000171962598f, + 0.0000166545325f, + 0.0000161220807f, + 0.0000155990318f, + 0.0000150854857f, + 0.0000145815531f, + 0.0000140872987f, + 0.0000136028167f, + 0.0000131281391f, + 0.0000126633440f, + 0.0000122084333f, + 0.0000117634690f, + 0.0000113284258f, + 0.0000109033494f, + 0.0000104881911f, + 0.0000100829787f, + 0.0000096876440f, + 0.0000093021962f, + 0.0000089265516f, + 0.0000085606992f, + 0.0000082045440f, + 0.0000078580532f, + 0.0000075211250f, + 0.0000071937032f, + 0.0000068756832f, + 0.0000065669838f, + 0.0000062675020f, + 0.0000059771297f, + 0.0000056957697f, + 0.0000054232859f, + 0.0000051595901f, + 0.0000049045172f, + 0.0000046579914f, + 0.0000044198178f, + 0.0000041899359f, + 0.0000039681205f, + 0.0000037543287f, + 0.0000035483053f, + 0.0000033500265f, + 0.0000031592080f, + 0.0000029758459f, + 0.0000027996282f, + 0.0000026305712f, + 0.0000024683369f, + 0.0000023129618f, + 0.0000021640841f, + 0.0000020217596f, + 0.0000018856055f, + 0.0000017556952f, + 0.0000016316288f, + 0.0000015134951f, + 0.0000014008804f, + 0.0000012938865f, + 0.0000011920904f, + 0.0000010956039f, + 0.0000010039987f, + 0.0000054617197f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_256_16.h b/core/src/dsp/multirate/.old_decim/taps/fir_256_16.h new file mode 100644 index 0000000..56f959f --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_256_16.h @@ -0,0 +1,88 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_16_len = 76; + const float fir_256_16_taps[] = { + 0.0000015142320f, + 0.0000056182880f, + 0.0000124498946f, + 0.0000260499212f, + 0.0000484430498f, + 0.0000846870575f, + 0.0001399358873f, + 0.0002214698093f, + 0.0003376597827f, + 0.0004986987881f, + 0.0007161460168f, + 0.0010030447437f, + 0.0013735255533f, + 0.0018425379543f, + 0.0024253148288f, + 0.0031368140196f, + 0.0039910067755f, + 0.0050001228341f, + 0.0061738297617f, + 0.0075184160910f, + 0.0090360019122f, + 0.0107238349685f, + 0.0125737121967f, + 0.0145715758254f, + 0.0166973209914f, + 0.0189248478075f, + 0.0212223774387f, + 0.0235530403051f, + 0.0258757292104f, + 0.0281461957951f, + 0.0303183537669f, + 0.0323457392931f, + 0.0341830677768f, + 0.0357878183250f, + 0.0371217728573f, + 0.0381524365951f, + 0.0388542706370f, + 0.0392096753967f, + 0.0392096753967f, + 0.0388542706370f, + 0.0381524365951f, + 0.0371217728573f, + 0.0357878183250f, + 0.0341830677768f, + 0.0323457392931f, + 0.0303183537669f, + 0.0281461957951f, + 0.0258757292104f, + 0.0235530403051f, + 0.0212223774387f, + 0.0189248478075f, + 0.0166973209914f, + 0.0145715758254f, + 0.0125737121967f, + 0.0107238349685f, + 0.0090360019122f, + 0.0075184160910f, + 0.0061738297617f, + 0.0050001228341f, + 0.0039910067755f, + 0.0031368140196f, + 0.0024253148288f, + 0.0018425379543f, + 0.0013735255533f, + 0.0010030447437f, + 0.0007161460168f, + 0.0004986987881f, + 0.0003376597827f, + 0.0002214698093f, + 0.0001399358873f, + 0.0000846870575f, + 0.0000484430498f, + 0.0000260499212f, + 0.0000124498946f, + 0.0000056182880f, + 0.0000015142320f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_256_32.h b/core/src/dsp/multirate/.old_decim/taps/fir_256_32.h new file mode 100644 index 0000000..995faaf --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_256_32.h @@ -0,0 +1,154 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_32_len = 142; + const float fir_256_32_taps[] = { + 0.0000017688668f, + 0.0000059240292f, + 0.0000063419158f, + 0.0000109315134f, + 0.0000155620383f, + 0.0000222451938f, + 0.0000306499257f, + 0.0000414255079f, + 0.0000549053491f, + 0.0000716171275f, + 0.0000920857379f, + 0.0001169121085f, + 0.0001467432458f, + 0.0001822838505f, + 0.0002242905946f, + 0.0002735720047f, + 0.0003309848921f, + 0.0003974308010f, + 0.0004738510608f, + 0.0005612209568f, + 0.0006605427983f, + 0.0007728379742f, + 0.0008991379865f, + 0.0010404745144f, + 0.0011978685639f, + 0.0013723187831f, + 0.0015647890362f, + 0.0017761953523f, + 0.0020073923789f, + 0.0022591594875f, + 0.0025321866931f, + 0.0028270605623f, + 0.0031442502958f, + 0.0034840941781f, + 0.0038467865966f, + 0.0042323658308f, + 0.0046407028156f, + 0.0050714910778f, + 0.0055242380402f, + 0.0059982578748f, + 0.0064926660779f, + 0.0070063759201f, + 0.0075380969064f, + 0.0080863353601f, + 0.0086493972198f, + 0.0092253931090f, + 0.0098122457142f, + 0.0104076994722f, + 0.0110093325391f, + 0.0116145709801f, + 0.0122207050884f, + 0.0128249077089f, + 0.0134242544118f, + 0.0140157453332f, + 0.0145963284712f, + 0.0151629242012f, + 0.0157124507544f, + 0.0162418503801f, + 0.0167481159032f, + 0.0172283173722f, + 0.0176796284881f, + 0.0180993525027f, + 0.0184849472748f, + 0.0188340491797f, + 0.0191444955798f, + 0.0194143455756f, + 0.0196418987797f, + 0.0198257118761f, + 0.0199646127554f, + 0.0200577120472f, + 0.0201044119003f, + 0.0201044119003f, + 0.0200577120472f, + 0.0199646127554f, + 0.0198257118761f, + 0.0196418987797f, + 0.0194143455756f, + 0.0191444955798f, + 0.0188340491797f, + 0.0184849472748f, + 0.0180993525027f, + 0.0176796284881f, + 0.0172283173722f, + 0.0167481159032f, + 0.0162418503801f, + 0.0157124507544f, + 0.0151629242012f, + 0.0145963284712f, + 0.0140157453332f, + 0.0134242544118f, + 0.0128249077089f, + 0.0122207050884f, + 0.0116145709801f, + 0.0110093325391f, + 0.0104076994722f, + 0.0098122457142f, + 0.0092253931090f, + 0.0086493972198f, + 0.0080863353601f, + 0.0075380969064f, + 0.0070063759201f, + 0.0064926660779f, + 0.0059982578748f, + 0.0055242380402f, + 0.0050714910778f, + 0.0046407028156f, + 0.0042323658308f, + 0.0038467865966f, + 0.0034840941781f, + 0.0031442502958f, + 0.0028270605623f, + 0.0025321866931f, + 0.0022591594875f, + 0.0020073923789f, + 0.0017761953523f, + 0.0015647890362f, + 0.0013723187831f, + 0.0011978685639f, + 0.0010404745144f, + 0.0008991379865f, + 0.0007728379742f, + 0.0006605427983f, + 0.0005612209568f, + 0.0004738510608f, + 0.0003974308010f, + 0.0003309848921f, + 0.0002735720047f, + 0.0002242905946f, + 0.0001822838505f, + 0.0001467432458f, + 0.0001169121085f, + 0.0000920857379f, + 0.0000716171275f, + 0.0000549053491f, + 0.0000414255079f, + 0.0000306499257f, + 0.0000222451938f, + 0.0000155620383f, + 0.0000109315134f, + 0.0000063419158f, + 0.0000059240292f, + 0.0000017688668f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_256_64.h b/core/src/dsp/multirate/.old_decim/taps/fir_256_64.h new file mode 100644 index 0000000..9836b4c --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_256_64.h @@ -0,0 +1,368 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_64_len = 356; + const float fir_256_64_taps[] = { + -0.0000062681742f, + -0.0000029140762f, + -0.0000035815110f, + -0.0000043422553f, + -0.0000052049053f, + -0.0000061772939f, + -0.0000072686109f, + -0.0000084872485f, + -0.0000098429063f, + -0.0000113444414f, + -0.0000130019541f, + -0.0000148246460f, + -0.0000168228827f, + -0.0000190060632f, + -0.0000213846550f, + -0.0000239680794f, + -0.0000267667146f, + -0.0000297898005f, + -0.0000330474067f, + -0.0000365483596f, + -0.0000403021726f, + -0.0000443169994f, + -0.0000486015224f, + -0.0000531629366f, + -0.0000580087933f, + -0.0000631450183f, + -0.0000685777077f, + -0.0000743111852f, + -0.0000803497472f, + -0.0000866957632f, + -0.0000933513680f, + -0.0001003166088f, + -0.0001075910834f, + -0.0001151721377f, + -0.0001230564481f, + -0.0001312382737f, + -0.0001397109815f, + -0.0001484653574f, + -0.0001574910729f, + -0.0001667750594f, + -0.0001763029154f, + -0.0001860573478f, + -0.0001960195192f, + -0.0002061675607f, + -0.0002164778583f, + -0.0002269236408f, + -0.0002374762065f, + -0.0002481035885f, + -0.0002587717224f, + -0.0002694431931f, + -0.0002800783421f, + -0.0002906341007f, + -0.0003010650378f, + -0.0003113222805f, + -0.0003213545042f, + -0.0003311069438f, + -0.0003405223259f, + -0.0003495399742f, + -0.0003580966832f, + -0.0003661259202f, + -0.0003735586428f, + -0.0003803225975f, + -0.0003863430819f, + -0.0003915423426f, + -0.0003958402819f, + -0.0003991539556f, + -0.0004013982252f, + -0.0004024853566f, + -0.0004023256179f, + -0.0004008269786f, + -0.0003978956543f, + -0.0003934359050f, + -0.0003873505277f, + -0.0003795407527f, + -0.0003699066836f, + -0.0003583472905f, + -0.0003447607977f, + -0.0003290447712f, + -0.0003110964540f, + -0.0002908129452f, + -0.0002680914824f, + -0.0002428297099f, + -0.0002149259070f, + -0.0001842793414f, + -0.0001507904431f, + -0.0001143612390f, + -0.0000748954712f, + -0.0000322991074f, + 0.0000135195964f, + 0.0000626495149f, + 0.0001151766480f, + 0.0001711834750f, + 0.0002307490067f, + 0.0002939480814f, + 0.0003608514761f, + 0.0004315251498f, + 0.0005060304153f, + 0.0005844231367f, + 0.0006667539631f, + 0.0007530674871f, + 0.0008434025410f, + 0.0009377913237f, + 0.0010362597605f, + 0.0011388266053f, + 0.0012455038652f, + 0.0013562958844f, + 0.0014711998354f, + 0.0015902047905f, + 0.0017132922802f, + 0.0018404353607f, + 0.0019715992373f, + 0.0021067403358f, + 0.0022458069916f, + 0.0023887385299f, + 0.0025354660208f, + 0.0026859113741f, + 0.0028399881592f, + 0.0029976007211f, + 0.0031586450629f, + 0.0033230079887f, + 0.0034905680464f, + 0.0036611947020f, + 0.0038347493416f, + 0.0040110844803f, + 0.0041900448203f, + 0.0043714664990f, + 0.0045551781983f, + 0.0047410004367f, + 0.0049287467249f, + 0.0051182229035f, + 0.0053092283419f, + 0.0055015553224f, + 0.0056949902776f, + 0.0058893132225f, + 0.0060842990234f, + 0.0062797168802f, + 0.0064753316199f, + 0.0066709032288f, + 0.0068661881644f, + 0.0070609389367f, + 0.0072549054317f, + 0.0074478345403f, + 0.0076394714860f, + 0.0078295595003f, + 0.0080178411460f, + 0.0082040580375f, + 0.0083879521517f, + 0.0085692655900f, + 0.0087477418693f, + 0.0089231257234f, + 0.0090951643643f, + 0.0092636073201f, + 0.0094282076595f, + 0.0095887218614f, + 0.0097449109950f, + 0.0098965406177f, + 0.0100433819014f, + 0.0101852115568f, + 0.0103218128967f, + 0.0104529757832f, + 0.0105784976211f, + 0.0106981833229f, + 0.0108118462264f, + 0.0109193080737f, + 0.0110203998455f, + 0.0111149617515f, + 0.0112028439747f, + 0.0112839066704f, + 0.0113580206147f, + 0.0114250672088f, + 0.0114849390277f, + 0.0115375398269f, + 0.0115827849866f, + 0.0116206015194f, + 0.0116509284062f, + 0.0116737166029f, + 0.0116889292662f, + 0.0116965417578f, + 0.0116965417578f, + 0.0116889292662f, + 0.0116737166029f, + 0.0116509284062f, + 0.0116206015194f, + 0.0115827849866f, + 0.0115375398269f, + 0.0114849390277f, + 0.0114250672088f, + 0.0113580206147f, + 0.0112839066704f, + 0.0112028439747f, + 0.0111149617515f, + 0.0110203998455f, + 0.0109193080737f, + 0.0108118462264f, + 0.0106981833229f, + 0.0105784976211f, + 0.0104529757832f, + 0.0103218128967f, + 0.0101852115568f, + 0.0100433819014f, + 0.0098965406177f, + 0.0097449109950f, + 0.0095887218614f, + 0.0094282076595f, + 0.0092636073201f, + 0.0090951643643f, + 0.0089231257234f, + 0.0087477418693f, + 0.0085692655900f, + 0.0083879521517f, + 0.0082040580375f, + 0.0080178411460f, + 0.0078295595003f, + 0.0076394714860f, + 0.0074478345403f, + 0.0072549054317f, + 0.0070609389367f, + 0.0068661881644f, + 0.0066709032288f, + 0.0064753316199f, + 0.0062797168802f, + 0.0060842990234f, + 0.0058893132225f, + 0.0056949902776f, + 0.0055015553224f, + 0.0053092283419f, + 0.0051182229035f, + 0.0049287467249f, + 0.0047410004367f, + 0.0045551781983f, + 0.0043714664990f, + 0.0041900448203f, + 0.0040110844803f, + 0.0038347493416f, + 0.0036611947020f, + 0.0034905680464f, + 0.0033230079887f, + 0.0031586450629f, + 0.0029976007211f, + 0.0028399881592f, + 0.0026859113741f, + 0.0025354660208f, + 0.0023887385299f, + 0.0022458069916f, + 0.0021067403358f, + 0.0019715992373f, + 0.0018404353607f, + 0.0017132922802f, + 0.0015902047905f, + 0.0014711998354f, + 0.0013562958844f, + 0.0012455038652f, + 0.0011388266053f, + 0.0010362597605f, + 0.0009377913237f, + 0.0008434025410f, + 0.0007530674871f, + 0.0006667539631f, + 0.0005844231367f, + 0.0005060304153f, + 0.0004315251498f, + 0.0003608514761f, + 0.0002939480814f, + 0.0002307490067f, + 0.0001711834750f, + 0.0001151766480f, + 0.0000626495149f, + 0.0000135195964f, + -0.0000322991074f, + -0.0000748954712f, + -0.0001143612390f, + -0.0001507904431f, + -0.0001842793414f, + -0.0002149259070f, + -0.0002428297099f, + -0.0002680914824f, + -0.0002908129452f, + -0.0003110964540f, + -0.0003290447712f, + -0.0003447607977f, + -0.0003583472905f, + -0.0003699066836f, + -0.0003795407527f, + -0.0003873505277f, + -0.0003934359050f, + -0.0003978956543f, + -0.0004008269786f, + -0.0004023256179f, + -0.0004024853566f, + -0.0004013982252f, + -0.0003991539556f, + -0.0003958402819f, + -0.0003915423426f, + -0.0003863430819f, + -0.0003803225975f, + -0.0003735586428f, + -0.0003661259202f, + -0.0003580966832f, + -0.0003495399742f, + -0.0003405223259f, + -0.0003311069438f, + -0.0003213545042f, + -0.0003113222805f, + -0.0003010650378f, + -0.0002906341007f, + -0.0002800783421f, + -0.0002694431931f, + -0.0002587717224f, + -0.0002481035885f, + -0.0002374762065f, + -0.0002269236408f, + -0.0002164778583f, + -0.0002061675607f, + -0.0001960195192f, + -0.0001860573478f, + -0.0001763029154f, + -0.0001667750594f, + -0.0001574910729f, + -0.0001484653574f, + -0.0001397109815f, + -0.0001312382737f, + -0.0001230564481f, + -0.0001151721377f, + -0.0001075910834f, + -0.0001003166088f, + -0.0000933513680f, + -0.0000866957632f, + -0.0000803497472f, + -0.0000743111852f, + -0.0000685777077f, + -0.0000631450183f, + -0.0000580087933f, + -0.0000531629366f, + -0.0000486015224f, + -0.0000443169994f, + -0.0000403021726f, + -0.0000365483596f, + -0.0000330474067f, + -0.0000297898005f, + -0.0000267667146f, + -0.0000239680794f, + -0.0000213846550f, + -0.0000190060632f, + -0.0000168228827f, + -0.0000148246460f, + -0.0000130019541f, + -0.0000113444414f, + -0.0000098429063f, + -0.0000084872485f, + -0.0000072686109f, + -0.0000061772939f, + -0.0000052049053f, + -0.0000043422553f, + -0.0000035815110f, + -0.0000029140762f, + -0.0000062681742f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_256_8.h b/core/src/dsp/multirate/.old_decim/taps/fir_256_8.h new file mode 100644 index 0000000..4316ee9 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_256_8.h @@ -0,0 +1,44 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_8_len = 32; + const float fir_256_8_taps[] = { + 0.0000481199958f, + 0.0002120253977f, + 0.0006339322060f, + 0.0015268611634f, + 0.0031751774844f, + 0.0059080996632f, + 0.0100482128498f, + 0.0158389158363f, + 0.0233630301033f, + 0.0324710705948f, + 0.0427398820012f, + 0.0534789041603f, + 0.0637922520572f, + 0.0726919132761f, + 0.0792439704433f, + 0.0827196815814f, + 0.0827196815814f, + 0.0792439704433f, + 0.0726919132761f, + 0.0637922520572f, + 0.0534789041603f, + 0.0427398820012f, + 0.0324710705948f, + 0.0233630301033f, + 0.0158389158363f, + 0.0100482128498f, + 0.0059080996632f, + 0.0031751774844f, + 0.0015268611634f, + 0.0006339322060f, + 0.0002120253977f, + 0.0000481199958f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_2_2.h b/core/src/dsp/multirate/.old_decim/taps/fir_2_2.h new file mode 100644 index 0000000..0b78f20 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_2_2.h @@ -0,0 +1,81 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_2_2_len = 69; + const float fir_2_2_taps[] = { + 0.0004006336249f, + 0.0020755985056f, + 0.0048563649567f, + 0.0059790166982f, + 0.0026229226079f, + -0.0027182591526f, + -0.0033815336714f, + 0.0016386385398f, + 0.0040818147060f, + -0.0009840292282f, + -0.0051209884701f, + 0.0001774409073f, + 0.0064258526620f, + 0.0010093516023f, + -0.0079128279100f, + -0.0027137006752f, + 0.0095093112574f, + 0.0050706357235f, + -0.0111540204771f, + -0.0082460599199f, + 0.0127857167873f, + 0.0124879068372f, + -0.0143474523867f, + -0.0182057708485f, + 0.0157818585768f, + 0.0261723747167f, + -0.0170376434096f, + -0.0380514893049f, + 0.0180670706247f, + 0.0582124126716f, + -0.0188323041841f, + -0.1027724866049f, + 0.0193031650356f, + 0.3171894887336f, + 0.4805375200904f, + 0.3171894887336f, + 0.0193031650356f, + -0.1027724866049f, + -0.0188323041841f, + 0.0582124126716f, + 0.0180670706247f, + -0.0380514893049f, + -0.0170376434096f, + 0.0261723747167f, + 0.0157818585768f, + -0.0182057708485f, + -0.0143474523867f, + 0.0124879068372f, + 0.0127857167873f, + -0.0082460599199f, + -0.0111540204771f, + 0.0050706357235f, + 0.0095093112574f, + -0.0027137006752f, + -0.0079128279100f, + 0.0010093516023f, + 0.0064258526620f, + 0.0001774409073f, + -0.0051209884701f, + -0.0009840292282f, + 0.0040818147060f, + 0.0016386385398f, + -0.0033815336714f, + -0.0027182591526f, + 0.0026229226079f, + 0.0059790166982f, + 0.0048563649567f, + 0.0020755985056f, + 0.0004006336249f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_32_16.h b/core/src/dsp/multirate/.old_decim/taps/fir_32_16.h new file mode 100644 index 0000000..b6d1ba5 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_32_16.h @@ -0,0 +1,140 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_16_len = 128; + const float fir_32_16_taps[] = { + 0.0000099342222f, + 0.0000146490348f, + 0.0000247646101f, + 0.0000387541309f, + 0.0000572736657f, + 0.0000808761926f, + 0.0001099349979f, + 0.0001445574213f, + 0.0001844922748f, + 0.0002290353727f, + 0.0002769386619f, + 0.0003263293316f, + 0.0003746459569f, + 0.0004185990900f, + 0.0004541637106f, + 0.0004766105134f, + 0.0004805821127f, + 0.0004602188681f, + 0.0004093371919f, + 0.0003216609257f, + 0.0001911037388f, + 0.0000120976033f, + -0.0002200406423f, + -0.0005087156694f, + -0.0008556468821f, + -0.0012604649511f, + -0.0017203301735f, + -0.0022295925790f, + -0.0027795143093f, + -0.0033580744939f, + -0.0039498755635f, + -0.0045361676357f, + -0.0050950043052f, + -0.0056015389258f, + -0.0060284654152f, + -0.0063466019019f, + -0.0065256093963f, + -0.0065348313327f, + -0.0063442336013f, + -0.0059254188348f, + -0.0052526835481f, + -0.0043040825207f, + -0.0030624618152f, + -0.0015164202550f, + 0.0003388408046f, + 0.0025008178935f, + 0.0049591911398f, + 0.0076955253725f, + 0.0106832101994f, + 0.0138876548446f, + 0.0172667447174f, + 0.0207715571925f, + 0.0243473242916f, + 0.0279346202686f, + 0.0314707429314f, + 0.0348912492894f, + 0.0381315991625f, + 0.0411288550641f, + 0.0438233832299f, + 0.0461604993011f, + 0.0480920029752f, + 0.0495775489259f, + 0.0505858063661f, + 0.0510953666101f, + 0.0510953666101f, + 0.0505858063661f, + 0.0495775489259f, + 0.0480920029752f, + 0.0461604993011f, + 0.0438233832299f, + 0.0411288550641f, + 0.0381315991625f, + 0.0348912492894f, + 0.0314707429314f, + 0.0279346202686f, + 0.0243473242916f, + 0.0207715571925f, + 0.0172667447174f, + 0.0138876548446f, + 0.0106832101994f, + 0.0076955253725f, + 0.0049591911398f, + 0.0025008178935f, + 0.0003388408046f, + -0.0015164202550f, + -0.0030624618152f, + -0.0043040825207f, + -0.0052526835481f, + -0.0059254188348f, + -0.0063442336013f, + -0.0065348313327f, + -0.0065256093963f, + -0.0063466019019f, + -0.0060284654152f, + -0.0056015389258f, + -0.0050950043052f, + -0.0045361676357f, + -0.0039498755635f, + -0.0033580744939f, + -0.0027795143093f, + -0.0022295925790f, + -0.0017203301735f, + -0.0012604649511f, + -0.0008556468821f, + -0.0005087156694f, + -0.0002200406423f, + 0.0000120976033f, + 0.0001911037388f, + 0.0003216609257f, + 0.0004093371919f, + 0.0004602188681f, + 0.0004805821127f, + 0.0004766105134f, + 0.0004541637106f, + 0.0004185990900f, + 0.0003746459569f, + 0.0003263293316f, + 0.0002769386619f, + 0.0002290353727f, + 0.0001844922748f, + 0.0001445574213f, + 0.0001099349979f, + 0.0000808761926f, + 0.0000572736657f, + 0.0000387541309f, + 0.0000247646101f, + 0.0000146490348f, + 0.0000099342222f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_32_2.h b/core/src/dsp/multirate/.old_decim/taps/fir_32_2.h new file mode 100644 index 0000000..25b9502 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_32_2.h @@ -0,0 +1,18 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_2_len = 6; + const float fir_32_2_taps[] = { + 0.0303426484663f, + 0.1557222116669f, + 0.3154225044548f, + 0.3154225044548f, + 0.1557222116669f, + 0.0303426484663f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_32_32.h b/core/src/dsp/multirate/.old_decim/taps/fir_32_32.h new file mode 100644 index 0000000..7d3017b --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_32_32.h @@ -0,0 +1,1115 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_32_len = 1103; + const float fir_32_32_taps[] = { + 0.0000064425788f, + 0.0000033014804f, + 0.0000041249453f, + 0.0000050666069f, + 0.0000061347473f, + 0.0000073374059f, + 0.0000086822757f, + 0.0000101765938f, + 0.0000118270277f, + 0.0000136395560f, + 0.0000156193469f, + 0.0000177706336f, + 0.0000200965883f, + 0.0000225991964f, + 0.0000252791303f, + 0.0000281356268f, + 0.0000311663665f, + 0.0000343673588f, + 0.0000377328326f, + 0.0000412551345f, + 0.0000449246363f, + 0.0000487296525f, + 0.0000526563699f, + 0.0000566887903f, + 0.0000608086879f, + 0.0000649955829f, + 0.0000692267316f, + 0.0000734771355f, + 0.0000777195696f, + 0.0000819246310f, + 0.0000860608088f, + 0.0000900945758f, + 0.0000939905024f, + 0.0000977113936f, + 0.0001012184487f, + 0.0001044714435f, + 0.0001074289359f, + 0.0001100484926f, + 0.0001122869384f, + 0.0001141006252f, + 0.0001154457210f, + 0.0001162785168f, + 0.0001165557502f, + 0.0001162349436f, + 0.0001152747551f, + 0.0001136353405f, + 0.0001112787225f, + 0.0001081691663f, + 0.0001042735572f, + 0.0000995617786f, + 0.0000940070861f, + 0.0000875864757f, + 0.0000802810417f, + 0.0000720763221f, + 0.0000629626269f, + 0.0000529353467f, + 0.0000419952383f, + 0.0000301486828f, + 0.0000174079151f, + 0.0000037912184f, + -0.0000106769153f, + -0.0000259656655f, + -0.0000420378042f, + -0.0000588496612f, + -0.0000763511359f, + -0.0000944857564f, + -0.0001131907895f, + -0.0001323974004f, + -0.0001520308649f, + -0.0001720108329f, + -0.0001922516448f, + -0.0002126626991f, + -0.0002331488711f, + -0.0002536109811f, + -0.0002739463104f, + -0.0002940491630f, + -0.0003138114702f, + -0.0003331234349f, + -0.0003518742125f, + -0.0003699526238f, + -0.0003872478959f, + -0.0004036504263f, + -0.0004190525651f, + -0.0004333494098f, + -0.0004464396065f, + -0.0004582261523f, + -0.0004686171928f, + -0.0004775268066f, + -0.0004848757728f, + -0.0004905923132f, + -0.0004946128030f, + -0.0004968824437f, + -0.0004973558920f, + -0.0004959978377f, + -0.0004927835248f, + -0.0004876992105f, + -0.0004807425563f, + -0.0004719229454f, + -0.0004612617230f, + -0.0004487923547f, + -0.0004345604987f, + -0.0004186239903f, + -0.0004010527353f, + -0.0003819285099f, + -0.0003613446675f, + -0.0003394057517f, + -0.0003162270149f, + -0.0002919338447f, + -0.0002666611005f, + -0.0002405523614f, + -0.0002137590910f, + -0.0001864397218f, + -0.0001587586656f, + -0.0001308852545f, + -0.0001029926207f, + -0.0000752565205f, + -0.0000478541121f, + -0.0000209626947f, + 0.0000052415821f, + 0.0000305850284f, + 0.0000548977338f, + 0.0000780148883f, + 0.0000997780906f, + 0.0001200366365f, + 0.0001386487747f, + 0.0001554829191f, + 0.0001704188086f, + 0.0001833486017f, + 0.0001941778982f, + 0.0002028266752f, + 0.0002092301313f, + 0.0002133394270f, + 0.0002151223160f, + 0.0002145636574f, + 0.0002116658040f, + 0.0002064488603f, + 0.0001989508042f, + 0.0001892274713f, + 0.0001773523961f, + 0.0001634165101f, + 0.0001475276961f, + 0.0001298101992f, + 0.0001104038960f, + 0.0000894634263f, + 0.0000671571903f, + 0.0000436662173f, + 0.0000191829133f, + -0.0000060903059f, + -0.0000319424858f, + -0.0000581556992f, + -0.0000845066962f, + -0.0001107686256f, + -0.0001367128149f, + -0.0001621105962f, + -0.0001867351629f, + -0.0002103634419f, + -0.0002327779678f, + -0.0002537687424f, + -0.0002731350628f, + -0.0002906873051f, + -0.0003062486452f, + -0.0003196567027f, + -0.0003307650922f, + -0.0003394448683f, + -0.0003455858480f, + -0.0003490978007f, + -0.0003499114897f, + -0.0003479795568f, + -0.0003432772379f, + -0.0003358029014f, + -0.0003255784014f, + -0.0003126492400f, + -0.0002970845330f, + -0.0002789767769f, + -0.0002584414148f, + -0.0002356162023f, + -0.0002106603742f, + -0.0001837536163f, + -0.0001550948484f, + -0.0001249008236f, + -0.0000934045545f, + -0.0000608535759f, + -0.0000275080565f, + 0.0000063612278f, + 0.0000404750427f, + 0.0000745479515f, + 0.0001082906593f, + 0.0001414124288f, + 0.0001736235455f, + 0.0002046378152f, + 0.0002341750699f, + 0.0002619636629f, + 0.0002877429300f, + 0.0003112655965f, + 0.0003323001063f, + 0.0003506328541f, + 0.0003660702983f, + 0.0003784409347f, + 0.0003875971118f, + 0.0003934166692f, + 0.0003958043827f, + 0.0003946931989f, + 0.0003900452468f, + 0.0003818526131f, + 0.0003701378703f, + 0.0003549543498f, + 0.0003363861529f, + 0.0003145478953f, + 0.0002895841828f, + 0.0002616688194f, + 0.0002310037485f, + 0.0001978177334f, + 0.0001623647845f, + 0.0001249223415f, + 0.0000857892233f, + 0.0000452833598f, + 0.0000037393217f, + -0.0000384943344f, + -0.0000810578837f, + -0.0001235833928f, + -0.0001656977983f, + -0.0002070260772f, + -0.0002471944859f, + -0.0002858338377f, + -0.0003225827932f, + -0.0003570911325f, + -0.0003890229831f, + -0.0004180599723f, + -0.0004439042760f, + -0.0004662815362f, + -0.0004849436183f, + -0.0004996711823f, + -0.0005102760424f, + -0.0005166032906f, + -0.0005185331617f, + -0.0005159826200f, + -0.0005089066484f, + -0.0004972992247f, + -0.0004811939705f, + -0.0004606644634f, + -0.0004358242025f, + -0.0004068262238f, + -0.0003738623613f, + -0.0003371621574f, + -0.0002969914239f, + -0.0002536504622f, + -0.0002074719536f, + -0.0001588185305f, + -0.0001080800484f, + -0.0000556705748f, + -0.0000020251190f, + 0.0000524038732f, + 0.0001071502323f, + 0.0001617379566f, + 0.0002156852502f, + 0.0002685086744f, + 0.0003197273785f, + 0.0003688673719f, + 0.0004154658029f, + 0.0004590752048f, + 0.0004992676723f, + 0.0005356389296f, + 0.0005678122527f, + 0.0005954422100f, + 0.0006182181836f, + 0.0006358676383f, + 0.0006481591046f, + 0.0006549048458f, + 0.0006559631794f, + 0.0006512404284f, + 0.0006406924783f, + 0.0006243259206f, + 0.0006021987666f, + 0.0005744207175f, + 0.0005411529820f, + 0.0005026076371f, + 0.0004590465283f, + 0.0004107797148f, + 0.0003581634636f, + 0.0003015978052f, + 0.0002415236649f, + 0.0001784195887f, + 0.0001127980870f, + 0.0000452016213f, + -0.0000238017346f, + -0.0000936229265f, + -0.0001636568079f, + -0.0002332872451f, + -0.0003018923975f, + -0.0003688501294f, + -0.0004335435059f, + -0.0004953663284f, + -0.0005537286580f, + -0.0006080622805f, + -0.0006578260616f, + -0.0007025111454f, + -0.0007416459455f, + -0.0007748008827f, + -0.0008015928239f, + -0.0008216891766f, + -0.0008348115993f, + -0.0008407392879f, + -0.0008393118036f, + -0.0008304314087f, + -0.0008140648836f, + -0.0007902448005f, + -0.0007590702339f, + -0.0007207068934f, + -0.0006753866683f, + -0.0006234065804f, + -0.0005651271432f, + -0.0005009701345f, + -0.0004314157931f, + -0.0003569994547f, + -0.0002783076491f, + -0.0001959736845f, + -0.0001106727507f, + -0.0000231165764f, + 0.0000659523175f, + 0.0001557667262f, + 0.0002455411796f, + 0.0003344786214f, + 0.0004217772924f, + 0.0005066377605f, + 0.0005882700376f, + 0.0006659007212f, + 0.0007387800990f, + 0.0008061891518f, + 0.0008674463921f, + 0.0009219144750f, + 0.0009690065202f, + 0.0010081920830f, + 0.0010390027190f, + 0.0010610370839f, + 0.0010739655188f, + 0.0010775340714f, + 0.0010715679088f, + 0.0010559740836f, + 0.0010307436170f, + 0.0009959528728f, + 0.0009517641963f, + 0.0008984258034f, + 0.0008362709091f, + 0.0007657160900f, + 0.0006872588853f, + 0.0006014746453f, + 0.0005090126426f, + 0.0004105914704f, + 0.0003069937573f, + 0.0001990602342f, + 0.0000876831956f, + -0.0000262005955f, + -0.0001416175057f, + -0.0002575650727f, + -0.0003730204271f, + -0.0004869490246f, + -0.0005983136178f, + -0.0007060833913f, + -0.0008092431831f, + -0.0009068027112f, + -0.0009978057260f, + -0.0010813390042f, + -0.0011565411061f, + -0.0012226108118f, + -0.0012788151601f, + -0.0013244970116f, + -0.0013590820627f, + -0.0013820852403f, + -0.0013931164108f, + -0.0013918853438f, + -0.0013782058733f, + -0.0013519992101f, + -0.0013132963596f, + -0.0012622396133f, + -0.0011990830835f, + -0.0011241922635f, + -0.0010380426004f, + -0.0009412170790f, + -0.0008344028202f, + -0.0007183867113f, + -0.0005940500874f, + -0.0004623624990f, + -0.0003243746032f, + -0.0001812102286f, + -0.0000340576689f, + 0.0001158397300f, + 0.0002671936193f, + 0.0004186812546f, + 0.0005689565779f, + 0.0007166616851f, + 0.0008604385851f, + 0.0009989411533f, + 0.0011308471768f, + 0.0012548703897f, + 0.0013697723925f, + 0.0014743743505f, + 0.0015675683649f, + 0.0016483284140f, + 0.0017157207613f, + 0.0017689137313f, + 0.0018071867586f, + 0.0018299386199f, + 0.0018366947630f, + 0.0018271136566f, + 0.0018009920869f, + 0.0017582693411f, + 0.0016990302210f, + 0.0016235068417f, + 0.0015320791808f, + 0.0014252743518f, + 0.0013037645862f, + 0.0011683639225f, + 0.0010200236060f, + 0.0008598262202f, + 0.0006889785773f, + 0.0005088034091f, + 0.0003207299089f, + 0.0001262831873f, + -0.0000729272881f, + -0.0002752201843f, + -0.0004788556370f, + -0.0006820493265f, + -0.0008829871871f, + -0.0010798406364f, + -0.0012707822026f, + -0.0014540014231f, + -0.0016277208850f, + -0.0017902122715f, + -0.0019398122798f, + -0.0020749382716f, + -0.0021941035199f, + -0.0022959319149f, + -0.0023791719963f, + -0.0024427101804f, + -0.0024855830567f, + -0.0025069886346f, + -0.0025062964261f, + -0.0024830562593f, + -0.0024370057269f, + -0.0023680761826f, + -0.0022763972095f, + -0.0021622994954f, + -0.0020263160645f, + -0.0018691818234f, + -0.0016918313969f, + -0.0014953952408f, + -0.0012811940314f, + -0.0010507313508f, + -0.0008056846932f, + -0.0005478948409f, + -0.0002793536645f, + -0.0000021904215f, + 0.0002813433620f, + 0.0005688903286f, + 0.0008580049348f, + 0.0011461721821f, + 0.0014308273011f, + 0.0017093762462f, + 0.0019792168491f, + 0.0022377604712f, + 0.0024824539913f, + 0.0027108019552f, + 0.0029203887137f, + 0.0031089003710f, + 0.0032741463650f, + 0.0034140805006f, + 0.0035268212589f, + 0.0036106712088f, + 0.0036641353518f, + 0.0036859382353f, + 0.0036750396796f, + 0.0036306489697f, + 0.0035522373756f, + 0.0034395488724f, + 0.0032926089480f, + 0.0031117313961f, + 0.0028975230072f, + 0.0026508860881f, + 0.0023730187510f, + 0.0020654129361f, + 0.0017298501434f, + 0.0013683948695f, + 0.0009833857623f, + 0.0005774245247f, + 0.0001533626145f, + -0.0002857141922f, + -0.0007365032920f, + -0.0011955046994f, + -0.0016590423288f, + -0.0021232869835f, + -0.0025842809035f, + -0.0030379637136f, + -0.0034801995974f, + -0.0039068055144f, + -0.0043135802655f, + -0.0046963342035f, + -0.0050509193789f, + -0.0053732599050f, + -0.0056593823215f, + -0.0059054457343f, + -0.0061077715081f, + -0.0062628722893f, + -0.0063674801377f, + -0.0064185735538f, + -0.0064134031881f, + -0.0063495160337f, + -0.0062247779062f, + -0.0060373940293f, + -0.0057859275562f, + -0.0054693158688f, + -0.0050868845136f, + -0.0046383586475f, + -0.0041238718858f, + -0.0035439724591f, + -0.0028996266103f, + -0.0021922191758f, + -0.0014235513217f, + -0.0005958354197f, + 0.0002883129257f, + 0.0012258856715f, + 0.0022134959000f, + 0.0032473940837f, + 0.0043234869591f, + 0.0054373588997f, + 0.0065842956603f, + 0.0077593103446f, + 0.0089571714337f, + 0.0101724326945f, + 0.0113994647757f, + 0.0126324882830f, + 0.0138656081140f, + 0.0150928488250f, + 0.0163081907913f, + 0.0175056069151f, + 0.0186790996341f, + 0.0198227379747f, + 0.0209306943985f, + 0.0219972811850f, + 0.0230169861023f, + 0.0239845071163f, + 0.0248947858968f, + 0.0257430398889f, + 0.0265247927237f, + 0.0272359027557f, + 0.0278725895284f, + 0.0284314579800f, + 0.0289095202198f, + 0.0293042147231f, + 0.0296134228075f, + 0.0298354822751f, + 0.0299691981248f, + 0.0300138502580f, + 0.0299691981248f, + 0.0298354822751f, + 0.0296134228075f, + 0.0293042147231f, + 0.0289095202198f, + 0.0284314579800f, + 0.0278725895284f, + 0.0272359027557f, + 0.0265247927237f, + 0.0257430398889f, + 0.0248947858968f, + 0.0239845071163f, + 0.0230169861023f, + 0.0219972811850f, + 0.0209306943985f, + 0.0198227379747f, + 0.0186790996341f, + 0.0175056069151f, + 0.0163081907913f, + 0.0150928488250f, + 0.0138656081140f, + 0.0126324882830f, + 0.0113994647757f, + 0.0101724326945f, + 0.0089571714337f, + 0.0077593103446f, + 0.0065842956603f, + 0.0054373588997f, + 0.0043234869591f, + 0.0032473940837f, + 0.0022134959000f, + 0.0012258856715f, + 0.0002883129257f, + -0.0005958354197f, + -0.0014235513217f, + -0.0021922191758f, + -0.0028996266103f, + -0.0035439724591f, + -0.0041238718858f, + -0.0046383586475f, + -0.0050868845136f, + -0.0054693158688f, + -0.0057859275562f, + -0.0060373940293f, + -0.0062247779062f, + -0.0063495160337f, + -0.0064134031881f, + -0.0064185735538f, + -0.0063674801377f, + -0.0062628722893f, + -0.0061077715081f, + -0.0059054457343f, + -0.0056593823215f, + -0.0053732599050f, + -0.0050509193789f, + -0.0046963342035f, + -0.0043135802655f, + -0.0039068055144f, + -0.0034801995974f, + -0.0030379637136f, + -0.0025842809035f, + -0.0021232869835f, + -0.0016590423288f, + -0.0011955046994f, + -0.0007365032920f, + -0.0002857141922f, + 0.0001533626145f, + 0.0005774245247f, + 0.0009833857623f, + 0.0013683948695f, + 0.0017298501434f, + 0.0020654129361f, + 0.0023730187510f, + 0.0026508860881f, + 0.0028975230072f, + 0.0031117313961f, + 0.0032926089480f, + 0.0034395488724f, + 0.0035522373756f, + 0.0036306489697f, + 0.0036750396796f, + 0.0036859382353f, + 0.0036641353518f, + 0.0036106712088f, + 0.0035268212589f, + 0.0034140805006f, + 0.0032741463650f, + 0.0031089003710f, + 0.0029203887137f, + 0.0027108019552f, + 0.0024824539913f, + 0.0022377604712f, + 0.0019792168491f, + 0.0017093762462f, + 0.0014308273011f, + 0.0011461721821f, + 0.0008580049348f, + 0.0005688903286f, + 0.0002813433620f, + -0.0000021904215f, + -0.0002793536645f, + -0.0005478948409f, + -0.0008056846932f, + -0.0010507313508f, + -0.0012811940314f, + -0.0014953952408f, + -0.0016918313969f, + -0.0018691818234f, + -0.0020263160645f, + -0.0021622994954f, + -0.0022763972095f, + -0.0023680761826f, + -0.0024370057269f, + -0.0024830562593f, + -0.0025062964261f, + -0.0025069886346f, + -0.0024855830567f, + -0.0024427101804f, + -0.0023791719963f, + -0.0022959319149f, + -0.0021941035199f, + -0.0020749382716f, + -0.0019398122798f, + -0.0017902122715f, + -0.0016277208850f, + -0.0014540014231f, + -0.0012707822026f, + -0.0010798406364f, + -0.0008829871871f, + -0.0006820493265f, + -0.0004788556370f, + -0.0002752201843f, + -0.0000729272881f, + 0.0001262831873f, + 0.0003207299089f, + 0.0005088034091f, + 0.0006889785773f, + 0.0008598262202f, + 0.0010200236060f, + 0.0011683639225f, + 0.0013037645862f, + 0.0014252743518f, + 0.0015320791808f, + 0.0016235068417f, + 0.0016990302210f, + 0.0017582693411f, + 0.0018009920869f, + 0.0018271136566f, + 0.0018366947630f, + 0.0018299386199f, + 0.0018071867586f, + 0.0017689137313f, + 0.0017157207613f, + 0.0016483284140f, + 0.0015675683649f, + 0.0014743743505f, + 0.0013697723925f, + 0.0012548703897f, + 0.0011308471768f, + 0.0009989411533f, + 0.0008604385851f, + 0.0007166616851f, + 0.0005689565779f, + 0.0004186812546f, + 0.0002671936193f, + 0.0001158397300f, + -0.0000340576689f, + -0.0001812102286f, + -0.0003243746032f, + -0.0004623624990f, + -0.0005940500874f, + -0.0007183867113f, + -0.0008344028202f, + -0.0009412170790f, + -0.0010380426004f, + -0.0011241922635f, + -0.0011990830835f, + -0.0012622396133f, + -0.0013132963596f, + -0.0013519992101f, + -0.0013782058733f, + -0.0013918853438f, + -0.0013931164108f, + -0.0013820852403f, + -0.0013590820627f, + -0.0013244970116f, + -0.0012788151601f, + -0.0012226108118f, + -0.0011565411061f, + -0.0010813390042f, + -0.0009978057260f, + -0.0009068027112f, + -0.0008092431831f, + -0.0007060833913f, + -0.0005983136178f, + -0.0004869490246f, + -0.0003730204271f, + -0.0002575650727f, + -0.0001416175057f, + -0.0000262005955f, + 0.0000876831956f, + 0.0001990602342f, + 0.0003069937573f, + 0.0004105914704f, + 0.0005090126426f, + 0.0006014746453f, + 0.0006872588853f, + 0.0007657160900f, + 0.0008362709091f, + 0.0008984258034f, + 0.0009517641963f, + 0.0009959528728f, + 0.0010307436170f, + 0.0010559740836f, + 0.0010715679088f, + 0.0010775340714f, + 0.0010739655188f, + 0.0010610370839f, + 0.0010390027190f, + 0.0010081920830f, + 0.0009690065202f, + 0.0009219144750f, + 0.0008674463921f, + 0.0008061891518f, + 0.0007387800990f, + 0.0006659007212f, + 0.0005882700376f, + 0.0005066377605f, + 0.0004217772924f, + 0.0003344786214f, + 0.0002455411796f, + 0.0001557667262f, + 0.0000659523175f, + -0.0000231165764f, + -0.0001106727507f, + -0.0001959736845f, + -0.0002783076491f, + -0.0003569994547f, + -0.0004314157931f, + -0.0005009701345f, + -0.0005651271432f, + -0.0006234065804f, + -0.0006753866683f, + -0.0007207068934f, + -0.0007590702339f, + -0.0007902448005f, + -0.0008140648836f, + -0.0008304314087f, + -0.0008393118036f, + -0.0008407392879f, + -0.0008348115993f, + -0.0008216891766f, + -0.0008015928239f, + -0.0007748008827f, + -0.0007416459455f, + -0.0007025111454f, + -0.0006578260616f, + -0.0006080622805f, + -0.0005537286580f, + -0.0004953663284f, + -0.0004335435059f, + -0.0003688501294f, + -0.0003018923975f, + -0.0002332872451f, + -0.0001636568079f, + -0.0000936229265f, + -0.0000238017346f, + 0.0000452016213f, + 0.0001127980870f, + 0.0001784195887f, + 0.0002415236649f, + 0.0003015978052f, + 0.0003581634636f, + 0.0004107797148f, + 0.0004590465283f, + 0.0005026076371f, + 0.0005411529820f, + 0.0005744207175f, + 0.0006021987666f, + 0.0006243259206f, + 0.0006406924783f, + 0.0006512404284f, + 0.0006559631794f, + 0.0006549048458f, + 0.0006481591046f, + 0.0006358676383f, + 0.0006182181836f, + 0.0005954422100f, + 0.0005678122527f, + 0.0005356389296f, + 0.0004992676723f, + 0.0004590752048f, + 0.0004154658029f, + 0.0003688673719f, + 0.0003197273785f, + 0.0002685086744f, + 0.0002156852502f, + 0.0001617379566f, + 0.0001071502323f, + 0.0000524038732f, + -0.0000020251190f, + -0.0000556705748f, + -0.0001080800484f, + -0.0001588185305f, + -0.0002074719536f, + -0.0002536504622f, + -0.0002969914239f, + -0.0003371621574f, + -0.0003738623613f, + -0.0004068262238f, + -0.0004358242025f, + -0.0004606644634f, + -0.0004811939705f, + -0.0004972992247f, + -0.0005089066484f, + -0.0005159826200f, + -0.0005185331617f, + -0.0005166032906f, + -0.0005102760424f, + -0.0004996711823f, + -0.0004849436183f, + -0.0004662815362f, + -0.0004439042760f, + -0.0004180599723f, + -0.0003890229831f, + -0.0003570911325f, + -0.0003225827932f, + -0.0002858338377f, + -0.0002471944859f, + -0.0002070260772f, + -0.0001656977983f, + -0.0001235833928f, + -0.0000810578837f, + -0.0000384943344f, + 0.0000037393217f, + 0.0000452833598f, + 0.0000857892233f, + 0.0001249223415f, + 0.0001623647845f, + 0.0001978177334f, + 0.0002310037485f, + 0.0002616688194f, + 0.0002895841828f, + 0.0003145478953f, + 0.0003363861529f, + 0.0003549543498f, + 0.0003701378703f, + 0.0003818526131f, + 0.0003900452468f, + 0.0003946931989f, + 0.0003958043827f, + 0.0003934166692f, + 0.0003875971118f, + 0.0003784409347f, + 0.0003660702983f, + 0.0003506328541f, + 0.0003323001063f, + 0.0003112655965f, + 0.0002877429300f, + 0.0002619636629f, + 0.0002341750699f, + 0.0002046378152f, + 0.0001736235455f, + 0.0001414124288f, + 0.0001082906593f, + 0.0000745479515f, + 0.0000404750427f, + 0.0000063612278f, + -0.0000275080565f, + -0.0000608535759f, + -0.0000934045545f, + -0.0001249008236f, + -0.0001550948484f, + -0.0001837536163f, + -0.0002106603742f, + -0.0002356162023f, + -0.0002584414148f, + -0.0002789767769f, + -0.0002970845330f, + -0.0003126492400f, + -0.0003255784014f, + -0.0003358029014f, + -0.0003432772379f, + -0.0003479795568f, + -0.0003499114897f, + -0.0003490978007f, + -0.0003455858480f, + -0.0003394448683f, + -0.0003307650922f, + -0.0003196567027f, + -0.0003062486452f, + -0.0002906873051f, + -0.0002731350628f, + -0.0002537687424f, + -0.0002327779678f, + -0.0002103634419f, + -0.0001867351629f, + -0.0001621105962f, + -0.0001367128149f, + -0.0001107686256f, + -0.0000845066962f, + -0.0000581556992f, + -0.0000319424858f, + -0.0000060903059f, + 0.0000191829133f, + 0.0000436662173f, + 0.0000671571903f, + 0.0000894634263f, + 0.0001104038960f, + 0.0001298101992f, + 0.0001475276961f, + 0.0001634165101f, + 0.0001773523961f, + 0.0001892274713f, + 0.0001989508042f, + 0.0002064488603f, + 0.0002116658040f, + 0.0002145636574f, + 0.0002151223160f, + 0.0002133394270f, + 0.0002092301313f, + 0.0002028266752f, + 0.0001941778982f, + 0.0001833486017f, + 0.0001704188086f, + 0.0001554829191f, + 0.0001386487747f, + 0.0001200366365f, + 0.0000997780906f, + 0.0000780148883f, + 0.0000548977338f, + 0.0000305850284f, + 0.0000052415821f, + -0.0000209626947f, + -0.0000478541121f, + -0.0000752565205f, + -0.0001029926207f, + -0.0001308852545f, + -0.0001587586656f, + -0.0001864397218f, + -0.0002137590910f, + -0.0002405523614f, + -0.0002666611005f, + -0.0002919338447f, + -0.0003162270149f, + -0.0003394057517f, + -0.0003613446675f, + -0.0003819285099f, + -0.0004010527353f, + -0.0004186239903f, + -0.0004345604987f, + -0.0004487923547f, + -0.0004612617230f, + -0.0004719229454f, + -0.0004807425563f, + -0.0004876992105f, + -0.0004927835248f, + -0.0004959978377f, + -0.0004973558920f, + -0.0004968824437f, + -0.0004946128030f, + -0.0004905923132f, + -0.0004848757728f, + -0.0004775268066f, + -0.0004686171928f, + -0.0004582261523f, + -0.0004464396065f, + -0.0004333494098f, + -0.0004190525651f, + -0.0004036504263f, + -0.0003872478959f, + -0.0003699526238f, + -0.0003518742125f, + -0.0003331234349f, + -0.0003138114702f, + -0.0002940491630f, + -0.0002739463104f, + -0.0002536109811f, + -0.0002331488711f, + -0.0002126626991f, + -0.0001922516448f, + -0.0001720108329f, + -0.0001520308649f, + -0.0001323974004f, + -0.0001131907895f, + -0.0000944857564f, + -0.0000763511359f, + -0.0000588496612f, + -0.0000420378042f, + -0.0000259656655f, + -0.0000106769153f, + 0.0000037912184f, + 0.0000174079151f, + 0.0000301486828f, + 0.0000419952383f, + 0.0000529353467f, + 0.0000629626269f, + 0.0000720763221f, + 0.0000802810417f, + 0.0000875864757f, + 0.0000940070861f, + 0.0000995617786f, + 0.0001042735572f, + 0.0001081691663f, + 0.0001112787225f, + 0.0001136353405f, + 0.0001152747551f, + 0.0001162349436f, + 0.0001165557502f, + 0.0001162785168f, + 0.0001154457210f, + 0.0001141006252f, + 0.0001122869384f, + 0.0001100484926f, + 0.0001074289359f, + 0.0001044714435f, + 0.0001012184487f, + 0.0000977113936f, + 0.0000939905024f, + 0.0000900945758f, + 0.0000860608088f, + 0.0000819246310f, + 0.0000777195696f, + 0.0000734771355f, + 0.0000692267316f, + 0.0000649955829f, + 0.0000608086879f, + 0.0000566887903f, + 0.0000526563699f, + 0.0000487296525f, + 0.0000449246363f, + 0.0000412551345f, + 0.0000377328326f, + 0.0000343673588f, + 0.0000311663665f, + 0.0000281356268f, + 0.0000252791303f, + 0.0000225991964f, + 0.0000200965883f, + 0.0000177706336f, + 0.0000156193469f, + 0.0000136395560f, + 0.0000118270277f, + 0.0000101765938f, + 0.0000086822757f, + 0.0000073374059f, + 0.0000061347473f, + 0.0000050666069f, + 0.0000041249453f, + 0.0000033014804f, + 0.0000064425788f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_32_4.h b/core/src/dsp/multirate/.old_decim/taps/fir_32_4.h new file mode 100644 index 0000000..6fd3fa8 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_32_4.h @@ -0,0 +1,29 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_4_len = 17; + const float fir_32_4_taps[] = { + 0.0002602343386f, + 0.0019197560804f, + 0.0076270554566f, + 0.0212647832351f, + 0.0459374309886f, + 0.0808345515056f, + 0.1191594258092f, + 0.1495554802033f, + 0.1611781123721f, + 0.1495554802033f, + 0.1191594258092f, + 0.0808345515056f, + 0.0459374309886f, + 0.0212647832351f, + 0.0076270554566f, + 0.0019197560804f, + 0.0002602343386f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_32_8.h b/core/src/dsp/multirate/.old_decim/taps/fir_32_8.h new file mode 100644 index 0000000..25f8c42 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_32_8.h @@ -0,0 +1,57 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_8_len = 45; + const float fir_32_8_taps[] = { + -0.0000309582228f, + -0.0001079580167f, + -0.0002728448293f, + -0.0005651806741f, + -0.0010146553103f, + -0.0016201042973f, + -0.0023253502129f, + -0.0029961993139f, + -0.0034054389929f, + -0.0032331082459f, + -0.0020878393215f, + 0.0004484139474f, + 0.0047549865150f, + 0.0110947837587f, + 0.0195373899494f, + 0.0298988087157f, + 0.0417130694495f, + 0.0542467727184f, + 0.0665603957204f, + 0.0776111715593f, + 0.0863835049898f, + 0.0920262381310f, + 0.0939733024676f, + 0.0920262381310f, + 0.0863835049898f, + 0.0776111715593f, + 0.0665603957204f, + 0.0542467727184f, + 0.0417130694495f, + 0.0298988087157f, + 0.0195373899494f, + 0.0110947837587f, + 0.0047549865150f, + 0.0004484139474f, + -0.0020878393215f, + -0.0032331082459f, + -0.0034054389929f, + -0.0029961993139f, + -0.0023253502129f, + -0.0016201042973f, + -0.0010146553103f, + -0.0005651806741f, + -0.0002728448293f, + -0.0001079580167f, + -0.0000309582228f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_4096_128.h b/core/src/dsp/multirate/.old_decim/taps/fir_4096_128.h new file mode 100644 index 0000000..d330868 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_4096_128.h @@ -0,0 +1,699 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_4096_128_len = 687; + const float fir_4096_128_taps[] = { + -0.0000001853079f, + -0.0000000346264f, + -0.0000000376411f, + -0.0000000406683f, + -0.0000000436847f, + -0.0000000466640f, + -0.0000000495767f, + -0.0000000523896f, + -0.0000000550661f, + -0.0000000575654f, + -0.0000000598428f, + -0.0000000618489f, + -0.0000000635299f, + -0.0000000648269f, + -0.0000000656757f, + -0.0000000660068f, + -0.0000000657448f, + -0.0000000648081f, + -0.0000000631089f, + -0.0000000605524f, + -0.0000000570369f, + -0.0000000524531f, + -0.0000000466841f, + -0.0000000396046f, + -0.0000000310810f, + -0.0000000209706f, + -0.0000000091215f, + 0.0000000046280f, + 0.0000000204496f, + 0.0000000385257f, + 0.0000000590497f, + 0.0000000822264f, + 0.0000001082725f, + 0.0000001374170f, + 0.0000001699018f, + 0.0000002059821f, + 0.0000002459268f, + 0.0000002900194f, + 0.0000003385579f, + 0.0000003918557f, + 0.0000004502420f, + 0.0000005140626f, + 0.0000005836800f, + 0.0000006594741f, + 0.0000007418430f, + 0.0000008312033f, + 0.0000009279907f, + 0.0000010326607f, + 0.0000011456888f, + 0.0000012675717f, + 0.0000013988273f, + 0.0000015399957f, + 0.0000016916395f, + 0.0000018543446f, + 0.0000020287205f, + 0.0000022154015f, + 0.0000024150466f, + 0.0000026283404f, + 0.0000028559940f, + 0.0000030987450f, + 0.0000033573588f, + 0.0000036326283f, + 0.0000039253756f, + 0.0000042364515f, + 0.0000045667370f, + 0.0000049171433f, + 0.0000052886125f, + 0.0000056821186f, + 0.0000060986673f, + 0.0000065392974f, + 0.0000070050805f, + 0.0000074971223f, + 0.0000080165629f, + 0.0000085645769f, + 0.0000091423747f, + 0.0000097512023f, + 0.0000103923421f, + 0.0000110671135f, + 0.0000117768730f, + 0.0000125230151f, + 0.0000133069722f, + 0.0000141302156f, + 0.0000149942554f, + 0.0000159006412f, + 0.0000168509623f, + 0.0000178468480f, + 0.0000188899682f, + 0.0000199820332f, + 0.0000211247945f, + 0.0000223200446f, + 0.0000235696176f, + 0.0000248753891f, + 0.0000262392764f, + 0.0000276632389f, + 0.0000291492778f, + 0.0000306994366f, + 0.0000323158008f, + 0.0000340004981f, + 0.0000357556983f, + 0.0000375836134f, + 0.0000394864972f, + 0.0000414666457f, + 0.0000435263962f, + 0.0000456681279f, + 0.0000478942611f, + 0.0000502072572f, + 0.0000526096182f, + 0.0000551038867f, + 0.0000576926449f, + 0.0000603785150f, + 0.0000631641580f, + 0.0000660522733f, + 0.0000690455987f, + 0.0000721469091f, + 0.0000753590162f, + 0.0000786847678f, + 0.0000821270469f, + 0.0000856887711f, + 0.0000893728917f, + 0.0000931823927f, + 0.0000971202902f, + 0.0001011896310f, + 0.0001053934918f, + 0.0001097349782f, + 0.0001142172235f, + 0.0001188433875f, + 0.0001236166552f, + 0.0001285402359f, + 0.0001336173613f, + 0.0001388512848f, + 0.0001442452795f, + 0.0001498026371f, + 0.0001555266664f, + 0.0001614206914f, + 0.0001674880501f, + 0.0001737320925f, + 0.0001801561792f, + 0.0001867636795f, + 0.0001935579694f, + 0.0002005424304f, + 0.0002077204468f, + 0.0002150954042f, + 0.0002226706877f, + 0.0002304496792f, + 0.0002384357564f, + 0.0002466322894f, + 0.0002550426396f, + 0.0002636701572f, + 0.0002725181784f, + 0.0002815900242f, + 0.0002908889972f, + 0.0003004183794f, + 0.0003101814303f, + 0.0003201813839f, + 0.0003304214468f, + 0.0003409047951f, + 0.0003516345723f, + 0.0003626138868f, + 0.0003738458092f, + 0.0003853333694f, + 0.0003970795547f, + 0.0004090873065f, + 0.0004213595178f, + 0.0004338990308f, + 0.0004467086339f, + 0.0004597910591f, + 0.0004731489791f, + 0.0004867850049f, + 0.0005007016827f, + 0.0005149014913f, + 0.0005293868393f, + 0.0005441600623f, + 0.0005592234204f, + 0.0005745790947f, + 0.0005902291855f, + 0.0006061757086f, + 0.0006224205933f, + 0.0006389656791f, + 0.0006558127133f, + 0.0006729633479f, + 0.0006904191373f, + 0.0007081815354f, + 0.0007262518929f, + 0.0007446314546f, + 0.0007633213568f, + 0.0007823226250f, + 0.0008016361709f, + 0.0008212627897f, + 0.0008412031585f, + 0.0008614578327f, + 0.0008820272443f, + 0.0009029116994f, + 0.0009241113755f, + 0.0009456263198f, + 0.0009674564462f, + 0.0009896015337f, + 0.0010120612242f, + 0.0010348350198f, + 0.0010579222817f, + 0.0010813222275f, + 0.0011050339296f, + 0.0011290563132f, + 0.0011533881548f, + 0.0011780280801f, + 0.0012029745628f, + 0.0012282259227f, + 0.0012537803242f, + 0.0012796357754f, + 0.0013057901260f, + 0.0013322410668f, + 0.0013589861279f, + 0.0013860226783f, + 0.0014133479243f, + 0.0014409589089f, + 0.0014688525111f, + 0.0014970254450f, + 0.0015254742592f, + 0.0015541953364f, + 0.0015831848930f, + 0.0016124389787f, + 0.0016419534764f, + 0.0016717241017f, + 0.0017017464036f, + 0.0017320157641f, + 0.0017625273983f, + 0.0017932763553f, + 0.0018242575180f, + 0.0018554656041f, + 0.0018868951663f, + 0.0019185405936f, + 0.0019503961118f, + 0.0019824557844f, + 0.0020147135141f, + 0.0020471630437f, + 0.0020797979574f, + 0.0021126116823f, + 0.0021455974903f, + 0.0021787484991f, + 0.0022120576745f, + 0.0022455178321f, + 0.0022791216394f, + 0.0023128616177f, + 0.0023467301445f, + 0.0023807194560f, + 0.0024148216493f, + 0.0024490286850f, + 0.0024833323899f, + 0.0025177244601f, + 0.0025521964633f, + 0.0025867398422f, + 0.0026213459177f, + 0.0026560058918f, + 0.0026907108512f, + 0.0027254517703f, + 0.0027602195153f, + 0.0027950048475f, + 0.0028297984269f, + 0.0028645908163f, + 0.0028993724850f, + 0.0029341338127f, + 0.0029688650939f, + 0.0030035565421f, + 0.0030381982934f, + 0.0030727804117f, + 0.0031072928924f, + 0.0031417256676f, + 0.0031760686099f, + 0.0032103115375f, + 0.0032444442190f, + 0.0032784563779f, + 0.0033123376974f, + 0.0033460778257f, + 0.0033796663804f, + 0.0034130929541f, + 0.0034463471189f, + 0.0034794184319f, + 0.0035122964401f, + 0.0035449706860f, + 0.0035774307122f, + 0.0036096660671f, + 0.0036416663102f, + 0.0036734210173f, + 0.0037049197858f, + 0.0037361522402f, + 0.0037671080372f, + 0.0037977768717f, + 0.0038281484815f, + 0.0038582126530f, + 0.0038879592268f, + 0.0039173781029f, + 0.0039464592460f, + 0.0039751926911f, + 0.0040035685488f, + 0.0040315770105f, + 0.0040592083542f, + 0.0040864529492f, + 0.0041133012618f, + 0.0041397438603f, + 0.0041657714205f, + 0.0041913747306f, + 0.0042165446965f, + 0.0042412723466f, + 0.0042655488373f, + 0.0042893654574f, + 0.0043127136335f, + 0.0043355849347f, + 0.0043579710770f, + 0.0043798639286f, + 0.0044012555142f, + 0.0044221380197f, + 0.0044425037963f, + 0.0044623453655f, + 0.0044816554230f, + 0.0045004268430f, + 0.0045186526821f, + 0.0045363261840f, + 0.0045534407824f, + 0.0045699901059f, + 0.0045859679809f, + 0.0046013684356f, + 0.0046161857032f, + 0.0046304142258f, + 0.0046440486570f, + 0.0046570838656f, + 0.0046695149383f, + 0.0046813371826f, + 0.0046925461296f, + 0.0047031375370f, + 0.0047131073910f, + 0.0047224519091f, + 0.0047311675420f, + 0.0047392509762f, + 0.0047466991355f, + 0.0047535091831f, + 0.0047596785231f, + 0.0047652048022f, + 0.0047700859110f, + 0.0047743199853f, + 0.0047779054073f, + 0.0047808408063f, + 0.0047831250597f, + 0.0047847572939f, + 0.0047857368844f, + 0.0047860634562f, + 0.0047857368844f, + 0.0047847572939f, + 0.0047831250597f, + 0.0047808408063f, + 0.0047779054073f, + 0.0047743199853f, + 0.0047700859110f, + 0.0047652048022f, + 0.0047596785231f, + 0.0047535091831f, + 0.0047466991355f, + 0.0047392509762f, + 0.0047311675420f, + 0.0047224519091f, + 0.0047131073910f, + 0.0047031375370f, + 0.0046925461296f, + 0.0046813371826f, + 0.0046695149383f, + 0.0046570838656f, + 0.0046440486570f, + 0.0046304142258f, + 0.0046161857032f, + 0.0046013684356f, + 0.0045859679809f, + 0.0045699901059f, + 0.0045534407824f, + 0.0045363261840f, + 0.0045186526821f, + 0.0045004268430f, + 0.0044816554230f, + 0.0044623453655f, + 0.0044425037963f, + 0.0044221380197f, + 0.0044012555142f, + 0.0043798639286f, + 0.0043579710770f, + 0.0043355849347f, + 0.0043127136335f, + 0.0042893654574f, + 0.0042655488373f, + 0.0042412723466f, + 0.0042165446965f, + 0.0041913747306f, + 0.0041657714205f, + 0.0041397438603f, + 0.0041133012618f, + 0.0040864529492f, + 0.0040592083542f, + 0.0040315770105f, + 0.0040035685488f, + 0.0039751926911f, + 0.0039464592460f, + 0.0039173781029f, + 0.0038879592268f, + 0.0038582126530f, + 0.0038281484815f, + 0.0037977768717f, + 0.0037671080372f, + 0.0037361522402f, + 0.0037049197858f, + 0.0036734210173f, + 0.0036416663102f, + 0.0036096660671f, + 0.0035774307122f, + 0.0035449706860f, + 0.0035122964401f, + 0.0034794184319f, + 0.0034463471189f, + 0.0034130929541f, + 0.0033796663804f, + 0.0033460778257f, + 0.0033123376974f, + 0.0032784563779f, + 0.0032444442190f, + 0.0032103115375f, + 0.0031760686099f, + 0.0031417256676f, + 0.0031072928924f, + 0.0030727804117f, + 0.0030381982934f, + 0.0030035565421f, + 0.0029688650939f, + 0.0029341338127f, + 0.0028993724850f, + 0.0028645908163f, + 0.0028297984269f, + 0.0027950048475f, + 0.0027602195153f, + 0.0027254517703f, + 0.0026907108512f, + 0.0026560058918f, + 0.0026213459177f, + 0.0025867398422f, + 0.0025521964633f, + 0.0025177244601f, + 0.0024833323899f, + 0.0024490286850f, + 0.0024148216493f, + 0.0023807194560f, + 0.0023467301445f, + 0.0023128616177f, + 0.0022791216394f, + 0.0022455178321f, + 0.0022120576745f, + 0.0021787484991f, + 0.0021455974903f, + 0.0021126116823f, + 0.0020797979574f, + 0.0020471630437f, + 0.0020147135141f, + 0.0019824557844f, + 0.0019503961118f, + 0.0019185405936f, + 0.0018868951663f, + 0.0018554656041f, + 0.0018242575180f, + 0.0017932763553f, + 0.0017625273983f, + 0.0017320157641f, + 0.0017017464036f, + 0.0016717241017f, + 0.0016419534764f, + 0.0016124389787f, + 0.0015831848930f, + 0.0015541953364f, + 0.0015254742592f, + 0.0014970254450f, + 0.0014688525111f, + 0.0014409589089f, + 0.0014133479243f, + 0.0013860226783f, + 0.0013589861279f, + 0.0013322410668f, + 0.0013057901260f, + 0.0012796357754f, + 0.0012537803242f, + 0.0012282259227f, + 0.0012029745628f, + 0.0011780280801f, + 0.0011533881548f, + 0.0011290563132f, + 0.0011050339296f, + 0.0010813222275f, + 0.0010579222817f, + 0.0010348350198f, + 0.0010120612242f, + 0.0009896015337f, + 0.0009674564462f, + 0.0009456263198f, + 0.0009241113755f, + 0.0009029116994f, + 0.0008820272443f, + 0.0008614578327f, + 0.0008412031585f, + 0.0008212627897f, + 0.0008016361709f, + 0.0007823226250f, + 0.0007633213568f, + 0.0007446314546f, + 0.0007262518929f, + 0.0007081815354f, + 0.0006904191373f, + 0.0006729633479f, + 0.0006558127133f, + 0.0006389656791f, + 0.0006224205933f, + 0.0006061757086f, + 0.0005902291855f, + 0.0005745790947f, + 0.0005592234204f, + 0.0005441600623f, + 0.0005293868393f, + 0.0005149014913f, + 0.0005007016827f, + 0.0004867850049f, + 0.0004731489791f, + 0.0004597910591f, + 0.0004467086339f, + 0.0004338990308f, + 0.0004213595178f, + 0.0004090873065f, + 0.0003970795547f, + 0.0003853333694f, + 0.0003738458092f, + 0.0003626138868f, + 0.0003516345723f, + 0.0003409047951f, + 0.0003304214468f, + 0.0003201813839f, + 0.0003101814303f, + 0.0003004183794f, + 0.0002908889972f, + 0.0002815900242f, + 0.0002725181784f, + 0.0002636701572f, + 0.0002550426396f, + 0.0002466322894f, + 0.0002384357564f, + 0.0002304496792f, + 0.0002226706877f, + 0.0002150954042f, + 0.0002077204468f, + 0.0002005424304f, + 0.0001935579694f, + 0.0001867636795f, + 0.0001801561792f, + 0.0001737320925f, + 0.0001674880501f, + 0.0001614206914f, + 0.0001555266664f, + 0.0001498026371f, + 0.0001442452795f, + 0.0001388512848f, + 0.0001336173613f, + 0.0001285402359f, + 0.0001236166552f, + 0.0001188433875f, + 0.0001142172235f, + 0.0001097349782f, + 0.0001053934918f, + 0.0001011896310f, + 0.0000971202902f, + 0.0000931823927f, + 0.0000893728917f, + 0.0000856887711f, + 0.0000821270469f, + 0.0000786847678f, + 0.0000753590162f, + 0.0000721469091f, + 0.0000690455987f, + 0.0000660522733f, + 0.0000631641580f, + 0.0000603785150f, + 0.0000576926449f, + 0.0000551038867f, + 0.0000526096182f, + 0.0000502072572f, + 0.0000478942611f, + 0.0000456681279f, + 0.0000435263962f, + 0.0000414666457f, + 0.0000394864972f, + 0.0000375836134f, + 0.0000357556983f, + 0.0000340004981f, + 0.0000323158008f, + 0.0000306994366f, + 0.0000291492778f, + 0.0000276632389f, + 0.0000262392764f, + 0.0000248753891f, + 0.0000235696176f, + 0.0000223200446f, + 0.0000211247945f, + 0.0000199820332f, + 0.0000188899682f, + 0.0000178468480f, + 0.0000168509623f, + 0.0000159006412f, + 0.0000149942554f, + 0.0000141302156f, + 0.0000133069722f, + 0.0000125230151f, + 0.0000117768730f, + 0.0000110671135f, + 0.0000103923421f, + 0.0000097512023f, + 0.0000091423747f, + 0.0000085645769f, + 0.0000080165629f, + 0.0000074971223f, + 0.0000070050805f, + 0.0000065392974f, + 0.0000060986673f, + 0.0000056821186f, + 0.0000052886125f, + 0.0000049171433f, + 0.0000045667370f, + 0.0000042364515f, + 0.0000039253756f, + 0.0000036326283f, + 0.0000033573588f, + 0.0000030987450f, + 0.0000028559940f, + 0.0000026283404f, + 0.0000024150466f, + 0.0000022154015f, + 0.0000020287205f, + 0.0000018543446f, + 0.0000016916395f, + 0.0000015399957f, + 0.0000013988273f, + 0.0000012675717f, + 0.0000011456888f, + 0.0000010326607f, + 0.0000009279907f, + 0.0000008312033f, + 0.0000007418430f, + 0.0000006594741f, + 0.0000005836800f, + 0.0000005140626f, + 0.0000004502420f, + 0.0000003918557f, + 0.0000003385579f, + 0.0000002900194f, + 0.0000002459268f, + 0.0000002059821f, + 0.0000001699018f, + 0.0000001374170f, + 0.0000001082725f, + 0.0000000822264f, + 0.0000000590497f, + 0.0000000385257f, + 0.0000000204496f, + 0.0000000046280f, + -0.0000000091215f, + -0.0000000209706f, + -0.0000000310810f, + -0.0000000396046f, + -0.0000000466841f, + -0.0000000524531f, + -0.0000000570369f, + -0.0000000605524f, + -0.0000000631089f, + -0.0000000648081f, + -0.0000000657448f, + -0.0000000660068f, + -0.0000000656757f, + -0.0000000648269f, + -0.0000000635299f, + -0.0000000618489f, + -0.0000000598428f, + -0.0000000575654f, + -0.0000000550661f, + -0.0000000523896f, + -0.0000000495767f, + -0.0000000466640f, + -0.0000000436847f, + -0.0000000406683f, + -0.0000000376411f, + -0.0000000346264f, + -0.0000001853079f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_4_2.h b/core/src/dsp/multirate/.old_decim/taps/fir_4_2.h new file mode 100644 index 0000000..530dab6 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_4_2.h @@ -0,0 +1,27 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_4_2_len = 15; + const float fir_4_2_taps[] = { + 0.0021282968604f, + 0.0076473554450f, + 0.0006460703751f, + -0.0368053147543f, + -0.0516552094180f, + 0.0659607033051f, + 0.2951835298658f, + 0.4189947458581f, + 0.2951835298658f, + 0.0659607033051f, + -0.0516552094180f, + -0.0368053147543f, + 0.0006460703751f, + 0.0076473554450f, + 0.0021282968604f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_4_4.h b/core/src/dsp/multirate/.old_decim/taps/fir_4_4.h new file mode 100644 index 0000000..67dfa9d --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_4_4.h @@ -0,0 +1,151 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_4_4_len = 139; + const float fir_4_4_taps[] = { + 0.0000421670468f, + 0.0001624808733f, + 0.0004134748309f, + 0.0008154887363f, + 0.0013234848969f, + 0.0018039325195f, + 0.0020508055942f, + 0.0018514767578f, + 0.0010883586950f, + -0.0001655988021f, + -0.0016128396844f, + -0.0027991727988f, + -0.0032807371963f, + -0.0028309298807f, + -0.0015892963679f, + -0.0000601423367f, + 0.0010721577127f, + 0.0012520595571f, + 0.0003467812959f, + -0.0012334913120f, + -0.0026828654998f, + -0.0031783401077f, + -0.0023201194397f, + -0.0004020929064f, + 0.0016614376925f, + 0.0027617271233f, + 0.0021869815035f, + 0.0000713073547f, + -0.0025708936840f, + -0.0043015122742f, + -0.0040150945520f, + -0.0016068800323f, + 0.0018386741176f, + 0.0045100483540f, + 0.0048045475259f, + 0.0022668636218f, + -0.0020047039996f, + -0.0057855488980f, + -0.0068496560241f, + -0.0042397202795f, + 0.0010243185376f, + 0.0062751930360f, + 0.0085115122341f, + 0.0060706031243f, + -0.0002476114409f, + -0.0073175117999f, + -0.0111703368494f, + -0.0091526981761f, + -0.0016211575907f, + 0.0078514356977f, + 0.0140732387192f, + 0.0129726920823f, + 0.0040874732850f, + -0.0086349542834f, + -0.0184139640743f, + -0.0190500116861f, + -0.0085456264258f, + 0.0090399664680f, + 0.0247932831806f, + 0.0290341811985f, + 0.0165603631688f, + -0.0095223462745f, + -0.0375695624710f, + -0.0514111407319f, + -0.0372217902165f, + 0.0096794936561f, + 0.0812862136678f, + 0.1585522999585f, + 0.2179171693939f, + 0.2401648350457f, + 0.2179171693939f, + 0.1585522999585f, + 0.0812862136678f, + 0.0096794936561f, + -0.0372217902165f, + -0.0514111407319f, + -0.0375695624710f, + -0.0095223462745f, + 0.0165603631688f, + 0.0290341811985f, + 0.0247932831806f, + 0.0090399664680f, + -0.0085456264258f, + -0.0190500116861f, + -0.0184139640743f, + -0.0086349542834f, + 0.0040874732850f, + 0.0129726920823f, + 0.0140732387192f, + 0.0078514356977f, + -0.0016211575907f, + -0.0091526981761f, + -0.0111703368494f, + -0.0073175117999f, + -0.0002476114409f, + 0.0060706031243f, + 0.0085115122341f, + 0.0062751930360f, + 0.0010243185376f, + -0.0042397202795f, + -0.0068496560241f, + -0.0057855488980f, + -0.0020047039996f, + 0.0022668636218f, + 0.0048045475259f, + 0.0045100483540f, + 0.0018386741176f, + -0.0016068800323f, + -0.0040150945520f, + -0.0043015122742f, + -0.0025708936840f, + 0.0000713073547f, + 0.0021869815035f, + 0.0027617271233f, + 0.0016614376925f, + -0.0004020929064f, + -0.0023201194397f, + -0.0031783401077f, + -0.0026828654998f, + -0.0012334913120f, + 0.0003467812959f, + 0.0012520595571f, + 0.0010721577127f, + -0.0000601423367f, + -0.0015892963679f, + -0.0028309298807f, + -0.0032807371963f, + -0.0027991727988f, + -0.0016128396844f, + -0.0001655988021f, + 0.0010883586950f, + 0.0018514767578f, + 0.0020508055942f, + 0.0018039325195f, + 0.0013234848969f, + 0.0008154887363f, + 0.0004134748309f, + 0.0001624808733f, + 0.0000421670468f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_512_128.h b/core/src/dsp/multirate/.old_decim/taps/fir_512_128.h new file mode 100644 index 0000000..e566c88 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_512_128.h @@ -0,0 +1,723 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_128_len = 711; + const float fir_512_128_taps[] = { + -0.0000055896992f, + -0.0000013001543f, + -0.0000014502329f, + -0.0000016110215f, + -0.0000017829984f, + -0.0000019666521f, + -0.0000021624812f, + -0.0000023709942f, + -0.0000025927091f, + -0.0000028281532f, + -0.0000030778629f, + -0.0000033423834f, + -0.0000036222682f, + -0.0000039180789f, + -0.0000042303847f, + -0.0000045597620f, + -0.0000049067942f, + -0.0000052720710f, + -0.0000056561877f, + -0.0000060597452f, + -0.0000064833493f, + -0.0000069276099f, + -0.0000073931405f, + -0.0000078805577f, + -0.0000083904807f, + -0.0000089235302f, + -0.0000094803279f, + -0.0000100614958f, + -0.0000106676557f, + -0.0000112994278f, + -0.0000119574304f, + -0.0000126422788f, + -0.0000133545848f, + -0.0000140949552f, + -0.0000148639914f, + -0.0000156622882f, + -0.0000164904329f, + -0.0000173490044f, + -0.0000182385717f, + -0.0000191596936f, + -0.0000201129171f, + -0.0000210987761f, + -0.0000221177911f, + -0.0000231704670f, + -0.0000242572927f, + -0.0000253787397f, + -0.0000265352606f, + -0.0000277272881f, + -0.0000289552338f, + -0.0000302194865f, + -0.0000315204114f, + -0.0000328583485f, + -0.0000342336112f, + -0.0000356464850f, + -0.0000370972263f, + -0.0000385860605f, + -0.0000401131811f, + -0.0000416787480f, + -0.0000432828861f, + -0.0000449256839f, + -0.0000466071919f, + -0.0000483274213f, + -0.0000500863422f, + -0.0000518838825f, + -0.0000537199261f, + -0.0000555943117f, + -0.0000575068307f, + -0.0000594572265f, + -0.0000614451922f, + -0.0000634703697f, + -0.0000655323476f, + -0.0000676306604f, + -0.0000697647864f, + -0.0000719341464f, + -0.0000741381022f, + -0.0000763759553f, + -0.0000786469450f, + -0.0000809502475f, + -0.0000832849740f, + -0.0000856501695f, + -0.0000880448112f, + -0.0000904678075f, + -0.0000929179961f, + -0.0000953941432f, + -0.0000978949415f, + -0.0001004190099f, + -0.0001029648911f, + -0.0001055310512f, + -0.0001081158783f, + -0.0001107176810f, + -0.0001133346877f, + -0.0001159650452f, + -0.0001186068179f, + -0.0001212579865f, + -0.0001239164473f, + -0.0001265800111f, + -0.0001292464023f, + -0.0001319132583f, + -0.0001345781284f, + -0.0001372384734f, + -0.0001398916645f, + -0.0001425349833f, + -0.0001451656204f, + -0.0001477806759f, + -0.0001503771580f, + -0.0001529519831f, + -0.0001555019757f, + -0.0001580238676f, + -0.0001605142982f, + -0.0001629698139f, + -0.0001653868686f, + -0.0001677618232f, + -0.0001700909463f, + -0.0001723704138f, + -0.0001745963094f, + -0.0001767646249f, + -0.0001788712607f, + -0.0001809120262f, + -0.0001828826403f, + -0.0001847787321f, + -0.0001865958418f, + -0.0001883294212f, + -0.0001899748350f, + -0.0001915273613f, + -0.0001929821931f, + -0.0001943344392f, + -0.0001955791256f, + -0.0001967111968f, + -0.0001977255172f, + -0.0001986168726f, + -0.0001993799720f, + -0.0002000094489f, + -0.0002004998634f, + -0.0002008457042f, + -0.0002010413902f, + -0.0002010812729f, + -0.0002009596382f, + -0.0002006707090f, + -0.0002002086476f, + -0.0001995675575f, + -0.0001987414866f, + -0.0001977244297f, + -0.0001965103308f, + -0.0001950930862f, + -0.0001934665474f, + -0.0001916245241f, + -0.0001895607869f, + -0.0001872690707f, + -0.0001847430782f, + -0.0001819764827f, + -0.0001789629316f, + -0.0001756960501f, + -0.0001721694447f, + -0.0001683767065f, + -0.0001643114154f, + -0.0001599671433f, + -0.0001553374586f, + -0.0001504159297f, + -0.0001451961290f, + -0.0001396716370f, + -0.0001338360466f, + -0.0001276829672f, + -0.0001212060287f, + -0.0001143988861f, + -0.0001072552238f, + -0.0000997687600f, + -0.0000919332511f, + -0.0000837424964f, + -0.0000751903422f, + -0.0000662706872f, + -0.0000569774862f, + -0.0000473047557f, + -0.0000372465778f, + -0.0000267971056f, + -0.0000159505676f, + -0.0000047012723f, + 0.0000069563861f, + 0.0000190279240f, + 0.0000315187628f, + 0.0000444342241f, + 0.0000577795252f, + 0.0000715597739f, + 0.0000857799638f, + 0.0001004449692f, + 0.0001155595405f, + 0.0001311282992f, + 0.0001471557332f, + 0.0001636461917f, + 0.0001806038808f, + 0.0001980328584f, + 0.0002159370295f, + 0.0002343201416f, + 0.0002531857801f, + 0.0002725373634f, + 0.0002923781387f, + 0.0003127111768f, + 0.0003335393686f, + 0.0003548654197f, + 0.0003766918469f, + 0.0003990209730f, + 0.0004218549234f, + 0.0004451956214f, + 0.0004690447845f, + 0.0004934039201f, + 0.0005182743216f, + 0.0005436570649f, + 0.0005695530043f, + 0.0005959627692f, + 0.0006228867602f, + 0.0006503251459f, + 0.0006782778596f, + 0.0007067445959f, + 0.0007357248078f, + 0.0007652177037f, + 0.0007952222443f, + 0.0008257371403f, + 0.0008567608492f, + 0.0008882915736f, + 0.0009203272580f, + 0.0009528655873f, + 0.0009859039843f, + 0.0010194396081f, + 0.0010534693522f, + 0.0010879898425f, + 0.0011229974367f, + 0.0011584882220f, + 0.0011944580146f, + 0.0012309023586f, + 0.0012678165250f, + 0.0013051955110f, + 0.0013430340397f, + 0.0013813265595f, + 0.0014200672442f, + 0.0014592499929f, + 0.0014988684300f, + 0.0015389159058f, + 0.0015793854968f, + 0.0016202700068f, + 0.0016615619670f, + 0.0017032536381f, + 0.0017453370105f, + 0.0017878038064f, + 0.0018306454814f, + 0.0018738532257f, + 0.0019174179666f, + 0.0019613303706f, + 0.0020055808454f, + 0.0020501595428f, + 0.0020950563610f, + 0.0021402609477f, + 0.0021857627034f, + 0.0022315507840f, + 0.0022776141047f, + 0.0023239413434f, + 0.0023705209447f, + 0.0024173411233f, + 0.0024643898688f, + 0.0025116549495f, + 0.0025591239169f, + 0.0026067841107f, + 0.0026546226632f, + 0.0027026265043f, + 0.0027507823669f, + 0.0027990767918f, + 0.0028474961335f, + 0.0028960265655f, + 0.0029446540864f, + 0.0029933645254f, + 0.0030421435486f, + 0.0030909766650f, + 0.0031398492332f, + 0.0031887464674f, + 0.0032376534443f, + 0.0032865551097f, + 0.0033354362854f, + 0.0033842816762f, + 0.0034330758769f, + 0.0034818033796f, + 0.0035304485810f, + 0.0035789957896f, + 0.0036274292338f, + 0.0036757330686f, + 0.0037238913843f, + 0.0037718882136f, + 0.0038197075396f, + 0.0038673333040f, + 0.0039147494150f, + 0.0039619397550f, + 0.0040088881896f, + 0.0040555785748f, + 0.0041019947660f, + 0.0041481206260f, + 0.0041939400332f, + 0.0042394368905f, + 0.0042845951330f, + 0.0043293987369f, + 0.0043738317277f, + 0.0044178781890f, + 0.0044615222704f, + 0.0045047481964f, + 0.0045475402748f, + 0.0045898829050f, + 0.0046317605863f, + 0.0046731579268f, + 0.0047140596512f, + 0.0047544506094f, + 0.0047943157851f, + 0.0048336403032f, + 0.0048724094390f, + 0.0049106086256f, + 0.0049482234626f, + 0.0049852397233f, + 0.0050216433634f, + 0.0050574205286f, + 0.0050925575621f, + 0.0051270410128f, + 0.0051608576423f, + 0.0051939944329f, + 0.0052264385945f, + 0.0052581775725f, + 0.0052891990541f, + 0.0053194909762f, + 0.0053490415314f, + 0.0053778391756f, + 0.0054058726342f, + 0.0054331309083f, + 0.0054596032817f, + 0.0054852793266f, + 0.0055101489098f, + 0.0055342021983f, + 0.0055574296655f, + 0.0055798220963f, + 0.0056013705925f, + 0.0056220665783f, + 0.0056419018048f, + 0.0056608683553f, + 0.0056789586495f, + 0.0056961654483f, + 0.0057124818576f, + 0.0057279013330f, + 0.0057424176828f, + 0.0057560250723f, + 0.0057687180271f, + 0.0057804914360f, + 0.0057913405542f, + 0.0058012610063f, + 0.0058102487887f, + 0.0058183002716f, + 0.0058254122019f, + 0.0058315817045f, + 0.0058368062842f, + 0.0058410838272f, + 0.0058444126023f, + 0.0058467912620f, + 0.0058482188432f, + 0.0058486947679f, + 0.0058482188432f, + 0.0058467912620f, + 0.0058444126023f, + 0.0058410838272f, + 0.0058368062842f, + 0.0058315817045f, + 0.0058254122019f, + 0.0058183002716f, + 0.0058102487887f, + 0.0058012610063f, + 0.0057913405542f, + 0.0057804914360f, + 0.0057687180271f, + 0.0057560250723f, + 0.0057424176828f, + 0.0057279013330f, + 0.0057124818576f, + 0.0056961654483f, + 0.0056789586495f, + 0.0056608683553f, + 0.0056419018048f, + 0.0056220665783f, + 0.0056013705925f, + 0.0055798220963f, + 0.0055574296655f, + 0.0055342021983f, + 0.0055101489098f, + 0.0054852793266f, + 0.0054596032817f, + 0.0054331309083f, + 0.0054058726342f, + 0.0053778391756f, + 0.0053490415314f, + 0.0053194909762f, + 0.0052891990541f, + 0.0052581775725f, + 0.0052264385945f, + 0.0051939944329f, + 0.0051608576423f, + 0.0051270410128f, + 0.0050925575621f, + 0.0050574205286f, + 0.0050216433634f, + 0.0049852397233f, + 0.0049482234626f, + 0.0049106086256f, + 0.0048724094390f, + 0.0048336403032f, + 0.0047943157851f, + 0.0047544506094f, + 0.0047140596512f, + 0.0046731579268f, + 0.0046317605863f, + 0.0045898829050f, + 0.0045475402748f, + 0.0045047481964f, + 0.0044615222704f, + 0.0044178781890f, + 0.0043738317277f, + 0.0043293987369f, + 0.0042845951330f, + 0.0042394368905f, + 0.0041939400332f, + 0.0041481206260f, + 0.0041019947660f, + 0.0040555785748f, + 0.0040088881896f, + 0.0039619397550f, + 0.0039147494150f, + 0.0038673333040f, + 0.0038197075396f, + 0.0037718882136f, + 0.0037238913843f, + 0.0036757330686f, + 0.0036274292338f, + 0.0035789957896f, + 0.0035304485810f, + 0.0034818033796f, + 0.0034330758769f, + 0.0033842816762f, + 0.0033354362854f, + 0.0032865551097f, + 0.0032376534443f, + 0.0031887464674f, + 0.0031398492332f, + 0.0030909766650f, + 0.0030421435486f, + 0.0029933645254f, + 0.0029446540864f, + 0.0028960265655f, + 0.0028474961335f, + 0.0027990767918f, + 0.0027507823669f, + 0.0027026265043f, + 0.0026546226632f, + 0.0026067841107f, + 0.0025591239169f, + 0.0025116549495f, + 0.0024643898688f, + 0.0024173411233f, + 0.0023705209447f, + 0.0023239413434f, + 0.0022776141047f, + 0.0022315507840f, + 0.0021857627034f, + 0.0021402609477f, + 0.0020950563610f, + 0.0020501595428f, + 0.0020055808454f, + 0.0019613303706f, + 0.0019174179666f, + 0.0018738532257f, + 0.0018306454814f, + 0.0017878038064f, + 0.0017453370105f, + 0.0017032536381f, + 0.0016615619670f, + 0.0016202700068f, + 0.0015793854968f, + 0.0015389159058f, + 0.0014988684300f, + 0.0014592499929f, + 0.0014200672442f, + 0.0013813265595f, + 0.0013430340397f, + 0.0013051955110f, + 0.0012678165250f, + 0.0012309023586f, + 0.0011944580146f, + 0.0011584882220f, + 0.0011229974367f, + 0.0010879898425f, + 0.0010534693522f, + 0.0010194396081f, + 0.0009859039843f, + 0.0009528655873f, + 0.0009203272580f, + 0.0008882915736f, + 0.0008567608492f, + 0.0008257371403f, + 0.0007952222443f, + 0.0007652177037f, + 0.0007357248078f, + 0.0007067445959f, + 0.0006782778596f, + 0.0006503251459f, + 0.0006228867602f, + 0.0005959627692f, + 0.0005695530043f, + 0.0005436570649f, + 0.0005182743216f, + 0.0004934039201f, + 0.0004690447845f, + 0.0004451956214f, + 0.0004218549234f, + 0.0003990209730f, + 0.0003766918469f, + 0.0003548654197f, + 0.0003335393686f, + 0.0003127111768f, + 0.0002923781387f, + 0.0002725373634f, + 0.0002531857801f, + 0.0002343201416f, + 0.0002159370295f, + 0.0001980328584f, + 0.0001806038808f, + 0.0001636461917f, + 0.0001471557332f, + 0.0001311282992f, + 0.0001155595405f, + 0.0001004449692f, + 0.0000857799638f, + 0.0000715597739f, + 0.0000577795252f, + 0.0000444342241f, + 0.0000315187628f, + 0.0000190279240f, + 0.0000069563861f, + -0.0000047012723f, + -0.0000159505676f, + -0.0000267971056f, + -0.0000372465778f, + -0.0000473047557f, + -0.0000569774862f, + -0.0000662706872f, + -0.0000751903422f, + -0.0000837424964f, + -0.0000919332511f, + -0.0000997687600f, + -0.0001072552238f, + -0.0001143988861f, + -0.0001212060287f, + -0.0001276829672f, + -0.0001338360466f, + -0.0001396716370f, + -0.0001451961290f, + -0.0001504159297f, + -0.0001553374586f, + -0.0001599671433f, + -0.0001643114154f, + -0.0001683767065f, + -0.0001721694447f, + -0.0001756960501f, + -0.0001789629316f, + -0.0001819764827f, + -0.0001847430782f, + -0.0001872690707f, + -0.0001895607869f, + -0.0001916245241f, + -0.0001934665474f, + -0.0001950930862f, + -0.0001965103308f, + -0.0001977244297f, + -0.0001987414866f, + -0.0001995675575f, + -0.0002002086476f, + -0.0002006707090f, + -0.0002009596382f, + -0.0002010812729f, + -0.0002010413902f, + -0.0002008457042f, + -0.0002004998634f, + -0.0002000094489f, + -0.0001993799720f, + -0.0001986168726f, + -0.0001977255172f, + -0.0001967111968f, + -0.0001955791256f, + -0.0001943344392f, + -0.0001929821931f, + -0.0001915273613f, + -0.0001899748350f, + -0.0001883294212f, + -0.0001865958418f, + -0.0001847787321f, + -0.0001828826403f, + -0.0001809120262f, + -0.0001788712607f, + -0.0001767646249f, + -0.0001745963094f, + -0.0001723704138f, + -0.0001700909463f, + -0.0001677618232f, + -0.0001653868686f, + -0.0001629698139f, + -0.0001605142982f, + -0.0001580238676f, + -0.0001555019757f, + -0.0001529519831f, + -0.0001503771580f, + -0.0001477806759f, + -0.0001451656204f, + -0.0001425349833f, + -0.0001398916645f, + -0.0001372384734f, + -0.0001345781284f, + -0.0001319132583f, + -0.0001292464023f, + -0.0001265800111f, + -0.0001239164473f, + -0.0001212579865f, + -0.0001186068179f, + -0.0001159650452f, + -0.0001133346877f, + -0.0001107176810f, + -0.0001081158783f, + -0.0001055310512f, + -0.0001029648911f, + -0.0001004190099f, + -0.0000978949415f, + -0.0000953941432f, + -0.0000929179961f, + -0.0000904678075f, + -0.0000880448112f, + -0.0000856501695f, + -0.0000832849740f, + -0.0000809502475f, + -0.0000786469450f, + -0.0000763759553f, + -0.0000741381022f, + -0.0000719341464f, + -0.0000697647864f, + -0.0000676306604f, + -0.0000655323476f, + -0.0000634703697f, + -0.0000614451922f, + -0.0000594572265f, + -0.0000575068307f, + -0.0000555943117f, + -0.0000537199261f, + -0.0000518838825f, + -0.0000500863422f, + -0.0000483274213f, + -0.0000466071919f, + -0.0000449256839f, + -0.0000432828861f, + -0.0000416787480f, + -0.0000401131811f, + -0.0000385860605f, + -0.0000370972263f, + -0.0000356464850f, + -0.0000342336112f, + -0.0000328583485f, + -0.0000315204114f, + -0.0000302194865f, + -0.0000289552338f, + -0.0000277272881f, + -0.0000265352606f, + -0.0000253787397f, + -0.0000242572927f, + -0.0000231704670f, + -0.0000221177911f, + -0.0000210987761f, + -0.0000201129171f, + -0.0000191596936f, + -0.0000182385717f, + -0.0000173490044f, + -0.0000164904329f, + -0.0000156622882f, + -0.0000148639914f, + -0.0000140949552f, + -0.0000133545848f, + -0.0000126422788f, + -0.0000119574304f, + -0.0000112994278f, + -0.0000106676557f, + -0.0000100614958f, + -0.0000094803279f, + -0.0000089235302f, + -0.0000083904807f, + -0.0000078805577f, + -0.0000073931405f, + -0.0000069276099f, + -0.0000064833493f, + -0.0000060597452f, + -0.0000056561877f, + -0.0000052720710f, + -0.0000049067942f, + -0.0000045597620f, + -0.0000042303847f, + -0.0000039180789f, + -0.0000036222682f, + -0.0000033423834f, + -0.0000030778629f, + -0.0000028281532f, + -0.0000025927091f, + -0.0000023709942f, + -0.0000021624812f, + -0.0000019666521f, + -0.0000017829984f, + -0.0000016110215f, + -0.0000014502329f, + -0.0000013001543f, + -0.0000055896992f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_512_16.h b/core/src/dsp/multirate/.old_decim/taps/fir_512_16.h new file mode 100644 index 0000000..c7a3e7c --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_512_16.h @@ -0,0 +1,76 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_16_len = 64; + const float fir_512_16_taps[] = { + 0.0000151940580f, + 0.0000353162294f, + 0.0000744053215f, + 0.0001396086425f, + 0.0002418195104f, + 0.0003943662769f, + 0.0006129837252f, + 0.0009156126139f, + 0.0013220032816f, + 0.0018531099165f, + 0.0025302756637f, + 0.0033742244254f, + 0.0044038919853f, + 0.0056351456882f, + 0.0070794569573f, + 0.0087426030278f, + 0.0106234821202f, + 0.0127131288122f, + 0.0149940128678f, + 0.0174396949525f, + 0.0200148967258f, + 0.0226760214362f, + 0.0253721355820f, + 0.0280463940126f, + 0.0306378619753f, + 0.0330836601043f, + 0.0353213343016f, + 0.0372913337462f, + 0.0389394684890f, + 0.0402192143245f, + 0.0410937374123f, + 0.0415375243532f, + 0.0415375243532f, + 0.0410937374123f, + 0.0402192143245f, + 0.0389394684890f, + 0.0372913337462f, + 0.0353213343016f, + 0.0330836601043f, + 0.0306378619753f, + 0.0280463940126f, + 0.0253721355820f, + 0.0226760214362f, + 0.0200148967258f, + 0.0174396949525f, + 0.0149940128678f, + 0.0127131288122f, + 0.0106234821202f, + 0.0087426030278f, + 0.0070794569573f, + 0.0056351456882f, + 0.0044038919853f, + 0.0033742244254f, + 0.0025302756637f, + 0.0018531099165f, + 0.0013220032816f, + 0.0009156126139f, + 0.0006129837252f, + 0.0003943662769f, + 0.0002418195104f, + 0.0001396086425f, + 0.0000744053215f, + 0.0000353162294f, + 0.0000151940580f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_512_32.h b/core/src/dsp/multirate/.old_decim/taps/fir_512_32.h new file mode 100644 index 0000000..2f92925 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_512_32.h @@ -0,0 +1,163 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_32_len = 151; + const float fir_512_32_taps[] = { + 0.0000009251202f, + 0.0000018465197f, + 0.0000024464700f, + 0.0000043159736f, + 0.0000061801355f, + 0.0000092195926f, + 0.0000128748733f, + 0.0000179050798f, + 0.0000241667435f, + 0.0000322353329f, + 0.0000422298191f, + 0.0000546726009f, + 0.0000698676453f, + 0.0000883565591f, + 0.0001105894638f, + 0.0001371665649f, + 0.0001686634471f, + 0.0002057583064f, + 0.0002491382743f, + 0.0002995652579f, + 0.0003578243175f, + 0.0004247560835f, + 0.0005012264845f, + 0.0005881405242f, + 0.0006864223881f, + 0.0007970184354f, + 0.0009208819280f, + 0.0010589694866f, + 0.0012122275138f, + 0.0013815845184f, + 0.0015679378702f, + 0.0017721434865f, + 0.0019950024469f, + 0.0022372491131f, + 0.0024995376582f, + 0.0027824295157f, + 0.0030863801975f, + 0.0034117269055f, + 0.0037586762067f, + 0.0041272926196f, + 0.0045174878173f, + 0.0049290109819f, + 0.0053614402367f, + 0.0058141755168f, + 0.0062864329037f, + 0.0067772406753f, + 0.0072854371318f, + 0.0078096703652f, + 0.0083484000282f, + 0.0088999012000f, + 0.0094622703727f, + 0.0100334335903f, + 0.0106111567180f, + 0.0111930578078f, + 0.0117766214851f, + 0.0123592152594f, + 0.0129381076271f, + 0.0135104878117f, + 0.0140734869548f, + 0.0146242005530f, + 0.0151597119088f, + 0.0156771163460f, + 0.0161735459270f, + 0.0166461943912f, + 0.0170923420315f, + 0.0175093802160f, + 0.0178948352652f, + 0.0182463913957f, + 0.0185619124518f, + 0.0188394621562f, + 0.0190773226296f, + 0.0192740109449f, + 0.0194282935085f, + 0.0195391980867f, + 0.0196060233225f, + 0.0196283456221f, + 0.0196060233225f, + 0.0195391980867f, + 0.0194282935085f, + 0.0192740109449f, + 0.0190773226296f, + 0.0188394621562f, + 0.0185619124518f, + 0.0182463913957f, + 0.0178948352652f, + 0.0175093802160f, + 0.0170923420315f, + 0.0166461943912f, + 0.0161735459270f, + 0.0156771163460f, + 0.0151597119088f, + 0.0146242005530f, + 0.0140734869548f, + 0.0135104878117f, + 0.0129381076271f, + 0.0123592152594f, + 0.0117766214851f, + 0.0111930578078f, + 0.0106111567180f, + 0.0100334335903f, + 0.0094622703727f, + 0.0088999012000f, + 0.0083484000282f, + 0.0078096703652f, + 0.0072854371318f, + 0.0067772406753f, + 0.0062864329037f, + 0.0058141755168f, + 0.0053614402367f, + 0.0049290109819f, + 0.0045174878173f, + 0.0041272926196f, + 0.0037586762067f, + 0.0034117269055f, + 0.0030863801975f, + 0.0027824295157f, + 0.0024995376582f, + 0.0022372491131f, + 0.0019950024469f, + 0.0017721434865f, + 0.0015679378702f, + 0.0013815845184f, + 0.0012122275138f, + 0.0010589694866f, + 0.0009208819280f, + 0.0007970184354f, + 0.0006864223881f, + 0.0005881405242f, + 0.0005012264845f, + 0.0004247560835f, + 0.0003578243175f, + 0.0002995652579f, + 0.0002491382743f, + 0.0002057583064f, + 0.0001686634471f, + 0.0001371665649f, + 0.0001105894638f, + 0.0000883565591f, + 0.0000698676453f, + 0.0000546726009f, + 0.0000422298191f, + 0.0000322353329f, + 0.0000241667435f, + 0.0000179050798f, + 0.0000128748733f, + 0.0000092195926f, + 0.0000061801355f, + 0.0000043159736f, + 0.0000024464700f, + 0.0000018465197f, + 0.0000009251202f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_512_64.h b/core/src/dsp/multirate/.old_decim/taps/fir_512_64.h new file mode 100644 index 0000000..5b32321 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_512_64.h @@ -0,0 +1,296 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_64_len = 284; + const float fir_512_64_taps[] = { + -0.0000003515813f, + 0.0000031171026f, + 0.0000020524162f, + 0.0000024542289f, + 0.0000031065207f, + 0.0000038930134f, + 0.0000048162506f, + 0.0000058895006f, + 0.0000071310597f, + 0.0000085581431f, + 0.0000101918418f, + 0.0000120521359f, + 0.0000141629532f, + 0.0000165472024f, + 0.0000192318152f, + 0.0000222427880f, + 0.0000256102026f, + 0.0000293632777f, + 0.0000335353640f, + 0.0000381590070f, + 0.0000432709128f, + 0.0000489070228f, + 0.0000551074473f, + 0.0000619115526f, + 0.0000693628586f, + 0.0000775041409f, + 0.0000863822872f, + 0.0000960434161f, + 0.0001065376894f, + 0.0001179144487f, + 0.0001302269805f, + 0.0001435276713f, + 0.0001578727234f, + 0.0001733173295f, + 0.0001899203366f, + 0.0002077394422f, + 0.0002268358025f, + 0.0002472692536f, + 0.0002691028607f, + 0.0002923981667f, + 0.0003172196808f, + 0.0003436301558f, + 0.0003716950150f, + 0.0004014776616f, + 0.0004330438412f, + 0.0004664569860f, + 0.0005017825128f, + 0.0005390832050f, + 0.0005784234446f, + 0.0006198646358f, + 0.0006634693699f, + 0.0007092968953f, + 0.0007574072145f, + 0.0008078566037f, + 0.0008607016429f, + 0.0009159947893f, + 0.0009737883402f, + 0.0010341300646f, + 0.0010970670999f, + 0.0011626416466f, + 0.0012308947989f, + 0.0013018623072f, + 0.0013755783437f, + 0.0014520713385f, + 0.0015313676803f, + 0.0016134876310f, + 0.0016984489635f, + 0.0017862629594f, + 0.0018769379853f, + 0.0019704755784f, + 0.0020668739631f, + 0.0021661242292f, + 0.0022682137899f, + 0.0023731226581f, + 0.0024808268465f, + 0.0025912947466f, + 0.0027044904730f, + 0.0028203703485f, + 0.0029388861938f, + 0.0030599819237f, + 0.0031835967820f, + 0.0033096620532f, + 0.0034381042430f, + 0.0035688419092f, + 0.0037017887878f, + 0.0038368507462f, + 0.0039739288549f, + 0.0041129164657f, + 0.0042537022285f, + 0.0043961672967f, + 0.0045401882879f, + 0.0046856346183f, + 0.0048323714068f, + 0.0049802569384f, + 0.0051291455099f, + 0.0052788850244f, + 0.0054293197749f, + 0.0055802881698f, + 0.0057316254533f, + 0.0058831615603f, + 0.0060347237702f, + 0.0061861346909f, + 0.0063372148423f, + 0.0064877807676f, + 0.0066376475425f, + 0.0067866270121f, + 0.0069345302214f, + 0.0070811657753f, + 0.0072263421851f, + 0.0073698663497f, + 0.0075115458128f, + 0.0076511873613f, + 0.0077885991889f, + 0.0079235896075f, + 0.0080559691125f, + 0.0081855492031f, + 0.0083121443425f, + 0.0084355708848f, + 0.0085556489242f, + 0.0086722013236f, + 0.0087850554475f, + 0.0088940422881f, + 0.0089989980770f, + 0.0090997635037f, + 0.0091961852010f, + 0.0092881150520f, + 0.0093754115438f, + 0.0094579391596f, + 0.0095355695951f, + 0.0096081812323f, + 0.0096756602138f, + 0.0097378999951f, + 0.0097948022733f, + 0.0098462766138f, + 0.0098922412299f, + 0.0099326226814f, + 0.0099673565022f, + 0.0099963869681f, + 0.0100196675703f, + 0.0100371608503f, + 0.0100488387168f, + 0.0100546823476f, + 0.0100546823476f, + 0.0100488387168f, + 0.0100371608503f, + 0.0100196675703f, + 0.0099963869681f, + 0.0099673565022f, + 0.0099326226814f, + 0.0098922412299f, + 0.0098462766138f, + 0.0097948022733f, + 0.0097378999951f, + 0.0096756602138f, + 0.0096081812323f, + 0.0095355695951f, + 0.0094579391596f, + 0.0093754115438f, + 0.0092881150520f, + 0.0091961852010f, + 0.0090997635037f, + 0.0089989980770f, + 0.0088940422881f, + 0.0087850554475f, + 0.0086722013236f, + 0.0085556489242f, + 0.0084355708848f, + 0.0083121443425f, + 0.0081855492031f, + 0.0080559691125f, + 0.0079235896075f, + 0.0077885991889f, + 0.0076511873613f, + 0.0075115458128f, + 0.0073698663497f, + 0.0072263421851f, + 0.0070811657753f, + 0.0069345302214f, + 0.0067866270121f, + 0.0066376475425f, + 0.0064877807676f, + 0.0063372148423f, + 0.0061861346909f, + 0.0060347237702f, + 0.0058831615603f, + 0.0057316254533f, + 0.0055802881698f, + 0.0054293197749f, + 0.0052788850244f, + 0.0051291455099f, + 0.0049802569384f, + 0.0048323714068f, + 0.0046856346183f, + 0.0045401882879f, + 0.0043961672967f, + 0.0042537022285f, + 0.0041129164657f, + 0.0039739288549f, + 0.0038368507462f, + 0.0037017887878f, + 0.0035688419092f, + 0.0034381042430f, + 0.0033096620532f, + 0.0031835967820f, + 0.0030599819237f, + 0.0029388861938f, + 0.0028203703485f, + 0.0027044904730f, + 0.0025912947466f, + 0.0024808268465f, + 0.0023731226581f, + 0.0022682137899f, + 0.0021661242292f, + 0.0020668739631f, + 0.0019704755784f, + 0.0018769379853f, + 0.0017862629594f, + 0.0016984489635f, + 0.0016134876310f, + 0.0015313676803f, + 0.0014520713385f, + 0.0013755783437f, + 0.0013018623072f, + 0.0012308947989f, + 0.0011626416466f, + 0.0010970670999f, + 0.0010341300646f, + 0.0009737883402f, + 0.0009159947893f, + 0.0008607016429f, + 0.0008078566037f, + 0.0007574072145f, + 0.0007092968953f, + 0.0006634693699f, + 0.0006198646358f, + 0.0005784234446f, + 0.0005390832050f, + 0.0005017825128f, + 0.0004664569860f, + 0.0004330438412f, + 0.0004014776616f, + 0.0003716950150f, + 0.0003436301558f, + 0.0003172196808f, + 0.0002923981667f, + 0.0002691028607f, + 0.0002472692536f, + 0.0002268358025f, + 0.0002077394422f, + 0.0001899203366f, + 0.0001733173295f, + 0.0001578727234f, + 0.0001435276713f, + 0.0001302269805f, + 0.0001179144487f, + 0.0001065376894f, + 0.0000960434161f, + 0.0000863822872f, + 0.0000775041409f, + 0.0000693628586f, + 0.0000619115526f, + 0.0000551074473f, + 0.0000489070228f, + 0.0000432709128f, + 0.0000381590070f, + 0.0000335353640f, + 0.0000293632777f, + 0.0000256102026f, + 0.0000222427880f, + 0.0000192318152f, + 0.0000165472024f, + 0.0000141629532f, + 0.0000120521359f, + 0.0000101918418f, + 0.0000085581431f, + 0.0000071310597f, + 0.0000058895006f, + 0.0000048162506f, + 0.0000038930134f, + 0.0000031065207f, + 0.0000024542289f, + 0.0000020524162f, + 0.0000031171026f, + -0.0000003515813f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_64_16.h b/core/src/dsp/multirate/.old_decim/taps/fir_64_16.h new file mode 100644 index 0000000..6338347 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_64_16.h @@ -0,0 +1,102 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_16_len = 90; + const float fir_64_16_taps[] = { + -0.0000120522386f, + -0.0000222544605f, + -0.0000415800824f, + -0.0000705601980f, + -0.0001117597283f, + -0.0001677821532f, + -0.0002410541699f, + -0.0003335536910f, + -0.0004464864558f, + -0.0005799214861f, + -0.0007324007475f, + -0.0009005433028f, + -0.0010786685830f, + -0.0012584667286f, + -0.0014287458994f, + -0.0015752866570f, + -0.0016808317559f, + -0.0017252357928f, + -0.0016857931470f, + -0.0015377546562f, + -0.0012550337974f, + -0.0008110922394f, + -0.0001799830654f, + 0.0006624815809f, + 0.0017374824702f, + 0.0030619182176f, + 0.0046471635731f, + 0.0064979256976f, + 0.0086112639295f, + 0.0109758357695f, + 0.0135714252753f, + 0.0163687998961f, + 0.0193299283477f, + 0.0224085760310f, + 0.0255512765146f, + 0.0286986586848f, + 0.0317870903592f, + 0.0347505815535f, + 0.0375228752484f, + 0.0400396413686f, + 0.0422406815901f, + 0.0440720490748f, + 0.0454879886598f, + 0.0464526093979f, + 0.0469412124342f, + 0.0469412124342f, + 0.0464526093979f, + 0.0454879886598f, + 0.0440720490748f, + 0.0422406815901f, + 0.0400396413686f, + 0.0375228752484f, + 0.0347505815535f, + 0.0317870903592f, + 0.0286986586848f, + 0.0255512765146f, + 0.0224085760310f, + 0.0193299283477f, + 0.0163687998961f, + 0.0135714252753f, + 0.0109758357695f, + 0.0086112639295f, + 0.0064979256976f, + 0.0046471635731f, + 0.0030619182176f, + 0.0017374824702f, + 0.0006624815809f, + -0.0001799830654f, + -0.0008110922394f, + -0.0012550337974f, + -0.0015377546562f, + -0.0016857931470f, + -0.0017252357928f, + -0.0016808317559f, + -0.0015752866570f, + -0.0014287458994f, + -0.0012584667286f, + -0.0010786685830f, + -0.0009005433028f, + -0.0007324007475f, + -0.0005799214861f, + -0.0004464864558f, + -0.0003335536910f, + -0.0002410541699f, + -0.0001677821532f, + -0.0001117597283f, + -0.0000705601980f, + -0.0000415800824f, + -0.0000222544605f, + -0.0000120522386f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_64_2.h b/core/src/dsp/multirate/.old_decim/taps/fir_64_2.h new file mode 100644 index 0000000..27d0bc8 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_64_2.h @@ -0,0 +1,16 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_2_len = 4; + const float fir_64_2_taps[] = { + 0.1238512125230f, + 0.3713298898913f, + 0.3713298898913f, + 0.1238512125230f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_64_32.h b/core/src/dsp/multirate/.old_decim/taps/fir_64_32.h new file mode 100644 index 0000000..13acb09 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_64_32.h @@ -0,0 +1,266 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_32_len = 254; + const float fir_64_32_taps[] = { + 0.0000071177827f, + 0.0000052360330f, + 0.0000070999389f, + 0.0000093491421f, + 0.0000120258010f, + 0.0000151698657f, + 0.0000188213706f, + 0.0000230162819f, + 0.0000277885900f, + 0.0000331659761f, + 0.0000391717261f, + 0.0000458202516f, + 0.0000531188652f, + 0.0000610632073f, + 0.0000696389402f, + 0.0000788171514f, + 0.0000885560397f, + 0.0000987963809f, + 0.0001094632965f, + 0.0001204618823f, + 0.0001316791619f, + 0.0001429799890f, + 0.0001542092968f, + 0.0001651883918f, + 0.0001757176133f, + 0.0001855731360f, + 0.0001945101517f, + 0.0002022602911f, + 0.0002085354301f, + 0.0002130258290f, + 0.0002154046469f, + 0.0002153268755f, + 0.0002124346213f, + 0.0002063568823f, + 0.0001967156262f, + 0.0001831264229f, + 0.0001652053085f, + 0.0001425702458f, + 0.0001148487208f, + 0.0000816799586f, + 0.0000427231519f, + -0.0000023396876f, + -0.0000537950170f, + -0.0001118944427f, + -0.0001768457191f, + -0.0002488091749f, + -0.0003278886589f, + -0.0004141279672f, + -0.0005075020096f, + -0.0006079135226f, + -0.0007151847604f, + -0.0008290548018f, + -0.0009491720834f, + -0.0010750926197f, + -0.0012062737004f, + -0.0013420733382f, + -0.0014817454403f, + -0.0016244407789f, + -0.0017692039202f, + -0.0019149759766f, + -0.0020605935333f, + -0.0022047933917f, + -0.0023462136721f, + -0.0024834006928f, + -0.0026148123580f, + -0.0027388272354f, + -0.0028537502533f, + -0.0029578239527f, + -0.0030492364244f, + -0.0031261346152f, + -0.0031866343375f, + -0.0032288354106f, + -0.0032508334770f, + -0.0032507366611f, + -0.0032266788309f, + -0.0031768373662f, + -0.0030994474167f, + -0.0029928202893f, + -0.0028553581802f, + -0.0026855726253f, + -0.0024820991257f, + -0.0022437150570f, + -0.0019693535723f, + -0.0016581203414f, + -0.0013093061003f, + -0.0009224015920f, + -0.0004971081448f, + -0.0000333502105f, + 0.0004687166063f, + 0.0010086959640f, + 0.0015859458172f, + 0.0021995722597f, + 0.0028484280438f, + 0.0035311102220f, + 0.0042459624638f, + 0.0049910767459f, + 0.0057642996479f, + 0.0065632382031f, + 0.0073852702104f, + 0.0082275542093f, + 0.0090870436937f, + 0.0099605010219f, + 0.0108445152647f, + 0.0117355197089f, + 0.0126298129235f, + 0.0135235793719f, + 0.0144129131434f, + 0.0152938410591f, + 0.0161623483955f, + 0.0170144037611f, + 0.0178459860423f, + 0.0186531102422f, + 0.0194318548104f, + 0.0201783875831f, + 0.0208889926181f, + 0.0215600953536f, + 0.0221882880668f, + 0.0227703533794f, + 0.0233032874883f, + 0.0237843211931f, + 0.0242109401088f, + 0.0245809024718f, + 0.0248922556389f, + 0.0251433500349f, + 0.0253328513679f, + 0.0254597502167f, + 0.0255233695354f, + 0.0255233695354f, + 0.0254597502167f, + 0.0253328513679f, + 0.0251433500349f, + 0.0248922556389f, + 0.0245809024718f, + 0.0242109401088f, + 0.0237843211931f, + 0.0233032874883f, + 0.0227703533794f, + 0.0221882880668f, + 0.0215600953536f, + 0.0208889926181f, + 0.0201783875831f, + 0.0194318548104f, + 0.0186531102422f, + 0.0178459860423f, + 0.0170144037611f, + 0.0161623483955f, + 0.0152938410591f, + 0.0144129131434f, + 0.0135235793719f, + 0.0126298129235f, + 0.0117355197089f, + 0.0108445152647f, + 0.0099605010219f, + 0.0090870436937f, + 0.0082275542093f, + 0.0073852702104f, + 0.0065632382031f, + 0.0057642996479f, + 0.0049910767459f, + 0.0042459624638f, + 0.0035311102220f, + 0.0028484280438f, + 0.0021995722597f, + 0.0015859458172f, + 0.0010086959640f, + 0.0004687166063f, + -0.0000333502105f, + -0.0004971081448f, + -0.0009224015920f, + -0.0013093061003f, + -0.0016581203414f, + -0.0019693535723f, + -0.0022437150570f, + -0.0024820991257f, + -0.0026855726253f, + -0.0028553581802f, + -0.0029928202893f, + -0.0030994474167f, + -0.0031768373662f, + -0.0032266788309f, + -0.0032507366611f, + -0.0032508334770f, + -0.0032288354106f, + -0.0031866343375f, + -0.0031261346152f, + -0.0030492364244f, + -0.0029578239527f, + -0.0028537502533f, + -0.0027388272354f, + -0.0026148123580f, + -0.0024834006928f, + -0.0023462136721f, + -0.0022047933917f, + -0.0020605935333f, + -0.0019149759766f, + -0.0017692039202f, + -0.0016244407789f, + -0.0014817454403f, + -0.0013420733382f, + -0.0012062737004f, + -0.0010750926197f, + -0.0009491720834f, + -0.0008290548018f, + -0.0007151847604f, + -0.0006079135226f, + -0.0005075020096f, + -0.0004141279672f, + -0.0003278886589f, + -0.0002488091749f, + -0.0001768457191f, + -0.0001118944427f, + -0.0000537950170f, + -0.0000023396876f, + 0.0000427231519f, + 0.0000816799586f, + 0.0001148487208f, + 0.0001425702458f, + 0.0001652053085f, + 0.0001831264229f, + 0.0001967156262f, + 0.0002063568823f, + 0.0002124346213f, + 0.0002153268755f, + 0.0002154046469f, + 0.0002130258290f, + 0.0002085354301f, + 0.0002022602911f, + 0.0001945101517f, + 0.0001855731360f, + 0.0001757176133f, + 0.0001651883918f, + 0.0001542092968f, + 0.0001429799890f, + 0.0001316791619f, + 0.0001204618823f, + 0.0001094632965f, + 0.0000987963809f, + 0.0000885560397f, + 0.0000788171514f, + 0.0000696389402f, + 0.0000610632073f, + 0.0000531188652f, + 0.0000458202516f, + 0.0000391717261f, + 0.0000331659761f, + 0.0000277885900f, + 0.0000230162819f, + 0.0000188213706f, + 0.0000151698657f, + 0.0000120258010f, + 0.0000093491421f, + 0.0000070999389f, + 0.0000052360330f, + 0.0000071177827f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_64_4.h b/core/src/dsp/multirate/.old_decim/taps/fir_64_4.h new file mode 100644 index 0000000..2194e0e --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_64_4.h @@ -0,0 +1,31 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_4_len = 19; + const float fir_64_4_taps[] = { + 0.0000429609248f, + 0.0004765567633f, + 0.0024957623882f, + 0.0086502620997f, + 0.0224930555988f, + 0.0467176748088f, + 0.0803238710382f, + 0.1168174685032f, + 0.1455785879790f, + 0.1565458506682f, + 0.1455785879790f, + 0.1168174685032f, + 0.0803238710382f, + 0.0467176748088f, + 0.0224930555988f, + 0.0086502620997f, + 0.0024957623882f, + 0.0004765567633f, + 0.0000429609248f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_64_8.h b/core/src/dsp/multirate/.old_decim/taps/fir_64_8.h new file mode 100644 index 0000000..ff936c0 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_64_8.h @@ -0,0 +1,48 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_8_len = 36; + const float fir_64_8_taps[] = { + 0.0000128128011f, + 0.0000776899411f, + 0.0002545373360f, + 0.0006610024251f, + 0.0014604787010f, + 0.0028714653290f, + 0.0051457499501f, + 0.0085388881542f, + 0.0132623498958f, + 0.0194293686660f, + 0.0270017805237f, + 0.0357514664485f, + 0.0452474908137f, + 0.0548772985184f, + 0.0639035753681f, + 0.0715509180316f, + 0.0771091525773f, + 0.0800353323941f, + 0.0800353323941f, + 0.0771091525773f, + 0.0715509180316f, + 0.0639035753681f, + 0.0548772985184f, + 0.0452474908137f, + 0.0357514664485f, + 0.0270017805237f, + 0.0194293686660f, + 0.0132623498958f, + 0.0085388881542f, + 0.0051457499501f, + 0.0028714653290f, + 0.0014604787010f, + 0.0006610024251f, + 0.0002545373360f, + 0.0000776899411f, + 0.0000128128011f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_8_2.h b/core/src/dsp/multirate/.old_decim/taps/fir_8_2.h new file mode 100644 index 0000000..1b8354b --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_8_2.h @@ -0,0 +1,21 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_8_2_len = 9; + const float fir_8_2_taps[] = { + -0.0096855460565f, + -0.0196926482904f, + 0.0627645107767f, + 0.2740445488509f, + 0.4025398240918f, + 0.2740445488509f, + 0.0627645107767f, + -0.0196926482904f, + -0.0096855460565f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_8_4.h b/core/src/dsp/multirate/.old_decim/taps/fir_8_4.h new file mode 100644 index 0000000..d9df1ed --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_8_4.h @@ -0,0 +1,44 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_8_4_len = 32; + const float fir_8_4_taps[] = { + 0.0000925825278f, + 0.0004344995834f, + 0.0011434673031f, + 0.0019921953877f, + 0.0021069453084f, + 0.0000218242037f, + -0.0055687125738f, + -0.0144165472383f, + -0.0233747474180f, + -0.0262097913981f, + -0.0154074590383f, + 0.0142533246733f, + 0.0619133245834f, + 0.1188703177504f, + 0.1704338338746f, + 0.2011522624092f, + 0.2011522624092f, + 0.1704338338746f, + 0.1188703177504f, + 0.0619133245834f, + 0.0142533246733f, + -0.0154074590383f, + -0.0262097913981f, + -0.0233747474180f, + -0.0144165472383f, + -0.0055687125738f, + 0.0000218242037f, + 0.0021069453084f, + 0.0019921953877f, + 0.0011434673031f, + 0.0004344995834f, + 0.0000925825278f, + }; +} diff --git a/core/src/dsp/multirate/.old_decim/taps/fir_8_8.h b/core/src/dsp/multirate/.old_decim/taps/fir_8_8.h new file mode 100644 index 0000000..b1d5de5 --- /dev/null +++ b/core/src/dsp/multirate/.old_decim/taps/fir_8_8.h @@ -0,0 +1,292 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_8_8_len = 280; + const float fir_8_8_taps[] = { + 0.0000052994842f, + 0.0000236531982f, + 0.0000454431541f, + 0.0000866606150f, + 0.0001454681461f, + 0.0002276460304f, + 0.0003345911923f, + 0.0004668904560f, + 0.0006220183860f, + 0.0007944666281f, + 0.0009753045793f, + 0.0011524547932f, + 0.0013112968761f, + 0.0014357836468f, + 0.0015099531702f, + 0.0015197416085f, + 0.0014549038561f, + 0.0013108132368f, + 0.0010898828479f, + 0.0008023617978f, + 0.0004663041298f, + 0.0001065892726f, + -0.0002470172936f, + -0.0005626469270f, + -0.0008097088243f, + -0.0009625110041f, + -0.0010036852815f, + -0.0009269528060f, + -0.0007387999373f, + -0.0004587307896f, + -0.0001179165349f, + 0.0002437426033f, + 0.0005819117379f, + 0.0008530352611f, + 0.0010198667279f, + 0.0010566109951f, + 0.0009529624621f, + 0.0007164088602f, + 0.0003723511050f, + -0.0000381502360f, + -0.0004628817408f, + -0.0008447972550f, + -0.0011294256831f, + -0.0012724326538f, + -0.0012463078782f, + -0.0010451923796f, + -0.0006870442177f, + -0.0002126532093f, + 0.0003185796904f, + 0.0008357346058f, + 0.0012655423999f, + 0.0015424876979f, + 0.0016184879319f, + 0.0014707552431f, + 0.0011066080375f, + 0.0005643461992f, + -0.0000901977407f, + -0.0007712304481f, + -0.0013838905368f, + -0.0018371322225f, + -0.0020568961991f, + -0.0019977090699f, + -0.0016509537671f, + -0.0010484135134f, + -0.0002602767483f, + 0.0006124690999f, + 0.0014505273627f, + 0.0021321900783f, + 0.0025505844320f, + 0.0026298818820f, + 0.0023380802069f, + 0.0016943083615f, + 0.0007692604372f, + -0.0003217361360f, + -0.0014324858797f, + -0.0024049762894f, + -0.0030913100580f, + -0.0033755493545f, + -0.0031923301613f, + -0.0025393728936f, + -0.0014817135720f, + -0.0001465338471f, + 0.0012912514887f, + 0.0026311543404f, + 0.0036743211895f, + 0.0042521988692f, + 0.0042526374291f, + 0.0036395284429f, + 0.0024627622943f, + 0.0008564752688f, + -0.0009748928184f, + -0.0027814968415f, + -0.0043010655579f, + -0.0052957555102f, + -0.0055878599029f, + -0.0050892037537f, + -0.0038196329489f, + -0.0019112679623f, + 0.0004029949855f, + 0.0028161150389f, + 0.0049858689474f, + 0.0065814235194f, + 0.0073314238254f, + 0.0070669002384f, + 0.0057525958483f, + 0.0035015266976f, + 0.0005695959447f, + -0.0026703422489f, + -0.0057727554561f, + -0.0082771418381f, + -0.0097720954139f, + -0.0099573040630f, + -0.0086947790176f, + -0.0060415019273f, + -0.0022576736745f, + 0.0022123488358f, + 0.0067858745476f, + 0.0108103047042f, + 0.0136467461009f, + 0.0147589153736f, + 0.0137961123447f, + 0.0106590975496f, + 0.0055392102924f, + -0.0010761158185f, + -0.0084344441235f, + -0.0155846252876f, + -0.0214724302300f, + -0.0250557443256f, + -0.0254266556205f, + -0.0219263229678f, + -0.0142387338262f, + -0.0024513843925f, + 0.0129256469755f, + 0.0309861862491f, + 0.0504987785185f, + 0.0700154216583f, + 0.0880072662488f, + 0.1030129814746f, + 0.1137837576738f, + 0.1194090364685f, + 0.1194090364685f, + 0.1137837576738f, + 0.1030129814746f, + 0.0880072662488f, + 0.0700154216583f, + 0.0504987785185f, + 0.0309861862491f, + 0.0129256469755f, + -0.0024513843925f, + -0.0142387338262f, + -0.0219263229678f, + -0.0254266556205f, + -0.0250557443256f, + -0.0214724302300f, + -0.0155846252876f, + -0.0084344441235f, + -0.0010761158185f, + 0.0055392102924f, + 0.0106590975496f, + 0.0137961123447f, + 0.0147589153736f, + 0.0136467461009f, + 0.0108103047042f, + 0.0067858745476f, + 0.0022123488358f, + -0.0022576736745f, + -0.0060415019273f, + -0.0086947790176f, + -0.0099573040630f, + -0.0097720954139f, + -0.0082771418381f, + -0.0057727554561f, + -0.0026703422489f, + 0.0005695959447f, + 0.0035015266976f, + 0.0057525958483f, + 0.0070669002384f, + 0.0073314238254f, + 0.0065814235194f, + 0.0049858689474f, + 0.0028161150389f, + 0.0004029949855f, + -0.0019112679623f, + -0.0038196329489f, + -0.0050892037537f, + -0.0055878599029f, + -0.0052957555102f, + -0.0043010655579f, + -0.0027814968415f, + -0.0009748928184f, + 0.0008564752688f, + 0.0024627622943f, + 0.0036395284429f, + 0.0042526374291f, + 0.0042521988692f, + 0.0036743211895f, + 0.0026311543404f, + 0.0012912514887f, + -0.0001465338471f, + -0.0014817135720f, + -0.0025393728936f, + -0.0031923301613f, + -0.0033755493545f, + -0.0030913100580f, + -0.0024049762894f, + -0.0014324858797f, + -0.0003217361360f, + 0.0007692604372f, + 0.0016943083615f, + 0.0023380802069f, + 0.0026298818820f, + 0.0025505844320f, + 0.0021321900783f, + 0.0014505273627f, + 0.0006124690999f, + -0.0002602767483f, + -0.0010484135134f, + -0.0016509537671f, + -0.0019977090699f, + -0.0020568961991f, + -0.0018371322225f, + -0.0013838905368f, + -0.0007712304481f, + -0.0000901977407f, + 0.0005643461992f, + 0.0011066080375f, + 0.0014707552431f, + 0.0016184879319f, + 0.0015424876979f, + 0.0012655423999f, + 0.0008357346058f, + 0.0003185796904f, + -0.0002126532093f, + -0.0006870442177f, + -0.0010451923796f, + -0.0012463078782f, + -0.0012724326538f, + -0.0011294256831f, + -0.0008447972550f, + -0.0004628817408f, + -0.0000381502360f, + 0.0003723511050f, + 0.0007164088602f, + 0.0009529624621f, + 0.0010566109951f, + 0.0010198667279f, + 0.0008530352611f, + 0.0005819117379f, + 0.0002437426033f, + -0.0001179165349f, + -0.0004587307896f, + -0.0007387999373f, + -0.0009269528060f, + -0.0010036852815f, + -0.0009625110041f, + -0.0008097088243f, + -0.0005626469270f, + -0.0002470172936f, + 0.0001065892726f, + 0.0004663041298f, + 0.0008023617978f, + 0.0010898828479f, + 0.0013108132368f, + 0.0014549038561f, + 0.0015197416085f, + 0.0015099531702f, + 0.0014357836468f, + 0.0013112968761f, + 0.0011524547932f, + 0.0009753045793f, + 0.0007944666281f, + 0.0006220183860f, + 0.0004668904560f, + 0.0003345911923f, + 0.0002276460304f, + 0.0001454681461f, + 0.0000866606150f, + 0.0000454431541f, + 0.0000236531982f, + 0.0000052994842f, + }; +} diff --git a/core/src/dsp/multirate/decim/plans.h b/core/src/dsp/multirate/decim/plans.h new file mode 100644 index 0000000..94a8278 --- /dev/null +++ b/core/src/dsp/multirate/decim/plans.h @@ -0,0 +1,138 @@ +#pragma once +#include "taps/fir_1024_64.h" +#include "taps/fir_128_16.h" +#include "taps/fir_16_8.h" +#include "taps/fir_2048_64.h" +#include "taps/fir_256_32.h" +#include "taps/fir_2_2.h" +#include "taps/fir_32_8.h" +#include "taps/fir_4096_64.h" +#include "taps/fir_4_2.h" +#include "taps/fir_512_32.h" +#include "taps/fir_64_8.h" +#include "taps/fir_8192_128.h" +#include "taps/fir_8_4.h" + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + struct stage { + unsigned int decimation; + unsigned int tapcount; + const float* taps; + }; + + struct plan { + unsigned int stageCount; + const stage* stages; + }; + + const unsigned int plan_1024_len = 3; + const stage plan_1024[] = { + { 64, fir_1024_64_len, fir_1024_64_taps }, + { 8, fir_16_8_len, fir_16_8_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_128_len = 3; + const stage plan_128[] = { + { 16, fir_128_16_len, fir_128_16_taps }, + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_16_len = 2; + const stage plan_16[] = { + { 8, fir_16_8_len, fir_16_8_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_2_len = 1; + const stage plan_2[] = { + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_2048_len = 4; + const stage plan_2048[] = { + { 64, fir_2048_64_len, fir_2048_64_taps }, + { 8, fir_32_8_len, fir_32_8_taps }, + { 2, fir_4_2_len, fir_4_2_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_256_len = 3; + const stage plan_256[] = { + { 32, fir_256_32_len, fir_256_32_taps }, + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_32_len = 3; + const stage plan_32[] = { + { 8, fir_32_8_len, fir_32_8_taps }, + { 2, fir_4_2_len, fir_4_2_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_4_len = 2; + const stage plan_4[] = { + { 2, fir_4_2_len, fir_4_2_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_4096_len = 4; + const stage plan_4096[] = { + { 64, fir_4096_64_len, fir_4096_64_taps }, + { 8, fir_64_8_len, fir_64_8_taps }, + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_512_len = 3; + const stage plan_512[] = { + { 32, fir_512_32_len, fir_512_32_taps }, + { 8, fir_16_8_len, fir_16_8_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_64_len = 3; + const stage plan_64[] = { + { 8, fir_64_8_len, fir_64_8_taps }, + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_8_len = 2; + const stage plan_8[] = { + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plan_8192_len = 4; + const stage plan_8192[] = { + { 128, fir_8192_128_len, fir_8192_128_taps }, + { 8, fir_64_8_len, fir_64_8_taps }, + { 4, fir_8_4_len, fir_8_4_taps }, + { 2, fir_2_2_len, fir_2_2_taps }, + }; + + const unsigned int plans_len = 13; + const plan plans[] { + { plan_2_len, plan_2 }, + { plan_4_len, plan_4 }, + { plan_8_len, plan_8 }, + { plan_16_len, plan_16 }, + { plan_32_len, plan_32 }, + { plan_64_len, plan_64 }, + { plan_128_len, plan_128 }, + { plan_256_len, plan_256 }, + { plan_512_len, plan_512 }, + { plan_1024_len, plan_1024 }, + { plan_2048_len, plan_2048 }, + { plan_4096_len, plan_4096 }, + { plan_8192_len, plan_8192 }, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_1024_128.h b/core/src/dsp/multirate/decim/taps/fir_1024_128.h new file mode 100644 index 0000000..d088a9d --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_1024_128.h @@ -0,0 +1,577 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_1024_128_len = 565; + const float fir_1024_128_taps[] = { + -0.0000004327587f, + 0.0000026997780f, + 0.0000011158244f, + 0.0000009851064f, + 0.0000010818484f, + 0.0000012233487f, + 0.0000013829611f, + 0.0000015574122f, + 0.0000017469545f, + 0.0000019523988f, + 0.0000021746708f, + 0.0000024147452f, + 0.0000026736369f, + 0.0000029524002f, + 0.0000032521294f, + 0.0000035739593f, + 0.0000039190664f, + 0.0000042886691f, + 0.0000046840291f, + 0.0000051064513f, + 0.0000055572854f, + 0.0000060379258f, + 0.0000065498127f, + 0.0000070944329f, + 0.0000076733199f, + 0.0000082880550f, + 0.0000089402676f, + 0.0000096316359f, + 0.0000103638874f, + 0.0000111387995f, + 0.0000119581996f, + 0.0000128239662f, + 0.0000137380287f, + 0.0000147023683f, + 0.0000157190179f, + 0.0000167900628f, + 0.0000179176408f, + 0.0000191039423f, + 0.0000203512110f, + 0.0000216617435f, + 0.0000230378899f, + 0.0000244820535f, + 0.0000259966913f, + 0.0000275843135f, + 0.0000292474837f, + 0.0000309888191f, + 0.0000328109897f, + 0.0000347167188f, + 0.0000367087824f, + 0.0000387900088f, + 0.0000409632787f, + 0.0000432315243f, + 0.0000455977293f, + 0.0000480649281f, + 0.0000506362055f, + 0.0000533146957f, + 0.0000561035822f, + 0.0000590060964f, + 0.0000620255175f, + 0.0000651651712f, + 0.0000684284288f, + 0.0000718187066f, + 0.0000753394644f, + 0.0000789942048f, + 0.0000827864719f, + 0.0000867198500f, + 0.0000907979625f, + 0.0000950244704f, + 0.0000994030710f, + 0.0001039374965f, + 0.0001086315122f, + 0.0001134889152f, + 0.0001185135326f, + 0.0001237092199f, + 0.0001290798590f, + 0.0001346293565f, + 0.0001403616418f, + 0.0001462806650f, + 0.0001523903952f, + 0.0001586948179f, + 0.0001651979332f, + 0.0001719037534f, + 0.0001788163010f, + 0.0001859396059f, + 0.0001932777035f, + 0.0002008346317f, + 0.0002086144290f, + 0.0002166211315f, + 0.0002248587702f, + 0.0002333313688f, + 0.0002420429405f, + 0.0002509974854f, + 0.0002601989878f, + 0.0002696514131f, + 0.0002793587049f, + 0.0002893247820f, + 0.0002995535358f, + 0.0003100488266f, + 0.0003208144809f, + 0.0003318542882f, + 0.0003431719977f, + 0.0003547713152f, + 0.0003666559000f, + 0.0003788293613f, + 0.0003912952551f, + 0.0004040570809f, + 0.0004171182782f, + 0.0004304822235f, + 0.0004441522261f, + 0.0004581315258f, + 0.0004724232886f, + 0.0004870306035f, + 0.0005019564795f, + 0.0005172038413f, + 0.0005327755266f, + 0.0005486742825f, + 0.0005649027617f, + 0.0005814635194f, + 0.0005983590097f, + 0.0006155915822f, + 0.0006331634787f, + 0.0006510768296f, + 0.0006693336508f, + 0.0006879358399f, + 0.0007068851735f, + 0.0007261833032f, + 0.0007458317529f, + 0.0007658319153f, + 0.0007861850487f, + 0.0008068922738f, + 0.0008279545709f, + 0.0008493727764f, + 0.0008711475801f, + 0.0008932795221f, + 0.0009157689899f, + 0.0009386162156f, + 0.0009618212732f, + 0.0009853840755f, + 0.0010093043719f, + 0.0010335817458f, + 0.0010582156116f, + 0.0010832052129f, + 0.0011085496198f, + 0.0011342477266f, + 0.0011602982499f, + 0.0011866997262f, + 0.0012134505102f, + 0.0012405487727f, + 0.0012679924989f, + 0.0012957794865f, + 0.0013239073445f, + 0.0013523734912f, + 0.0013811751533f, + 0.0014103093644f, + 0.0014397729637f, + 0.0014695625952f, + 0.0014996747065f, + 0.0015301055485f, + 0.0015608511740f, + 0.0015919074376f, + 0.0016232699954f, + 0.0016549343039f, + 0.0016868956210f, + 0.0017191490046f, + 0.0017516893140f, + 0.0017845112089f, + 0.0018176091508f, + 0.0018509774026f, + 0.0018846100298f, + 0.0019185009010f, + 0.0019526436887f, + 0.0019870318707f, + 0.0020216587307f, + 0.0020565173602f, + 0.0020916006596f, + 0.0021269013399f, + 0.0021624119242f, + 0.0021981247499f, + 0.0022340319707f, + 0.0022701255585f, + 0.0023063973058f, + 0.0023428388283f, + 0.0023794415672f, + 0.0024161967921f, + 0.0024530956039f, + 0.0024901289377f, + 0.0025272875658f, + 0.0025645621012f, + 0.0026019430011f, + 0.0026394205698f, + 0.0026769849632f, + 0.0027146261921f, + 0.0027523341262f, + 0.0027900984982f, + 0.0028279089079f, + 0.0028657548267f, + 0.0029036256018f, + 0.0029415104608f, + 0.0029793985165f, + 0.0030172787713f, + 0.0030551401225f, + 0.0030929713673f, + 0.0031307612072f, + 0.0031684982542f, + 0.0032061710353f, + 0.0032437679982f, + 0.0032812775168f, + 0.0033186878969f, + 0.0033559873813f, + 0.0033931641562f, + 0.0034302063567f, + 0.0034671020727f, + 0.0035038393549f, + 0.0035404062207f, + 0.0035767906605f, + 0.0036129806440f, + 0.0036489641257f, + 0.0036847290520f, + 0.0037202633668f, + 0.0037555550186f, + 0.0037905919660f, + 0.0038253621849f, + 0.0038598536743f, + 0.0038940544635f, + 0.0039279526178f, + 0.0039615362454f, + 0.0039947935041f, + 0.0040277126075f, + 0.0040602818315f, + 0.0040924895211f, + 0.0041243240966f, + 0.0041557740604f, + 0.0041868280032f, + 0.0042174746106f, + 0.0042477026695f, + 0.0042775010745f, + 0.0043068588342f, + 0.0043357650775f, + 0.0043642090601f, + 0.0043921801703f, + 0.0044196679357f, + 0.0044466620287f, + 0.0044731522730f, + 0.0044991286493f, + 0.0045245813014f, + 0.0045495005417f, + 0.0045738768574f, + 0.0045977009155f, + 0.0046209635689f, + 0.0046436558617f, + 0.0046657690344f, + 0.0046872945291f, + 0.0047082239951f, + 0.0047285492933f, + 0.0047482625015f, + 0.0047673559190f, + 0.0047858220715f, + 0.0048036537152f, + 0.0048208438417f, + 0.0048373856818f, + 0.0048532727100f, + 0.0048684986482f, + 0.0048830574697f, + 0.0048969434029f, + 0.0049101509346f, + 0.0049226748137f, + 0.0049345100543f, + 0.0049456519385f, + 0.0049560960197f, + 0.0049658381254f, + 0.0049748743591f, + 0.0049832011036f, + 0.0049908150224f, + 0.0049977130625f, + 0.0050038924557f, + 0.0050093507207f, + 0.0050140856644f, + 0.0050180953834f, + 0.0050213782651f, + 0.0050239329888f, + 0.0050257585263f, + 0.0050268541429f, + 0.0050272193974f, + 0.0050268541429f, + 0.0050257585263f, + 0.0050239329888f, + 0.0050213782651f, + 0.0050180953834f, + 0.0050140856644f, + 0.0050093507207f, + 0.0050038924557f, + 0.0049977130625f, + 0.0049908150224f, + 0.0049832011036f, + 0.0049748743591f, + 0.0049658381254f, + 0.0049560960197f, + 0.0049456519385f, + 0.0049345100543f, + 0.0049226748137f, + 0.0049101509346f, + 0.0048969434029f, + 0.0048830574697f, + 0.0048684986482f, + 0.0048532727100f, + 0.0048373856818f, + 0.0048208438417f, + 0.0048036537152f, + 0.0047858220715f, + 0.0047673559190f, + 0.0047482625015f, + 0.0047285492933f, + 0.0047082239951f, + 0.0046872945291f, + 0.0046657690344f, + 0.0046436558617f, + 0.0046209635689f, + 0.0045977009155f, + 0.0045738768574f, + 0.0045495005417f, + 0.0045245813014f, + 0.0044991286493f, + 0.0044731522730f, + 0.0044466620287f, + 0.0044196679357f, + 0.0043921801703f, + 0.0043642090601f, + 0.0043357650775f, + 0.0043068588342f, + 0.0042775010745f, + 0.0042477026695f, + 0.0042174746106f, + 0.0041868280032f, + 0.0041557740604f, + 0.0041243240966f, + 0.0040924895211f, + 0.0040602818315f, + 0.0040277126075f, + 0.0039947935041f, + 0.0039615362454f, + 0.0039279526178f, + 0.0038940544635f, + 0.0038598536743f, + 0.0038253621849f, + 0.0037905919660f, + 0.0037555550186f, + 0.0037202633668f, + 0.0036847290520f, + 0.0036489641257f, + 0.0036129806440f, + 0.0035767906605f, + 0.0035404062207f, + 0.0035038393549f, + 0.0034671020727f, + 0.0034302063567f, + 0.0033931641562f, + 0.0033559873813f, + 0.0033186878969f, + 0.0032812775168f, + 0.0032437679982f, + 0.0032061710353f, + 0.0031684982542f, + 0.0031307612072f, + 0.0030929713673f, + 0.0030551401225f, + 0.0030172787713f, + 0.0029793985165f, + 0.0029415104608f, + 0.0029036256018f, + 0.0028657548267f, + 0.0028279089079f, + 0.0027900984982f, + 0.0027523341262f, + 0.0027146261921f, + 0.0026769849632f, + 0.0026394205698f, + 0.0026019430011f, + 0.0025645621012f, + 0.0025272875658f, + 0.0024901289377f, + 0.0024530956039f, + 0.0024161967921f, + 0.0023794415672f, + 0.0023428388283f, + 0.0023063973058f, + 0.0022701255585f, + 0.0022340319707f, + 0.0021981247499f, + 0.0021624119242f, + 0.0021269013399f, + 0.0020916006596f, + 0.0020565173602f, + 0.0020216587307f, + 0.0019870318707f, + 0.0019526436887f, + 0.0019185009010f, + 0.0018846100298f, + 0.0018509774026f, + 0.0018176091508f, + 0.0017845112089f, + 0.0017516893140f, + 0.0017191490046f, + 0.0016868956210f, + 0.0016549343039f, + 0.0016232699954f, + 0.0015919074376f, + 0.0015608511740f, + 0.0015301055485f, + 0.0014996747065f, + 0.0014695625952f, + 0.0014397729637f, + 0.0014103093644f, + 0.0013811751533f, + 0.0013523734912f, + 0.0013239073445f, + 0.0012957794865f, + 0.0012679924989f, + 0.0012405487727f, + 0.0012134505102f, + 0.0011866997262f, + 0.0011602982499f, + 0.0011342477266f, + 0.0011085496198f, + 0.0010832052129f, + 0.0010582156116f, + 0.0010335817458f, + 0.0010093043719f, + 0.0009853840755f, + 0.0009618212732f, + 0.0009386162156f, + 0.0009157689899f, + 0.0008932795221f, + 0.0008711475801f, + 0.0008493727764f, + 0.0008279545709f, + 0.0008068922738f, + 0.0007861850487f, + 0.0007658319153f, + 0.0007458317529f, + 0.0007261833032f, + 0.0007068851735f, + 0.0006879358399f, + 0.0006693336508f, + 0.0006510768296f, + 0.0006331634787f, + 0.0006155915822f, + 0.0005983590097f, + 0.0005814635194f, + 0.0005649027617f, + 0.0005486742825f, + 0.0005327755266f, + 0.0005172038413f, + 0.0005019564795f, + 0.0004870306035f, + 0.0004724232886f, + 0.0004581315258f, + 0.0004441522261f, + 0.0004304822235f, + 0.0004171182782f, + 0.0004040570809f, + 0.0003912952551f, + 0.0003788293613f, + 0.0003666559000f, + 0.0003547713152f, + 0.0003431719977f, + 0.0003318542882f, + 0.0003208144809f, + 0.0003100488266f, + 0.0002995535358f, + 0.0002893247820f, + 0.0002793587049f, + 0.0002696514131f, + 0.0002601989878f, + 0.0002509974854f, + 0.0002420429405f, + 0.0002333313688f, + 0.0002248587702f, + 0.0002166211315f, + 0.0002086144290f, + 0.0002008346317f, + 0.0001932777035f, + 0.0001859396059f, + 0.0001788163010f, + 0.0001719037534f, + 0.0001651979332f, + 0.0001586948179f, + 0.0001523903952f, + 0.0001462806650f, + 0.0001403616418f, + 0.0001346293565f, + 0.0001290798590f, + 0.0001237092199f, + 0.0001185135326f, + 0.0001134889152f, + 0.0001086315122f, + 0.0001039374965f, + 0.0000994030710f, + 0.0000950244704f, + 0.0000907979625f, + 0.0000867198500f, + 0.0000827864719f, + 0.0000789942048f, + 0.0000753394644f, + 0.0000718187066f, + 0.0000684284288f, + 0.0000651651712f, + 0.0000620255175f, + 0.0000590060964f, + 0.0000561035822f, + 0.0000533146957f, + 0.0000506362055f, + 0.0000480649281f, + 0.0000455977293f, + 0.0000432315243f, + 0.0000409632787f, + 0.0000387900088f, + 0.0000367087824f, + 0.0000347167188f, + 0.0000328109897f, + 0.0000309888191f, + 0.0000292474837f, + 0.0000275843135f, + 0.0000259966913f, + 0.0000244820535f, + 0.0000230378899f, + 0.0000216617435f, + 0.0000203512110f, + 0.0000191039423f, + 0.0000179176408f, + 0.0000167900628f, + 0.0000157190179f, + 0.0000147023683f, + 0.0000137380287f, + 0.0000128239662f, + 0.0000119581996f, + 0.0000111387995f, + 0.0000103638874f, + 0.0000096316359f, + 0.0000089402676f, + 0.0000082880550f, + 0.0000076733199f, + 0.0000070944329f, + 0.0000065498127f, + 0.0000060379258f, + 0.0000055572854f, + 0.0000051064513f, + 0.0000046840291f, + 0.0000042886691f, + 0.0000039190664f, + 0.0000035739593f, + 0.0000032521294f, + 0.0000029524002f, + 0.0000026736369f, + 0.0000024147452f, + 0.0000021746708f, + 0.0000019523988f, + 0.0000017469545f, + 0.0000015574122f, + 0.0000013829611f, + 0.0000012233487f, + 0.0000010818484f, + 0.0000009851064f, + 0.0000011158244f, + 0.0000026997780f, + -0.0000004327587f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_1024_32.h b/core/src/dsp/multirate/decim/taps/fir_1024_32.h new file mode 100644 index 0000000..90dc634 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_1024_32.h @@ -0,0 +1,139 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_1024_32_len = 127; + const float fir_1024_32_taps[] = { + 0.0000088623347f, + 0.0000103966907f, + 0.0000163498386f, + 0.0000244235766f, + 0.0000351129776f, + 0.0000489833599f, + 0.0000666735323f, + 0.0000888982223f, + 0.0001164495403f, + 0.0001501973386f, + 0.0001910883324f, + 0.0002401438579f, + 0.0002984561609f, + 0.0003671831240f, + 0.0004475413632f, + 0.0005407976486f, + 0.0006482586323f, + 0.0007712588932f, + 0.0009111473429f, + 0.0010692720689f, + 0.0012469637247f, + 0.0014455176106f, + 0.0016661746238f, + 0.0019101012879f, + 0.0021783691022f, + 0.0024719334814f, + 0.0027916125787f, + 0.0031380663077f, + 0.0035117758952f, + 0.0039130243058f, + 0.0043418778893f, + 0.0047981695968f, + 0.0052814841081f, + 0.0057911451996f, + 0.0063262056615f, + 0.0068854400478f, + 0.0074673405131f, + 0.0080701159494f, + 0.0086916945938f, + 0.0093297302355f, + 0.0099816120904f, + 0.0106444783655f, + 0.0113152334735f, + 0.0119905688011f, + 0.0126669868781f, + 0.0133408287327f, + 0.0140083041674f, + 0.0146655246349f, + 0.0153085383440f, + 0.0159333671827f, + 0.0165360450080f, + 0.0171126568203f, + 0.0176593783140f, + 0.0181725152845f, + 0.0186485423586f, + 0.0190841405193f, + 0.0194762329058f, + 0.0198220183835f, + 0.0201190024112f, + 0.0203650247621f, + 0.0205582836996f, + 0.0206973562585f, + 0.0207812143359f, + 0.0208092363555f, + 0.0207812143359f, + 0.0206973562585f, + 0.0205582836996f, + 0.0203650247621f, + 0.0201190024112f, + 0.0198220183835f, + 0.0194762329058f, + 0.0190841405193f, + 0.0186485423586f, + 0.0181725152845f, + 0.0176593783140f, + 0.0171126568203f, + 0.0165360450080f, + 0.0159333671827f, + 0.0153085383440f, + 0.0146655246349f, + 0.0140083041674f, + 0.0133408287327f, + 0.0126669868781f, + 0.0119905688011f, + 0.0113152334735f, + 0.0106444783655f, + 0.0099816120904f, + 0.0093297302355f, + 0.0086916945938f, + 0.0080701159494f, + 0.0074673405131f, + 0.0068854400478f, + 0.0063262056615f, + 0.0057911451996f, + 0.0052814841081f, + 0.0047981695968f, + 0.0043418778893f, + 0.0039130243058f, + 0.0035117758952f, + 0.0031380663077f, + 0.0027916125787f, + 0.0024719334814f, + 0.0021783691022f, + 0.0019101012879f, + 0.0016661746238f, + 0.0014455176106f, + 0.0012469637247f, + 0.0010692720689f, + 0.0009111473429f, + 0.0007712588932f, + 0.0006482586323f, + 0.0005407976486f, + 0.0004475413632f, + 0.0003671831240f, + 0.0002984561609f, + 0.0002401438579f, + 0.0001910883324f, + 0.0001501973386f, + 0.0001164495403f, + 0.0000888982223f, + 0.0000666735323f, + 0.0000489833599f, + 0.0000351129776f, + 0.0000244235766f, + 0.0000163498386f, + 0.0000103966907f, + 0.0000088623347f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_1024_64.h b/core/src/dsp/multirate/decim/taps/fir_1024_64.h new file mode 100644 index 0000000..110cb08 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_1024_64.h @@ -0,0 +1,269 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_1024_64_len = 257; + const float fir_1024_64_taps[] = { + 0.000006462031529, + 0.000003762409463, + 0.000004844873785, + 0.000006123946040, + 0.000007623557621, + 0.000009369500189, + 0.000011389489511, + 0.000013713225713, + 0.000016372450007, + 0.000019400995965, + 0.000022834836357, + 0.000026712124166, + 0.000031073227314, + 0.000035960757034, + 0.000041419588684, + 0.000047496875380, + 0.000054242053050, + 0.000061706837053, + 0.000069945209697, + 0.000079013398311, + 0.000088969843345, + 0.000099875155888, + 0.000111792065160, + 0.000124785354321, + 0.000138921785260, + 0.000154270012137, + 0.000170900482798, + 0.000188885328279, + 0.000208298240660, + 0.000229214338496, + 0.000251710020027, + 0.000275862804808, + 0.000301751162750, + 0.000329454331625, + 0.000359052122812, + 0.000390624715628, + 0.000424252440518, + 0.000460015551653, + 0.000497993989069, + 0.000538267130868, + 0.000580913536707, + 0.000626010681838, + 0.000673634683977, + 0.000723860022294, + 0.000776759250136, + 0.000832402702294, + 0.000890858197110, + 0.000952190735149, + 0.001016462194703, + 0.001083731025617, + 0.001154051942217, + 0.001227475616900, + 0.001304048374716, + 0.001383811890755, + 0.001466802891491, + 0.001553052860930, + 0.001642587753007, + 0.001735427711423, + 0.001831586798359, + 0.001931072732585, + 0.002033886639476, + 0.002140022812541, + 0.002249468489330, + 0.002362203641302, + 0.002478200780155, + 0.002597424780897, + 0.002719832722953, + 0.002845373750630, + 0.002973988953416, + 0.003105611267477, + 0.003240165399026, + 0.003377567770453, + 0.003517726489639, + 0.003660541344023, + 0.003805903818490, + 0.003953697139430, + 0.004103796343600, + 0.004256068373481, + 0.004410372198649, + 0.004566558963662, + 0.004724472161982, + 0.004883947836741, + 0.005044814807351, + 0.005206894922255, + 0.005370003337046, + 0.005533948818282, + 0.005698534071229, + 0.005863556091925, + 0.006028806542319, + 0.006194072147902, + 0.006359135116484, + 0.006523773577483, + 0.006687762040265, + 0.006850871870724, + 0.007012871784157, + 0.007173528353865, + 0.007332606533364, + 0.007489870190776, + 0.007645082654370, + 0.007798007266777, + 0.007948407946740, + 0.008096049756555, + 0.008240699473269, + 0.008382126161983, + 0.008520101749207, + 0.008654401594640, + 0.008784805059577, + 0.008911096069443, + 0.009033063669314, + 0.009150502570440, + 0.009263213685289, + 0.009371004650260, + 0.009473690333377, + 0.009571093325806, + 0.009663044415454, + 0.009749383040556, + 0.009829957722201, + 0.009904626474092, + 0.009973257187859, + 0.010035727993149, + 0.010091927590538, + 0.010141755556416, + 0.010185122619096, + 0.010221950904489, + 0.010252174150955, + 0.010275737892470, + 0.010292599609103, + 0.010302728845123, + 0.010306107293174, + 0.010302728845123, + 0.010292599609103, + 0.010275737892470, + 0.010252174150955, + 0.010221950904489, + 0.010185122619096, + 0.010141755556416, + 0.010091927590538, + 0.010035727993149, + 0.009973257187859, + 0.009904626474092, + 0.009829957722201, + 0.009749383040556, + 0.009663044415454, + 0.009571093325806, + 0.009473690333377, + 0.009371004650260, + 0.009263213685289, + 0.009150502570440, + 0.009033063669314, + 0.008911096069443, + 0.008784805059577, + 0.008654401594640, + 0.008520101749207, + 0.008382126161983, + 0.008240699473269, + 0.008096049756555, + 0.007948407946740, + 0.007798007266777, + 0.007645082654370, + 0.007489870190776, + 0.007332606533364, + 0.007173528353865, + 0.007012871784157, + 0.006850871870724, + 0.006687762040265, + 0.006523773577483, + 0.006359135116484, + 0.006194072147902, + 0.006028806542319, + 0.005863556091925, + 0.005698534071229, + 0.005533948818282, + 0.005370003337046, + 0.005206894922255, + 0.005044814807351, + 0.004883947836741, + 0.004724472161982, + 0.004566558963662, + 0.004410372198649, + 0.004256068373481, + 0.004103796343600, + 0.003953697139430, + 0.003805903818490, + 0.003660541344023, + 0.003517726489639, + 0.003377567770453, + 0.003240165399026, + 0.003105611267477, + 0.002973988953416, + 0.002845373750630, + 0.002719832722953, + 0.002597424780897, + 0.002478200780155, + 0.002362203641302, + 0.002249468489330, + 0.002140022812541, + 0.002033886639476, + 0.001931072732585, + 0.001831586798359, + 0.001735427711423, + 0.001642587753007, + 0.001553052860930, + 0.001466802891491, + 0.001383811890755, + 0.001304048374716, + 0.001227475616900, + 0.001154051942217, + 0.001083731025617, + 0.001016462194703, + 0.000952190735149, + 0.000890858197110, + 0.000832402702294, + 0.000776759250136, + 0.000723860022294, + 0.000673634683977, + 0.000626010681838, + 0.000580913536707, + 0.000538267130868, + 0.000497993989069, + 0.000460015551653, + 0.000424252440518, + 0.000390624715628, + 0.000359052122812, + 0.000329454331625, + 0.000301751162750, + 0.000275862804808, + 0.000251710020027, + 0.000229214338496, + 0.000208298240660, + 0.000188885328279, + 0.000170900482798, + 0.000154270012137, + 0.000138921785260, + 0.000124785354321, + 0.000111792065160, + 0.000099875155888, + 0.000088969843345, + 0.000079013398311, + 0.000069945209697, + 0.000061706837053, + 0.000054242053050, + 0.000047496875380, + 0.000041419588684, + 0.000035960757034, + 0.000031073227314, + 0.000026712124166, + 0.000022834836357, + 0.000019400995965, + 0.000016372450007, + 0.000013713225713, + 0.000011389489511, + 0.000009369500189, + 0.000007623557621, + 0.000006123946040, + 0.000004844873785, + 0.000003762409463, + 0.000006462031529, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_128_16.h b/core/src/dsp/multirate/decim/taps/fir_128_16.h new file mode 100644 index 0000000..878cc70 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_128_16.h @@ -0,0 +1,84 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_16_len = 72; + const float fir_128_16_taps[] = { + 0.000003688211243, + 0.000013660745184, + 0.000027864244875, + 0.000056024595736, + 0.000099948148808, + 0.000168552197041, + 0.000269382284025, + 0.000413325712010, + 0.000612084815649, + 0.000879405538662, + 0.001230104825804, + 0.001680092905716, + 0.002245658820654, + 0.002942957882659, + 0.003787212583021, + 0.004791922493325, + 0.005967969572298, + 0.007322738536994, + 0.008859256322921, + 0.010575423925694, + 0.012463379308760, + 0.014509046778473, + 0.016691912242846, + 0.018985060458242, + 0.021355495646189, + 0.023764754477139, + 0.026169804021396, + 0.028524201614471, + 0.030779477612194, + 0.032886687871454, + 0.034798070863046, + 0.036468735790737, + 0.037858303447209, + 0.038932421304764, + 0.039664078609141, + 0.040034655893826, + 0.040034655893826, + 0.039664078609141, + 0.038932421304764, + 0.037858303447209, + 0.036468735790737, + 0.034798070863046, + 0.032886687871454, + 0.030779477612194, + 0.028524201614471, + 0.026169804021396, + 0.023764754477139, + 0.021355495646189, + 0.018985060458242, + 0.016691912242846, + 0.014509046778473, + 0.012463379308760, + 0.010575423925694, + 0.008859256322921, + 0.007322738536994, + 0.005967969572298, + 0.004791922493325, + 0.003787212583021, + 0.002942957882659, + 0.002245658820654, + 0.001680092905716, + 0.001230104825804, + 0.000879405538662, + 0.000612084815649, + 0.000413325712010, + 0.000269382284025, + 0.000168552197041, + 0.000099948148808, + 0.000056024595736, + 0.000027864244875, + 0.000013660745184, + 0.000003688211243, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_128_32.h b/core/src/dsp/multirate/decim/taps/fir_128_32.h new file mode 100644 index 0000000..101e8ed --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_128_32.h @@ -0,0 +1,192 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_32_len = 180; + const float fir_128_32_taps[] = { + -0.0000073470522f, + -0.0000069110271f, + -0.0000100675012f, + -0.0000140912235f, + -0.0000191269472f, + -0.0000253238429f, + -0.0000328428415f, + -0.0000418456044f, + -0.0000525009779f, + -0.0000649731010f, + -0.0000794269134f, + -0.0000960153923f, + -0.0001148841160f, + -0.0001361576878f, + -0.0001599434282f, + -0.0001863171187f, + -0.0002153259738f, + -0.0002469739186f, + -0.0002812240728f, + -0.0003179838558f, + -0.0003571072928f, + -0.0003983803151f, + -0.0004415232676f, + -0.0004861768325f, + -0.0005319051695f, + -0.0005781829346f, + -0.0006243995153f, + -0.0006698476317f, + -0.0007137291329f, + -0.0007551456568f, + -0.0007931064250f, + -0.0008265213926f, + -0.0008542114175f, + -0.0008749042532f, + -0.0008872473744f, + -0.0008898070530f, + -0.0008810839958f, + -0.0008595156045f, + -0.0008234944283f, + -0.0007713735444f, + -0.0007014876566f, + -0.0006121613543f, + -0.0005017325051f, + -0.0003685629664f, + -0.0002110637384f, + -0.0000277075239f, + 0.0001829450626f, + 0.0004222318502f, + 0.0006913626978f, + 0.0009914056595f, + 0.0013232613264f, + 0.0016876497890f, + 0.0020850867621f, + 0.0025158723705f, + 0.0029800700983f, + 0.0034774984108f, + 0.0040077135249f, + 0.0045700048063f, + 0.0051633822546f, + 0.0057865764825f, + 0.0064380316487f, + 0.0071159106399f, + 0.0078180939705f, + 0.0085421905540f, + 0.0092855428368f, + 0.0100452432731f, + 0.0108181456753f, + 0.0116008872163f, + 0.0123899056779f, + 0.0131814665052f, + 0.0139716853391f, + 0.0147565593567f, + 0.0155319941959f, + 0.0162938385551f, + 0.0170379143753f, + 0.0177600534535f, + 0.0184561295564f, + 0.0191220956422f, + 0.0197540164501f, + 0.0203481048339f, + 0.0209007533176f, + 0.0214085680250f, + 0.0218683977139f, + 0.0222773638505f, + 0.0226328857338f, + 0.0229327054015f, + 0.0231749076307f, + 0.0233579385724f, + 0.0234806196554f, + 0.0235421591137f, + 0.0235421591137f, + 0.0234806196554f, + 0.0233579385724f, + 0.0231749076307f, + 0.0229327054015f, + 0.0226328857338f, + 0.0222773638505f, + 0.0218683977139f, + 0.0214085680250f, + 0.0209007533176f, + 0.0203481048339f, + 0.0197540164501f, + 0.0191220956422f, + 0.0184561295564f, + 0.0177600534535f, + 0.0170379143753f, + 0.0162938385551f, + 0.0155319941959f, + 0.0147565593567f, + 0.0139716853391f, + 0.0131814665052f, + 0.0123899056779f, + 0.0116008872163f, + 0.0108181456753f, + 0.0100452432731f, + 0.0092855428368f, + 0.0085421905540f, + 0.0078180939705f, + 0.0071159106399f, + 0.0064380316487f, + 0.0057865764825f, + 0.0051633822546f, + 0.0045700048063f, + 0.0040077135249f, + 0.0034774984108f, + 0.0029800700983f, + 0.0025158723705f, + 0.0020850867621f, + 0.0016876497890f, + 0.0013232613264f, + 0.0009914056595f, + 0.0006913626978f, + 0.0004222318502f, + 0.0001829450626f, + -0.0000277075239f, + -0.0002110637384f, + -0.0003685629664f, + -0.0005017325051f, + -0.0006121613543f, + -0.0007014876566f, + -0.0007713735444f, + -0.0008234944283f, + -0.0008595156045f, + -0.0008810839958f, + -0.0008898070530f, + -0.0008872473744f, + -0.0008749042532f, + -0.0008542114175f, + -0.0008265213926f, + -0.0007931064250f, + -0.0007551456568f, + -0.0007137291329f, + -0.0006698476317f, + -0.0006243995153f, + -0.0005781829346f, + -0.0005319051695f, + -0.0004861768325f, + -0.0004415232676f, + -0.0003983803151f, + -0.0003571072928f, + -0.0003179838558f, + -0.0002812240728f, + -0.0002469739186f, + -0.0002153259738f, + -0.0001863171187f, + -0.0001599434282f, + -0.0001361576878f, + -0.0001148841160f, + -0.0000960153923f, + -0.0000794269134f, + -0.0000649731010f, + -0.0000525009779f, + -0.0000418456044f, + -0.0000328428415f, + -0.0000253238429f, + -0.0000191269472f, + -0.0000140912235f, + -0.0000100675012f, + -0.0000069110271f, + -0.0000073470522f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_128_4.h b/core/src/dsp/multirate/decim/taps/fir_128_4.h new file mode 100644 index 0000000..289c966 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_128_4.h @@ -0,0 +1,28 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_4_len = 16; + const float fir_128_4_taps[] = { + 0.0003502294673f, + 0.0025622621714f, + 0.0100604175711f, + 0.0274832811630f, + 0.0576540582560f, + 0.0975667617613f, + 0.1368722747794f, + 0.1615718864375f, + 0.1615718864375f, + 0.1368722747794f, + 0.0975667617613f, + 0.0576540582560f, + 0.0274832811630f, + 0.0100604175711f, + 0.0025622621714f, + 0.0003502294673f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_128_64.h b/core/src/dsp/multirate/decim/taps/fir_128_64.h new file mode 100644 index 0000000..786cc1e --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_128_64.h @@ -0,0 +1,519 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_64_len = 507; + const float fir_128_64_taps[] = { + 0.0000059328143f, + 0.0000021865747f, + 0.0000025830027f, + 0.0000030222125f, + 0.0000035067628f, + 0.0000040392284f, + 0.0000046221895f, + 0.0000052582199f, + 0.0000059498747f, + 0.0000066996765f, + 0.0000075101016f, + 0.0000083835652f, + 0.0000093224054f, + 0.0000103288670f, + 0.0000114050841f, + 0.0000125530626f, + 0.0000137746613f, + 0.0000150715728f, + 0.0000164453038f, + 0.0000178971548f, + 0.0000194281990f, + 0.0000210392611f, + 0.0000227308957f, + 0.0000245033648f, + 0.0000263566159f, + 0.0000282902593f, + 0.0000303035451f, + 0.0000323953405f, + 0.0000345641075f, + 0.0000368078793f, + 0.0000391242389f, + 0.0000415102957f, + 0.0000439626648f, + 0.0000464774447f, + 0.0000490501970f, + 0.0000516759262f, + 0.0000543490601f, + 0.0000570634318f, + 0.0000598122618f, + 0.0000625881417f, + 0.0000653830194f, + 0.0000681881850f, + 0.0000709942585f, + 0.0000737911790f, + 0.0000765681960f, + 0.0000793138614f, + 0.0000820160247f, + 0.0000846618292f, + 0.0000872377109f, + 0.0000897293998f, + 0.0000921219225f, + 0.0000943996085f, + 0.0000965460984f, + 0.0000985443543f, + 0.0001003766741f, + 0.0001020247075f, + 0.0001034694753f, + 0.0001046913914f, + 0.0001056702886f, + 0.0001063854463f, + 0.0001068156220f, + 0.0001069390861f, + 0.0001067336594f, + 0.0001061767539f, + 0.0001052454174f, + 0.0001039163805f, + 0.0001021661074f, + 0.0000999708498f, + 0.0000973067041f, + 0.0000941496711f, + 0.0000904757201f, + 0.0000862608548f, + 0.0000814811826f, + 0.0000761129878f, + 0.0000701328055f, + 0.0000635175006f, + 0.0000562443479f, + 0.0000482911149f, + 0.0000396361475f, + 0.0000302584574f, + 0.0000201378119f, + 0.0000092548251f, + -0.0000024089487f, + -0.0000148709202f, + -0.0000281473694f, + -0.0000422533485f, + -0.0000572025836f, + -0.0000730073769f, + -0.0000896785070f, + -0.0001072251303f, + -0.0001256546823f, + -0.0001449727787f, + -0.0001651831180f, + -0.0001862873844f, + -0.0002082851526f, + -0.0002311737938f, + -0.0002549483834f, + -0.0002796016114f, + -0.0003051236947f, + -0.0003315022928f, + -0.0003587224261f, + -0.0003867663977f, + -0.0004156137196f, + -0.0004452410417f, + -0.0004756220865f, + -0.0005067275876f, + -0.0005385252334f, + -0.0005709796161f, + -0.0006040521866f, + -0.0006377012146f, + -0.0006718817554f, + -0.0007065456227f, + -0.0007416413688f, + -0.0007771142706f, + -0.0008129063239f, + -0.0008489562441f, + -0.0008851994755f, + -0.0009215682077f, + -0.0009579914002f, + -0.0009943948149f, + -0.0010307010577f, + -0.0010668296278f, + -0.0011026969756f, + -0.0011382165698f, + -0.0011732989726f, + -0.0012078519242f, + -0.0012417804357f, + -0.0012749868911f, + -0.0013073711584f, + -0.0013388307085f, + -0.0013692607440f, + -0.0013985543359f, + -0.0014266025695f, + -0.0014532946976f, + -0.0014785183035f, + -0.0015021594706f, + -0.0015241029610f, + -0.0015442324013f, + -0.0015624304759f, + -0.0015785791272f, + -0.0015925597630f, + -0.0016042534706f, + -0.0016135412362f, + -0.0016203041714f, + -0.0016244237439f, + -0.0016257820138f, + -0.0016242618751f, + -0.0016197472998f, + -0.0016121235873f, + -0.0016012776158f, + -0.0015870980974f, + -0.0015694758340f, + -0.0015483039764f, + -0.0015234782833f, + -0.0014948973813f, + -0.0014624630249f, + -0.0014260803553f, + -0.0013856581588f, + -0.0013411091226f, + -0.0012923500886f, + -0.0012393023038f, + -0.0011818916675f, + -0.0011200489733f, + -0.0010537101473f, + -0.0009828164799f, + -0.0009073148519f, + -0.0008271579535f, + -0.0007423044962f, + -0.0006527194165f, + -0.0005583740715f, + -0.0004592464247f, + -0.0003553212224f, + -0.0002465901604f, + -0.0001330520388f, + -0.0000147129070f, + 0.0001084138051f, + 0.0002363071656f, + 0.0003689386344f, + 0.0005062719681f, + 0.0006482631397f, + 0.0007948602715f, + 0.0009460035829f, + 0.0011016253518f, + 0.0012616498923f, + 0.0014259935461f, + 0.0015945646903f, + 0.0017672637604f, + 0.0019439832887f, + 0.0021246079593f, + 0.0023090146782f, + 0.0024970726603f, + 0.0026886435316f, + 0.0028835814481f, + 0.0030817332298f, + 0.0032829385117f, + 0.0034870299096f, + 0.0036938332018f, + 0.0039031675262f, + 0.0041148455925f, + 0.0043286739091f, + 0.0045444530249f, + 0.0047619777845f, + 0.0049810375985f, + 0.0052014167253f, + 0.0054228945678f, + 0.0056452459812f, + 0.0058682415926f, + 0.0060916481332f, + 0.0063152287796f, + 0.0065387435067f, + 0.0067619494488f, + 0.0069846012704f, + 0.0072064515449f, + 0.0074272511403f, + 0.0076467496121f, + 0.0078646956013f, + 0.0080808372388f, + 0.0082949225525f, + 0.0085066998790f, + 0.0087159182778f, + 0.0089223279466f, + 0.0091256806387f, + 0.0093257300791f, + 0.0095222323814f, + 0.0097149464619f, + 0.0099036344516f, + 0.0100880621047f, + 0.0102679992034f, + 0.0104432199569f, + 0.0106135033952f, + 0.0107786337550f, + 0.0109384008597f, + 0.0110926004890f, + 0.0112410347414f, + 0.0113835123847f, + 0.0115198491970f, + 0.0116498682958f, + 0.0117734004551f, + 0.0118902844090f, + 0.0120003671424f, + 0.0121035041671f, + 0.0121995597832f, + 0.0122884073249f, + 0.0123699293904f, + 0.0124440180558f, + 0.0125105750712f, + 0.0125695120403f, + 0.0126207505817f, + 0.0126642224718f, + 0.0126998697703f, + 0.0127276449258f, + 0.0127475108633f, + 0.0127594410518f, + 0.0127634195532f, + 0.0127594410518f, + 0.0127475108633f, + 0.0127276449258f, + 0.0126998697703f, + 0.0126642224718f, + 0.0126207505817f, + 0.0125695120403f, + 0.0125105750712f, + 0.0124440180558f, + 0.0123699293904f, + 0.0122884073249f, + 0.0121995597832f, + 0.0121035041671f, + 0.0120003671424f, + 0.0118902844090f, + 0.0117734004551f, + 0.0116498682958f, + 0.0115198491970f, + 0.0113835123847f, + 0.0112410347414f, + 0.0110926004890f, + 0.0109384008597f, + 0.0107786337550f, + 0.0106135033952f, + 0.0104432199569f, + 0.0102679992034f, + 0.0100880621047f, + 0.0099036344516f, + 0.0097149464619f, + 0.0095222323814f, + 0.0093257300791f, + 0.0091256806387f, + 0.0089223279466f, + 0.0087159182778f, + 0.0085066998790f, + 0.0082949225525f, + 0.0080808372388f, + 0.0078646956013f, + 0.0076467496121f, + 0.0074272511403f, + 0.0072064515449f, + 0.0069846012704f, + 0.0067619494488f, + 0.0065387435067f, + 0.0063152287796f, + 0.0060916481332f, + 0.0058682415926f, + 0.0056452459812f, + 0.0054228945678f, + 0.0052014167253f, + 0.0049810375985f, + 0.0047619777845f, + 0.0045444530249f, + 0.0043286739091f, + 0.0041148455925f, + 0.0039031675262f, + 0.0036938332018f, + 0.0034870299096f, + 0.0032829385117f, + 0.0030817332298f, + 0.0028835814481f, + 0.0026886435316f, + 0.0024970726603f, + 0.0023090146782f, + 0.0021246079593f, + 0.0019439832887f, + 0.0017672637604f, + 0.0015945646903f, + 0.0014259935461f, + 0.0012616498923f, + 0.0011016253518f, + 0.0009460035829f, + 0.0007948602715f, + 0.0006482631397f, + 0.0005062719681f, + 0.0003689386344f, + 0.0002363071656f, + 0.0001084138051f, + -0.0000147129070f, + -0.0001330520388f, + -0.0002465901604f, + -0.0003553212224f, + -0.0004592464247f, + -0.0005583740715f, + -0.0006527194165f, + -0.0007423044962f, + -0.0008271579535f, + -0.0009073148519f, + -0.0009828164799f, + -0.0010537101473f, + -0.0011200489733f, + -0.0011818916675f, + -0.0012393023038f, + -0.0012923500886f, + -0.0013411091226f, + -0.0013856581588f, + -0.0014260803553f, + -0.0014624630249f, + -0.0014948973813f, + -0.0015234782833f, + -0.0015483039764f, + -0.0015694758340f, + -0.0015870980974f, + -0.0016012776158f, + -0.0016121235873f, + -0.0016197472998f, + -0.0016242618751f, + -0.0016257820138f, + -0.0016244237439f, + -0.0016203041714f, + -0.0016135412362f, + -0.0016042534706f, + -0.0015925597630f, + -0.0015785791272f, + -0.0015624304759f, + -0.0015442324013f, + -0.0015241029610f, + -0.0015021594706f, + -0.0014785183035f, + -0.0014532946976f, + -0.0014266025695f, + -0.0013985543359f, + -0.0013692607440f, + -0.0013388307085f, + -0.0013073711584f, + -0.0012749868911f, + -0.0012417804357f, + -0.0012078519242f, + -0.0011732989726f, + -0.0011382165698f, + -0.0011026969756f, + -0.0010668296278f, + -0.0010307010577f, + -0.0009943948149f, + -0.0009579914002f, + -0.0009215682077f, + -0.0008851994755f, + -0.0008489562441f, + -0.0008129063239f, + -0.0007771142706f, + -0.0007416413688f, + -0.0007065456227f, + -0.0006718817554f, + -0.0006377012146f, + -0.0006040521866f, + -0.0005709796161f, + -0.0005385252334f, + -0.0005067275876f, + -0.0004756220865f, + -0.0004452410417f, + -0.0004156137196f, + -0.0003867663977f, + -0.0003587224261f, + -0.0003315022928f, + -0.0003051236947f, + -0.0002796016114f, + -0.0002549483834f, + -0.0002311737938f, + -0.0002082851526f, + -0.0001862873844f, + -0.0001651831180f, + -0.0001449727787f, + -0.0001256546823f, + -0.0001072251303f, + -0.0000896785070f, + -0.0000730073769f, + -0.0000572025836f, + -0.0000422533485f, + -0.0000281473694f, + -0.0000148709202f, + -0.0000024089487f, + 0.0000092548251f, + 0.0000201378119f, + 0.0000302584574f, + 0.0000396361475f, + 0.0000482911149f, + 0.0000562443479f, + 0.0000635175006f, + 0.0000701328055f, + 0.0000761129878f, + 0.0000814811826f, + 0.0000862608548f, + 0.0000904757201f, + 0.0000941496711f, + 0.0000973067041f, + 0.0000999708498f, + 0.0001021661074f, + 0.0001039163805f, + 0.0001052454174f, + 0.0001061767539f, + 0.0001067336594f, + 0.0001069390861f, + 0.0001068156220f, + 0.0001063854463f, + 0.0001056702886f, + 0.0001046913914f, + 0.0001034694753f, + 0.0001020247075f, + 0.0001003766741f, + 0.0000985443543f, + 0.0000965460984f, + 0.0000943996085f, + 0.0000921219225f, + 0.0000897293998f, + 0.0000872377109f, + 0.0000846618292f, + 0.0000820160247f, + 0.0000793138614f, + 0.0000765681960f, + 0.0000737911790f, + 0.0000709942585f, + 0.0000681881850f, + 0.0000653830194f, + 0.0000625881417f, + 0.0000598122618f, + 0.0000570634318f, + 0.0000543490601f, + 0.0000516759262f, + 0.0000490501970f, + 0.0000464774447f, + 0.0000439626648f, + 0.0000415102957f, + 0.0000391242389f, + 0.0000368078793f, + 0.0000345641075f, + 0.0000323953405f, + 0.0000303035451f, + 0.0000282902593f, + 0.0000263566159f, + 0.0000245033648f, + 0.0000227308957f, + 0.0000210392611f, + 0.0000194281990f, + 0.0000178971548f, + 0.0000164453038f, + 0.0000150715728f, + 0.0000137746613f, + 0.0000125530626f, + 0.0000114050841f, + 0.0000103288670f, + 0.0000093224054f, + 0.0000083835652f, + 0.0000075101016f, + 0.0000066996765f, + 0.0000059498747f, + 0.0000052582199f, + 0.0000046221895f, + 0.0000040392284f, + 0.0000035067628f, + 0.0000030222125f, + 0.0000025830027f, + 0.0000021865747f, + 0.0000059328143f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_128_8.h b/core/src/dsp/multirate/decim/taps/fir_128_8.h new file mode 100644 index 0000000..3acd642 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_128_8.h @@ -0,0 +1,45 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_128_8_len = 33; + const float fir_128_8_taps[] = { + 0.0000402645396f, + 0.0001776497260f, + 0.0005328099895f, + 0.0012889952275f, + 0.0026955140465f, + 0.0050490564879f, + 0.0086535181818f, + 0.0137600626254f, + 0.0204960424230f, + 0.0287971941582f, + 0.0383605456257f, + 0.0486341848839f, + 0.0588539901422f, + 0.0681275795918f, + 0.0755543850679f, + 0.0803608914008f, + 0.0820245881555f, + 0.0803608914008f, + 0.0755543850679f, + 0.0681275795918f, + 0.0588539901422f, + 0.0486341848839f, + 0.0383605456257f, + 0.0287971941582f, + 0.0204960424230f, + 0.0137600626254f, + 0.0086535181818f, + 0.0050490564879f, + 0.0026955140465f, + 0.0012889952275f, + 0.0005328099895f, + 0.0001776497260f, + 0.0000402645396f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_16_16.h b/core/src/dsp/multirate/decim/taps/fir_16_16.h new file mode 100644 index 0000000..1bd95f9 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_16_16.h @@ -0,0 +1,564 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_16_len = 552; + const float fir_16_16_taps[] = { + 0.0000083199827f, + 0.0000084881676f, + 0.0000125885567f, + 0.0000177804634f, + 0.0000241852833f, + 0.0000319042337f, + 0.0000410140885f, + 0.0000515556971f, + 0.0000635293624f, + 0.0000768836058f, + 0.0000915114120f, + 0.0001072405937f, + 0.0001238323243f, + 0.0001409745652f, + 0.0001582843174f, + 0.0001753054713f, + 0.0001915159849f, + 0.0002063311677f, + 0.0002191165223f, + 0.0002291968856f, + 0.0002358749754f, + 0.0002384460258f, + 0.0002362212252f, + 0.0002285465848f, + 0.0002148295414f, + 0.0001945599050f, + 0.0001673370635f, + 0.0001328901081f, + 0.0000911024573f, + 0.0000420277999f, + -0.0000140913087f, + -0.0000768150927f, + -0.0001454972457f, + -0.0002192871274f, + -0.0002971322962f, + -0.0003777932686f, + -0.0004598592590f, + -0.0005417761096f, + -0.0006218750188f, + -0.0006984125260f, + -0.0007696102015f, + -0.0008337037348f, + -0.0008889897559f, + -0.0009338793741f, + -0.0009669467668f, + -0.0009869812183f, + -0.0009930311084f, + -0.0009844478476f, + -0.0009609186466f, + -0.0009224959242f, + -0.0008696128718f, + -0.0008030930096f, + -0.0007241441121f, + -0.0006343445666f, + -0.0005356135898f, + -0.0004301737349f, + -0.0003204982716f, + -0.0002092522968f, + -0.0000992213271f, + 0.0000067633979f, + 0.0001059080771f, + 0.0001955385388f, + 0.0002731857749f, + 0.0003366654366f, + 0.0003841550469f, + 0.0004142599400f, + 0.0004260714830f, + 0.0004192093552f, + 0.0003938516106f, + 0.0003507454223f, + 0.0002912027367f, + 0.0002170751467f, + 0.0001307129555f, + 0.0000349043239f, + -0.0000671996814f, + -0.0001721766401f, + -0.0002764343270f, + -0.0003763233051f, + -0.0004682533995f, + -0.0005488139662f, + -0.0006148906121f, + -0.0006637776003f, + -0.0006932789118f, + -0.0007017970554f, + -0.0006884034538f, + -0.0006528899123f, + -0.0005957963722f, + -0.0005184153646f, + -0.0004227701586f, + -0.0003115682847f, + -0.0001881294675f, + -0.0000562910721f, + 0.0000797078370f, + 0.0002153593731f, + 0.0003460336990f, + 0.0004671344133f, + 0.0005742581225f, + 0.0006633522280f, + 0.0007308658562f, + 0.0007738881585f, + 0.0007902689274f, + 0.0007787167083f, + 0.0007388701444f, + 0.0006713394034f, + 0.0005777148960f, + 0.0004605423719f, + 0.0003232635598f, + 0.0001701240020f, + 0.0000060494092f, + -0.0001635052308f, + -0.0003327304257f, + -0.0004956543392f, + -0.0006463473881f, + -0.0007791311572f, + -0.0008887858391f, + -0.0009707473406f, + -0.0010212883637f, + -0.0010376748928f, + -0.0010182935142f, + -0.0009627423256f, + -0.0008718829334f, + -0.0007478485121f, + -0.0005940082363f, + -0.0004148858953f, + -0.0002160362179f, + -0.0000038797853f, + 0.0002144967369f, + 0.0004315713068f, + 0.0006396386805f, + 0.0008310780982f, + 0.0009986251377f, + 0.0011356405836f, + 0.0012363642899f, + 0.0012961469552f, + 0.0013116484677f, + 0.0012809971563f, + 0.0012039006285f, + 0.0010817051861f, + 0.0009173976585f, + 0.0007155502328f, + 0.0004822060361f, + 0.0002247101187f, + -0.0000485122542f, + -0.0003282213579f, + -0.0006046670924f, + -0.0008679194122f, + -0.0011082164816f, + -0.0013163164160f, + -0.0014838424648f, + -0.0016036069166f, + -0.0016699037326f, + -0.0016787563734f, + -0.0016281127287f, + -0.0015179765142f, + -0.0013504705242f, + -0.0011298254200f, + -0.0008622940855f, + -0.0005559904445f, + -0.0002206579656f, + 0.0001326278146f, + 0.0004918125002f, + 0.0008442625446f, + 0.0011771971009f, + 0.0014781391329f, + 0.0017353688983f, + 0.0019383651103f, + 0.0020782164138f, + 0.0021479888549f, + 0.0021430337774f, + 0.0020612244406f, + 0.0019031097610f, + 0.0016719780803f, + 0.0013738250803f, + 0.0010172247913f, + 0.0006131045972f, + 0.0001744298610f, + -0.0002841939575f, + -0.0007469896914f, + -0.0011975333012f, + -0.0016193180225f, + -0.0019963392576f, + -0.0023136800202f, + -0.0025580762604f, + -0.0027184414762f, + -0.0027863306535f, + -0.0027563254360f, + -0.0026263241476f, + -0.0023977237973f, + -0.0020754837838f, + -0.0016680658389f, + -0.0011872477991f, + -0.0006478144405f, + -0.0000671315905f, + 0.0005353843889f, + 0.0011388873506f, + 0.0017217924441f, + 0.0022625165854f, + 0.0027402428016f, + 0.0031356836285f, + 0.0034318155224f, + 0.0036145589782f, + 0.0036733773953f, + 0.0036017725718f, + 0.0033976546025f, + 0.0030635707180f, + 0.0026067787615f, + 0.0020391592667f, + 0.0013769620179f, + 0.0006403921219f, + -0.0001469573694f, + -0.0009588099622f, + -0.0017670296747f, + -0.0025425381258f, + -0.0032562984671f, + -0.0038803325839f, + -0.0043887399877f, + -0.0047586814357f, + -0.0049712946658f, + -0.0050125064331f, + -0.0048737118489f, + -0.0045522909896f, + -0.0040519418186f, + -0.0033828092770f, + -0.0025614012271f, + -0.0016102839965f, + -0.0005575620934f, + 0.0005638508289f, + 0.0017171507753f, + 0.0028627309673f, + 0.0039594061171f, + 0.0049657407264f, + 0.0058414394672f, + 0.0065487591885f, + 0.0070538953140f, + 0.0073282995418f, + 0.0073498818543f, + 0.0071040568482f, + 0.0065845934106f, + 0.0057942364555f, + 0.0047450710480f, + 0.0034586110723f, + 0.0019655981535f, + 0.0003055096637f, + -0.0014742207991f, + -0.0033192537092f, + -0.0051696434604f, + -0.0069613540836f, + -0.0086279538448f, + -0.0101024412833f, + -0.0113191540820f, + -0.0122157045903f, + -0.0127348875124f, + -0.0128265011561f, + -0.0124490285360f, + -0.0115711241461f, + -0.0101728602554f, + -0.0082466894895f, + -0.0057980911592f, + -0.0028458744398f, + 0.0005778759911f, + 0.0044282188570f, + 0.0086481335451f, + 0.0131696415938f, + 0.0179152456807f, + 0.0227996521306f, + 0.0277317322133f, + 0.0326166721023f, + 0.0373582535356f, + 0.0418612046008f, + 0.0460335559188f, + 0.0497889382248f, + 0.0530487572435f, + 0.0557441859425f, + 0.0578179180988f, + 0.0592256344327f, + 0.0599371398233f, + 0.0599371398233f, + 0.0592256344327f, + 0.0578179180988f, + 0.0557441859425f, + 0.0530487572435f, + 0.0497889382248f, + 0.0460335559188f, + 0.0418612046008f, + 0.0373582535356f, + 0.0326166721023f, + 0.0277317322133f, + 0.0227996521306f, + 0.0179152456807f, + 0.0131696415938f, + 0.0086481335451f, + 0.0044282188570f, + 0.0005778759911f, + -0.0028458744398f, + -0.0057980911592f, + -0.0082466894895f, + -0.0101728602554f, + -0.0115711241461f, + -0.0124490285360f, + -0.0128265011561f, + -0.0127348875124f, + -0.0122157045903f, + -0.0113191540820f, + -0.0101024412833f, + -0.0086279538448f, + -0.0069613540836f, + -0.0051696434604f, + -0.0033192537092f, + -0.0014742207991f, + 0.0003055096637f, + 0.0019655981535f, + 0.0034586110723f, + 0.0047450710480f, + 0.0057942364555f, + 0.0065845934106f, + 0.0071040568482f, + 0.0073498818543f, + 0.0073282995418f, + 0.0070538953140f, + 0.0065487591885f, + 0.0058414394672f, + 0.0049657407264f, + 0.0039594061171f, + 0.0028627309673f, + 0.0017171507753f, + 0.0005638508289f, + -0.0005575620934f, + -0.0016102839965f, + -0.0025614012271f, + -0.0033828092770f, + -0.0040519418186f, + -0.0045522909896f, + -0.0048737118489f, + -0.0050125064331f, + -0.0049712946658f, + -0.0047586814357f, + -0.0043887399877f, + -0.0038803325839f, + -0.0032562984671f, + -0.0025425381258f, + -0.0017670296747f, + -0.0009588099622f, + -0.0001469573694f, + 0.0006403921219f, + 0.0013769620179f, + 0.0020391592667f, + 0.0026067787615f, + 0.0030635707180f, + 0.0033976546025f, + 0.0036017725718f, + 0.0036733773953f, + 0.0036145589782f, + 0.0034318155224f, + 0.0031356836285f, + 0.0027402428016f, + 0.0022625165854f, + 0.0017217924441f, + 0.0011388873506f, + 0.0005353843889f, + -0.0000671315905f, + -0.0006478144405f, + -0.0011872477991f, + -0.0016680658389f, + -0.0020754837838f, + -0.0023977237973f, + -0.0026263241476f, + -0.0027563254360f, + -0.0027863306535f, + -0.0027184414762f, + -0.0025580762604f, + -0.0023136800202f, + -0.0019963392576f, + -0.0016193180225f, + -0.0011975333012f, + -0.0007469896914f, + -0.0002841939575f, + 0.0001744298610f, + 0.0006131045972f, + 0.0010172247913f, + 0.0013738250803f, + 0.0016719780803f, + 0.0019031097610f, + 0.0020612244406f, + 0.0021430337774f, + 0.0021479888549f, + 0.0020782164138f, + 0.0019383651103f, + 0.0017353688983f, + 0.0014781391329f, + 0.0011771971009f, + 0.0008442625446f, + 0.0004918125002f, + 0.0001326278146f, + -0.0002206579656f, + -0.0005559904445f, + -0.0008622940855f, + -0.0011298254200f, + -0.0013504705242f, + -0.0015179765142f, + -0.0016281127287f, + -0.0016787563734f, + -0.0016699037326f, + -0.0016036069166f, + -0.0014838424648f, + -0.0013163164160f, + -0.0011082164816f, + -0.0008679194122f, + -0.0006046670924f, + -0.0003282213579f, + -0.0000485122542f, + 0.0002247101187f, + 0.0004822060361f, + 0.0007155502328f, + 0.0009173976585f, + 0.0010817051861f, + 0.0012039006285f, + 0.0012809971563f, + 0.0013116484677f, + 0.0012961469552f, + 0.0012363642899f, + 0.0011356405836f, + 0.0009986251377f, + 0.0008310780982f, + 0.0006396386805f, + 0.0004315713068f, + 0.0002144967369f, + -0.0000038797853f, + -0.0002160362179f, + -0.0004148858953f, + -0.0005940082363f, + -0.0007478485121f, + -0.0008718829334f, + -0.0009627423256f, + -0.0010182935142f, + -0.0010376748928f, + -0.0010212883637f, + -0.0009707473406f, + -0.0008887858391f, + -0.0007791311572f, + -0.0006463473881f, + -0.0004956543392f, + -0.0003327304257f, + -0.0001635052308f, + 0.0000060494092f, + 0.0001701240020f, + 0.0003232635598f, + 0.0004605423719f, + 0.0005777148960f, + 0.0006713394034f, + 0.0007388701444f, + 0.0007787167083f, + 0.0007902689274f, + 0.0007738881585f, + 0.0007308658562f, + 0.0006633522280f, + 0.0005742581225f, + 0.0004671344133f, + 0.0003460336990f, + 0.0002153593731f, + 0.0000797078370f, + -0.0000562910721f, + -0.0001881294675f, + -0.0003115682847f, + -0.0004227701586f, + -0.0005184153646f, + -0.0005957963722f, + -0.0006528899123f, + -0.0006884034538f, + -0.0007017970554f, + -0.0006932789118f, + -0.0006637776003f, + -0.0006148906121f, + -0.0005488139662f, + -0.0004682533995f, + -0.0003763233051f, + -0.0002764343270f, + -0.0001721766401f, + -0.0000671996814f, + 0.0000349043239f, + 0.0001307129555f, + 0.0002170751467f, + 0.0002912027367f, + 0.0003507454223f, + 0.0003938516106f, + 0.0004192093552f, + 0.0004260714830f, + 0.0004142599400f, + 0.0003841550469f, + 0.0003366654366f, + 0.0002731857749f, + 0.0001955385388f, + 0.0001059080771f, + 0.0000067633979f, + -0.0000992213271f, + -0.0002092522968f, + -0.0003204982716f, + -0.0004301737349f, + -0.0005356135898f, + -0.0006343445666f, + -0.0007241441121f, + -0.0008030930096f, + -0.0008696128718f, + -0.0009224959242f, + -0.0009609186466f, + -0.0009844478476f, + -0.0009930311084f, + -0.0009869812183f, + -0.0009669467668f, + -0.0009338793741f, + -0.0008889897559f, + -0.0008337037348f, + -0.0007696102015f, + -0.0006984125260f, + -0.0006218750188f, + -0.0005417761096f, + -0.0004598592590f, + -0.0003777932686f, + -0.0002971322962f, + -0.0002192871274f, + -0.0001454972457f, + -0.0000768150927f, + -0.0000140913087f, + 0.0000420277999f, + 0.0000911024573f, + 0.0001328901081f, + 0.0001673370635f, + 0.0001945599050f, + 0.0002148295414f, + 0.0002285465848f, + 0.0002362212252f, + 0.0002384460258f, + 0.0002358749754f, + 0.0002291968856f, + 0.0002191165223f, + 0.0002063311677f, + 0.0001915159849f, + 0.0001753054713f, + 0.0001582843174f, + 0.0001409745652f, + 0.0001238323243f, + 0.0001072405937f, + 0.0000915114120f, + 0.0000768836058f, + 0.0000635293624f, + 0.0000515556971f, + 0.0000410140885f, + 0.0000319042337f, + 0.0000241852833f, + 0.0000177804634f, + 0.0000125885567f, + 0.0000084881676f, + 0.0000083199827f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_16_2.h b/core/src/dsp/multirate/decim/taps/fir_16_2.h new file mode 100644 index 0000000..c5d4d18 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_16_2.h @@ -0,0 +1,18 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_2_len = 6; + const float fir_16_2_taps[] = { + 0.0314633937131f, + 0.1579813285983f, + 0.3165763689208f, + 0.3165763689208f, + 0.1579813285983f, + 0.0314633937131f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_16_4.h b/core/src/dsp/multirate/decim/taps/fir_16_4.h new file mode 100644 index 0000000..749c982 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_16_4.h @@ -0,0 +1,34 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_4_len = 22; + const float fir_16_4_taps[] = { + -0.0002023708919f, + -0.0011062368313f, + -0.0032163920847f, + -0.0059942384543f, + -0.0065224236296f, + 0.0007775124540f, + 0.0220383093327f, + 0.0596819563778f, + 0.1084838507550f, + 0.1553460280327f, + 0.1842685402388f, + 0.1842685402388f, + 0.1553460280327f, + 0.1084838507550f, + 0.0596819563778f, + 0.0220383093327f, + 0.0007775124540f, + -0.0065224236296f, + -0.0059942384543f, + -0.0032163920847f, + -0.0011062368313f, + -0.0002023708919f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_16_8.h b/core/src/dsp/multirate/decim/taps/fir_16_8.h new file mode 100644 index 0000000..d1a2196 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_16_8.h @@ -0,0 +1,66 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_16_8_len = 54; + const float fir_16_8_taps[] = { + -0.000010549050011, + -0.000061489537039, + -0.000169592150226, + -0.000389171926135, + -0.000769975911674, + -0.001370854592385, + -0.002239650734147, + -0.003399889102518, + -0.004830705343877, + -0.006448446354249, + -0.008091855414668, + -0.009515841436220, + -0.010397441921856, + -0.010356613271974, + -0.008992201469341, + -0.005930787518203, + -0.000883278427221, + 0.006298245739840, + 0.015572308400311, + 0.026677311102094, + 0.039125595948408, + 0.052226522148894, + 0.065138644768753, + 0.076946519590666, + 0.086753453366436, + 0.093778448420600, + 0.097444265291570, + 0.097444265291570, + 0.093778448420600, + 0.086753453366436, + 0.076946519590666, + 0.065138644768753, + 0.052226522148894, + 0.039125595948408, + 0.026677311102094, + 0.015572308400311, + 0.006298245739840, + -0.000883278427221, + -0.005930787518203, + -0.008992201469341, + -0.010356613271974, + -0.010397441921856, + -0.009515841436220, + -0.008091855414668, + -0.006448446354249, + -0.004830705343877, + -0.003399889102518, + -0.002239650734147, + -0.001370854592385, + -0.000769975911674, + -0.000389171926135, + -0.000169592150226, + -0.000061489537039, + -0.000010549050011, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_2048_128.h b/core/src/dsp/multirate/decim/taps/fir_2048_128.h new file mode 100644 index 0000000..756db6c --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_2048_128.h @@ -0,0 +1,526 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_2048_128_len = 514; + const float fir_2048_128_taps[] = { + 0.0000056977543f, + 0.0000016519060f, + 0.0000018900898f, + 0.0000021498690f, + 0.0000024330160f, + 0.0000027405173f, + 0.0000030742515f, + 0.0000034353223f, + 0.0000038257163f, + 0.0000042466607f, + 0.0000047002521f, + 0.0000051878472f, + 0.0000057116542f, + 0.0000062731650f, + 0.0000068747009f, + 0.0000075178944f, + 0.0000082051812f, + 0.0000089383392f, + 0.0000097199199f, + 0.0000105518511f, + 0.0000114368007f, + 0.0000123768507f, + 0.0000133747862f, + 0.0000144328464f, + 0.0000155539344f, + 0.0000167404496f, + 0.0000179954131f, + 0.0000193213868f, + 0.0000207215097f, + 0.0000221985076f, + 0.0000237556374f, + 0.0000253957896f, + 0.0000271223379f, + 0.0000289383380f, + 0.0000308472794f, + 0.0000328523820f, + 0.0000349572499f, + 0.0000371652659f, + 0.0000394801467f, + 0.0000419054357f, + 0.0000444449599f, + 0.0000471024204f, + 0.0000498817519f, + 0.0000527868089f, + 0.0000558216304f, + 0.0000589902202f, + 0.0000622967176f, + 0.0000657452697f, + 0.0000693401121f, + 0.0000730855287f, + 0.0000769858465f, + 0.0000810454789f, + 0.0000852688387f, + 0.0000896604605f, + 0.0000942248370f, + 0.0000989666149f, + 0.0001038903598f, + 0.0001090008210f, + 0.0001143026296f, + 0.0001198006263f, + 0.0001254994998f, + 0.0001314041710f, + 0.0001375193773f, + 0.0001438501072f, + 0.0001504011376f, + 0.0001571775115f, + 0.0001641840351f, + 0.0001714257921f, + 0.0001789076072f, + 0.0001866345903f, + 0.0001946115730f, + 0.0002028436762f, + 0.0002113357263f, + 0.0002200928393f, + 0.0002291198237f, + 0.0002384217741f, + 0.0002480034673f, + 0.0002578699598f, + 0.0002680259827f, + 0.0002784765367f, + 0.0002892262923f, + 0.0003002801771f, + 0.0003116427850f, + 0.0003233189523f, + 0.0003353131809f, + 0.0003476301967f, + 0.0003602743932f, + 0.0003732503673f, + 0.0003865623868f, + 0.0004002149008f, + 0.0004142120341f, + 0.0004285580685f, + 0.0004432569680f, + 0.0004583128281f, + 0.0004737294337f, + 0.0004895106749f, + 0.0005056601389f, + 0.0005221814910f, + 0.0005390781024f, + 0.0005563533944f, + 0.0005740105034f, + 0.0005920525879f, + 0.0006104825303f, + 0.0006293032077f, + 0.0006485172300f, + 0.0006681271742f, + 0.0006881353590f, + 0.0007085440434f, + 0.0007293552362f, + 0.0007505708607f, + 0.0007721925977f, + 0.0007942220177f, + 0.0008166604553f, + 0.0008395091117f, + 0.0008627689581f, + 0.0008864408102f, + 0.0009105252585f, + 0.0009350227185f, + 0.0009599333834f, + 0.0009852572538f, + 0.0010109941099f, + 0.0010371435239f, + 0.0010637048482f, + 0.0010906772135f, + 0.0011180595302f, + 0.0011458504759f, + 0.0011740485059f, + 0.0012026518338f, + 0.0012316584473f, + 0.0012610660863f, + 0.0012908722603f, + 0.0013210742267f, + 0.0013516690064f, + 0.0013826533670f, + 0.0014140238326f, + 0.0014457766743f, + 0.0014779079120f, + 0.0015104133153f, + 0.0015432883942f, + 0.0015765284129f, + 0.0016101283668f, + 0.0016440830124f, + 0.0016783868277f, + 0.0017130340602f, + 0.0017480186691f, + 0.0017833343933f, + 0.0018189746732f, + 0.0018549327411f, + 0.0018912015203f, + 0.0019277737394f, + 0.0019646418086f, + 0.0020017979573f, + 0.0020392340874f, + 0.0020769419357f, + 0.0021149129027f, + 0.0021531382398f, + 0.0021916088550f, + 0.0022303155238f, + 0.0022692486717f, + 0.0023083986089f, + 0.0023477552904f, + 0.0023873085737f, + 0.0024270479569f, + 0.0024669628584f, + 0.0025070423351f, + 0.0025472753813f, + 0.0025876506298f, + 0.0026281566678f, + 0.0026687817225f, + 0.0027095139925f, + 0.0027503413194f, + 0.0027912515330f, + 0.0028322321111f, + 0.0028732705358f, + 0.0029143539447f, + 0.0029554694944f, + 0.0029966040069f, + 0.0030377443376f, + 0.0030788770187f, + 0.0031199886295f, + 0.0031610654399f, + 0.0032020937793f, + 0.0032430596841f, + 0.0032839492614f, + 0.0033247483433f, + 0.0033654428438f, + 0.0034060184215f, + 0.0034464608266f, + 0.0034867555758f, + 0.0035268882866f, + 0.0035668443662f, + 0.0036066093308f, + 0.0036461685116f, + 0.0036855073558f, + 0.0037246111522f, + 0.0037634653125f, + 0.0038020551175f, + 0.0038403659769f, + 0.0038783831984f, + 0.0039160922239f, + 0.0039534784232f, + 0.0039905273052f, + 0.0040272243371f, + 0.0040635551298f, + 0.0040995052831f, + 0.0041350605451f, + 0.0041702066839f, + 0.0042049296200f, + 0.0042392153249f, + 0.0042730499268f, + 0.0043064196357f, + 0.0043393108225f, + 0.0043717099704f, + 0.0044036037280f, + 0.0044349788856f, + 0.0044658224039f, + 0.0044961214142f, + 0.0045258632233f, + 0.0045550353360f, + 0.0045836254386f, + 0.0046116214419f, + 0.0046390114441f, + 0.0046657837931f, + 0.0046919270308f, + 0.0047174299722f, + 0.0047422816340f, + 0.0047664713274f, + 0.0047899885734f, + 0.0048128232074f, + 0.0048349652830f, + 0.0048564051867f, + 0.0048771335320f, + 0.0048971412812f, + 0.0049164196340f, + 0.0049349601525f, + 0.0049527546463f, + 0.0049697952998f, + 0.0049860745555f, + 0.0050015852406f, + 0.0050163204516f, + 0.0050302736774f, + 0.0050434386878f, + 0.0050558096508f, + 0.0050673810271f, + 0.0050781476793f, + 0.0050881047743f, + 0.0050972478830f, + 0.0051055728926f, + 0.0051130760938f, + 0.0051197541055f, + 0.0051256039484f, + 0.0051306229828f, + 0.0051348089672f, + 0.0051381600106f, + 0.0051406746155f, + 0.0051423516450f, + 0.0051431903494f, + 0.0051431903494f, + 0.0051423516450f, + 0.0051406746155f, + 0.0051381600106f, + 0.0051348089672f, + 0.0051306229828f, + 0.0051256039484f, + 0.0051197541055f, + 0.0051130760938f, + 0.0051055728926f, + 0.0050972478830f, + 0.0050881047743f, + 0.0050781476793f, + 0.0050673810271f, + 0.0050558096508f, + 0.0050434386878f, + 0.0050302736774f, + 0.0050163204516f, + 0.0050015852406f, + 0.0049860745555f, + 0.0049697952998f, + 0.0049527546463f, + 0.0049349601525f, + 0.0049164196340f, + 0.0048971412812f, + 0.0048771335320f, + 0.0048564051867f, + 0.0048349652830f, + 0.0048128232074f, + 0.0047899885734f, + 0.0047664713274f, + 0.0047422816340f, + 0.0047174299722f, + 0.0046919270308f, + 0.0046657837931f, + 0.0046390114441f, + 0.0046116214419f, + 0.0045836254386f, + 0.0045550353360f, + 0.0045258632233f, + 0.0044961214142f, + 0.0044658224039f, + 0.0044349788856f, + 0.0044036037280f, + 0.0043717099704f, + 0.0043393108225f, + 0.0043064196357f, + 0.0042730499268f, + 0.0042392153249f, + 0.0042049296200f, + 0.0041702066839f, + 0.0041350605451f, + 0.0040995052831f, + 0.0040635551298f, + 0.0040272243371f, + 0.0039905273052f, + 0.0039534784232f, + 0.0039160922239f, + 0.0038783831984f, + 0.0038403659769f, + 0.0038020551175f, + 0.0037634653125f, + 0.0037246111522f, + 0.0036855073558f, + 0.0036461685116f, + 0.0036066093308f, + 0.0035668443662f, + 0.0035268882866f, + 0.0034867555758f, + 0.0034464608266f, + 0.0034060184215f, + 0.0033654428438f, + 0.0033247483433f, + 0.0032839492614f, + 0.0032430596841f, + 0.0032020937793f, + 0.0031610654399f, + 0.0031199886295f, + 0.0030788770187f, + 0.0030377443376f, + 0.0029966040069f, + 0.0029554694944f, + 0.0029143539447f, + 0.0028732705358f, + 0.0028322321111f, + 0.0027912515330f, + 0.0027503413194f, + 0.0027095139925f, + 0.0026687817225f, + 0.0026281566678f, + 0.0025876506298f, + 0.0025472753813f, + 0.0025070423351f, + 0.0024669628584f, + 0.0024270479569f, + 0.0023873085737f, + 0.0023477552904f, + 0.0023083986089f, + 0.0022692486717f, + 0.0022303155238f, + 0.0021916088550f, + 0.0021531382398f, + 0.0021149129027f, + 0.0020769419357f, + 0.0020392340874f, + 0.0020017979573f, + 0.0019646418086f, + 0.0019277737394f, + 0.0018912015203f, + 0.0018549327411f, + 0.0018189746732f, + 0.0017833343933f, + 0.0017480186691f, + 0.0017130340602f, + 0.0016783868277f, + 0.0016440830124f, + 0.0016101283668f, + 0.0015765284129f, + 0.0015432883942f, + 0.0015104133153f, + 0.0014779079120f, + 0.0014457766743f, + 0.0014140238326f, + 0.0013826533670f, + 0.0013516690064f, + 0.0013210742267f, + 0.0012908722603f, + 0.0012610660863f, + 0.0012316584473f, + 0.0012026518338f, + 0.0011740485059f, + 0.0011458504759f, + 0.0011180595302f, + 0.0010906772135f, + 0.0010637048482f, + 0.0010371435239f, + 0.0010109941099f, + 0.0009852572538f, + 0.0009599333834f, + 0.0009350227185f, + 0.0009105252585f, + 0.0008864408102f, + 0.0008627689581f, + 0.0008395091117f, + 0.0008166604553f, + 0.0007942220177f, + 0.0007721925977f, + 0.0007505708607f, + 0.0007293552362f, + 0.0007085440434f, + 0.0006881353590f, + 0.0006681271742f, + 0.0006485172300f, + 0.0006293032077f, + 0.0006104825303f, + 0.0005920525879f, + 0.0005740105034f, + 0.0005563533944f, + 0.0005390781024f, + 0.0005221814910f, + 0.0005056601389f, + 0.0004895106749f, + 0.0004737294337f, + 0.0004583128281f, + 0.0004432569680f, + 0.0004285580685f, + 0.0004142120341f, + 0.0004002149008f, + 0.0003865623868f, + 0.0003732503673f, + 0.0003602743932f, + 0.0003476301967f, + 0.0003353131809f, + 0.0003233189523f, + 0.0003116427850f, + 0.0003002801771f, + 0.0002892262923f, + 0.0002784765367f, + 0.0002680259827f, + 0.0002578699598f, + 0.0002480034673f, + 0.0002384217741f, + 0.0002291198237f, + 0.0002200928393f, + 0.0002113357263f, + 0.0002028436762f, + 0.0001946115730f, + 0.0001866345903f, + 0.0001789076072f, + 0.0001714257921f, + 0.0001641840351f, + 0.0001571775115f, + 0.0001504011376f, + 0.0001438501072f, + 0.0001375193773f, + 0.0001314041710f, + 0.0001254994998f, + 0.0001198006263f, + 0.0001143026296f, + 0.0001090008210f, + 0.0001038903598f, + 0.0000989666149f, + 0.0000942248370f, + 0.0000896604605f, + 0.0000852688387f, + 0.0000810454789f, + 0.0000769858465f, + 0.0000730855287f, + 0.0000693401121f, + 0.0000657452697f, + 0.0000622967176f, + 0.0000589902202f, + 0.0000558216304f, + 0.0000527868089f, + 0.0000498817519f, + 0.0000471024204f, + 0.0000444449599f, + 0.0000419054357f, + 0.0000394801467f, + 0.0000371652659f, + 0.0000349572499f, + 0.0000328523820f, + 0.0000308472794f, + 0.0000289383380f, + 0.0000271223379f, + 0.0000253957896f, + 0.0000237556374f, + 0.0000221985076f, + 0.0000207215097f, + 0.0000193213868f, + 0.0000179954131f, + 0.0000167404496f, + 0.0000155539344f, + 0.0000144328464f, + 0.0000133747862f, + 0.0000123768507f, + 0.0000114368007f, + 0.0000105518511f, + 0.0000097199199f, + 0.0000089383392f, + 0.0000082051812f, + 0.0000075178944f, + 0.0000068747009f, + 0.0000062731650f, + 0.0000057116542f, + 0.0000051878472f, + 0.0000047002521f, + 0.0000042466607f, + 0.0000038257163f, + 0.0000034353223f, + 0.0000030742515f, + 0.0000027405173f, + 0.0000024330160f, + 0.0000021498690f, + 0.0000018900898f, + 0.0000016519060f, + 0.0000056977543f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_2048_64.h b/core/src/dsp/multirate/decim/taps/fir_2048_64.h new file mode 100644 index 0000000..a583dfb --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_2048_64.h @@ -0,0 +1,341 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_2048_64_len = 329; + const float fir_2048_64_taps[] = { + 0.000000000199668, + 0.000000205043166, + 0.000000156335587, + 0.000000215541606, + 0.000000289043906, + 0.000000379397653, + 0.000000489366234, + 0.000000622040059, + 0.000000780862872, + 0.000000969659261, + 0.000001192663259, + 0.000001454547981, + 0.000001760456262, + 0.000002116032238, + 0.000002527453817, + 0.000003001465946, + 0.000003545414625, + 0.000004167281561, + 0.000004875719359, + 0.000005680087172, + 0.000006590486661, + 0.000007617798168, + 0.000008773716957, + 0.000010070789376, + 0.000011522448815, + 0.000013143051261, + 0.000014947910332, + 0.000016953331574, + 0.000019176645863, + 0.000021636241718, + 0.000024351596326, + 0.000027343305093, + 0.000030633109489, + 0.000034243923000, + 0.000038199854973, + 0.000042526232102, + 0.000047249617395, + 0.000052397826336, + 0.000057999940064, + 0.000064086315335, + 0.000070688591034, + 0.000077839691045, + 0.000085573823231, + 0.000093926474339, + 0.000102934400627, + 0.000112635613980, + 0.000123069363379, + 0.000134276111489, + 0.000146297506226, + 0.000159176347141, + 0.000172956546458, + 0.000187683084638, + 0.000203401960366, + 0.000220160134836, + 0.000238005470250, + 0.000256986662475, + 0.000277153167800, + 0.000298555123757, + 0.000321243264012, + 0.000345268827318, + 0.000370683460586, + 0.000397539116108, + 0.000425887943051, + 0.000455782173269, + 0.000487274001624, + 0.000520415460934, + 0.000555258291741, + 0.000591853807104, + 0.000630252752645, + 0.000670505162114, + 0.000712660208750, + 0.000756766052737, + 0.000802869685119, + 0.000851016768484, + 0.000901251474847, + 0.000953616321094, + 0.001008152002452, + 0.001064897224391, + 0.001123888533469, + 0.001185160147570, + 0.001248743786063, + 0.001314668500389, + 0.001382960505628, + 0.001453643013568, + 0.001526736067868, + 0.001602256381861, + 0.001680217179590, + 0.001760628040646, + 0.001843494749418, + 0.001928819149316, + 0.002016599002583, + 0.002106827856267, + 0.002199494914939, + 0.002294584920730, + 0.002392078041256, + 0.002491949765985, + 0.002594170811576, + 0.002698707036722, + 0.002805519367007, + 0.002914563730244, + 0.003025791002763, + 0.003139146967090, + 0.003254572281416, + 0.003372002461236, + 0.003491367873501, + 0.003612593743601, + 0.003735600175462, + 0.003860302184972, + 0.003986609746975, + 0.004114427855956, + 0.004243656600570, + 0.004374191252069, + 0.004505922366671, + 0.004638735901866, + 0.004772513346579, + 0.004907131865119, + 0.005042464454740, + 0.005178380116639, + 0.005314744040122, + 0.005451417799686, + 0.005588259564642, + 0.005725124320935, + 0.005861864104709, + 0.005998328247162, + 0.006134363630171, + 0.006269814952126, + 0.006404525003407, + 0.006538334950818, + 0.006671084630359, + 0.006802612847587, + 0.006932757684861, + 0.007061356814659, + 0.007188247818209, + 0.007313268508566, + 0.007436257257322, + 0.007557053324043, + 0.007675497187571, + 0.007791430878266, + 0.007904698310281, + 0.008015145612939, + 0.008122621460286, + 0.008226977397872, + 0.008328068165838, + 0.008425752017374, + 0.008519891031616, + 0.008610351420080, + 0.008697003825729, + 0.008779723613781, + 0.008858391153404, + 0.008932892089457, + 0.009003117603448, + 0.009068964662954, + 0.009130336258703, + 0.009187141628648, + 0.009239296468318, + 0.009286723126810, + 0.009329350787828, + 0.009367115635223, + 0.009399961002488, + 0.009427837505799, + 0.009450703160140, + 0.009468523478197, + 0.009481271551679, + 0.009488928114839, + 0.009491481589983, + 0.009488928114839, + 0.009481271551679, + 0.009468523478197, + 0.009450703160140, + 0.009427837505799, + 0.009399961002488, + 0.009367115635223, + 0.009329350787828, + 0.009286723126810, + 0.009239296468318, + 0.009187141628648, + 0.009130336258703, + 0.009068964662954, + 0.009003117603448, + 0.008932892089457, + 0.008858391153404, + 0.008779723613781, + 0.008697003825729, + 0.008610351420080, + 0.008519891031616, + 0.008425752017374, + 0.008328068165838, + 0.008226977397872, + 0.008122621460286, + 0.008015145612939, + 0.007904698310281, + 0.007791430878266, + 0.007675497187571, + 0.007557053324043, + 0.007436257257322, + 0.007313268508566, + 0.007188247818209, + 0.007061356814659, + 0.006932757684861, + 0.006802612847587, + 0.006671084630359, + 0.006538334950818, + 0.006404525003407, + 0.006269814952126, + 0.006134363630171, + 0.005998328247162, + 0.005861864104709, + 0.005725124320935, + 0.005588259564642, + 0.005451417799686, + 0.005314744040122, + 0.005178380116639, + 0.005042464454740, + 0.004907131865119, + 0.004772513346579, + 0.004638735901866, + 0.004505922366671, + 0.004374191252069, + 0.004243656600570, + 0.004114427855956, + 0.003986609746975, + 0.003860302184972, + 0.003735600175462, + 0.003612593743601, + 0.003491367873501, + 0.003372002461236, + 0.003254572281416, + 0.003139146967090, + 0.003025791002763, + 0.002914563730244, + 0.002805519367007, + 0.002698707036722, + 0.002594170811576, + 0.002491949765985, + 0.002392078041256, + 0.002294584920730, + 0.002199494914939, + 0.002106827856267, + 0.002016599002583, + 0.001928819149316, + 0.001843494749418, + 0.001760628040646, + 0.001680217179590, + 0.001602256381861, + 0.001526736067868, + 0.001453643013568, + 0.001382960505628, + 0.001314668500389, + 0.001248743786063, + 0.001185160147570, + 0.001123888533469, + 0.001064897224391, + 0.001008152002452, + 0.000953616321094, + 0.000901251474847, + 0.000851016768484, + 0.000802869685119, + 0.000756766052737, + 0.000712660208750, + 0.000670505162114, + 0.000630252752645, + 0.000591853807104, + 0.000555258291741, + 0.000520415460934, + 0.000487274001624, + 0.000455782173269, + 0.000425887943051, + 0.000397539116108, + 0.000370683460586, + 0.000345268827318, + 0.000321243264012, + 0.000298555123757, + 0.000277153167800, + 0.000256986662475, + 0.000238005470250, + 0.000220160134836, + 0.000203401960366, + 0.000187683084638, + 0.000172956546458, + 0.000159176347141, + 0.000146297506226, + 0.000134276111489, + 0.000123069363379, + 0.000112635613980, + 0.000102934400627, + 0.000093926474339, + 0.000085573823231, + 0.000077839691045, + 0.000070688591034, + 0.000064086315335, + 0.000057999940064, + 0.000052397826336, + 0.000047249617395, + 0.000042526232102, + 0.000038199854973, + 0.000034243923000, + 0.000030633109489, + 0.000027343305093, + 0.000024351596326, + 0.000021636241718, + 0.000019176645863, + 0.000016953331574, + 0.000014947910332, + 0.000013143051261, + 0.000011522448815, + 0.000010070789376, + 0.000008773716957, + 0.000007617798168, + 0.000006590486661, + 0.000005680087172, + 0.000004875719359, + 0.000004167281561, + 0.000003545414625, + 0.000003001465946, + 0.000002527453817, + 0.000002116032238, + 0.000001760456262, + 0.000001454547981, + 0.000001192663259, + 0.000000969659261, + 0.000000780862872, + 0.000000622040059, + 0.000000489366234, + 0.000000379397653, + 0.000000289043906, + 0.000000215541606, + 0.000000156335587, + 0.000000205043166, + 0.000000000199668, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_256_128.h b/core/src/dsp/multirate/decim/taps/fir_256_128.h new file mode 100644 index 0000000..ee5bb60 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_256_128.h @@ -0,0 +1,1024 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_128_len = 1012; + const float fir_256_128_taps[] = { + 0.0000054617197f, + 0.0000010039987f, + 0.0000010956039f, + 0.0000011920904f, + 0.0000012938865f, + 0.0000014008804f, + 0.0000015134951f, + 0.0000016316288f, + 0.0000017556952f, + 0.0000018856055f, + 0.0000020217596f, + 0.0000021640841f, + 0.0000023129618f, + 0.0000024683369f, + 0.0000026305712f, + 0.0000027996282f, + 0.0000029758459f, + 0.0000031592080f, + 0.0000033500265f, + 0.0000035483053f, + 0.0000037543287f, + 0.0000039681205f, + 0.0000041899359f, + 0.0000044198178f, + 0.0000046579914f, + 0.0000049045172f, + 0.0000051595901f, + 0.0000054232859f, + 0.0000056957697f, + 0.0000059771297f, + 0.0000062675020f, + 0.0000065669838f, + 0.0000068756832f, + 0.0000071937032f, + 0.0000075211250f, + 0.0000078580532f, + 0.0000082045440f, + 0.0000085606992f, + 0.0000089265516f, + 0.0000093021962f, + 0.0000096876440f, + 0.0000100829787f, + 0.0000104881911f, + 0.0000109033494f, + 0.0000113284258f, + 0.0000117634690f, + 0.0000122084333f, + 0.0000126633440f, + 0.0000131281391f, + 0.0000136028167f, + 0.0000140872987f, + 0.0000145815531f, + 0.0000150854857f, + 0.0000155990318f, + 0.0000161220807f, + 0.0000166545325f, + 0.0000171962598f, + 0.0000177471253f, + 0.0000183069836f, + 0.0000188756586f, + 0.0000194529856f, + 0.0000200387487f, + 0.0000206327617f, + 0.0000212347684f, + 0.0000218445591f, + 0.0000224618368f, + 0.0000230863658f, + 0.0000237178084f, + 0.0000243559001f, + 0.0000250002630f, + 0.0000256506012f, + 0.0000263064966f, + 0.0000269676192f, + 0.0000276335113f, + 0.0000283038060f, + 0.0000289780068f, + 0.0000296557072f, + 0.0000303363724f, + 0.0000310195537f, + 0.0000317046787f, + 0.0000323912545f, + 0.0000330786713f, + 0.0000337663900f, + 0.0000344537638f, + 0.0000351402059f, + 0.0000358250326f, + 0.0000365076083f, + 0.0000371872122f, + 0.0000378631590f, + 0.0000385346910f, + 0.0000392010726f, + 0.0000398615087f, + 0.0000405152136f, + 0.0000411613543f, + 0.0000417990953f, + 0.0000424275651f, + 0.0000430458793f, + 0.0000436531270f, + 0.0000442483761f, + 0.0000448306757f, + 0.0000453990473f, + 0.0000459524996f, + 0.0000464900089f, + 0.0000470105429f, + 0.0000475130351f, + 0.0000479964116f, + 0.0000484595649f, + 0.0000489013793f, + 0.0000493207086f, + 0.0000497163952f, + 0.0000500872564f, + 0.0000504320934f, + 0.0000507496888f, + 0.0000510388032f, + 0.0000512981874f, + 0.0000515265621f, + 0.0000517226482f, + 0.0000518851286f, + 0.0000520126964f, + 0.0000521039980f, + 0.0000521577014f, + 0.0000521724191f, + 0.0000521467956f, + 0.0000520794123f, + 0.0000519688928f, + 0.0000518137901f, + 0.0000516127093f, + 0.0000513641784f, + 0.0000510667862f, + 0.0000507190397f, + 0.0000503195135f, + 0.0000498666979f, + 0.0000493591558f, + 0.0000487953650f, + 0.0000481738794f, + 0.0000474931688f, + 0.0000467517812f, + 0.0000459481829f, + 0.0000450809190f, + 0.0000441484575f, + 0.0000431493437f, + 0.0000420820523f, + 0.0000409451326f, + 0.0000397370709f, + 0.0000384564242f, + 0.0000371016959f, + 0.0000356714551f, + 0.0000341642269f, + 0.0000325785972f, + 0.0000309131181f, + 0.0000291663973f, + 0.0000273370189f, + 0.0000254236173f, + 0.0000234248141f, + 0.0000213392762f, + 0.0000191656671f, + 0.0000169026922f, + 0.0000145490624f, + 0.0000121035277f, + 0.0000095648509f, + 0.0000069318331f, + 0.0000042032944f, + 0.0000013780933f, + -0.0000015448876f, + -0.0000045667258f, + -0.0000076884710f, + -0.0000109111299f, + -0.0000142356795f, + -0.0000176630487f, + -0.0000211941363f, + -0.0000248297868f, + -0.0000285708153f, + -0.0000324179752f, + -0.0000363719922f, + -0.0000404335221f, + -0.0000446031954f, + -0.0000488815635f, + -0.0000532691560f, + -0.0000577664138f, + -0.0000623737594f, + -0.0000670915167f, + -0.0000719199952f, + -0.0000768593961f, + -0.0000819099094f, + -0.0000870716076f, + -0.0000923445550f, + -0.0000977286901f, + -0.0001032239450f, + -0.0001088301187f, + -0.0001145470050f, + -0.0001203742580f, + -0.0001263115271f, + -0.0001323583166f, + -0.0001385141249f, + -0.0001447783020f, + -0.0001511501895f, + -0.0001576289781f, + -0.0001642138471f, + -0.0001709038232f, + -0.0001776979177f, + -0.0001845949894f, + -0.0001915938761f, + -0.0001986932647f, + -0.0002058918142f, + -0.0002131880358f, + -0.0002205804055f, + -0.0002280672545f, + -0.0002356468714f, + -0.0002433174043f, + -0.0002510769507f, + -0.0002589234716f, + -0.0002668548703f, + -0.0002748689175f, + -0.0002829633193f, + -0.0002911356534f, + -0.0002993834261f, + -0.0003077040191f, + -0.0003160947374f, + -0.0003245527639f, + -0.0003330752009f, + -0.0003416590306f, + -0.0003503011513f, + -0.0003589983429f, + -0.0003677472992f, + -0.0003765445962f, + -0.0003853867235f, + -0.0003942700520f, + -0.0004031908675f, + -0.0004121453355f, + -0.0004211295386f, + -0.0004301394370f, + -0.0004391709117f, + -0.0004482197180f, + -0.0004572815366f, + -0.0004663519194f, + -0.0004754263492f, + -0.0004845001759f, + -0.0004935686869f, + -0.0005026270327f, + -0.0005116703080f, + -0.0005206934671f, + -0.0005296914154f, + -0.0005386589147f, + -0.0005475906847f, + -0.0005564812990f, + -0.0005653252961f, + -0.0005741170662f, + -0.0005828509711f, + -0.0005915212236f, + -0.0006001220139f, + -0.0006086473832f, + -0.0006170913558f, + -0.0006254478087f, + -0.0006337106061f, + -0.0006418734679f, + -0.0006499301053f, + -0.0006578740890f, + -0.0006656989842f, + -0.0006733982212f, + -0.0006809652268f, + -0.0006883933000f, + -0.0006956757374f, + -0.0007028057162f, + -0.0007097764122f, + -0.0007165808902f, + -0.0007232122149f, + -0.0007296633493f, + -0.0007359272569f, + -0.0007419968098f, + -0.0007478648811f, + -0.0007535242631f, + -0.0007589677498f, + -0.0007641880653f, + -0.0007691779366f, + -0.0007739300312f, + -0.0007784370217f, + -0.0007826915315f, + -0.0007866861914f, + -0.0007904135933f, + -0.0007938663403f, + -0.0007970370052f, + -0.0007999181773f, + -0.0008025024239f, + -0.0008047823347f, + -0.0008067504850f, + -0.0008083994801f, + -0.0008097219168f, + -0.0008107104310f, + -0.0008113576556f, + -0.0008116562723f, + -0.0008115989647f, + -0.0008111784758f, + -0.0008103875548f, + -0.0008092190219f, + -0.0008076657071f, + -0.0008057205234f, + -0.0008033763972f, + -0.0008006263506f, + -0.0007974634219f, + -0.0007938807581f, + -0.0007898715256f, + -0.0007854290126f, + -0.0007805465296f, + -0.0007752175217f, + -0.0007694354603f, + -0.0007631939632f, + -0.0007564866791f, + -0.0007493074146f, + -0.0007416500121f, + -0.0007335084828f, + -0.0007248768797f, + -0.0007157494339f, + -0.0007061204255f, + -0.0006959843215f, + -0.0006853356454f, + -0.0006741691151f, + -0.0006624795144f, + -0.0006502618271f, + -0.0006375111133f, + -0.0006242226379f, + -0.0006103917530f, + -0.0005960140195f, + -0.0005810850973f, + -0.0005656008577f, + -0.0005495572834f, + -0.0005329505706f, + -0.0005157770396f, + -0.0004980332255f, + -0.0004797158006f, + -0.0004608216523f, + -0.0004413478190f, + -0.0004212915539f, + -0.0004006502744f, + -0.0003794216126f, + -0.0003576033774f, + -0.0003351935927f, + -0.0003121904710f, + -0.0002885924395f, + -0.0002643981260f, + -0.0002396063730f, + -0.0002142162337f, + -0.0001882269770f, + -0.0001616380917f, + -0.0001344492837f, + -0.0001066604864f, + -0.0000782718524f, + -0.0000492837685f, + -0.0000196968430f, + 0.0000104880762f, + 0.0000412699167f, + 0.0000726473624f, + 0.0001046188693f, + 0.0001371826468f, + 0.0001703366727f, + 0.0002040786763f, + 0.0002384061515f, + 0.0002733163427f, + 0.0003088062548f, + 0.0003448726437f, + 0.0003815120213f, + 0.0004187206518f, + 0.0004564945514f, + 0.0004948294900f, + 0.0005337209861f, + 0.0005731643140f, + 0.0006131544939f, + 0.0006536863036f, + 0.0006947542648f, + 0.0007363526596f, + 0.0007784755123f, + 0.0008211166104f, + 0.0008642694829f, + 0.0009079274248f, + 0.0009520834733f, + 0.0009967304337f, + 0.0010418608557f, + 0.0010874670591f, + 0.0011335411113f, + 0.0011800748517f, + 0.0012270598713f, + 0.0012744875354f, + 0.0013223489661f, + 0.0013706350614f, + 0.0014193364826f, + 0.0014684436687f, + 0.0015179468293f, + 0.0015678359536f, + 0.0016181008094f, + 0.0016687309465f, + 0.0017197157018f, + 0.0017710441970f, + 0.0018227053500f, + 0.0018746878666f, + 0.0019269802582f, + 0.0019795708285f, + 0.0020324476959f, + 0.0020855987758f, + 0.0021390118086f, + 0.0021926743367f, + 0.0022465737373f, + 0.0023006971965f, + 0.0023550317442f, + 0.0024095642271f, + 0.0024642813451f, + 0.0025191696234f, + 0.0025742154495f, + 0.0026294050460f, + 0.0026847245064f, + 0.0027401597701f, + 0.0027956966562f, + 0.0028513208414f, + 0.0029070178900f, + 0.0029627732367f, + 0.0030185722124f, + 0.0030744000312f, + 0.0031302418118f, + 0.0031860825701f, + 0.0032419072346f, + 0.0032977006457f, + 0.0033534475647f, + 0.0034091326794f, + 0.0034647406073f, + 0.0035202559073f, + 0.0035756630769f, + 0.0036309465703f, + 0.0036860907892f, + 0.0037410801073f, + 0.0037958988559f, + 0.0038505313527f, + 0.0039049618835f, + 0.0039591747350f, + 0.0040131541736f, + 0.0040668844797f, + 0.0041203499262f, + 0.0041735348127f, + 0.0042264234446f, + 0.0042790001663f, + 0.0043312493419f, + 0.0043831553862f, + 0.0044347027481f, + 0.0044858759388f, + 0.0045366595183f, + 0.0045870381197f, + 0.0046369964405f, + 0.0046865192616f, + 0.0047355914438f, + 0.0047841979416f, + 0.0048323238052f, + 0.0048799541881f, + 0.0049270743557f, + 0.0049736696861f, + 0.0050197256849f, + 0.0050652279802f, + 0.0051101623431f, + 0.0051545146765f, + 0.0051982710415f, + 0.0052414176408f, + 0.0052839408493f, + 0.0053258271941f, + 0.0053670633876f, + 0.0054076363051f, + 0.0054475330196f, + 0.0054867407779f, + 0.0055252470364f, + 0.0055630394362f, + 0.0056001058389f, + 0.0056364343024f, + 0.0056720131146f, + 0.0057068307715f, + 0.0057408760083f, + 0.0057741377800f, + 0.0058066052887f, + 0.0058382679685f, + 0.0058691155076f, + 0.0058991378384f, + 0.0059283251534f, + 0.0059566679018f, + 0.0059841567980f, + 0.0060107828250f, + 0.0060365372360f, + 0.0060614115641f, + 0.0060853976175f, + 0.0061084874942f, + 0.0061306735723f, + 0.0061519485294f, + 0.0061723053272f, + 0.0061917372361f, + 0.0062102378145f, + 0.0062278009372f, + 0.0062444207718f, + 0.0062600918085f, + 0.0062748088344f, + 0.0062885669652f, + 0.0063013616175f, + 0.0063131885409f, + 0.0063240437903f, + 0.0063339237566f, + 0.0063428251405f, + 0.0063507449805f, + 0.0063576806296f, + 0.0063636297789f, + 0.0063685904388f, + 0.0063725609572f, + 0.0063755400055f, + 0.0063775265914f, + 0.0063785200498f, + 0.0063785200498f, + 0.0063775265914f, + 0.0063755400055f, + 0.0063725609572f, + 0.0063685904388f, + 0.0063636297789f, + 0.0063576806296f, + 0.0063507449805f, + 0.0063428251405f, + 0.0063339237566f, + 0.0063240437903f, + 0.0063131885409f, + 0.0063013616175f, + 0.0062885669652f, + 0.0062748088344f, + 0.0062600918085f, + 0.0062444207718f, + 0.0062278009372f, + 0.0062102378145f, + 0.0061917372361f, + 0.0061723053272f, + 0.0061519485294f, + 0.0061306735723f, + 0.0061084874942f, + 0.0060853976175f, + 0.0060614115641f, + 0.0060365372360f, + 0.0060107828250f, + 0.0059841567980f, + 0.0059566679018f, + 0.0059283251534f, + 0.0058991378384f, + 0.0058691155076f, + 0.0058382679685f, + 0.0058066052887f, + 0.0057741377800f, + 0.0057408760083f, + 0.0057068307715f, + 0.0056720131146f, + 0.0056364343024f, + 0.0056001058389f, + 0.0055630394362f, + 0.0055252470364f, + 0.0054867407779f, + 0.0054475330196f, + 0.0054076363051f, + 0.0053670633876f, + 0.0053258271941f, + 0.0052839408493f, + 0.0052414176408f, + 0.0051982710415f, + 0.0051545146765f, + 0.0051101623431f, + 0.0050652279802f, + 0.0050197256849f, + 0.0049736696861f, + 0.0049270743557f, + 0.0048799541881f, + 0.0048323238052f, + 0.0047841979416f, + 0.0047355914438f, + 0.0046865192616f, + 0.0046369964405f, + 0.0045870381197f, + 0.0045366595183f, + 0.0044858759388f, + 0.0044347027481f, + 0.0043831553862f, + 0.0043312493419f, + 0.0042790001663f, + 0.0042264234446f, + 0.0041735348127f, + 0.0041203499262f, + 0.0040668844797f, + 0.0040131541736f, + 0.0039591747350f, + 0.0039049618835f, + 0.0038505313527f, + 0.0037958988559f, + 0.0037410801073f, + 0.0036860907892f, + 0.0036309465703f, + 0.0035756630769f, + 0.0035202559073f, + 0.0034647406073f, + 0.0034091326794f, + 0.0033534475647f, + 0.0032977006457f, + 0.0032419072346f, + 0.0031860825701f, + 0.0031302418118f, + 0.0030744000312f, + 0.0030185722124f, + 0.0029627732367f, + 0.0029070178900f, + 0.0028513208414f, + 0.0027956966562f, + 0.0027401597701f, + 0.0026847245064f, + 0.0026294050460f, + 0.0025742154495f, + 0.0025191696234f, + 0.0024642813451f, + 0.0024095642271f, + 0.0023550317442f, + 0.0023006971965f, + 0.0022465737373f, + 0.0021926743367f, + 0.0021390118086f, + 0.0020855987758f, + 0.0020324476959f, + 0.0019795708285f, + 0.0019269802582f, + 0.0018746878666f, + 0.0018227053500f, + 0.0017710441970f, + 0.0017197157018f, + 0.0016687309465f, + 0.0016181008094f, + 0.0015678359536f, + 0.0015179468293f, + 0.0014684436687f, + 0.0014193364826f, + 0.0013706350614f, + 0.0013223489661f, + 0.0012744875354f, + 0.0012270598713f, + 0.0011800748517f, + 0.0011335411113f, + 0.0010874670591f, + 0.0010418608557f, + 0.0009967304337f, + 0.0009520834733f, + 0.0009079274248f, + 0.0008642694829f, + 0.0008211166104f, + 0.0007784755123f, + 0.0007363526596f, + 0.0006947542648f, + 0.0006536863036f, + 0.0006131544939f, + 0.0005731643140f, + 0.0005337209861f, + 0.0004948294900f, + 0.0004564945514f, + 0.0004187206518f, + 0.0003815120213f, + 0.0003448726437f, + 0.0003088062548f, + 0.0002733163427f, + 0.0002384061515f, + 0.0002040786763f, + 0.0001703366727f, + 0.0001371826468f, + 0.0001046188693f, + 0.0000726473624f, + 0.0000412699167f, + 0.0000104880762f, + -0.0000196968430f, + -0.0000492837685f, + -0.0000782718524f, + -0.0001066604864f, + -0.0001344492837f, + -0.0001616380917f, + -0.0001882269770f, + -0.0002142162337f, + -0.0002396063730f, + -0.0002643981260f, + -0.0002885924395f, + -0.0003121904710f, + -0.0003351935927f, + -0.0003576033774f, + -0.0003794216126f, + -0.0004006502744f, + -0.0004212915539f, + -0.0004413478190f, + -0.0004608216523f, + -0.0004797158006f, + -0.0004980332255f, + -0.0005157770396f, + -0.0005329505706f, + -0.0005495572834f, + -0.0005656008577f, + -0.0005810850973f, + -0.0005960140195f, + -0.0006103917530f, + -0.0006242226379f, + -0.0006375111133f, + -0.0006502618271f, + -0.0006624795144f, + -0.0006741691151f, + -0.0006853356454f, + -0.0006959843215f, + -0.0007061204255f, + -0.0007157494339f, + -0.0007248768797f, + -0.0007335084828f, + -0.0007416500121f, + -0.0007493074146f, + -0.0007564866791f, + -0.0007631939632f, + -0.0007694354603f, + -0.0007752175217f, + -0.0007805465296f, + -0.0007854290126f, + -0.0007898715256f, + -0.0007938807581f, + -0.0007974634219f, + -0.0008006263506f, + -0.0008033763972f, + -0.0008057205234f, + -0.0008076657071f, + -0.0008092190219f, + -0.0008103875548f, + -0.0008111784758f, + -0.0008115989647f, + -0.0008116562723f, + -0.0008113576556f, + -0.0008107104310f, + -0.0008097219168f, + -0.0008083994801f, + -0.0008067504850f, + -0.0008047823347f, + -0.0008025024239f, + -0.0007999181773f, + -0.0007970370052f, + -0.0007938663403f, + -0.0007904135933f, + -0.0007866861914f, + -0.0007826915315f, + -0.0007784370217f, + -0.0007739300312f, + -0.0007691779366f, + -0.0007641880653f, + -0.0007589677498f, + -0.0007535242631f, + -0.0007478648811f, + -0.0007419968098f, + -0.0007359272569f, + -0.0007296633493f, + -0.0007232122149f, + -0.0007165808902f, + -0.0007097764122f, + -0.0007028057162f, + -0.0006956757374f, + -0.0006883933000f, + -0.0006809652268f, + -0.0006733982212f, + -0.0006656989842f, + -0.0006578740890f, + -0.0006499301053f, + -0.0006418734679f, + -0.0006337106061f, + -0.0006254478087f, + -0.0006170913558f, + -0.0006086473832f, + -0.0006001220139f, + -0.0005915212236f, + -0.0005828509711f, + -0.0005741170662f, + -0.0005653252961f, + -0.0005564812990f, + -0.0005475906847f, + -0.0005386589147f, + -0.0005296914154f, + -0.0005206934671f, + -0.0005116703080f, + -0.0005026270327f, + -0.0004935686869f, + -0.0004845001759f, + -0.0004754263492f, + -0.0004663519194f, + -0.0004572815366f, + -0.0004482197180f, + -0.0004391709117f, + -0.0004301394370f, + -0.0004211295386f, + -0.0004121453355f, + -0.0004031908675f, + -0.0003942700520f, + -0.0003853867235f, + -0.0003765445962f, + -0.0003677472992f, + -0.0003589983429f, + -0.0003503011513f, + -0.0003416590306f, + -0.0003330752009f, + -0.0003245527639f, + -0.0003160947374f, + -0.0003077040191f, + -0.0002993834261f, + -0.0002911356534f, + -0.0002829633193f, + -0.0002748689175f, + -0.0002668548703f, + -0.0002589234716f, + -0.0002510769507f, + -0.0002433174043f, + -0.0002356468714f, + -0.0002280672545f, + -0.0002205804055f, + -0.0002131880358f, + -0.0002058918142f, + -0.0001986932647f, + -0.0001915938761f, + -0.0001845949894f, + -0.0001776979177f, + -0.0001709038232f, + -0.0001642138471f, + -0.0001576289781f, + -0.0001511501895f, + -0.0001447783020f, + -0.0001385141249f, + -0.0001323583166f, + -0.0001263115271f, + -0.0001203742580f, + -0.0001145470050f, + -0.0001088301187f, + -0.0001032239450f, + -0.0000977286901f, + -0.0000923445550f, + -0.0000870716076f, + -0.0000819099094f, + -0.0000768593961f, + -0.0000719199952f, + -0.0000670915167f, + -0.0000623737594f, + -0.0000577664138f, + -0.0000532691560f, + -0.0000488815635f, + -0.0000446031954f, + -0.0000404335221f, + -0.0000363719922f, + -0.0000324179752f, + -0.0000285708153f, + -0.0000248297868f, + -0.0000211941363f, + -0.0000176630487f, + -0.0000142356795f, + -0.0000109111299f, + -0.0000076884710f, + -0.0000045667258f, + -0.0000015448876f, + 0.0000013780933f, + 0.0000042032944f, + 0.0000069318331f, + 0.0000095648509f, + 0.0000121035277f, + 0.0000145490624f, + 0.0000169026922f, + 0.0000191656671f, + 0.0000213392762f, + 0.0000234248141f, + 0.0000254236173f, + 0.0000273370189f, + 0.0000291663973f, + 0.0000309131181f, + 0.0000325785972f, + 0.0000341642269f, + 0.0000356714551f, + 0.0000371016959f, + 0.0000384564242f, + 0.0000397370709f, + 0.0000409451326f, + 0.0000420820523f, + 0.0000431493437f, + 0.0000441484575f, + 0.0000450809190f, + 0.0000459481829f, + 0.0000467517812f, + 0.0000474931688f, + 0.0000481738794f, + 0.0000487953650f, + 0.0000493591558f, + 0.0000498666979f, + 0.0000503195135f, + 0.0000507190397f, + 0.0000510667862f, + 0.0000513641784f, + 0.0000516127093f, + 0.0000518137901f, + 0.0000519688928f, + 0.0000520794123f, + 0.0000521467956f, + 0.0000521724191f, + 0.0000521577014f, + 0.0000521039980f, + 0.0000520126964f, + 0.0000518851286f, + 0.0000517226482f, + 0.0000515265621f, + 0.0000512981874f, + 0.0000510388032f, + 0.0000507496888f, + 0.0000504320934f, + 0.0000500872564f, + 0.0000497163952f, + 0.0000493207086f, + 0.0000489013793f, + 0.0000484595649f, + 0.0000479964116f, + 0.0000475130351f, + 0.0000470105429f, + 0.0000464900089f, + 0.0000459524996f, + 0.0000453990473f, + 0.0000448306757f, + 0.0000442483761f, + 0.0000436531270f, + 0.0000430458793f, + 0.0000424275651f, + 0.0000417990953f, + 0.0000411613543f, + 0.0000405152136f, + 0.0000398615087f, + 0.0000392010726f, + 0.0000385346910f, + 0.0000378631590f, + 0.0000371872122f, + 0.0000365076083f, + 0.0000358250326f, + 0.0000351402059f, + 0.0000344537638f, + 0.0000337663900f, + 0.0000330786713f, + 0.0000323912545f, + 0.0000317046787f, + 0.0000310195537f, + 0.0000303363724f, + 0.0000296557072f, + 0.0000289780068f, + 0.0000283038060f, + 0.0000276335113f, + 0.0000269676192f, + 0.0000263064966f, + 0.0000256506012f, + 0.0000250002630f, + 0.0000243559001f, + 0.0000237178084f, + 0.0000230863658f, + 0.0000224618368f, + 0.0000218445591f, + 0.0000212347684f, + 0.0000206327617f, + 0.0000200387487f, + 0.0000194529856f, + 0.0000188756586f, + 0.0000183069836f, + 0.0000177471253f, + 0.0000171962598f, + 0.0000166545325f, + 0.0000161220807f, + 0.0000155990318f, + 0.0000150854857f, + 0.0000145815531f, + 0.0000140872987f, + 0.0000136028167f, + 0.0000131281391f, + 0.0000126633440f, + 0.0000122084333f, + 0.0000117634690f, + 0.0000113284258f, + 0.0000109033494f, + 0.0000104881911f, + 0.0000100829787f, + 0.0000096876440f, + 0.0000093021962f, + 0.0000089265516f, + 0.0000085606992f, + 0.0000082045440f, + 0.0000078580532f, + 0.0000075211250f, + 0.0000071937032f, + 0.0000068756832f, + 0.0000065669838f, + 0.0000062675020f, + 0.0000059771297f, + 0.0000056957697f, + 0.0000054232859f, + 0.0000051595901f, + 0.0000049045172f, + 0.0000046579914f, + 0.0000044198178f, + 0.0000041899359f, + 0.0000039681205f, + 0.0000037543287f, + 0.0000035483053f, + 0.0000033500265f, + 0.0000031592080f, + 0.0000029758459f, + 0.0000027996282f, + 0.0000026305712f, + 0.0000024683369f, + 0.0000023129618f, + 0.0000021640841f, + 0.0000020217596f, + 0.0000018856055f, + 0.0000017556952f, + 0.0000016316288f, + 0.0000015134951f, + 0.0000014008804f, + 0.0000012938865f, + 0.0000011920904f, + 0.0000010956039f, + 0.0000010039987f, + 0.0000054617197f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_256_16.h b/core/src/dsp/multirate/decim/taps/fir_256_16.h new file mode 100644 index 0000000..56f959f --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_256_16.h @@ -0,0 +1,88 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_16_len = 76; + const float fir_256_16_taps[] = { + 0.0000015142320f, + 0.0000056182880f, + 0.0000124498946f, + 0.0000260499212f, + 0.0000484430498f, + 0.0000846870575f, + 0.0001399358873f, + 0.0002214698093f, + 0.0003376597827f, + 0.0004986987881f, + 0.0007161460168f, + 0.0010030447437f, + 0.0013735255533f, + 0.0018425379543f, + 0.0024253148288f, + 0.0031368140196f, + 0.0039910067755f, + 0.0050001228341f, + 0.0061738297617f, + 0.0075184160910f, + 0.0090360019122f, + 0.0107238349685f, + 0.0125737121967f, + 0.0145715758254f, + 0.0166973209914f, + 0.0189248478075f, + 0.0212223774387f, + 0.0235530403051f, + 0.0258757292104f, + 0.0281461957951f, + 0.0303183537669f, + 0.0323457392931f, + 0.0341830677768f, + 0.0357878183250f, + 0.0371217728573f, + 0.0381524365951f, + 0.0388542706370f, + 0.0392096753967f, + 0.0392096753967f, + 0.0388542706370f, + 0.0381524365951f, + 0.0371217728573f, + 0.0357878183250f, + 0.0341830677768f, + 0.0323457392931f, + 0.0303183537669f, + 0.0281461957951f, + 0.0258757292104f, + 0.0235530403051f, + 0.0212223774387f, + 0.0189248478075f, + 0.0166973209914f, + 0.0145715758254f, + 0.0125737121967f, + 0.0107238349685f, + 0.0090360019122f, + 0.0075184160910f, + 0.0061738297617f, + 0.0050001228341f, + 0.0039910067755f, + 0.0031368140196f, + 0.0024253148288f, + 0.0018425379543f, + 0.0013735255533f, + 0.0010030447437f, + 0.0007161460168f, + 0.0004986987881f, + 0.0003376597827f, + 0.0002214698093f, + 0.0001399358873f, + 0.0000846870575f, + 0.0000484430498f, + 0.0000260499212f, + 0.0000124498946f, + 0.0000056182880f, + 0.0000015142320f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_256_32.h b/core/src/dsp/multirate/decim/taps/fir_256_32.h new file mode 100644 index 0000000..d47c58e --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_256_32.h @@ -0,0 +1,155 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_32_len = 143; + const float fir_256_32_taps[] = { + 0.000002024710441, + 0.000005071986063, + 0.000005649621619, + 0.000009996317351, + 0.000013960233561, + 0.000020203028684, + 0.000027743453140, + 0.000037649365146, + 0.000049946026699, + 0.000065301488097, + 0.000084113029863, + 0.000107006458486, + 0.000134566059018, + 0.000167482006932, + 0.000206469601804, + 0.000252311382077, + 0.000305831073218, + 0.000367903193892, + 0.000439441775093, + 0.000521398892491, + 0.000614756278678, + 0.000720519104213, + 0.000839706996025, + 0.000973345013002, + 0.001122453164999, + 0.001288035337090, + 0.001471067271555, + 0.001672483946636, + 0.001893166344323, + 0.002133927814945, + 0.002395500153619, + 0.002678519576086, + 0.002983512762124, + 0.003310883161302, + 0.003660897754233, + 0.004033674471928, + 0.004429170475222, + 0.004847171495793, + 0.005287282435142, + 0.005748919410995, + 0.006231303428249, + 0.006733455837854, + 0.007254195729720, + 0.007792139384731, + 0.008345701888126, + 0.008913100980819, + 0.009492363197372, + 0.010081332310191, + 0.010677680068163, + 0.011278919186999, + 0.011882418516063, + 0.012485420274634, + 0.013085059219684, + 0.013678383576860, + 0.014262377537964, + 0.014833985102374, + 0.015390135015749, + 0.015927766539308, + 0.016443855765594, + 0.016935442183430, + 0.017399655185551, + 0.017833740207285, + 0.018235084184538, + 0.018601240022499, + 0.018929949775865, + 0.019219166253362, + 0.019467072776985, + 0.019672100847465, + 0.019832945492079, + 0.019948578099591, + 0.020018256578123, + 0.020041532705549, + 0.020018256578123, + 0.019948578099591, + 0.019832945492079, + 0.019672100847465, + 0.019467072776985, + 0.019219166253362, + 0.018929949775865, + 0.018601240022499, + 0.018235084184538, + 0.017833740207285, + 0.017399655185551, + 0.016935442183430, + 0.016443855765594, + 0.015927766539308, + 0.015390135015749, + 0.014833985102374, + 0.014262377537964, + 0.013678383576860, + 0.013085059219684, + 0.012485420274634, + 0.011882418516063, + 0.011278919186999, + 0.010677680068163, + 0.010081332310191, + 0.009492363197372, + 0.008913100980819, + 0.008345701888126, + 0.007792139384731, + 0.007254195729720, + 0.006733455837854, + 0.006231303428249, + 0.005748919410995, + 0.005287282435142, + 0.004847171495793, + 0.004429170475222, + 0.004033674471928, + 0.003660897754233, + 0.003310883161302, + 0.002983512762124, + 0.002678519576086, + 0.002395500153619, + 0.002133927814945, + 0.001893166344323, + 0.001672483946636, + 0.001471067271555, + 0.001288035337090, + 0.001122453164999, + 0.000973345013002, + 0.000839706996025, + 0.000720519104213, + 0.000614756278678, + 0.000521398892491, + 0.000439441775093, + 0.000367903193892, + 0.000305831073218, + 0.000252311382077, + 0.000206469601804, + 0.000167482006932, + 0.000134566059018, + 0.000107006458486, + 0.000084113029863, + 0.000065301488097, + 0.000049946026699, + 0.000037649365146, + 0.000027743453140, + 0.000020203028684, + 0.000013960233561, + 0.000009996317351, + 0.000005649621619, + 0.000005071986063, + 0.000002024710441, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_256_64.h b/core/src/dsp/multirate/decim/taps/fir_256_64.h new file mode 100644 index 0000000..9836b4c --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_256_64.h @@ -0,0 +1,368 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_64_len = 356; + const float fir_256_64_taps[] = { + -0.0000062681742f, + -0.0000029140762f, + -0.0000035815110f, + -0.0000043422553f, + -0.0000052049053f, + -0.0000061772939f, + -0.0000072686109f, + -0.0000084872485f, + -0.0000098429063f, + -0.0000113444414f, + -0.0000130019541f, + -0.0000148246460f, + -0.0000168228827f, + -0.0000190060632f, + -0.0000213846550f, + -0.0000239680794f, + -0.0000267667146f, + -0.0000297898005f, + -0.0000330474067f, + -0.0000365483596f, + -0.0000403021726f, + -0.0000443169994f, + -0.0000486015224f, + -0.0000531629366f, + -0.0000580087933f, + -0.0000631450183f, + -0.0000685777077f, + -0.0000743111852f, + -0.0000803497472f, + -0.0000866957632f, + -0.0000933513680f, + -0.0001003166088f, + -0.0001075910834f, + -0.0001151721377f, + -0.0001230564481f, + -0.0001312382737f, + -0.0001397109815f, + -0.0001484653574f, + -0.0001574910729f, + -0.0001667750594f, + -0.0001763029154f, + -0.0001860573478f, + -0.0001960195192f, + -0.0002061675607f, + -0.0002164778583f, + -0.0002269236408f, + -0.0002374762065f, + -0.0002481035885f, + -0.0002587717224f, + -0.0002694431931f, + -0.0002800783421f, + -0.0002906341007f, + -0.0003010650378f, + -0.0003113222805f, + -0.0003213545042f, + -0.0003311069438f, + -0.0003405223259f, + -0.0003495399742f, + -0.0003580966832f, + -0.0003661259202f, + -0.0003735586428f, + -0.0003803225975f, + -0.0003863430819f, + -0.0003915423426f, + -0.0003958402819f, + -0.0003991539556f, + -0.0004013982252f, + -0.0004024853566f, + -0.0004023256179f, + -0.0004008269786f, + -0.0003978956543f, + -0.0003934359050f, + -0.0003873505277f, + -0.0003795407527f, + -0.0003699066836f, + -0.0003583472905f, + -0.0003447607977f, + -0.0003290447712f, + -0.0003110964540f, + -0.0002908129452f, + -0.0002680914824f, + -0.0002428297099f, + -0.0002149259070f, + -0.0001842793414f, + -0.0001507904431f, + -0.0001143612390f, + -0.0000748954712f, + -0.0000322991074f, + 0.0000135195964f, + 0.0000626495149f, + 0.0001151766480f, + 0.0001711834750f, + 0.0002307490067f, + 0.0002939480814f, + 0.0003608514761f, + 0.0004315251498f, + 0.0005060304153f, + 0.0005844231367f, + 0.0006667539631f, + 0.0007530674871f, + 0.0008434025410f, + 0.0009377913237f, + 0.0010362597605f, + 0.0011388266053f, + 0.0012455038652f, + 0.0013562958844f, + 0.0014711998354f, + 0.0015902047905f, + 0.0017132922802f, + 0.0018404353607f, + 0.0019715992373f, + 0.0021067403358f, + 0.0022458069916f, + 0.0023887385299f, + 0.0025354660208f, + 0.0026859113741f, + 0.0028399881592f, + 0.0029976007211f, + 0.0031586450629f, + 0.0033230079887f, + 0.0034905680464f, + 0.0036611947020f, + 0.0038347493416f, + 0.0040110844803f, + 0.0041900448203f, + 0.0043714664990f, + 0.0045551781983f, + 0.0047410004367f, + 0.0049287467249f, + 0.0051182229035f, + 0.0053092283419f, + 0.0055015553224f, + 0.0056949902776f, + 0.0058893132225f, + 0.0060842990234f, + 0.0062797168802f, + 0.0064753316199f, + 0.0066709032288f, + 0.0068661881644f, + 0.0070609389367f, + 0.0072549054317f, + 0.0074478345403f, + 0.0076394714860f, + 0.0078295595003f, + 0.0080178411460f, + 0.0082040580375f, + 0.0083879521517f, + 0.0085692655900f, + 0.0087477418693f, + 0.0089231257234f, + 0.0090951643643f, + 0.0092636073201f, + 0.0094282076595f, + 0.0095887218614f, + 0.0097449109950f, + 0.0098965406177f, + 0.0100433819014f, + 0.0101852115568f, + 0.0103218128967f, + 0.0104529757832f, + 0.0105784976211f, + 0.0106981833229f, + 0.0108118462264f, + 0.0109193080737f, + 0.0110203998455f, + 0.0111149617515f, + 0.0112028439747f, + 0.0112839066704f, + 0.0113580206147f, + 0.0114250672088f, + 0.0114849390277f, + 0.0115375398269f, + 0.0115827849866f, + 0.0116206015194f, + 0.0116509284062f, + 0.0116737166029f, + 0.0116889292662f, + 0.0116965417578f, + 0.0116965417578f, + 0.0116889292662f, + 0.0116737166029f, + 0.0116509284062f, + 0.0116206015194f, + 0.0115827849866f, + 0.0115375398269f, + 0.0114849390277f, + 0.0114250672088f, + 0.0113580206147f, + 0.0112839066704f, + 0.0112028439747f, + 0.0111149617515f, + 0.0110203998455f, + 0.0109193080737f, + 0.0108118462264f, + 0.0106981833229f, + 0.0105784976211f, + 0.0104529757832f, + 0.0103218128967f, + 0.0101852115568f, + 0.0100433819014f, + 0.0098965406177f, + 0.0097449109950f, + 0.0095887218614f, + 0.0094282076595f, + 0.0092636073201f, + 0.0090951643643f, + 0.0089231257234f, + 0.0087477418693f, + 0.0085692655900f, + 0.0083879521517f, + 0.0082040580375f, + 0.0080178411460f, + 0.0078295595003f, + 0.0076394714860f, + 0.0074478345403f, + 0.0072549054317f, + 0.0070609389367f, + 0.0068661881644f, + 0.0066709032288f, + 0.0064753316199f, + 0.0062797168802f, + 0.0060842990234f, + 0.0058893132225f, + 0.0056949902776f, + 0.0055015553224f, + 0.0053092283419f, + 0.0051182229035f, + 0.0049287467249f, + 0.0047410004367f, + 0.0045551781983f, + 0.0043714664990f, + 0.0041900448203f, + 0.0040110844803f, + 0.0038347493416f, + 0.0036611947020f, + 0.0034905680464f, + 0.0033230079887f, + 0.0031586450629f, + 0.0029976007211f, + 0.0028399881592f, + 0.0026859113741f, + 0.0025354660208f, + 0.0023887385299f, + 0.0022458069916f, + 0.0021067403358f, + 0.0019715992373f, + 0.0018404353607f, + 0.0017132922802f, + 0.0015902047905f, + 0.0014711998354f, + 0.0013562958844f, + 0.0012455038652f, + 0.0011388266053f, + 0.0010362597605f, + 0.0009377913237f, + 0.0008434025410f, + 0.0007530674871f, + 0.0006667539631f, + 0.0005844231367f, + 0.0005060304153f, + 0.0004315251498f, + 0.0003608514761f, + 0.0002939480814f, + 0.0002307490067f, + 0.0001711834750f, + 0.0001151766480f, + 0.0000626495149f, + 0.0000135195964f, + -0.0000322991074f, + -0.0000748954712f, + -0.0001143612390f, + -0.0001507904431f, + -0.0001842793414f, + -0.0002149259070f, + -0.0002428297099f, + -0.0002680914824f, + -0.0002908129452f, + -0.0003110964540f, + -0.0003290447712f, + -0.0003447607977f, + -0.0003583472905f, + -0.0003699066836f, + -0.0003795407527f, + -0.0003873505277f, + -0.0003934359050f, + -0.0003978956543f, + -0.0004008269786f, + -0.0004023256179f, + -0.0004024853566f, + -0.0004013982252f, + -0.0003991539556f, + -0.0003958402819f, + -0.0003915423426f, + -0.0003863430819f, + -0.0003803225975f, + -0.0003735586428f, + -0.0003661259202f, + -0.0003580966832f, + -0.0003495399742f, + -0.0003405223259f, + -0.0003311069438f, + -0.0003213545042f, + -0.0003113222805f, + -0.0003010650378f, + -0.0002906341007f, + -0.0002800783421f, + -0.0002694431931f, + -0.0002587717224f, + -0.0002481035885f, + -0.0002374762065f, + -0.0002269236408f, + -0.0002164778583f, + -0.0002061675607f, + -0.0001960195192f, + -0.0001860573478f, + -0.0001763029154f, + -0.0001667750594f, + -0.0001574910729f, + -0.0001484653574f, + -0.0001397109815f, + -0.0001312382737f, + -0.0001230564481f, + -0.0001151721377f, + -0.0001075910834f, + -0.0001003166088f, + -0.0000933513680f, + -0.0000866957632f, + -0.0000803497472f, + -0.0000743111852f, + -0.0000685777077f, + -0.0000631450183f, + -0.0000580087933f, + -0.0000531629366f, + -0.0000486015224f, + -0.0000443169994f, + -0.0000403021726f, + -0.0000365483596f, + -0.0000330474067f, + -0.0000297898005f, + -0.0000267667146f, + -0.0000239680794f, + -0.0000213846550f, + -0.0000190060632f, + -0.0000168228827f, + -0.0000148246460f, + -0.0000130019541f, + -0.0000113444414f, + -0.0000098429063f, + -0.0000084872485f, + -0.0000072686109f, + -0.0000061772939f, + -0.0000052049053f, + -0.0000043422553f, + -0.0000035815110f, + -0.0000029140762f, + -0.0000062681742f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_256_8.h b/core/src/dsp/multirate/decim/taps/fir_256_8.h new file mode 100644 index 0000000..4316ee9 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_256_8.h @@ -0,0 +1,44 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_256_8_len = 32; + const float fir_256_8_taps[] = { + 0.0000481199958f, + 0.0002120253977f, + 0.0006339322060f, + 0.0015268611634f, + 0.0031751774844f, + 0.0059080996632f, + 0.0100482128498f, + 0.0158389158363f, + 0.0233630301033f, + 0.0324710705948f, + 0.0427398820012f, + 0.0534789041603f, + 0.0637922520572f, + 0.0726919132761f, + 0.0792439704433f, + 0.0827196815814f, + 0.0827196815814f, + 0.0792439704433f, + 0.0726919132761f, + 0.0637922520572f, + 0.0534789041603f, + 0.0427398820012f, + 0.0324710705948f, + 0.0233630301033f, + 0.0158389158363f, + 0.0100482128498f, + 0.0059080996632f, + 0.0031751774844f, + 0.0015268611634f, + 0.0006339322060f, + 0.0002120253977f, + 0.0000481199958f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_2_2.h b/core/src/dsp/multirate/decim/taps/fir_2_2.h new file mode 100644 index 0000000..bc9ac46 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_2_2.h @@ -0,0 +1,81 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_2_2_len = 69; + const float fir_2_2_taps[] = { + 0.000400633624864, + 0.002075598505552, + 0.004856364956715, + 0.005979016698235, + 0.002622922607902, + -0.002718259152577, + -0.003381533671376, + 0.001638638539759, + 0.004081814705993, + -0.000984029228217, + -0.005120988470135, + 0.000177440907285, + 0.006425852662023, + 0.001009351602305, + -0.007912827910006, + -0.002713700675199, + 0.009509311257450, + 0.005070635723474, + -0.011154020477109, + -0.008246059919867, + 0.012785716787299, + 0.012487906837156, + -0.014347452386709, + -0.018205770848481, + 0.015781858576801, + 0.026172374716730, + -0.017037643409603, + -0.038051489304887, + 0.018067070624730, + 0.058212412671604, + -0.018832304184135, + -0.102772486604899, + 0.019303165035556, + 0.317189488733641, + 0.480537520090363, + 0.317189488733641, + 0.019303165035556, + -0.102772486604899, + -0.018832304184135, + 0.058212412671604, + 0.018067070624730, + -0.038051489304887, + -0.017037643409603, + 0.026172374716730, + 0.015781858576801, + -0.018205770848481, + -0.014347452386709, + 0.012487906837156, + 0.012785716787299, + -0.008246059919867, + -0.011154020477109, + 0.005070635723474, + 0.009509311257450, + -0.002713700675199, + -0.007912827910006, + 0.001009351602305, + 0.006425852662023, + 0.000177440907285, + -0.005120988470135, + -0.000984029228217, + 0.004081814705993, + 0.001638638539759, + -0.003381533671376, + -0.002718259152577, + 0.002622922607902, + 0.005979016698235, + 0.004856364956715, + 0.002075598505552, + 0.000400633624864, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_32_16.h b/core/src/dsp/multirate/decim/taps/fir_32_16.h new file mode 100644 index 0000000..b6d1ba5 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_32_16.h @@ -0,0 +1,140 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_16_len = 128; + const float fir_32_16_taps[] = { + 0.0000099342222f, + 0.0000146490348f, + 0.0000247646101f, + 0.0000387541309f, + 0.0000572736657f, + 0.0000808761926f, + 0.0001099349979f, + 0.0001445574213f, + 0.0001844922748f, + 0.0002290353727f, + 0.0002769386619f, + 0.0003263293316f, + 0.0003746459569f, + 0.0004185990900f, + 0.0004541637106f, + 0.0004766105134f, + 0.0004805821127f, + 0.0004602188681f, + 0.0004093371919f, + 0.0003216609257f, + 0.0001911037388f, + 0.0000120976033f, + -0.0002200406423f, + -0.0005087156694f, + -0.0008556468821f, + -0.0012604649511f, + -0.0017203301735f, + -0.0022295925790f, + -0.0027795143093f, + -0.0033580744939f, + -0.0039498755635f, + -0.0045361676357f, + -0.0050950043052f, + -0.0056015389258f, + -0.0060284654152f, + -0.0063466019019f, + -0.0065256093963f, + -0.0065348313327f, + -0.0063442336013f, + -0.0059254188348f, + -0.0052526835481f, + -0.0043040825207f, + -0.0030624618152f, + -0.0015164202550f, + 0.0003388408046f, + 0.0025008178935f, + 0.0049591911398f, + 0.0076955253725f, + 0.0106832101994f, + 0.0138876548446f, + 0.0172667447174f, + 0.0207715571925f, + 0.0243473242916f, + 0.0279346202686f, + 0.0314707429314f, + 0.0348912492894f, + 0.0381315991625f, + 0.0411288550641f, + 0.0438233832299f, + 0.0461604993011f, + 0.0480920029752f, + 0.0495775489259f, + 0.0505858063661f, + 0.0510953666101f, + 0.0510953666101f, + 0.0505858063661f, + 0.0495775489259f, + 0.0480920029752f, + 0.0461604993011f, + 0.0438233832299f, + 0.0411288550641f, + 0.0381315991625f, + 0.0348912492894f, + 0.0314707429314f, + 0.0279346202686f, + 0.0243473242916f, + 0.0207715571925f, + 0.0172667447174f, + 0.0138876548446f, + 0.0106832101994f, + 0.0076955253725f, + 0.0049591911398f, + 0.0025008178935f, + 0.0003388408046f, + -0.0015164202550f, + -0.0030624618152f, + -0.0043040825207f, + -0.0052526835481f, + -0.0059254188348f, + -0.0063442336013f, + -0.0065348313327f, + -0.0065256093963f, + -0.0063466019019f, + -0.0060284654152f, + -0.0056015389258f, + -0.0050950043052f, + -0.0045361676357f, + -0.0039498755635f, + -0.0033580744939f, + -0.0027795143093f, + -0.0022295925790f, + -0.0017203301735f, + -0.0012604649511f, + -0.0008556468821f, + -0.0005087156694f, + -0.0002200406423f, + 0.0000120976033f, + 0.0001911037388f, + 0.0003216609257f, + 0.0004093371919f, + 0.0004602188681f, + 0.0004805821127f, + 0.0004766105134f, + 0.0004541637106f, + 0.0004185990900f, + 0.0003746459569f, + 0.0003263293316f, + 0.0002769386619f, + 0.0002290353727f, + 0.0001844922748f, + 0.0001445574213f, + 0.0001099349979f, + 0.0000808761926f, + 0.0000572736657f, + 0.0000387541309f, + 0.0000247646101f, + 0.0000146490348f, + 0.0000099342222f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_32_2.h b/core/src/dsp/multirate/decim/taps/fir_32_2.h new file mode 100644 index 0000000..25b9502 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_32_2.h @@ -0,0 +1,18 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_2_len = 6; + const float fir_32_2_taps[] = { + 0.0303426484663f, + 0.1557222116669f, + 0.3154225044548f, + 0.3154225044548f, + 0.1557222116669f, + 0.0303426484663f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_32_32.h b/core/src/dsp/multirate/decim/taps/fir_32_32.h new file mode 100644 index 0000000..7d3017b --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_32_32.h @@ -0,0 +1,1115 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_32_len = 1103; + const float fir_32_32_taps[] = { + 0.0000064425788f, + 0.0000033014804f, + 0.0000041249453f, + 0.0000050666069f, + 0.0000061347473f, + 0.0000073374059f, + 0.0000086822757f, + 0.0000101765938f, + 0.0000118270277f, + 0.0000136395560f, + 0.0000156193469f, + 0.0000177706336f, + 0.0000200965883f, + 0.0000225991964f, + 0.0000252791303f, + 0.0000281356268f, + 0.0000311663665f, + 0.0000343673588f, + 0.0000377328326f, + 0.0000412551345f, + 0.0000449246363f, + 0.0000487296525f, + 0.0000526563699f, + 0.0000566887903f, + 0.0000608086879f, + 0.0000649955829f, + 0.0000692267316f, + 0.0000734771355f, + 0.0000777195696f, + 0.0000819246310f, + 0.0000860608088f, + 0.0000900945758f, + 0.0000939905024f, + 0.0000977113936f, + 0.0001012184487f, + 0.0001044714435f, + 0.0001074289359f, + 0.0001100484926f, + 0.0001122869384f, + 0.0001141006252f, + 0.0001154457210f, + 0.0001162785168f, + 0.0001165557502f, + 0.0001162349436f, + 0.0001152747551f, + 0.0001136353405f, + 0.0001112787225f, + 0.0001081691663f, + 0.0001042735572f, + 0.0000995617786f, + 0.0000940070861f, + 0.0000875864757f, + 0.0000802810417f, + 0.0000720763221f, + 0.0000629626269f, + 0.0000529353467f, + 0.0000419952383f, + 0.0000301486828f, + 0.0000174079151f, + 0.0000037912184f, + -0.0000106769153f, + -0.0000259656655f, + -0.0000420378042f, + -0.0000588496612f, + -0.0000763511359f, + -0.0000944857564f, + -0.0001131907895f, + -0.0001323974004f, + -0.0001520308649f, + -0.0001720108329f, + -0.0001922516448f, + -0.0002126626991f, + -0.0002331488711f, + -0.0002536109811f, + -0.0002739463104f, + -0.0002940491630f, + -0.0003138114702f, + -0.0003331234349f, + -0.0003518742125f, + -0.0003699526238f, + -0.0003872478959f, + -0.0004036504263f, + -0.0004190525651f, + -0.0004333494098f, + -0.0004464396065f, + -0.0004582261523f, + -0.0004686171928f, + -0.0004775268066f, + -0.0004848757728f, + -0.0004905923132f, + -0.0004946128030f, + -0.0004968824437f, + -0.0004973558920f, + -0.0004959978377f, + -0.0004927835248f, + -0.0004876992105f, + -0.0004807425563f, + -0.0004719229454f, + -0.0004612617230f, + -0.0004487923547f, + -0.0004345604987f, + -0.0004186239903f, + -0.0004010527353f, + -0.0003819285099f, + -0.0003613446675f, + -0.0003394057517f, + -0.0003162270149f, + -0.0002919338447f, + -0.0002666611005f, + -0.0002405523614f, + -0.0002137590910f, + -0.0001864397218f, + -0.0001587586656f, + -0.0001308852545f, + -0.0001029926207f, + -0.0000752565205f, + -0.0000478541121f, + -0.0000209626947f, + 0.0000052415821f, + 0.0000305850284f, + 0.0000548977338f, + 0.0000780148883f, + 0.0000997780906f, + 0.0001200366365f, + 0.0001386487747f, + 0.0001554829191f, + 0.0001704188086f, + 0.0001833486017f, + 0.0001941778982f, + 0.0002028266752f, + 0.0002092301313f, + 0.0002133394270f, + 0.0002151223160f, + 0.0002145636574f, + 0.0002116658040f, + 0.0002064488603f, + 0.0001989508042f, + 0.0001892274713f, + 0.0001773523961f, + 0.0001634165101f, + 0.0001475276961f, + 0.0001298101992f, + 0.0001104038960f, + 0.0000894634263f, + 0.0000671571903f, + 0.0000436662173f, + 0.0000191829133f, + -0.0000060903059f, + -0.0000319424858f, + -0.0000581556992f, + -0.0000845066962f, + -0.0001107686256f, + -0.0001367128149f, + -0.0001621105962f, + -0.0001867351629f, + -0.0002103634419f, + -0.0002327779678f, + -0.0002537687424f, + -0.0002731350628f, + -0.0002906873051f, + -0.0003062486452f, + -0.0003196567027f, + -0.0003307650922f, + -0.0003394448683f, + -0.0003455858480f, + -0.0003490978007f, + -0.0003499114897f, + -0.0003479795568f, + -0.0003432772379f, + -0.0003358029014f, + -0.0003255784014f, + -0.0003126492400f, + -0.0002970845330f, + -0.0002789767769f, + -0.0002584414148f, + -0.0002356162023f, + -0.0002106603742f, + -0.0001837536163f, + -0.0001550948484f, + -0.0001249008236f, + -0.0000934045545f, + -0.0000608535759f, + -0.0000275080565f, + 0.0000063612278f, + 0.0000404750427f, + 0.0000745479515f, + 0.0001082906593f, + 0.0001414124288f, + 0.0001736235455f, + 0.0002046378152f, + 0.0002341750699f, + 0.0002619636629f, + 0.0002877429300f, + 0.0003112655965f, + 0.0003323001063f, + 0.0003506328541f, + 0.0003660702983f, + 0.0003784409347f, + 0.0003875971118f, + 0.0003934166692f, + 0.0003958043827f, + 0.0003946931989f, + 0.0003900452468f, + 0.0003818526131f, + 0.0003701378703f, + 0.0003549543498f, + 0.0003363861529f, + 0.0003145478953f, + 0.0002895841828f, + 0.0002616688194f, + 0.0002310037485f, + 0.0001978177334f, + 0.0001623647845f, + 0.0001249223415f, + 0.0000857892233f, + 0.0000452833598f, + 0.0000037393217f, + -0.0000384943344f, + -0.0000810578837f, + -0.0001235833928f, + -0.0001656977983f, + -0.0002070260772f, + -0.0002471944859f, + -0.0002858338377f, + -0.0003225827932f, + -0.0003570911325f, + -0.0003890229831f, + -0.0004180599723f, + -0.0004439042760f, + -0.0004662815362f, + -0.0004849436183f, + -0.0004996711823f, + -0.0005102760424f, + -0.0005166032906f, + -0.0005185331617f, + -0.0005159826200f, + -0.0005089066484f, + -0.0004972992247f, + -0.0004811939705f, + -0.0004606644634f, + -0.0004358242025f, + -0.0004068262238f, + -0.0003738623613f, + -0.0003371621574f, + -0.0002969914239f, + -0.0002536504622f, + -0.0002074719536f, + -0.0001588185305f, + -0.0001080800484f, + -0.0000556705748f, + -0.0000020251190f, + 0.0000524038732f, + 0.0001071502323f, + 0.0001617379566f, + 0.0002156852502f, + 0.0002685086744f, + 0.0003197273785f, + 0.0003688673719f, + 0.0004154658029f, + 0.0004590752048f, + 0.0004992676723f, + 0.0005356389296f, + 0.0005678122527f, + 0.0005954422100f, + 0.0006182181836f, + 0.0006358676383f, + 0.0006481591046f, + 0.0006549048458f, + 0.0006559631794f, + 0.0006512404284f, + 0.0006406924783f, + 0.0006243259206f, + 0.0006021987666f, + 0.0005744207175f, + 0.0005411529820f, + 0.0005026076371f, + 0.0004590465283f, + 0.0004107797148f, + 0.0003581634636f, + 0.0003015978052f, + 0.0002415236649f, + 0.0001784195887f, + 0.0001127980870f, + 0.0000452016213f, + -0.0000238017346f, + -0.0000936229265f, + -0.0001636568079f, + -0.0002332872451f, + -0.0003018923975f, + -0.0003688501294f, + -0.0004335435059f, + -0.0004953663284f, + -0.0005537286580f, + -0.0006080622805f, + -0.0006578260616f, + -0.0007025111454f, + -0.0007416459455f, + -0.0007748008827f, + -0.0008015928239f, + -0.0008216891766f, + -0.0008348115993f, + -0.0008407392879f, + -0.0008393118036f, + -0.0008304314087f, + -0.0008140648836f, + -0.0007902448005f, + -0.0007590702339f, + -0.0007207068934f, + -0.0006753866683f, + -0.0006234065804f, + -0.0005651271432f, + -0.0005009701345f, + -0.0004314157931f, + -0.0003569994547f, + -0.0002783076491f, + -0.0001959736845f, + -0.0001106727507f, + -0.0000231165764f, + 0.0000659523175f, + 0.0001557667262f, + 0.0002455411796f, + 0.0003344786214f, + 0.0004217772924f, + 0.0005066377605f, + 0.0005882700376f, + 0.0006659007212f, + 0.0007387800990f, + 0.0008061891518f, + 0.0008674463921f, + 0.0009219144750f, + 0.0009690065202f, + 0.0010081920830f, + 0.0010390027190f, + 0.0010610370839f, + 0.0010739655188f, + 0.0010775340714f, + 0.0010715679088f, + 0.0010559740836f, + 0.0010307436170f, + 0.0009959528728f, + 0.0009517641963f, + 0.0008984258034f, + 0.0008362709091f, + 0.0007657160900f, + 0.0006872588853f, + 0.0006014746453f, + 0.0005090126426f, + 0.0004105914704f, + 0.0003069937573f, + 0.0001990602342f, + 0.0000876831956f, + -0.0000262005955f, + -0.0001416175057f, + -0.0002575650727f, + -0.0003730204271f, + -0.0004869490246f, + -0.0005983136178f, + -0.0007060833913f, + -0.0008092431831f, + -0.0009068027112f, + -0.0009978057260f, + -0.0010813390042f, + -0.0011565411061f, + -0.0012226108118f, + -0.0012788151601f, + -0.0013244970116f, + -0.0013590820627f, + -0.0013820852403f, + -0.0013931164108f, + -0.0013918853438f, + -0.0013782058733f, + -0.0013519992101f, + -0.0013132963596f, + -0.0012622396133f, + -0.0011990830835f, + -0.0011241922635f, + -0.0010380426004f, + -0.0009412170790f, + -0.0008344028202f, + -0.0007183867113f, + -0.0005940500874f, + -0.0004623624990f, + -0.0003243746032f, + -0.0001812102286f, + -0.0000340576689f, + 0.0001158397300f, + 0.0002671936193f, + 0.0004186812546f, + 0.0005689565779f, + 0.0007166616851f, + 0.0008604385851f, + 0.0009989411533f, + 0.0011308471768f, + 0.0012548703897f, + 0.0013697723925f, + 0.0014743743505f, + 0.0015675683649f, + 0.0016483284140f, + 0.0017157207613f, + 0.0017689137313f, + 0.0018071867586f, + 0.0018299386199f, + 0.0018366947630f, + 0.0018271136566f, + 0.0018009920869f, + 0.0017582693411f, + 0.0016990302210f, + 0.0016235068417f, + 0.0015320791808f, + 0.0014252743518f, + 0.0013037645862f, + 0.0011683639225f, + 0.0010200236060f, + 0.0008598262202f, + 0.0006889785773f, + 0.0005088034091f, + 0.0003207299089f, + 0.0001262831873f, + -0.0000729272881f, + -0.0002752201843f, + -0.0004788556370f, + -0.0006820493265f, + -0.0008829871871f, + -0.0010798406364f, + -0.0012707822026f, + -0.0014540014231f, + -0.0016277208850f, + -0.0017902122715f, + -0.0019398122798f, + -0.0020749382716f, + -0.0021941035199f, + -0.0022959319149f, + -0.0023791719963f, + -0.0024427101804f, + -0.0024855830567f, + -0.0025069886346f, + -0.0025062964261f, + -0.0024830562593f, + -0.0024370057269f, + -0.0023680761826f, + -0.0022763972095f, + -0.0021622994954f, + -0.0020263160645f, + -0.0018691818234f, + -0.0016918313969f, + -0.0014953952408f, + -0.0012811940314f, + -0.0010507313508f, + -0.0008056846932f, + -0.0005478948409f, + -0.0002793536645f, + -0.0000021904215f, + 0.0002813433620f, + 0.0005688903286f, + 0.0008580049348f, + 0.0011461721821f, + 0.0014308273011f, + 0.0017093762462f, + 0.0019792168491f, + 0.0022377604712f, + 0.0024824539913f, + 0.0027108019552f, + 0.0029203887137f, + 0.0031089003710f, + 0.0032741463650f, + 0.0034140805006f, + 0.0035268212589f, + 0.0036106712088f, + 0.0036641353518f, + 0.0036859382353f, + 0.0036750396796f, + 0.0036306489697f, + 0.0035522373756f, + 0.0034395488724f, + 0.0032926089480f, + 0.0031117313961f, + 0.0028975230072f, + 0.0026508860881f, + 0.0023730187510f, + 0.0020654129361f, + 0.0017298501434f, + 0.0013683948695f, + 0.0009833857623f, + 0.0005774245247f, + 0.0001533626145f, + -0.0002857141922f, + -0.0007365032920f, + -0.0011955046994f, + -0.0016590423288f, + -0.0021232869835f, + -0.0025842809035f, + -0.0030379637136f, + -0.0034801995974f, + -0.0039068055144f, + -0.0043135802655f, + -0.0046963342035f, + -0.0050509193789f, + -0.0053732599050f, + -0.0056593823215f, + -0.0059054457343f, + -0.0061077715081f, + -0.0062628722893f, + -0.0063674801377f, + -0.0064185735538f, + -0.0064134031881f, + -0.0063495160337f, + -0.0062247779062f, + -0.0060373940293f, + -0.0057859275562f, + -0.0054693158688f, + -0.0050868845136f, + -0.0046383586475f, + -0.0041238718858f, + -0.0035439724591f, + -0.0028996266103f, + -0.0021922191758f, + -0.0014235513217f, + -0.0005958354197f, + 0.0002883129257f, + 0.0012258856715f, + 0.0022134959000f, + 0.0032473940837f, + 0.0043234869591f, + 0.0054373588997f, + 0.0065842956603f, + 0.0077593103446f, + 0.0089571714337f, + 0.0101724326945f, + 0.0113994647757f, + 0.0126324882830f, + 0.0138656081140f, + 0.0150928488250f, + 0.0163081907913f, + 0.0175056069151f, + 0.0186790996341f, + 0.0198227379747f, + 0.0209306943985f, + 0.0219972811850f, + 0.0230169861023f, + 0.0239845071163f, + 0.0248947858968f, + 0.0257430398889f, + 0.0265247927237f, + 0.0272359027557f, + 0.0278725895284f, + 0.0284314579800f, + 0.0289095202198f, + 0.0293042147231f, + 0.0296134228075f, + 0.0298354822751f, + 0.0299691981248f, + 0.0300138502580f, + 0.0299691981248f, + 0.0298354822751f, + 0.0296134228075f, + 0.0293042147231f, + 0.0289095202198f, + 0.0284314579800f, + 0.0278725895284f, + 0.0272359027557f, + 0.0265247927237f, + 0.0257430398889f, + 0.0248947858968f, + 0.0239845071163f, + 0.0230169861023f, + 0.0219972811850f, + 0.0209306943985f, + 0.0198227379747f, + 0.0186790996341f, + 0.0175056069151f, + 0.0163081907913f, + 0.0150928488250f, + 0.0138656081140f, + 0.0126324882830f, + 0.0113994647757f, + 0.0101724326945f, + 0.0089571714337f, + 0.0077593103446f, + 0.0065842956603f, + 0.0054373588997f, + 0.0043234869591f, + 0.0032473940837f, + 0.0022134959000f, + 0.0012258856715f, + 0.0002883129257f, + -0.0005958354197f, + -0.0014235513217f, + -0.0021922191758f, + -0.0028996266103f, + -0.0035439724591f, + -0.0041238718858f, + -0.0046383586475f, + -0.0050868845136f, + -0.0054693158688f, + -0.0057859275562f, + -0.0060373940293f, + -0.0062247779062f, + -0.0063495160337f, + -0.0064134031881f, + -0.0064185735538f, + -0.0063674801377f, + -0.0062628722893f, + -0.0061077715081f, + -0.0059054457343f, + -0.0056593823215f, + -0.0053732599050f, + -0.0050509193789f, + -0.0046963342035f, + -0.0043135802655f, + -0.0039068055144f, + -0.0034801995974f, + -0.0030379637136f, + -0.0025842809035f, + -0.0021232869835f, + -0.0016590423288f, + -0.0011955046994f, + -0.0007365032920f, + -0.0002857141922f, + 0.0001533626145f, + 0.0005774245247f, + 0.0009833857623f, + 0.0013683948695f, + 0.0017298501434f, + 0.0020654129361f, + 0.0023730187510f, + 0.0026508860881f, + 0.0028975230072f, + 0.0031117313961f, + 0.0032926089480f, + 0.0034395488724f, + 0.0035522373756f, + 0.0036306489697f, + 0.0036750396796f, + 0.0036859382353f, + 0.0036641353518f, + 0.0036106712088f, + 0.0035268212589f, + 0.0034140805006f, + 0.0032741463650f, + 0.0031089003710f, + 0.0029203887137f, + 0.0027108019552f, + 0.0024824539913f, + 0.0022377604712f, + 0.0019792168491f, + 0.0017093762462f, + 0.0014308273011f, + 0.0011461721821f, + 0.0008580049348f, + 0.0005688903286f, + 0.0002813433620f, + -0.0000021904215f, + -0.0002793536645f, + -0.0005478948409f, + -0.0008056846932f, + -0.0010507313508f, + -0.0012811940314f, + -0.0014953952408f, + -0.0016918313969f, + -0.0018691818234f, + -0.0020263160645f, + -0.0021622994954f, + -0.0022763972095f, + -0.0023680761826f, + -0.0024370057269f, + -0.0024830562593f, + -0.0025062964261f, + -0.0025069886346f, + -0.0024855830567f, + -0.0024427101804f, + -0.0023791719963f, + -0.0022959319149f, + -0.0021941035199f, + -0.0020749382716f, + -0.0019398122798f, + -0.0017902122715f, + -0.0016277208850f, + -0.0014540014231f, + -0.0012707822026f, + -0.0010798406364f, + -0.0008829871871f, + -0.0006820493265f, + -0.0004788556370f, + -0.0002752201843f, + -0.0000729272881f, + 0.0001262831873f, + 0.0003207299089f, + 0.0005088034091f, + 0.0006889785773f, + 0.0008598262202f, + 0.0010200236060f, + 0.0011683639225f, + 0.0013037645862f, + 0.0014252743518f, + 0.0015320791808f, + 0.0016235068417f, + 0.0016990302210f, + 0.0017582693411f, + 0.0018009920869f, + 0.0018271136566f, + 0.0018366947630f, + 0.0018299386199f, + 0.0018071867586f, + 0.0017689137313f, + 0.0017157207613f, + 0.0016483284140f, + 0.0015675683649f, + 0.0014743743505f, + 0.0013697723925f, + 0.0012548703897f, + 0.0011308471768f, + 0.0009989411533f, + 0.0008604385851f, + 0.0007166616851f, + 0.0005689565779f, + 0.0004186812546f, + 0.0002671936193f, + 0.0001158397300f, + -0.0000340576689f, + -0.0001812102286f, + -0.0003243746032f, + -0.0004623624990f, + -0.0005940500874f, + -0.0007183867113f, + -0.0008344028202f, + -0.0009412170790f, + -0.0010380426004f, + -0.0011241922635f, + -0.0011990830835f, + -0.0012622396133f, + -0.0013132963596f, + -0.0013519992101f, + -0.0013782058733f, + -0.0013918853438f, + -0.0013931164108f, + -0.0013820852403f, + -0.0013590820627f, + -0.0013244970116f, + -0.0012788151601f, + -0.0012226108118f, + -0.0011565411061f, + -0.0010813390042f, + -0.0009978057260f, + -0.0009068027112f, + -0.0008092431831f, + -0.0007060833913f, + -0.0005983136178f, + -0.0004869490246f, + -0.0003730204271f, + -0.0002575650727f, + -0.0001416175057f, + -0.0000262005955f, + 0.0000876831956f, + 0.0001990602342f, + 0.0003069937573f, + 0.0004105914704f, + 0.0005090126426f, + 0.0006014746453f, + 0.0006872588853f, + 0.0007657160900f, + 0.0008362709091f, + 0.0008984258034f, + 0.0009517641963f, + 0.0009959528728f, + 0.0010307436170f, + 0.0010559740836f, + 0.0010715679088f, + 0.0010775340714f, + 0.0010739655188f, + 0.0010610370839f, + 0.0010390027190f, + 0.0010081920830f, + 0.0009690065202f, + 0.0009219144750f, + 0.0008674463921f, + 0.0008061891518f, + 0.0007387800990f, + 0.0006659007212f, + 0.0005882700376f, + 0.0005066377605f, + 0.0004217772924f, + 0.0003344786214f, + 0.0002455411796f, + 0.0001557667262f, + 0.0000659523175f, + -0.0000231165764f, + -0.0001106727507f, + -0.0001959736845f, + -0.0002783076491f, + -0.0003569994547f, + -0.0004314157931f, + -0.0005009701345f, + -0.0005651271432f, + -0.0006234065804f, + -0.0006753866683f, + -0.0007207068934f, + -0.0007590702339f, + -0.0007902448005f, + -0.0008140648836f, + -0.0008304314087f, + -0.0008393118036f, + -0.0008407392879f, + -0.0008348115993f, + -0.0008216891766f, + -0.0008015928239f, + -0.0007748008827f, + -0.0007416459455f, + -0.0007025111454f, + -0.0006578260616f, + -0.0006080622805f, + -0.0005537286580f, + -0.0004953663284f, + -0.0004335435059f, + -0.0003688501294f, + -0.0003018923975f, + -0.0002332872451f, + -0.0001636568079f, + -0.0000936229265f, + -0.0000238017346f, + 0.0000452016213f, + 0.0001127980870f, + 0.0001784195887f, + 0.0002415236649f, + 0.0003015978052f, + 0.0003581634636f, + 0.0004107797148f, + 0.0004590465283f, + 0.0005026076371f, + 0.0005411529820f, + 0.0005744207175f, + 0.0006021987666f, + 0.0006243259206f, + 0.0006406924783f, + 0.0006512404284f, + 0.0006559631794f, + 0.0006549048458f, + 0.0006481591046f, + 0.0006358676383f, + 0.0006182181836f, + 0.0005954422100f, + 0.0005678122527f, + 0.0005356389296f, + 0.0004992676723f, + 0.0004590752048f, + 0.0004154658029f, + 0.0003688673719f, + 0.0003197273785f, + 0.0002685086744f, + 0.0002156852502f, + 0.0001617379566f, + 0.0001071502323f, + 0.0000524038732f, + -0.0000020251190f, + -0.0000556705748f, + -0.0001080800484f, + -0.0001588185305f, + -0.0002074719536f, + -0.0002536504622f, + -0.0002969914239f, + -0.0003371621574f, + -0.0003738623613f, + -0.0004068262238f, + -0.0004358242025f, + -0.0004606644634f, + -0.0004811939705f, + -0.0004972992247f, + -0.0005089066484f, + -0.0005159826200f, + -0.0005185331617f, + -0.0005166032906f, + -0.0005102760424f, + -0.0004996711823f, + -0.0004849436183f, + -0.0004662815362f, + -0.0004439042760f, + -0.0004180599723f, + -0.0003890229831f, + -0.0003570911325f, + -0.0003225827932f, + -0.0002858338377f, + -0.0002471944859f, + -0.0002070260772f, + -0.0001656977983f, + -0.0001235833928f, + -0.0000810578837f, + -0.0000384943344f, + 0.0000037393217f, + 0.0000452833598f, + 0.0000857892233f, + 0.0001249223415f, + 0.0001623647845f, + 0.0001978177334f, + 0.0002310037485f, + 0.0002616688194f, + 0.0002895841828f, + 0.0003145478953f, + 0.0003363861529f, + 0.0003549543498f, + 0.0003701378703f, + 0.0003818526131f, + 0.0003900452468f, + 0.0003946931989f, + 0.0003958043827f, + 0.0003934166692f, + 0.0003875971118f, + 0.0003784409347f, + 0.0003660702983f, + 0.0003506328541f, + 0.0003323001063f, + 0.0003112655965f, + 0.0002877429300f, + 0.0002619636629f, + 0.0002341750699f, + 0.0002046378152f, + 0.0001736235455f, + 0.0001414124288f, + 0.0001082906593f, + 0.0000745479515f, + 0.0000404750427f, + 0.0000063612278f, + -0.0000275080565f, + -0.0000608535759f, + -0.0000934045545f, + -0.0001249008236f, + -0.0001550948484f, + -0.0001837536163f, + -0.0002106603742f, + -0.0002356162023f, + -0.0002584414148f, + -0.0002789767769f, + -0.0002970845330f, + -0.0003126492400f, + -0.0003255784014f, + -0.0003358029014f, + -0.0003432772379f, + -0.0003479795568f, + -0.0003499114897f, + -0.0003490978007f, + -0.0003455858480f, + -0.0003394448683f, + -0.0003307650922f, + -0.0003196567027f, + -0.0003062486452f, + -0.0002906873051f, + -0.0002731350628f, + -0.0002537687424f, + -0.0002327779678f, + -0.0002103634419f, + -0.0001867351629f, + -0.0001621105962f, + -0.0001367128149f, + -0.0001107686256f, + -0.0000845066962f, + -0.0000581556992f, + -0.0000319424858f, + -0.0000060903059f, + 0.0000191829133f, + 0.0000436662173f, + 0.0000671571903f, + 0.0000894634263f, + 0.0001104038960f, + 0.0001298101992f, + 0.0001475276961f, + 0.0001634165101f, + 0.0001773523961f, + 0.0001892274713f, + 0.0001989508042f, + 0.0002064488603f, + 0.0002116658040f, + 0.0002145636574f, + 0.0002151223160f, + 0.0002133394270f, + 0.0002092301313f, + 0.0002028266752f, + 0.0001941778982f, + 0.0001833486017f, + 0.0001704188086f, + 0.0001554829191f, + 0.0001386487747f, + 0.0001200366365f, + 0.0000997780906f, + 0.0000780148883f, + 0.0000548977338f, + 0.0000305850284f, + 0.0000052415821f, + -0.0000209626947f, + -0.0000478541121f, + -0.0000752565205f, + -0.0001029926207f, + -0.0001308852545f, + -0.0001587586656f, + -0.0001864397218f, + -0.0002137590910f, + -0.0002405523614f, + -0.0002666611005f, + -0.0002919338447f, + -0.0003162270149f, + -0.0003394057517f, + -0.0003613446675f, + -0.0003819285099f, + -0.0004010527353f, + -0.0004186239903f, + -0.0004345604987f, + -0.0004487923547f, + -0.0004612617230f, + -0.0004719229454f, + -0.0004807425563f, + -0.0004876992105f, + -0.0004927835248f, + -0.0004959978377f, + -0.0004973558920f, + -0.0004968824437f, + -0.0004946128030f, + -0.0004905923132f, + -0.0004848757728f, + -0.0004775268066f, + -0.0004686171928f, + -0.0004582261523f, + -0.0004464396065f, + -0.0004333494098f, + -0.0004190525651f, + -0.0004036504263f, + -0.0003872478959f, + -0.0003699526238f, + -0.0003518742125f, + -0.0003331234349f, + -0.0003138114702f, + -0.0002940491630f, + -0.0002739463104f, + -0.0002536109811f, + -0.0002331488711f, + -0.0002126626991f, + -0.0001922516448f, + -0.0001720108329f, + -0.0001520308649f, + -0.0001323974004f, + -0.0001131907895f, + -0.0000944857564f, + -0.0000763511359f, + -0.0000588496612f, + -0.0000420378042f, + -0.0000259656655f, + -0.0000106769153f, + 0.0000037912184f, + 0.0000174079151f, + 0.0000301486828f, + 0.0000419952383f, + 0.0000529353467f, + 0.0000629626269f, + 0.0000720763221f, + 0.0000802810417f, + 0.0000875864757f, + 0.0000940070861f, + 0.0000995617786f, + 0.0001042735572f, + 0.0001081691663f, + 0.0001112787225f, + 0.0001136353405f, + 0.0001152747551f, + 0.0001162349436f, + 0.0001165557502f, + 0.0001162785168f, + 0.0001154457210f, + 0.0001141006252f, + 0.0001122869384f, + 0.0001100484926f, + 0.0001074289359f, + 0.0001044714435f, + 0.0001012184487f, + 0.0000977113936f, + 0.0000939905024f, + 0.0000900945758f, + 0.0000860608088f, + 0.0000819246310f, + 0.0000777195696f, + 0.0000734771355f, + 0.0000692267316f, + 0.0000649955829f, + 0.0000608086879f, + 0.0000566887903f, + 0.0000526563699f, + 0.0000487296525f, + 0.0000449246363f, + 0.0000412551345f, + 0.0000377328326f, + 0.0000343673588f, + 0.0000311663665f, + 0.0000281356268f, + 0.0000252791303f, + 0.0000225991964f, + 0.0000200965883f, + 0.0000177706336f, + 0.0000156193469f, + 0.0000136395560f, + 0.0000118270277f, + 0.0000101765938f, + 0.0000086822757f, + 0.0000073374059f, + 0.0000061347473f, + 0.0000050666069f, + 0.0000041249453f, + 0.0000033014804f, + 0.0000064425788f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_32_4.h b/core/src/dsp/multirate/decim/taps/fir_32_4.h new file mode 100644 index 0000000..6fd3fa8 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_32_4.h @@ -0,0 +1,29 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_4_len = 17; + const float fir_32_4_taps[] = { + 0.0002602343386f, + 0.0019197560804f, + 0.0076270554566f, + 0.0212647832351f, + 0.0459374309886f, + 0.0808345515056f, + 0.1191594258092f, + 0.1495554802033f, + 0.1611781123721f, + 0.1495554802033f, + 0.1191594258092f, + 0.0808345515056f, + 0.0459374309886f, + 0.0212647832351f, + 0.0076270554566f, + 0.0019197560804f, + 0.0002602343386f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_32_8.h b/core/src/dsp/multirate/decim/taps/fir_32_8.h new file mode 100644 index 0000000..31b9e6f --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_32_8.h @@ -0,0 +1,56 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_32_8_len = 44; + const float fir_32_8_taps[] = { + -0.000029744589241, + -0.000102805435515, + -0.000256933218578, + -0.000524425617107, + -0.000923167111410, + -0.001434928315096, + -0.001981567015438, + -0.002404088713278, + -0.002451791426948, + -0.001788676228348, + -0.000022184036340, + 0.003244839156945, + 0.008343584867029, + 0.015460483392566, + 0.024564907542072, + 0.035359785525755, + 0.047269560715908, + 0.059474265224980, + 0.070989991387120, + 0.080786468196769, + 0.087923948445323, + 0.091686274752633, + 0.091686274752633, + 0.087923948445323, + 0.080786468196769, + 0.070989991387120, + 0.059474265224980, + 0.047269560715908, + 0.035359785525755, + 0.024564907542072, + 0.015460483392566, + 0.008343584867029, + 0.003244839156945, + -0.000022184036340, + -0.001788676228348, + -0.002451791426948, + -0.002404088713278, + -0.001981567015438, + -0.001434928315096, + -0.000923167111410, + -0.000524425617107, + -0.000256933218578, + -0.000102805435515, + -0.000029744589241, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_4096_128.h b/core/src/dsp/multirate/decim/taps/fir_4096_128.h new file mode 100644 index 0000000..d330868 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_4096_128.h @@ -0,0 +1,699 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_4096_128_len = 687; + const float fir_4096_128_taps[] = { + -0.0000001853079f, + -0.0000000346264f, + -0.0000000376411f, + -0.0000000406683f, + -0.0000000436847f, + -0.0000000466640f, + -0.0000000495767f, + -0.0000000523896f, + -0.0000000550661f, + -0.0000000575654f, + -0.0000000598428f, + -0.0000000618489f, + -0.0000000635299f, + -0.0000000648269f, + -0.0000000656757f, + -0.0000000660068f, + -0.0000000657448f, + -0.0000000648081f, + -0.0000000631089f, + -0.0000000605524f, + -0.0000000570369f, + -0.0000000524531f, + -0.0000000466841f, + -0.0000000396046f, + -0.0000000310810f, + -0.0000000209706f, + -0.0000000091215f, + 0.0000000046280f, + 0.0000000204496f, + 0.0000000385257f, + 0.0000000590497f, + 0.0000000822264f, + 0.0000001082725f, + 0.0000001374170f, + 0.0000001699018f, + 0.0000002059821f, + 0.0000002459268f, + 0.0000002900194f, + 0.0000003385579f, + 0.0000003918557f, + 0.0000004502420f, + 0.0000005140626f, + 0.0000005836800f, + 0.0000006594741f, + 0.0000007418430f, + 0.0000008312033f, + 0.0000009279907f, + 0.0000010326607f, + 0.0000011456888f, + 0.0000012675717f, + 0.0000013988273f, + 0.0000015399957f, + 0.0000016916395f, + 0.0000018543446f, + 0.0000020287205f, + 0.0000022154015f, + 0.0000024150466f, + 0.0000026283404f, + 0.0000028559940f, + 0.0000030987450f, + 0.0000033573588f, + 0.0000036326283f, + 0.0000039253756f, + 0.0000042364515f, + 0.0000045667370f, + 0.0000049171433f, + 0.0000052886125f, + 0.0000056821186f, + 0.0000060986673f, + 0.0000065392974f, + 0.0000070050805f, + 0.0000074971223f, + 0.0000080165629f, + 0.0000085645769f, + 0.0000091423747f, + 0.0000097512023f, + 0.0000103923421f, + 0.0000110671135f, + 0.0000117768730f, + 0.0000125230151f, + 0.0000133069722f, + 0.0000141302156f, + 0.0000149942554f, + 0.0000159006412f, + 0.0000168509623f, + 0.0000178468480f, + 0.0000188899682f, + 0.0000199820332f, + 0.0000211247945f, + 0.0000223200446f, + 0.0000235696176f, + 0.0000248753891f, + 0.0000262392764f, + 0.0000276632389f, + 0.0000291492778f, + 0.0000306994366f, + 0.0000323158008f, + 0.0000340004981f, + 0.0000357556983f, + 0.0000375836134f, + 0.0000394864972f, + 0.0000414666457f, + 0.0000435263962f, + 0.0000456681279f, + 0.0000478942611f, + 0.0000502072572f, + 0.0000526096182f, + 0.0000551038867f, + 0.0000576926449f, + 0.0000603785150f, + 0.0000631641580f, + 0.0000660522733f, + 0.0000690455987f, + 0.0000721469091f, + 0.0000753590162f, + 0.0000786847678f, + 0.0000821270469f, + 0.0000856887711f, + 0.0000893728917f, + 0.0000931823927f, + 0.0000971202902f, + 0.0001011896310f, + 0.0001053934918f, + 0.0001097349782f, + 0.0001142172235f, + 0.0001188433875f, + 0.0001236166552f, + 0.0001285402359f, + 0.0001336173613f, + 0.0001388512848f, + 0.0001442452795f, + 0.0001498026371f, + 0.0001555266664f, + 0.0001614206914f, + 0.0001674880501f, + 0.0001737320925f, + 0.0001801561792f, + 0.0001867636795f, + 0.0001935579694f, + 0.0002005424304f, + 0.0002077204468f, + 0.0002150954042f, + 0.0002226706877f, + 0.0002304496792f, + 0.0002384357564f, + 0.0002466322894f, + 0.0002550426396f, + 0.0002636701572f, + 0.0002725181784f, + 0.0002815900242f, + 0.0002908889972f, + 0.0003004183794f, + 0.0003101814303f, + 0.0003201813839f, + 0.0003304214468f, + 0.0003409047951f, + 0.0003516345723f, + 0.0003626138868f, + 0.0003738458092f, + 0.0003853333694f, + 0.0003970795547f, + 0.0004090873065f, + 0.0004213595178f, + 0.0004338990308f, + 0.0004467086339f, + 0.0004597910591f, + 0.0004731489791f, + 0.0004867850049f, + 0.0005007016827f, + 0.0005149014913f, + 0.0005293868393f, + 0.0005441600623f, + 0.0005592234204f, + 0.0005745790947f, + 0.0005902291855f, + 0.0006061757086f, + 0.0006224205933f, + 0.0006389656791f, + 0.0006558127133f, + 0.0006729633479f, + 0.0006904191373f, + 0.0007081815354f, + 0.0007262518929f, + 0.0007446314546f, + 0.0007633213568f, + 0.0007823226250f, + 0.0008016361709f, + 0.0008212627897f, + 0.0008412031585f, + 0.0008614578327f, + 0.0008820272443f, + 0.0009029116994f, + 0.0009241113755f, + 0.0009456263198f, + 0.0009674564462f, + 0.0009896015337f, + 0.0010120612242f, + 0.0010348350198f, + 0.0010579222817f, + 0.0010813222275f, + 0.0011050339296f, + 0.0011290563132f, + 0.0011533881548f, + 0.0011780280801f, + 0.0012029745628f, + 0.0012282259227f, + 0.0012537803242f, + 0.0012796357754f, + 0.0013057901260f, + 0.0013322410668f, + 0.0013589861279f, + 0.0013860226783f, + 0.0014133479243f, + 0.0014409589089f, + 0.0014688525111f, + 0.0014970254450f, + 0.0015254742592f, + 0.0015541953364f, + 0.0015831848930f, + 0.0016124389787f, + 0.0016419534764f, + 0.0016717241017f, + 0.0017017464036f, + 0.0017320157641f, + 0.0017625273983f, + 0.0017932763553f, + 0.0018242575180f, + 0.0018554656041f, + 0.0018868951663f, + 0.0019185405936f, + 0.0019503961118f, + 0.0019824557844f, + 0.0020147135141f, + 0.0020471630437f, + 0.0020797979574f, + 0.0021126116823f, + 0.0021455974903f, + 0.0021787484991f, + 0.0022120576745f, + 0.0022455178321f, + 0.0022791216394f, + 0.0023128616177f, + 0.0023467301445f, + 0.0023807194560f, + 0.0024148216493f, + 0.0024490286850f, + 0.0024833323899f, + 0.0025177244601f, + 0.0025521964633f, + 0.0025867398422f, + 0.0026213459177f, + 0.0026560058918f, + 0.0026907108512f, + 0.0027254517703f, + 0.0027602195153f, + 0.0027950048475f, + 0.0028297984269f, + 0.0028645908163f, + 0.0028993724850f, + 0.0029341338127f, + 0.0029688650939f, + 0.0030035565421f, + 0.0030381982934f, + 0.0030727804117f, + 0.0031072928924f, + 0.0031417256676f, + 0.0031760686099f, + 0.0032103115375f, + 0.0032444442190f, + 0.0032784563779f, + 0.0033123376974f, + 0.0033460778257f, + 0.0033796663804f, + 0.0034130929541f, + 0.0034463471189f, + 0.0034794184319f, + 0.0035122964401f, + 0.0035449706860f, + 0.0035774307122f, + 0.0036096660671f, + 0.0036416663102f, + 0.0036734210173f, + 0.0037049197858f, + 0.0037361522402f, + 0.0037671080372f, + 0.0037977768717f, + 0.0038281484815f, + 0.0038582126530f, + 0.0038879592268f, + 0.0039173781029f, + 0.0039464592460f, + 0.0039751926911f, + 0.0040035685488f, + 0.0040315770105f, + 0.0040592083542f, + 0.0040864529492f, + 0.0041133012618f, + 0.0041397438603f, + 0.0041657714205f, + 0.0041913747306f, + 0.0042165446965f, + 0.0042412723466f, + 0.0042655488373f, + 0.0042893654574f, + 0.0043127136335f, + 0.0043355849347f, + 0.0043579710770f, + 0.0043798639286f, + 0.0044012555142f, + 0.0044221380197f, + 0.0044425037963f, + 0.0044623453655f, + 0.0044816554230f, + 0.0045004268430f, + 0.0045186526821f, + 0.0045363261840f, + 0.0045534407824f, + 0.0045699901059f, + 0.0045859679809f, + 0.0046013684356f, + 0.0046161857032f, + 0.0046304142258f, + 0.0046440486570f, + 0.0046570838656f, + 0.0046695149383f, + 0.0046813371826f, + 0.0046925461296f, + 0.0047031375370f, + 0.0047131073910f, + 0.0047224519091f, + 0.0047311675420f, + 0.0047392509762f, + 0.0047466991355f, + 0.0047535091831f, + 0.0047596785231f, + 0.0047652048022f, + 0.0047700859110f, + 0.0047743199853f, + 0.0047779054073f, + 0.0047808408063f, + 0.0047831250597f, + 0.0047847572939f, + 0.0047857368844f, + 0.0047860634562f, + 0.0047857368844f, + 0.0047847572939f, + 0.0047831250597f, + 0.0047808408063f, + 0.0047779054073f, + 0.0047743199853f, + 0.0047700859110f, + 0.0047652048022f, + 0.0047596785231f, + 0.0047535091831f, + 0.0047466991355f, + 0.0047392509762f, + 0.0047311675420f, + 0.0047224519091f, + 0.0047131073910f, + 0.0047031375370f, + 0.0046925461296f, + 0.0046813371826f, + 0.0046695149383f, + 0.0046570838656f, + 0.0046440486570f, + 0.0046304142258f, + 0.0046161857032f, + 0.0046013684356f, + 0.0045859679809f, + 0.0045699901059f, + 0.0045534407824f, + 0.0045363261840f, + 0.0045186526821f, + 0.0045004268430f, + 0.0044816554230f, + 0.0044623453655f, + 0.0044425037963f, + 0.0044221380197f, + 0.0044012555142f, + 0.0043798639286f, + 0.0043579710770f, + 0.0043355849347f, + 0.0043127136335f, + 0.0042893654574f, + 0.0042655488373f, + 0.0042412723466f, + 0.0042165446965f, + 0.0041913747306f, + 0.0041657714205f, + 0.0041397438603f, + 0.0041133012618f, + 0.0040864529492f, + 0.0040592083542f, + 0.0040315770105f, + 0.0040035685488f, + 0.0039751926911f, + 0.0039464592460f, + 0.0039173781029f, + 0.0038879592268f, + 0.0038582126530f, + 0.0038281484815f, + 0.0037977768717f, + 0.0037671080372f, + 0.0037361522402f, + 0.0037049197858f, + 0.0036734210173f, + 0.0036416663102f, + 0.0036096660671f, + 0.0035774307122f, + 0.0035449706860f, + 0.0035122964401f, + 0.0034794184319f, + 0.0034463471189f, + 0.0034130929541f, + 0.0033796663804f, + 0.0033460778257f, + 0.0033123376974f, + 0.0032784563779f, + 0.0032444442190f, + 0.0032103115375f, + 0.0031760686099f, + 0.0031417256676f, + 0.0031072928924f, + 0.0030727804117f, + 0.0030381982934f, + 0.0030035565421f, + 0.0029688650939f, + 0.0029341338127f, + 0.0028993724850f, + 0.0028645908163f, + 0.0028297984269f, + 0.0027950048475f, + 0.0027602195153f, + 0.0027254517703f, + 0.0026907108512f, + 0.0026560058918f, + 0.0026213459177f, + 0.0025867398422f, + 0.0025521964633f, + 0.0025177244601f, + 0.0024833323899f, + 0.0024490286850f, + 0.0024148216493f, + 0.0023807194560f, + 0.0023467301445f, + 0.0023128616177f, + 0.0022791216394f, + 0.0022455178321f, + 0.0022120576745f, + 0.0021787484991f, + 0.0021455974903f, + 0.0021126116823f, + 0.0020797979574f, + 0.0020471630437f, + 0.0020147135141f, + 0.0019824557844f, + 0.0019503961118f, + 0.0019185405936f, + 0.0018868951663f, + 0.0018554656041f, + 0.0018242575180f, + 0.0017932763553f, + 0.0017625273983f, + 0.0017320157641f, + 0.0017017464036f, + 0.0016717241017f, + 0.0016419534764f, + 0.0016124389787f, + 0.0015831848930f, + 0.0015541953364f, + 0.0015254742592f, + 0.0014970254450f, + 0.0014688525111f, + 0.0014409589089f, + 0.0014133479243f, + 0.0013860226783f, + 0.0013589861279f, + 0.0013322410668f, + 0.0013057901260f, + 0.0012796357754f, + 0.0012537803242f, + 0.0012282259227f, + 0.0012029745628f, + 0.0011780280801f, + 0.0011533881548f, + 0.0011290563132f, + 0.0011050339296f, + 0.0010813222275f, + 0.0010579222817f, + 0.0010348350198f, + 0.0010120612242f, + 0.0009896015337f, + 0.0009674564462f, + 0.0009456263198f, + 0.0009241113755f, + 0.0009029116994f, + 0.0008820272443f, + 0.0008614578327f, + 0.0008412031585f, + 0.0008212627897f, + 0.0008016361709f, + 0.0007823226250f, + 0.0007633213568f, + 0.0007446314546f, + 0.0007262518929f, + 0.0007081815354f, + 0.0006904191373f, + 0.0006729633479f, + 0.0006558127133f, + 0.0006389656791f, + 0.0006224205933f, + 0.0006061757086f, + 0.0005902291855f, + 0.0005745790947f, + 0.0005592234204f, + 0.0005441600623f, + 0.0005293868393f, + 0.0005149014913f, + 0.0005007016827f, + 0.0004867850049f, + 0.0004731489791f, + 0.0004597910591f, + 0.0004467086339f, + 0.0004338990308f, + 0.0004213595178f, + 0.0004090873065f, + 0.0003970795547f, + 0.0003853333694f, + 0.0003738458092f, + 0.0003626138868f, + 0.0003516345723f, + 0.0003409047951f, + 0.0003304214468f, + 0.0003201813839f, + 0.0003101814303f, + 0.0003004183794f, + 0.0002908889972f, + 0.0002815900242f, + 0.0002725181784f, + 0.0002636701572f, + 0.0002550426396f, + 0.0002466322894f, + 0.0002384357564f, + 0.0002304496792f, + 0.0002226706877f, + 0.0002150954042f, + 0.0002077204468f, + 0.0002005424304f, + 0.0001935579694f, + 0.0001867636795f, + 0.0001801561792f, + 0.0001737320925f, + 0.0001674880501f, + 0.0001614206914f, + 0.0001555266664f, + 0.0001498026371f, + 0.0001442452795f, + 0.0001388512848f, + 0.0001336173613f, + 0.0001285402359f, + 0.0001236166552f, + 0.0001188433875f, + 0.0001142172235f, + 0.0001097349782f, + 0.0001053934918f, + 0.0001011896310f, + 0.0000971202902f, + 0.0000931823927f, + 0.0000893728917f, + 0.0000856887711f, + 0.0000821270469f, + 0.0000786847678f, + 0.0000753590162f, + 0.0000721469091f, + 0.0000690455987f, + 0.0000660522733f, + 0.0000631641580f, + 0.0000603785150f, + 0.0000576926449f, + 0.0000551038867f, + 0.0000526096182f, + 0.0000502072572f, + 0.0000478942611f, + 0.0000456681279f, + 0.0000435263962f, + 0.0000414666457f, + 0.0000394864972f, + 0.0000375836134f, + 0.0000357556983f, + 0.0000340004981f, + 0.0000323158008f, + 0.0000306994366f, + 0.0000291492778f, + 0.0000276632389f, + 0.0000262392764f, + 0.0000248753891f, + 0.0000235696176f, + 0.0000223200446f, + 0.0000211247945f, + 0.0000199820332f, + 0.0000188899682f, + 0.0000178468480f, + 0.0000168509623f, + 0.0000159006412f, + 0.0000149942554f, + 0.0000141302156f, + 0.0000133069722f, + 0.0000125230151f, + 0.0000117768730f, + 0.0000110671135f, + 0.0000103923421f, + 0.0000097512023f, + 0.0000091423747f, + 0.0000085645769f, + 0.0000080165629f, + 0.0000074971223f, + 0.0000070050805f, + 0.0000065392974f, + 0.0000060986673f, + 0.0000056821186f, + 0.0000052886125f, + 0.0000049171433f, + 0.0000045667370f, + 0.0000042364515f, + 0.0000039253756f, + 0.0000036326283f, + 0.0000033573588f, + 0.0000030987450f, + 0.0000028559940f, + 0.0000026283404f, + 0.0000024150466f, + 0.0000022154015f, + 0.0000020287205f, + 0.0000018543446f, + 0.0000016916395f, + 0.0000015399957f, + 0.0000013988273f, + 0.0000012675717f, + 0.0000011456888f, + 0.0000010326607f, + 0.0000009279907f, + 0.0000008312033f, + 0.0000007418430f, + 0.0000006594741f, + 0.0000005836800f, + 0.0000005140626f, + 0.0000004502420f, + 0.0000003918557f, + 0.0000003385579f, + 0.0000002900194f, + 0.0000002459268f, + 0.0000002059821f, + 0.0000001699018f, + 0.0000001374170f, + 0.0000001082725f, + 0.0000000822264f, + 0.0000000590497f, + 0.0000000385257f, + 0.0000000204496f, + 0.0000000046280f, + -0.0000000091215f, + -0.0000000209706f, + -0.0000000310810f, + -0.0000000396046f, + -0.0000000466841f, + -0.0000000524531f, + -0.0000000570369f, + -0.0000000605524f, + -0.0000000631089f, + -0.0000000648081f, + -0.0000000657448f, + -0.0000000660068f, + -0.0000000656757f, + -0.0000000648269f, + -0.0000000635299f, + -0.0000000618489f, + -0.0000000598428f, + -0.0000000575654f, + -0.0000000550661f, + -0.0000000523896f, + -0.0000000495767f, + -0.0000000466640f, + -0.0000000436847f, + -0.0000000406683f, + -0.0000000376411f, + -0.0000000346264f, + -0.0000001853079f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_4096_64.h b/core/src/dsp/multirate/decim/taps/fir_4096_64.h new file mode 100644 index 0000000..071fa7c --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_4096_64.h @@ -0,0 +1,412 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_4096_64_len = 400; + const float fir_4096_64_taps[] = { + -0.000000046390182, + -0.000000032671747, + -0.000000044019252, + -0.000000057847980, + -0.000000074525736, + -0.000000094444277, + -0.000000118038962, + -0.000000145771056, + -0.000000178146920, + -0.000000215699912, + -0.000000259008968, + -0.000000308679966, + -0.000000365363532, + -0.000000429735743, + -0.000000502514971, + -0.000000584441775, + -0.000000676294593, + -0.000000778868675, + -0.000000892990408, + -0.000001019495135, + -0.000001159239908, + -0.000001313080019, + -0.000001481879981, + -0.000001666488590, + -0.000001867747936, + -0.000002086466837, + -0.000002323427660, + -0.000002579357987, + -0.000002854935059, + -0.000003150755519, + -0.000003467337309, + -0.000003805087370, + -0.000004164300851, + -0.000004545126650, + -0.000004947563816, + -0.000005371424879, + -0.000005816329343, + -0.000006281664776, + -0.000006766577359, + -0.000007269930729, + -0.000007790293600, + -0.000008325896421, + -0.000008874616111, + -0.000009433930650, + -0.000010000901045, + -0.000010572124028, + -0.000011143711423, + -0.000011711241185, + -0.000012269734415, + -0.000012813605044, + -0.000013336634806, + -0.000013831921934, + -0.000014291854483, + -0.000014708058478, + -0.000015071370042, + -0.000015371783506, + -0.000015598422879, + -0.000015739490502, + -0.000015782238450, + -0.000015712918389, + -0.000015516753573, + -0.000015177890614, + -0.000014679372808, + -0.000014003094579, + -0.000013129776918, + -0.000012038925327, + -0.000010708808188, + -0.000009116419073, + -0.000007237458911, + -0.000005046303536, + -0.000002515990559, + 0.000000381806950, + 0.000003676787983, + 0.000007400042869, + 0.000011584054294, + 0.000016262708632, + 0.000021471289584, + 0.000027246480702, + 0.000033626350795, + 0.000040650346831, + 0.000048359270314, + 0.000056795259795, + 0.000066001757509, + 0.000076023480814, + 0.000086906378438, + 0.000098697590282, + 0.000111445392736, + 0.000125199146376, + 0.000140009229952, + 0.000155926975644, + 0.000173004591440, + 0.000191295083774, + 0.000210852168180, + 0.000231730179287, + 0.000253983969797, + 0.000277668807996, + 0.000302840265281, + 0.000329554101525, + 0.000357866141575, + 0.000387832149003, + 0.000419507692185, + 0.000452948007177, + 0.000488207854178, + 0.000525341370472, + 0.000564401918290, + 0.000605441928944, + 0.000648512743304, + 0.000693664448459, + 0.000740945712207, + 0.000790403613766, + 0.000842083473864, + 0.000896028681201, + 0.000952280519889, + 0.001010877993535, + 0.001071857651943, + 0.001135253414817, + 0.001201096399779, + 0.001269414747828, + 0.001340233454817, + 0.001413574200910, + 0.001489455187766, + 0.001567890974290, + 0.001648892321822, + 0.001732466038541, + 0.001818614834973, + 0.001907337179413, + 0.001998627166072, + 0.002092474383846, + 0.002188863799386, + 0.002287775641494, + 0.002389185301308, + 0.002493063234514, + 0.002599374880741, + 0.002708080585641, + 0.002819135541432, + 0.002932489730741, + 0.003048087890061, + 0.003165869477045, + 0.003285768658416, + 0.003407714302186, + 0.003531629991321, + 0.003657434042076, + 0.003785039544443, + 0.003914354407524, + 0.004045281427483, + 0.004177718360558, + 0.004311558018921, + 0.004446688371607, + 0.004582992668347, + 0.004720349568330, + 0.004858633291726, + 0.004997713775860, + 0.005137456853766, + 0.005277724436980, + 0.005418374720123, + 0.005559262389150, + 0.005700238850592, + 0.005841152463751, + 0.005981848792879, + 0.006122170861453, + 0.006261959425236, + 0.006401053246440, + 0.006539289385285, + 0.006676503491561, + 0.006812530112001, + 0.006947202996460, + 0.007080355418172, + 0.007211820491505, + 0.007341431501933, + 0.007469022232125, + 0.007594427298261, + 0.007717482481038, + 0.007838025064813, + 0.007955894169977, + 0.008070931091297, + 0.008182979628023, + 0.008291886417752, + 0.008397501260587, + 0.008499677444830, + 0.008598272061538, + 0.008693146318384, + 0.008784165841015, + 0.008871200971516, + 0.008954127053079, + 0.009032824709643, + 0.009107180110554, + 0.009177085228136, + 0.009242438079217, + 0.009303142957628, + 0.009359110649733, + 0.009410258639107, + 0.009456511293501, + 0.009497800039280, + 0.009534063517579, + 0.009565247726420, + 0.009591306144175, + 0.009612199837674, + 0.009627897551475, + 0.009638375780671, + 0.009643618824881, + 0.009643618824881, + 0.009638375780671, + 0.009627897551475, + 0.009612199837674, + 0.009591306144175, + 0.009565247726420, + 0.009534063517579, + 0.009497800039280, + 0.009456511293501, + 0.009410258639107, + 0.009359110649733, + 0.009303142957628, + 0.009242438079217, + 0.009177085228136, + 0.009107180110554, + 0.009032824709643, + 0.008954127053079, + 0.008871200971516, + 0.008784165841015, + 0.008693146318384, + 0.008598272061538, + 0.008499677444830, + 0.008397501260587, + 0.008291886417752, + 0.008182979628023, + 0.008070931091297, + 0.007955894169977, + 0.007838025064813, + 0.007717482481038, + 0.007594427298261, + 0.007469022232125, + 0.007341431501933, + 0.007211820491505, + 0.007080355418172, + 0.006947202996460, + 0.006812530112001, + 0.006676503491561, + 0.006539289385285, + 0.006401053246440, + 0.006261959425236, + 0.006122170861453, + 0.005981848792879, + 0.005841152463751, + 0.005700238850592, + 0.005559262389150, + 0.005418374720123, + 0.005277724436980, + 0.005137456853766, + 0.004997713775860, + 0.004858633291726, + 0.004720349568330, + 0.004582992668347, + 0.004446688371607, + 0.004311558018921, + 0.004177718360558, + 0.004045281427483, + 0.003914354407524, + 0.003785039544443, + 0.003657434042076, + 0.003531629991321, + 0.003407714302186, + 0.003285768658416, + 0.003165869477045, + 0.003048087890061, + 0.002932489730741, + 0.002819135541432, + 0.002708080585641, + 0.002599374880741, + 0.002493063234514, + 0.002389185301308, + 0.002287775641494, + 0.002188863799386, + 0.002092474383846, + 0.001998627166072, + 0.001907337179413, + 0.001818614834973, + 0.001732466038541, + 0.001648892321822, + 0.001567890974290, + 0.001489455187766, + 0.001413574200910, + 0.001340233454817, + 0.001269414747828, + 0.001201096399779, + 0.001135253414817, + 0.001071857651943, + 0.001010877993535, + 0.000952280519889, + 0.000896028681201, + 0.000842083473864, + 0.000790403613766, + 0.000740945712207, + 0.000693664448459, + 0.000648512743304, + 0.000605441928944, + 0.000564401918290, + 0.000525341370472, + 0.000488207854178, + 0.000452948007177, + 0.000419507692185, + 0.000387832149003, + 0.000357866141575, + 0.000329554101525, + 0.000302840265281, + 0.000277668807996, + 0.000253983969797, + 0.000231730179287, + 0.000210852168180, + 0.000191295083774, + 0.000173004591440, + 0.000155926975644, + 0.000140009229952, + 0.000125199146376, + 0.000111445392736, + 0.000098697590282, + 0.000086906378438, + 0.000076023480814, + 0.000066001757509, + 0.000056795259795, + 0.000048359270314, + 0.000040650346831, + 0.000033626350795, + 0.000027246480702, + 0.000021471289584, + 0.000016262708632, + 0.000011584054294, + 0.000007400042869, + 0.000003676787983, + 0.000000381806950, + -0.000002515990559, + -0.000005046303536, + -0.000007237458911, + -0.000009116419073, + -0.000010708808188, + -0.000012038925327, + -0.000013129776918, + -0.000014003094579, + -0.000014679372808, + -0.000015177890614, + -0.000015516753573, + -0.000015712918389, + -0.000015782238450, + -0.000015739490502, + -0.000015598422879, + -0.000015371783506, + -0.000015071370042, + -0.000014708058478, + -0.000014291854483, + -0.000013831921934, + -0.000013336634806, + -0.000012813605044, + -0.000012269734415, + -0.000011711241185, + -0.000011143711423, + -0.000010572124028, + -0.000010000901045, + -0.000009433930650, + -0.000008874616111, + -0.000008325896421, + -0.000007790293600, + -0.000007269930729, + -0.000006766577359, + -0.000006281664776, + -0.000005816329343, + -0.000005371424879, + -0.000004947563816, + -0.000004545126650, + -0.000004164300851, + -0.000003805087370, + -0.000003467337309, + -0.000003150755519, + -0.000002854935059, + -0.000002579357987, + -0.000002323427660, + -0.000002086466837, + -0.000001867747936, + -0.000001666488590, + -0.000001481879981, + -0.000001313080019, + -0.000001159239908, + -0.000001019495135, + -0.000000892990408, + -0.000000778868675, + -0.000000676294593, + -0.000000584441775, + -0.000000502514971, + -0.000000429735743, + -0.000000365363532, + -0.000000308679966, + -0.000000259008968, + -0.000000215699912, + -0.000000178146920, + -0.000000145771056, + -0.000000118038962, + -0.000000094444277, + -0.000000074525736, + -0.000000057847980, + -0.000000044019252, + -0.000000032671747, + -0.000000046390182, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_4_2.h b/core/src/dsp/multirate/decim/taps/fir_4_2.h new file mode 100644 index 0000000..d565846 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_4_2.h @@ -0,0 +1,24 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_4_2_len = 12; + const float fir_4_2_taps[] = { + -0.003856211869499, + -0.022330421420748, + -0.042348797151517, + 0.009330574289172, + 0.182544215014523, + 0.363014696342451, + 0.363014696342451, + 0.182544215014523, + 0.009330574289172, + -0.042348797151517, + -0.022330421420748, + -0.003856211869499, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_4_4.h b/core/src/dsp/multirate/decim/taps/fir_4_4.h new file mode 100644 index 0000000..67dfa9d --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_4_4.h @@ -0,0 +1,151 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_4_4_len = 139; + const float fir_4_4_taps[] = { + 0.0000421670468f, + 0.0001624808733f, + 0.0004134748309f, + 0.0008154887363f, + 0.0013234848969f, + 0.0018039325195f, + 0.0020508055942f, + 0.0018514767578f, + 0.0010883586950f, + -0.0001655988021f, + -0.0016128396844f, + -0.0027991727988f, + -0.0032807371963f, + -0.0028309298807f, + -0.0015892963679f, + -0.0000601423367f, + 0.0010721577127f, + 0.0012520595571f, + 0.0003467812959f, + -0.0012334913120f, + -0.0026828654998f, + -0.0031783401077f, + -0.0023201194397f, + -0.0004020929064f, + 0.0016614376925f, + 0.0027617271233f, + 0.0021869815035f, + 0.0000713073547f, + -0.0025708936840f, + -0.0043015122742f, + -0.0040150945520f, + -0.0016068800323f, + 0.0018386741176f, + 0.0045100483540f, + 0.0048045475259f, + 0.0022668636218f, + -0.0020047039996f, + -0.0057855488980f, + -0.0068496560241f, + -0.0042397202795f, + 0.0010243185376f, + 0.0062751930360f, + 0.0085115122341f, + 0.0060706031243f, + -0.0002476114409f, + -0.0073175117999f, + -0.0111703368494f, + -0.0091526981761f, + -0.0016211575907f, + 0.0078514356977f, + 0.0140732387192f, + 0.0129726920823f, + 0.0040874732850f, + -0.0086349542834f, + -0.0184139640743f, + -0.0190500116861f, + -0.0085456264258f, + 0.0090399664680f, + 0.0247932831806f, + 0.0290341811985f, + 0.0165603631688f, + -0.0095223462745f, + -0.0375695624710f, + -0.0514111407319f, + -0.0372217902165f, + 0.0096794936561f, + 0.0812862136678f, + 0.1585522999585f, + 0.2179171693939f, + 0.2401648350457f, + 0.2179171693939f, + 0.1585522999585f, + 0.0812862136678f, + 0.0096794936561f, + -0.0372217902165f, + -0.0514111407319f, + -0.0375695624710f, + -0.0095223462745f, + 0.0165603631688f, + 0.0290341811985f, + 0.0247932831806f, + 0.0090399664680f, + -0.0085456264258f, + -0.0190500116861f, + -0.0184139640743f, + -0.0086349542834f, + 0.0040874732850f, + 0.0129726920823f, + 0.0140732387192f, + 0.0078514356977f, + -0.0016211575907f, + -0.0091526981761f, + -0.0111703368494f, + -0.0073175117999f, + -0.0002476114409f, + 0.0060706031243f, + 0.0085115122341f, + 0.0062751930360f, + 0.0010243185376f, + -0.0042397202795f, + -0.0068496560241f, + -0.0057855488980f, + -0.0020047039996f, + 0.0022668636218f, + 0.0048045475259f, + 0.0045100483540f, + 0.0018386741176f, + -0.0016068800323f, + -0.0040150945520f, + -0.0043015122742f, + -0.0025708936840f, + 0.0000713073547f, + 0.0021869815035f, + 0.0027617271233f, + 0.0016614376925f, + -0.0004020929064f, + -0.0023201194397f, + -0.0031783401077f, + -0.0026828654998f, + -0.0012334913120f, + 0.0003467812959f, + 0.0012520595571f, + 0.0010721577127f, + -0.0000601423367f, + -0.0015892963679f, + -0.0028309298807f, + -0.0032807371963f, + -0.0027991727988f, + -0.0016128396844f, + -0.0001655988021f, + 0.0010883586950f, + 0.0018514767578f, + 0.0020508055942f, + 0.0018039325195f, + 0.0013234848969f, + 0.0008154887363f, + 0.0004134748309f, + 0.0001624808733f, + 0.0000421670468f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_512_128.h b/core/src/dsp/multirate/decim/taps/fir_512_128.h new file mode 100644 index 0000000..e566c88 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_512_128.h @@ -0,0 +1,723 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_128_len = 711; + const float fir_512_128_taps[] = { + -0.0000055896992f, + -0.0000013001543f, + -0.0000014502329f, + -0.0000016110215f, + -0.0000017829984f, + -0.0000019666521f, + -0.0000021624812f, + -0.0000023709942f, + -0.0000025927091f, + -0.0000028281532f, + -0.0000030778629f, + -0.0000033423834f, + -0.0000036222682f, + -0.0000039180789f, + -0.0000042303847f, + -0.0000045597620f, + -0.0000049067942f, + -0.0000052720710f, + -0.0000056561877f, + -0.0000060597452f, + -0.0000064833493f, + -0.0000069276099f, + -0.0000073931405f, + -0.0000078805577f, + -0.0000083904807f, + -0.0000089235302f, + -0.0000094803279f, + -0.0000100614958f, + -0.0000106676557f, + -0.0000112994278f, + -0.0000119574304f, + -0.0000126422788f, + -0.0000133545848f, + -0.0000140949552f, + -0.0000148639914f, + -0.0000156622882f, + -0.0000164904329f, + -0.0000173490044f, + -0.0000182385717f, + -0.0000191596936f, + -0.0000201129171f, + -0.0000210987761f, + -0.0000221177911f, + -0.0000231704670f, + -0.0000242572927f, + -0.0000253787397f, + -0.0000265352606f, + -0.0000277272881f, + -0.0000289552338f, + -0.0000302194865f, + -0.0000315204114f, + -0.0000328583485f, + -0.0000342336112f, + -0.0000356464850f, + -0.0000370972263f, + -0.0000385860605f, + -0.0000401131811f, + -0.0000416787480f, + -0.0000432828861f, + -0.0000449256839f, + -0.0000466071919f, + -0.0000483274213f, + -0.0000500863422f, + -0.0000518838825f, + -0.0000537199261f, + -0.0000555943117f, + -0.0000575068307f, + -0.0000594572265f, + -0.0000614451922f, + -0.0000634703697f, + -0.0000655323476f, + -0.0000676306604f, + -0.0000697647864f, + -0.0000719341464f, + -0.0000741381022f, + -0.0000763759553f, + -0.0000786469450f, + -0.0000809502475f, + -0.0000832849740f, + -0.0000856501695f, + -0.0000880448112f, + -0.0000904678075f, + -0.0000929179961f, + -0.0000953941432f, + -0.0000978949415f, + -0.0001004190099f, + -0.0001029648911f, + -0.0001055310512f, + -0.0001081158783f, + -0.0001107176810f, + -0.0001133346877f, + -0.0001159650452f, + -0.0001186068179f, + -0.0001212579865f, + -0.0001239164473f, + -0.0001265800111f, + -0.0001292464023f, + -0.0001319132583f, + -0.0001345781284f, + -0.0001372384734f, + -0.0001398916645f, + -0.0001425349833f, + -0.0001451656204f, + -0.0001477806759f, + -0.0001503771580f, + -0.0001529519831f, + -0.0001555019757f, + -0.0001580238676f, + -0.0001605142982f, + -0.0001629698139f, + -0.0001653868686f, + -0.0001677618232f, + -0.0001700909463f, + -0.0001723704138f, + -0.0001745963094f, + -0.0001767646249f, + -0.0001788712607f, + -0.0001809120262f, + -0.0001828826403f, + -0.0001847787321f, + -0.0001865958418f, + -0.0001883294212f, + -0.0001899748350f, + -0.0001915273613f, + -0.0001929821931f, + -0.0001943344392f, + -0.0001955791256f, + -0.0001967111968f, + -0.0001977255172f, + -0.0001986168726f, + -0.0001993799720f, + -0.0002000094489f, + -0.0002004998634f, + -0.0002008457042f, + -0.0002010413902f, + -0.0002010812729f, + -0.0002009596382f, + -0.0002006707090f, + -0.0002002086476f, + -0.0001995675575f, + -0.0001987414866f, + -0.0001977244297f, + -0.0001965103308f, + -0.0001950930862f, + -0.0001934665474f, + -0.0001916245241f, + -0.0001895607869f, + -0.0001872690707f, + -0.0001847430782f, + -0.0001819764827f, + -0.0001789629316f, + -0.0001756960501f, + -0.0001721694447f, + -0.0001683767065f, + -0.0001643114154f, + -0.0001599671433f, + -0.0001553374586f, + -0.0001504159297f, + -0.0001451961290f, + -0.0001396716370f, + -0.0001338360466f, + -0.0001276829672f, + -0.0001212060287f, + -0.0001143988861f, + -0.0001072552238f, + -0.0000997687600f, + -0.0000919332511f, + -0.0000837424964f, + -0.0000751903422f, + -0.0000662706872f, + -0.0000569774862f, + -0.0000473047557f, + -0.0000372465778f, + -0.0000267971056f, + -0.0000159505676f, + -0.0000047012723f, + 0.0000069563861f, + 0.0000190279240f, + 0.0000315187628f, + 0.0000444342241f, + 0.0000577795252f, + 0.0000715597739f, + 0.0000857799638f, + 0.0001004449692f, + 0.0001155595405f, + 0.0001311282992f, + 0.0001471557332f, + 0.0001636461917f, + 0.0001806038808f, + 0.0001980328584f, + 0.0002159370295f, + 0.0002343201416f, + 0.0002531857801f, + 0.0002725373634f, + 0.0002923781387f, + 0.0003127111768f, + 0.0003335393686f, + 0.0003548654197f, + 0.0003766918469f, + 0.0003990209730f, + 0.0004218549234f, + 0.0004451956214f, + 0.0004690447845f, + 0.0004934039201f, + 0.0005182743216f, + 0.0005436570649f, + 0.0005695530043f, + 0.0005959627692f, + 0.0006228867602f, + 0.0006503251459f, + 0.0006782778596f, + 0.0007067445959f, + 0.0007357248078f, + 0.0007652177037f, + 0.0007952222443f, + 0.0008257371403f, + 0.0008567608492f, + 0.0008882915736f, + 0.0009203272580f, + 0.0009528655873f, + 0.0009859039843f, + 0.0010194396081f, + 0.0010534693522f, + 0.0010879898425f, + 0.0011229974367f, + 0.0011584882220f, + 0.0011944580146f, + 0.0012309023586f, + 0.0012678165250f, + 0.0013051955110f, + 0.0013430340397f, + 0.0013813265595f, + 0.0014200672442f, + 0.0014592499929f, + 0.0014988684300f, + 0.0015389159058f, + 0.0015793854968f, + 0.0016202700068f, + 0.0016615619670f, + 0.0017032536381f, + 0.0017453370105f, + 0.0017878038064f, + 0.0018306454814f, + 0.0018738532257f, + 0.0019174179666f, + 0.0019613303706f, + 0.0020055808454f, + 0.0020501595428f, + 0.0020950563610f, + 0.0021402609477f, + 0.0021857627034f, + 0.0022315507840f, + 0.0022776141047f, + 0.0023239413434f, + 0.0023705209447f, + 0.0024173411233f, + 0.0024643898688f, + 0.0025116549495f, + 0.0025591239169f, + 0.0026067841107f, + 0.0026546226632f, + 0.0027026265043f, + 0.0027507823669f, + 0.0027990767918f, + 0.0028474961335f, + 0.0028960265655f, + 0.0029446540864f, + 0.0029933645254f, + 0.0030421435486f, + 0.0030909766650f, + 0.0031398492332f, + 0.0031887464674f, + 0.0032376534443f, + 0.0032865551097f, + 0.0033354362854f, + 0.0033842816762f, + 0.0034330758769f, + 0.0034818033796f, + 0.0035304485810f, + 0.0035789957896f, + 0.0036274292338f, + 0.0036757330686f, + 0.0037238913843f, + 0.0037718882136f, + 0.0038197075396f, + 0.0038673333040f, + 0.0039147494150f, + 0.0039619397550f, + 0.0040088881896f, + 0.0040555785748f, + 0.0041019947660f, + 0.0041481206260f, + 0.0041939400332f, + 0.0042394368905f, + 0.0042845951330f, + 0.0043293987369f, + 0.0043738317277f, + 0.0044178781890f, + 0.0044615222704f, + 0.0045047481964f, + 0.0045475402748f, + 0.0045898829050f, + 0.0046317605863f, + 0.0046731579268f, + 0.0047140596512f, + 0.0047544506094f, + 0.0047943157851f, + 0.0048336403032f, + 0.0048724094390f, + 0.0049106086256f, + 0.0049482234626f, + 0.0049852397233f, + 0.0050216433634f, + 0.0050574205286f, + 0.0050925575621f, + 0.0051270410128f, + 0.0051608576423f, + 0.0051939944329f, + 0.0052264385945f, + 0.0052581775725f, + 0.0052891990541f, + 0.0053194909762f, + 0.0053490415314f, + 0.0053778391756f, + 0.0054058726342f, + 0.0054331309083f, + 0.0054596032817f, + 0.0054852793266f, + 0.0055101489098f, + 0.0055342021983f, + 0.0055574296655f, + 0.0055798220963f, + 0.0056013705925f, + 0.0056220665783f, + 0.0056419018048f, + 0.0056608683553f, + 0.0056789586495f, + 0.0056961654483f, + 0.0057124818576f, + 0.0057279013330f, + 0.0057424176828f, + 0.0057560250723f, + 0.0057687180271f, + 0.0057804914360f, + 0.0057913405542f, + 0.0058012610063f, + 0.0058102487887f, + 0.0058183002716f, + 0.0058254122019f, + 0.0058315817045f, + 0.0058368062842f, + 0.0058410838272f, + 0.0058444126023f, + 0.0058467912620f, + 0.0058482188432f, + 0.0058486947679f, + 0.0058482188432f, + 0.0058467912620f, + 0.0058444126023f, + 0.0058410838272f, + 0.0058368062842f, + 0.0058315817045f, + 0.0058254122019f, + 0.0058183002716f, + 0.0058102487887f, + 0.0058012610063f, + 0.0057913405542f, + 0.0057804914360f, + 0.0057687180271f, + 0.0057560250723f, + 0.0057424176828f, + 0.0057279013330f, + 0.0057124818576f, + 0.0056961654483f, + 0.0056789586495f, + 0.0056608683553f, + 0.0056419018048f, + 0.0056220665783f, + 0.0056013705925f, + 0.0055798220963f, + 0.0055574296655f, + 0.0055342021983f, + 0.0055101489098f, + 0.0054852793266f, + 0.0054596032817f, + 0.0054331309083f, + 0.0054058726342f, + 0.0053778391756f, + 0.0053490415314f, + 0.0053194909762f, + 0.0052891990541f, + 0.0052581775725f, + 0.0052264385945f, + 0.0051939944329f, + 0.0051608576423f, + 0.0051270410128f, + 0.0050925575621f, + 0.0050574205286f, + 0.0050216433634f, + 0.0049852397233f, + 0.0049482234626f, + 0.0049106086256f, + 0.0048724094390f, + 0.0048336403032f, + 0.0047943157851f, + 0.0047544506094f, + 0.0047140596512f, + 0.0046731579268f, + 0.0046317605863f, + 0.0045898829050f, + 0.0045475402748f, + 0.0045047481964f, + 0.0044615222704f, + 0.0044178781890f, + 0.0043738317277f, + 0.0043293987369f, + 0.0042845951330f, + 0.0042394368905f, + 0.0041939400332f, + 0.0041481206260f, + 0.0041019947660f, + 0.0040555785748f, + 0.0040088881896f, + 0.0039619397550f, + 0.0039147494150f, + 0.0038673333040f, + 0.0038197075396f, + 0.0037718882136f, + 0.0037238913843f, + 0.0036757330686f, + 0.0036274292338f, + 0.0035789957896f, + 0.0035304485810f, + 0.0034818033796f, + 0.0034330758769f, + 0.0033842816762f, + 0.0033354362854f, + 0.0032865551097f, + 0.0032376534443f, + 0.0031887464674f, + 0.0031398492332f, + 0.0030909766650f, + 0.0030421435486f, + 0.0029933645254f, + 0.0029446540864f, + 0.0028960265655f, + 0.0028474961335f, + 0.0027990767918f, + 0.0027507823669f, + 0.0027026265043f, + 0.0026546226632f, + 0.0026067841107f, + 0.0025591239169f, + 0.0025116549495f, + 0.0024643898688f, + 0.0024173411233f, + 0.0023705209447f, + 0.0023239413434f, + 0.0022776141047f, + 0.0022315507840f, + 0.0021857627034f, + 0.0021402609477f, + 0.0020950563610f, + 0.0020501595428f, + 0.0020055808454f, + 0.0019613303706f, + 0.0019174179666f, + 0.0018738532257f, + 0.0018306454814f, + 0.0017878038064f, + 0.0017453370105f, + 0.0017032536381f, + 0.0016615619670f, + 0.0016202700068f, + 0.0015793854968f, + 0.0015389159058f, + 0.0014988684300f, + 0.0014592499929f, + 0.0014200672442f, + 0.0013813265595f, + 0.0013430340397f, + 0.0013051955110f, + 0.0012678165250f, + 0.0012309023586f, + 0.0011944580146f, + 0.0011584882220f, + 0.0011229974367f, + 0.0010879898425f, + 0.0010534693522f, + 0.0010194396081f, + 0.0009859039843f, + 0.0009528655873f, + 0.0009203272580f, + 0.0008882915736f, + 0.0008567608492f, + 0.0008257371403f, + 0.0007952222443f, + 0.0007652177037f, + 0.0007357248078f, + 0.0007067445959f, + 0.0006782778596f, + 0.0006503251459f, + 0.0006228867602f, + 0.0005959627692f, + 0.0005695530043f, + 0.0005436570649f, + 0.0005182743216f, + 0.0004934039201f, + 0.0004690447845f, + 0.0004451956214f, + 0.0004218549234f, + 0.0003990209730f, + 0.0003766918469f, + 0.0003548654197f, + 0.0003335393686f, + 0.0003127111768f, + 0.0002923781387f, + 0.0002725373634f, + 0.0002531857801f, + 0.0002343201416f, + 0.0002159370295f, + 0.0001980328584f, + 0.0001806038808f, + 0.0001636461917f, + 0.0001471557332f, + 0.0001311282992f, + 0.0001155595405f, + 0.0001004449692f, + 0.0000857799638f, + 0.0000715597739f, + 0.0000577795252f, + 0.0000444342241f, + 0.0000315187628f, + 0.0000190279240f, + 0.0000069563861f, + -0.0000047012723f, + -0.0000159505676f, + -0.0000267971056f, + -0.0000372465778f, + -0.0000473047557f, + -0.0000569774862f, + -0.0000662706872f, + -0.0000751903422f, + -0.0000837424964f, + -0.0000919332511f, + -0.0000997687600f, + -0.0001072552238f, + -0.0001143988861f, + -0.0001212060287f, + -0.0001276829672f, + -0.0001338360466f, + -0.0001396716370f, + -0.0001451961290f, + -0.0001504159297f, + -0.0001553374586f, + -0.0001599671433f, + -0.0001643114154f, + -0.0001683767065f, + -0.0001721694447f, + -0.0001756960501f, + -0.0001789629316f, + -0.0001819764827f, + -0.0001847430782f, + -0.0001872690707f, + -0.0001895607869f, + -0.0001916245241f, + -0.0001934665474f, + -0.0001950930862f, + -0.0001965103308f, + -0.0001977244297f, + -0.0001987414866f, + -0.0001995675575f, + -0.0002002086476f, + -0.0002006707090f, + -0.0002009596382f, + -0.0002010812729f, + -0.0002010413902f, + -0.0002008457042f, + -0.0002004998634f, + -0.0002000094489f, + -0.0001993799720f, + -0.0001986168726f, + -0.0001977255172f, + -0.0001967111968f, + -0.0001955791256f, + -0.0001943344392f, + -0.0001929821931f, + -0.0001915273613f, + -0.0001899748350f, + -0.0001883294212f, + -0.0001865958418f, + -0.0001847787321f, + -0.0001828826403f, + -0.0001809120262f, + -0.0001788712607f, + -0.0001767646249f, + -0.0001745963094f, + -0.0001723704138f, + -0.0001700909463f, + -0.0001677618232f, + -0.0001653868686f, + -0.0001629698139f, + -0.0001605142982f, + -0.0001580238676f, + -0.0001555019757f, + -0.0001529519831f, + -0.0001503771580f, + -0.0001477806759f, + -0.0001451656204f, + -0.0001425349833f, + -0.0001398916645f, + -0.0001372384734f, + -0.0001345781284f, + -0.0001319132583f, + -0.0001292464023f, + -0.0001265800111f, + -0.0001239164473f, + -0.0001212579865f, + -0.0001186068179f, + -0.0001159650452f, + -0.0001133346877f, + -0.0001107176810f, + -0.0001081158783f, + -0.0001055310512f, + -0.0001029648911f, + -0.0001004190099f, + -0.0000978949415f, + -0.0000953941432f, + -0.0000929179961f, + -0.0000904678075f, + -0.0000880448112f, + -0.0000856501695f, + -0.0000832849740f, + -0.0000809502475f, + -0.0000786469450f, + -0.0000763759553f, + -0.0000741381022f, + -0.0000719341464f, + -0.0000697647864f, + -0.0000676306604f, + -0.0000655323476f, + -0.0000634703697f, + -0.0000614451922f, + -0.0000594572265f, + -0.0000575068307f, + -0.0000555943117f, + -0.0000537199261f, + -0.0000518838825f, + -0.0000500863422f, + -0.0000483274213f, + -0.0000466071919f, + -0.0000449256839f, + -0.0000432828861f, + -0.0000416787480f, + -0.0000401131811f, + -0.0000385860605f, + -0.0000370972263f, + -0.0000356464850f, + -0.0000342336112f, + -0.0000328583485f, + -0.0000315204114f, + -0.0000302194865f, + -0.0000289552338f, + -0.0000277272881f, + -0.0000265352606f, + -0.0000253787397f, + -0.0000242572927f, + -0.0000231704670f, + -0.0000221177911f, + -0.0000210987761f, + -0.0000201129171f, + -0.0000191596936f, + -0.0000182385717f, + -0.0000173490044f, + -0.0000164904329f, + -0.0000156622882f, + -0.0000148639914f, + -0.0000140949552f, + -0.0000133545848f, + -0.0000126422788f, + -0.0000119574304f, + -0.0000112994278f, + -0.0000106676557f, + -0.0000100614958f, + -0.0000094803279f, + -0.0000089235302f, + -0.0000083904807f, + -0.0000078805577f, + -0.0000073931405f, + -0.0000069276099f, + -0.0000064833493f, + -0.0000060597452f, + -0.0000056561877f, + -0.0000052720710f, + -0.0000049067942f, + -0.0000045597620f, + -0.0000042303847f, + -0.0000039180789f, + -0.0000036222682f, + -0.0000033423834f, + -0.0000030778629f, + -0.0000028281532f, + -0.0000025927091f, + -0.0000023709942f, + -0.0000021624812f, + -0.0000019666521f, + -0.0000017829984f, + -0.0000016110215f, + -0.0000014502329f, + -0.0000013001543f, + -0.0000055896992f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_512_16.h b/core/src/dsp/multirate/decim/taps/fir_512_16.h new file mode 100644 index 0000000..c7a3e7c --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_512_16.h @@ -0,0 +1,76 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_16_len = 64; + const float fir_512_16_taps[] = { + 0.0000151940580f, + 0.0000353162294f, + 0.0000744053215f, + 0.0001396086425f, + 0.0002418195104f, + 0.0003943662769f, + 0.0006129837252f, + 0.0009156126139f, + 0.0013220032816f, + 0.0018531099165f, + 0.0025302756637f, + 0.0033742244254f, + 0.0044038919853f, + 0.0056351456882f, + 0.0070794569573f, + 0.0087426030278f, + 0.0106234821202f, + 0.0127131288122f, + 0.0149940128678f, + 0.0174396949525f, + 0.0200148967258f, + 0.0226760214362f, + 0.0253721355820f, + 0.0280463940126f, + 0.0306378619753f, + 0.0330836601043f, + 0.0353213343016f, + 0.0372913337462f, + 0.0389394684890f, + 0.0402192143245f, + 0.0410937374123f, + 0.0415375243532f, + 0.0415375243532f, + 0.0410937374123f, + 0.0402192143245f, + 0.0389394684890f, + 0.0372913337462f, + 0.0353213343016f, + 0.0330836601043f, + 0.0306378619753f, + 0.0280463940126f, + 0.0253721355820f, + 0.0226760214362f, + 0.0200148967258f, + 0.0174396949525f, + 0.0149940128678f, + 0.0127131288122f, + 0.0106234821202f, + 0.0087426030278f, + 0.0070794569573f, + 0.0056351456882f, + 0.0044038919853f, + 0.0033742244254f, + 0.0025302756637f, + 0.0018531099165f, + 0.0013220032816f, + 0.0009156126139f, + 0.0006129837252f, + 0.0003943662769f, + 0.0002418195104f, + 0.0001396086425f, + 0.0000744053215f, + 0.0000353162294f, + 0.0000151940580f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_512_32.h b/core/src/dsp/multirate/decim/taps/fir_512_32.h new file mode 100644 index 0000000..0ce8baa --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_512_32.h @@ -0,0 +1,141 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_32_len = 129; + const float fir_512_32_taps[] = { + 0.000008540968797, + 0.000009922400188, + 0.000015550948353, + 0.000023167181508, + 0.000033231811476, + 0.000046270708161, + 0.000062878000273, + 0.000083718456393, + 0.000109529013922, + 0.000141119329083, + 0.000179371225499, + 0.000225236929029, + 0.000279735987160, + 0.000343950788528, + 0.000419020613557, + 0.000506134170029, + 0.000606520589550, + 0.000721438886986, + 0.000852165912394, + 0.000999982852844, + 0.001166160372943, + 0.001351942511872, + 0.001558529485270, + 0.001787059568999, + 0.002038590271450, + 0.002314079024704, + 0.002614363649958, + 0.002940142872027, + 0.003291957174154, + 0.003670170297288, + 0.004074951693870, + 0.004506260250540, + 0.004963829590056, + 0.005447155254368, + 0.005955484057066, + 0.006487805874260, + 0.007042848116484, + 0.007619073095444, + 0.008214678463585, + 0.008827600864209, + 0.009455522888034, + 0.010095883384323, + 0.010745891124847, + 0.011402541770574, + 0.012062638037206, + 0.012722812904219, + 0.013379555663224, + 0.014029240550834, + 0.014668157666599, + 0.015292545833545, + 0.015898627022289, + 0.016482641925719, + 0.017040886246767, + 0.017569747239682, + 0.018065740033662, + 0.018525543262431, + 0.018946033522759, + 0.019324318198100, + 0.019657766196845, + 0.019944036181861, + 0.020181101897746, + 0.020367274240763, + 0.020501219760524, + 0.020581975330434, + 0.020608958779118, + 0.020581975330434, + 0.020501219760524, + 0.020367274240763, + 0.020181101897746, + 0.019944036181861, + 0.019657766196845, + 0.019324318198100, + 0.018946033522759, + 0.018525543262431, + 0.018065740033662, + 0.017569747239682, + 0.017040886246767, + 0.016482641925719, + 0.015898627022289, + 0.015292545833545, + 0.014668157666599, + 0.014029240550834, + 0.013379555663224, + 0.012722812904219, + 0.012062638037206, + 0.011402541770574, + 0.010745891124847, + 0.010095883384323, + 0.009455522888034, + 0.008827600864209, + 0.008214678463585, + 0.007619073095444, + 0.007042848116484, + 0.006487805874260, + 0.005955484057066, + 0.005447155254368, + 0.004963829590056, + 0.004506260250540, + 0.004074951693870, + 0.003670170297288, + 0.003291957174154, + 0.002940142872027, + 0.002614363649958, + 0.002314079024704, + 0.002038590271450, + 0.001787059568999, + 0.001558529485270, + 0.001351942511872, + 0.001166160372943, + 0.000999982852844, + 0.000852165912394, + 0.000721438886986, + 0.000606520589550, + 0.000506134170029, + 0.000419020613557, + 0.000343950788528, + 0.000279735987160, + 0.000225236929029, + 0.000179371225499, + 0.000141119329083, + 0.000109529013922, + 0.000083718456393, + 0.000062878000273, + 0.000046270708161, + 0.000033231811476, + 0.000023167181508, + 0.000015550948353, + 0.000009922400188, + 0.000008540968797, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_512_64.h b/core/src/dsp/multirate/decim/taps/fir_512_64.h new file mode 100644 index 0000000..5b32321 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_512_64.h @@ -0,0 +1,296 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_512_64_len = 284; + const float fir_512_64_taps[] = { + -0.0000003515813f, + 0.0000031171026f, + 0.0000020524162f, + 0.0000024542289f, + 0.0000031065207f, + 0.0000038930134f, + 0.0000048162506f, + 0.0000058895006f, + 0.0000071310597f, + 0.0000085581431f, + 0.0000101918418f, + 0.0000120521359f, + 0.0000141629532f, + 0.0000165472024f, + 0.0000192318152f, + 0.0000222427880f, + 0.0000256102026f, + 0.0000293632777f, + 0.0000335353640f, + 0.0000381590070f, + 0.0000432709128f, + 0.0000489070228f, + 0.0000551074473f, + 0.0000619115526f, + 0.0000693628586f, + 0.0000775041409f, + 0.0000863822872f, + 0.0000960434161f, + 0.0001065376894f, + 0.0001179144487f, + 0.0001302269805f, + 0.0001435276713f, + 0.0001578727234f, + 0.0001733173295f, + 0.0001899203366f, + 0.0002077394422f, + 0.0002268358025f, + 0.0002472692536f, + 0.0002691028607f, + 0.0002923981667f, + 0.0003172196808f, + 0.0003436301558f, + 0.0003716950150f, + 0.0004014776616f, + 0.0004330438412f, + 0.0004664569860f, + 0.0005017825128f, + 0.0005390832050f, + 0.0005784234446f, + 0.0006198646358f, + 0.0006634693699f, + 0.0007092968953f, + 0.0007574072145f, + 0.0008078566037f, + 0.0008607016429f, + 0.0009159947893f, + 0.0009737883402f, + 0.0010341300646f, + 0.0010970670999f, + 0.0011626416466f, + 0.0012308947989f, + 0.0013018623072f, + 0.0013755783437f, + 0.0014520713385f, + 0.0015313676803f, + 0.0016134876310f, + 0.0016984489635f, + 0.0017862629594f, + 0.0018769379853f, + 0.0019704755784f, + 0.0020668739631f, + 0.0021661242292f, + 0.0022682137899f, + 0.0023731226581f, + 0.0024808268465f, + 0.0025912947466f, + 0.0027044904730f, + 0.0028203703485f, + 0.0029388861938f, + 0.0030599819237f, + 0.0031835967820f, + 0.0033096620532f, + 0.0034381042430f, + 0.0035688419092f, + 0.0037017887878f, + 0.0038368507462f, + 0.0039739288549f, + 0.0041129164657f, + 0.0042537022285f, + 0.0043961672967f, + 0.0045401882879f, + 0.0046856346183f, + 0.0048323714068f, + 0.0049802569384f, + 0.0051291455099f, + 0.0052788850244f, + 0.0054293197749f, + 0.0055802881698f, + 0.0057316254533f, + 0.0058831615603f, + 0.0060347237702f, + 0.0061861346909f, + 0.0063372148423f, + 0.0064877807676f, + 0.0066376475425f, + 0.0067866270121f, + 0.0069345302214f, + 0.0070811657753f, + 0.0072263421851f, + 0.0073698663497f, + 0.0075115458128f, + 0.0076511873613f, + 0.0077885991889f, + 0.0079235896075f, + 0.0080559691125f, + 0.0081855492031f, + 0.0083121443425f, + 0.0084355708848f, + 0.0085556489242f, + 0.0086722013236f, + 0.0087850554475f, + 0.0088940422881f, + 0.0089989980770f, + 0.0090997635037f, + 0.0091961852010f, + 0.0092881150520f, + 0.0093754115438f, + 0.0094579391596f, + 0.0095355695951f, + 0.0096081812323f, + 0.0096756602138f, + 0.0097378999951f, + 0.0097948022733f, + 0.0098462766138f, + 0.0098922412299f, + 0.0099326226814f, + 0.0099673565022f, + 0.0099963869681f, + 0.0100196675703f, + 0.0100371608503f, + 0.0100488387168f, + 0.0100546823476f, + 0.0100546823476f, + 0.0100488387168f, + 0.0100371608503f, + 0.0100196675703f, + 0.0099963869681f, + 0.0099673565022f, + 0.0099326226814f, + 0.0098922412299f, + 0.0098462766138f, + 0.0097948022733f, + 0.0097378999951f, + 0.0096756602138f, + 0.0096081812323f, + 0.0095355695951f, + 0.0094579391596f, + 0.0093754115438f, + 0.0092881150520f, + 0.0091961852010f, + 0.0090997635037f, + 0.0089989980770f, + 0.0088940422881f, + 0.0087850554475f, + 0.0086722013236f, + 0.0085556489242f, + 0.0084355708848f, + 0.0083121443425f, + 0.0081855492031f, + 0.0080559691125f, + 0.0079235896075f, + 0.0077885991889f, + 0.0076511873613f, + 0.0075115458128f, + 0.0073698663497f, + 0.0072263421851f, + 0.0070811657753f, + 0.0069345302214f, + 0.0067866270121f, + 0.0066376475425f, + 0.0064877807676f, + 0.0063372148423f, + 0.0061861346909f, + 0.0060347237702f, + 0.0058831615603f, + 0.0057316254533f, + 0.0055802881698f, + 0.0054293197749f, + 0.0052788850244f, + 0.0051291455099f, + 0.0049802569384f, + 0.0048323714068f, + 0.0046856346183f, + 0.0045401882879f, + 0.0043961672967f, + 0.0042537022285f, + 0.0041129164657f, + 0.0039739288549f, + 0.0038368507462f, + 0.0037017887878f, + 0.0035688419092f, + 0.0034381042430f, + 0.0033096620532f, + 0.0031835967820f, + 0.0030599819237f, + 0.0029388861938f, + 0.0028203703485f, + 0.0027044904730f, + 0.0025912947466f, + 0.0024808268465f, + 0.0023731226581f, + 0.0022682137899f, + 0.0021661242292f, + 0.0020668739631f, + 0.0019704755784f, + 0.0018769379853f, + 0.0017862629594f, + 0.0016984489635f, + 0.0016134876310f, + 0.0015313676803f, + 0.0014520713385f, + 0.0013755783437f, + 0.0013018623072f, + 0.0012308947989f, + 0.0011626416466f, + 0.0010970670999f, + 0.0010341300646f, + 0.0009737883402f, + 0.0009159947893f, + 0.0008607016429f, + 0.0008078566037f, + 0.0007574072145f, + 0.0007092968953f, + 0.0006634693699f, + 0.0006198646358f, + 0.0005784234446f, + 0.0005390832050f, + 0.0005017825128f, + 0.0004664569860f, + 0.0004330438412f, + 0.0004014776616f, + 0.0003716950150f, + 0.0003436301558f, + 0.0003172196808f, + 0.0002923981667f, + 0.0002691028607f, + 0.0002472692536f, + 0.0002268358025f, + 0.0002077394422f, + 0.0001899203366f, + 0.0001733173295f, + 0.0001578727234f, + 0.0001435276713f, + 0.0001302269805f, + 0.0001179144487f, + 0.0001065376894f, + 0.0000960434161f, + 0.0000863822872f, + 0.0000775041409f, + 0.0000693628586f, + 0.0000619115526f, + 0.0000551074473f, + 0.0000489070228f, + 0.0000432709128f, + 0.0000381590070f, + 0.0000335353640f, + 0.0000293632777f, + 0.0000256102026f, + 0.0000222427880f, + 0.0000192318152f, + 0.0000165472024f, + 0.0000141629532f, + 0.0000120521359f, + 0.0000101918418f, + 0.0000085581431f, + 0.0000071310597f, + 0.0000058895006f, + 0.0000048162506f, + 0.0000038930134f, + 0.0000031065207f, + 0.0000024542289f, + 0.0000020524162f, + 0.0000031171026f, + -0.0000003515813f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_64_16.h b/core/src/dsp/multirate/decim/taps/fir_64_16.h new file mode 100644 index 0000000..6338347 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_64_16.h @@ -0,0 +1,102 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_16_len = 90; + const float fir_64_16_taps[] = { + -0.0000120522386f, + -0.0000222544605f, + -0.0000415800824f, + -0.0000705601980f, + -0.0001117597283f, + -0.0001677821532f, + -0.0002410541699f, + -0.0003335536910f, + -0.0004464864558f, + -0.0005799214861f, + -0.0007324007475f, + -0.0009005433028f, + -0.0010786685830f, + -0.0012584667286f, + -0.0014287458994f, + -0.0015752866570f, + -0.0016808317559f, + -0.0017252357928f, + -0.0016857931470f, + -0.0015377546562f, + -0.0012550337974f, + -0.0008110922394f, + -0.0001799830654f, + 0.0006624815809f, + 0.0017374824702f, + 0.0030619182176f, + 0.0046471635731f, + 0.0064979256976f, + 0.0086112639295f, + 0.0109758357695f, + 0.0135714252753f, + 0.0163687998961f, + 0.0193299283477f, + 0.0224085760310f, + 0.0255512765146f, + 0.0286986586848f, + 0.0317870903592f, + 0.0347505815535f, + 0.0375228752484f, + 0.0400396413686f, + 0.0422406815901f, + 0.0440720490748f, + 0.0454879886598f, + 0.0464526093979f, + 0.0469412124342f, + 0.0469412124342f, + 0.0464526093979f, + 0.0454879886598f, + 0.0440720490748f, + 0.0422406815901f, + 0.0400396413686f, + 0.0375228752484f, + 0.0347505815535f, + 0.0317870903592f, + 0.0286986586848f, + 0.0255512765146f, + 0.0224085760310f, + 0.0193299283477f, + 0.0163687998961f, + 0.0135714252753f, + 0.0109758357695f, + 0.0086112639295f, + 0.0064979256976f, + 0.0046471635731f, + 0.0030619182176f, + 0.0017374824702f, + 0.0006624815809f, + -0.0001799830654f, + -0.0008110922394f, + -0.0012550337974f, + -0.0015377546562f, + -0.0016857931470f, + -0.0017252357928f, + -0.0016808317559f, + -0.0015752866570f, + -0.0014287458994f, + -0.0012584667286f, + -0.0010786685830f, + -0.0009005433028f, + -0.0007324007475f, + -0.0005799214861f, + -0.0004464864558f, + -0.0003335536910f, + -0.0002410541699f, + -0.0001677821532f, + -0.0001117597283f, + -0.0000705601980f, + -0.0000415800824f, + -0.0000222544605f, + -0.0000120522386f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_64_2.h b/core/src/dsp/multirate/decim/taps/fir_64_2.h new file mode 100644 index 0000000..27d0bc8 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_64_2.h @@ -0,0 +1,16 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_2_len = 4; + const float fir_64_2_taps[] = { + 0.1238512125230f, + 0.3713298898913f, + 0.3713298898913f, + 0.1238512125230f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_64_32.h b/core/src/dsp/multirate/decim/taps/fir_64_32.h new file mode 100644 index 0000000..13acb09 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_64_32.h @@ -0,0 +1,266 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_32_len = 254; + const float fir_64_32_taps[] = { + 0.0000071177827f, + 0.0000052360330f, + 0.0000070999389f, + 0.0000093491421f, + 0.0000120258010f, + 0.0000151698657f, + 0.0000188213706f, + 0.0000230162819f, + 0.0000277885900f, + 0.0000331659761f, + 0.0000391717261f, + 0.0000458202516f, + 0.0000531188652f, + 0.0000610632073f, + 0.0000696389402f, + 0.0000788171514f, + 0.0000885560397f, + 0.0000987963809f, + 0.0001094632965f, + 0.0001204618823f, + 0.0001316791619f, + 0.0001429799890f, + 0.0001542092968f, + 0.0001651883918f, + 0.0001757176133f, + 0.0001855731360f, + 0.0001945101517f, + 0.0002022602911f, + 0.0002085354301f, + 0.0002130258290f, + 0.0002154046469f, + 0.0002153268755f, + 0.0002124346213f, + 0.0002063568823f, + 0.0001967156262f, + 0.0001831264229f, + 0.0001652053085f, + 0.0001425702458f, + 0.0001148487208f, + 0.0000816799586f, + 0.0000427231519f, + -0.0000023396876f, + -0.0000537950170f, + -0.0001118944427f, + -0.0001768457191f, + -0.0002488091749f, + -0.0003278886589f, + -0.0004141279672f, + -0.0005075020096f, + -0.0006079135226f, + -0.0007151847604f, + -0.0008290548018f, + -0.0009491720834f, + -0.0010750926197f, + -0.0012062737004f, + -0.0013420733382f, + -0.0014817454403f, + -0.0016244407789f, + -0.0017692039202f, + -0.0019149759766f, + -0.0020605935333f, + -0.0022047933917f, + -0.0023462136721f, + -0.0024834006928f, + -0.0026148123580f, + -0.0027388272354f, + -0.0028537502533f, + -0.0029578239527f, + -0.0030492364244f, + -0.0031261346152f, + -0.0031866343375f, + -0.0032288354106f, + -0.0032508334770f, + -0.0032507366611f, + -0.0032266788309f, + -0.0031768373662f, + -0.0030994474167f, + -0.0029928202893f, + -0.0028553581802f, + -0.0026855726253f, + -0.0024820991257f, + -0.0022437150570f, + -0.0019693535723f, + -0.0016581203414f, + -0.0013093061003f, + -0.0009224015920f, + -0.0004971081448f, + -0.0000333502105f, + 0.0004687166063f, + 0.0010086959640f, + 0.0015859458172f, + 0.0021995722597f, + 0.0028484280438f, + 0.0035311102220f, + 0.0042459624638f, + 0.0049910767459f, + 0.0057642996479f, + 0.0065632382031f, + 0.0073852702104f, + 0.0082275542093f, + 0.0090870436937f, + 0.0099605010219f, + 0.0108445152647f, + 0.0117355197089f, + 0.0126298129235f, + 0.0135235793719f, + 0.0144129131434f, + 0.0152938410591f, + 0.0161623483955f, + 0.0170144037611f, + 0.0178459860423f, + 0.0186531102422f, + 0.0194318548104f, + 0.0201783875831f, + 0.0208889926181f, + 0.0215600953536f, + 0.0221882880668f, + 0.0227703533794f, + 0.0233032874883f, + 0.0237843211931f, + 0.0242109401088f, + 0.0245809024718f, + 0.0248922556389f, + 0.0251433500349f, + 0.0253328513679f, + 0.0254597502167f, + 0.0255233695354f, + 0.0255233695354f, + 0.0254597502167f, + 0.0253328513679f, + 0.0251433500349f, + 0.0248922556389f, + 0.0245809024718f, + 0.0242109401088f, + 0.0237843211931f, + 0.0233032874883f, + 0.0227703533794f, + 0.0221882880668f, + 0.0215600953536f, + 0.0208889926181f, + 0.0201783875831f, + 0.0194318548104f, + 0.0186531102422f, + 0.0178459860423f, + 0.0170144037611f, + 0.0161623483955f, + 0.0152938410591f, + 0.0144129131434f, + 0.0135235793719f, + 0.0126298129235f, + 0.0117355197089f, + 0.0108445152647f, + 0.0099605010219f, + 0.0090870436937f, + 0.0082275542093f, + 0.0073852702104f, + 0.0065632382031f, + 0.0057642996479f, + 0.0049910767459f, + 0.0042459624638f, + 0.0035311102220f, + 0.0028484280438f, + 0.0021995722597f, + 0.0015859458172f, + 0.0010086959640f, + 0.0004687166063f, + -0.0000333502105f, + -0.0004971081448f, + -0.0009224015920f, + -0.0013093061003f, + -0.0016581203414f, + -0.0019693535723f, + -0.0022437150570f, + -0.0024820991257f, + -0.0026855726253f, + -0.0028553581802f, + -0.0029928202893f, + -0.0030994474167f, + -0.0031768373662f, + -0.0032266788309f, + -0.0032507366611f, + -0.0032508334770f, + -0.0032288354106f, + -0.0031866343375f, + -0.0031261346152f, + -0.0030492364244f, + -0.0029578239527f, + -0.0028537502533f, + -0.0027388272354f, + -0.0026148123580f, + -0.0024834006928f, + -0.0023462136721f, + -0.0022047933917f, + -0.0020605935333f, + -0.0019149759766f, + -0.0017692039202f, + -0.0016244407789f, + -0.0014817454403f, + -0.0013420733382f, + -0.0012062737004f, + -0.0010750926197f, + -0.0009491720834f, + -0.0008290548018f, + -0.0007151847604f, + -0.0006079135226f, + -0.0005075020096f, + -0.0004141279672f, + -0.0003278886589f, + -0.0002488091749f, + -0.0001768457191f, + -0.0001118944427f, + -0.0000537950170f, + -0.0000023396876f, + 0.0000427231519f, + 0.0000816799586f, + 0.0001148487208f, + 0.0001425702458f, + 0.0001652053085f, + 0.0001831264229f, + 0.0001967156262f, + 0.0002063568823f, + 0.0002124346213f, + 0.0002153268755f, + 0.0002154046469f, + 0.0002130258290f, + 0.0002085354301f, + 0.0002022602911f, + 0.0001945101517f, + 0.0001855731360f, + 0.0001757176133f, + 0.0001651883918f, + 0.0001542092968f, + 0.0001429799890f, + 0.0001316791619f, + 0.0001204618823f, + 0.0001094632965f, + 0.0000987963809f, + 0.0000885560397f, + 0.0000788171514f, + 0.0000696389402f, + 0.0000610632073f, + 0.0000531188652f, + 0.0000458202516f, + 0.0000391717261f, + 0.0000331659761f, + 0.0000277885900f, + 0.0000230162819f, + 0.0000188213706f, + 0.0000151698657f, + 0.0000120258010f, + 0.0000093491421f, + 0.0000070999389f, + 0.0000052360330f, + 0.0000071177827f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_64_4.h b/core/src/dsp/multirate/decim/taps/fir_64_4.h new file mode 100644 index 0000000..2194e0e --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_64_4.h @@ -0,0 +1,31 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_4_len = 19; + const float fir_64_4_taps[] = { + 0.0000429609248f, + 0.0004765567633f, + 0.0024957623882f, + 0.0086502620997f, + 0.0224930555988f, + 0.0467176748088f, + 0.0803238710382f, + 0.1168174685032f, + 0.1455785879790f, + 0.1565458506682f, + 0.1455785879790f, + 0.1168174685032f, + 0.0803238710382f, + 0.0467176748088f, + 0.0224930555988f, + 0.0086502620997f, + 0.0024957623882f, + 0.0004765567633f, + 0.0000429609248f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_64_8.h b/core/src/dsp/multirate/decim/taps/fir_64_8.h new file mode 100644 index 0000000..7e19493 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_64_8.h @@ -0,0 +1,48 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_64_8_len = 36; + const float fir_64_8_taps[] = { + 0.000015230923996, + 0.000082077920191, + 0.000262521513750, + 0.000673128659394, + 0.001475675202716, + 0.002887947811052, + 0.005159198622906, + 0.008543963462691, + 0.013252097427442, + 0.019396810069284, + 0.026940321432500, + 0.035656237803203, + 0.045115851141008, + 0.054709465624648, + 0.063702603363867, + 0.071322539438903, + 0.076861237718122, + 0.079777267801515, + 0.079777267801515, + 0.076861237718122, + 0.071322539438903, + 0.063702603363867, + 0.054709465624648, + 0.045115851141008, + 0.035656237803203, + 0.026940321432500, + 0.019396810069284, + 0.013252097427442, + 0.008543963462691, + 0.005159198622906, + 0.002887947811052, + 0.001475675202716, + 0.000673128659394, + 0.000262521513750, + 0.000082077920191, + 0.000015230923996, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_8192_128.h b/core/src/dsp/multirate/decim/taps/fir_8192_128.h new file mode 100644 index 0000000..c547d94 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_8192_128.h @@ -0,0 +1,738 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_8192_128_len = 726; + const float fir_8192_128_taps[] = { + -0.000000038736989, + -0.000000002900423, + -0.000000002802657, + -0.000000002550081, + -0.000000002127632, + -0.000000001515543, + -0.000000000693742, + 0.000000000362461, + 0.000000001678381, + 0.000000003283860, + 0.000000005209816, + 0.000000007491597, + 0.000000010166182, + 0.000000013274887, + 0.000000016861297, + 0.000000020973250, + 0.000000025661549, + 0.000000030981198, + 0.000000036990894, + 0.000000043753522, + 0.000000051336412, + 0.000000059811125, + 0.000000069254410, + 0.000000079747366, + 0.000000091377013, + 0.000000104234914, + 0.000000118419261, + 0.000000134033072, + 0.000000151186668, + 0.000000169995579, + 0.000000190583271, + 0.000000213078893, + 0.000000237620132, + 0.000000264350922, + 0.000000293424307, + 0.000000325000228, + 0.000000359248280, + 0.000000396345681, + 0.000000436479839, + 0.000000479846570, + 0.000000526652414, + 0.000000577113153, + 0.000000631455840, + 0.000000689917640, + 0.000000752747558, + 0.000000820205604, + 0.000000892564232, + 0.000000970107802, + 0.000001053133766, + 0.000001141952384, + 0.000001236887707, + 0.000001338277486, + 0.000001446474015, + 0.000001561844168, + 0.000001684770169, + 0.000001815649686, + 0.000001954896596, + 0.000002102941065, + 0.000002260230379, + 0.000002427228940, + 0.000002604419221, + 0.000002792301631, + 0.000002991395630, + 0.000003202239426, + 0.000003425391279, + 0.000003661429009, + 0.000003910951502, + 0.000004174578014, + 0.000004452949882, + 0.000004746729636, + 0.000005056602883, + 0.000005383277263, + 0.000005727484467, + 0.000006089979070, + 0.000006471540645, + 0.000006872972514, + 0.000007295103905, + 0.000007738788674, + 0.000008204907452, + 0.000008694366379, + 0.000009208099195, + 0.000009747066037, + 0.000010312255416, + 0.000010904683121, + 0.000011525394046, + 0.000012175461221, + 0.000012855987475, + 0.000013568104599, + 0.000014312974832, + 0.000015091790163, + 0.000015905773637, + 0.000016756178784, + 0.000017644290759, + 0.000018571425876, + 0.000019538932599, + 0.000020548191156, + 0.000021600614406, + 0.000022697647498, + 0.000023840768647, + 0.000025031488798, + 0.000026271352347, + 0.000027561936767, + 0.000028904853308, + 0.000030301746554, + 0.000031754295124, + 0.000033264211132, + 0.000034833240906, + 0.000036463164339, + 0.000038155795629, + 0.000039912982509, + 0.000041736607015, + 0.000043628584589, + 0.000045590864869, + 0.000047625430672, + 0.000049734298789, + 0.000051919518862, + 0.000054183174163, + 0.000056527380385, + 0.000058954286377, + 0.000061466072873, + 0.000064064953157, + 0.000066753171753, + 0.000069533004984, + 0.000072406759655, + 0.000075376773486, + 0.000078445413795, + 0.000081615077781, + 0.000084888191239, + 0.000088267208670, + 0.000091754612028, + 0.000095352910659, + 0.000099064640077, + 0.000102892361735, + 0.000106838661821, + 0.000110906150870, + 0.000115097462565, + 0.000119415253203, + 0.000123862200490, + 0.000128441002875, + 0.000133154378310, + 0.000138005063487, + 0.000142995812533, + 0.000148129396174, + 0.000153408600336, + 0.000158836225271, + 0.000164415084034, + 0.000170148001590, + 0.000176037813151, + 0.000182087363287, + 0.000188299504104, + 0.000194677094367, + 0.000201222997522, + 0.000207940080827, + 0.000214831213225, + 0.000221899264481, + 0.000229147102908, + 0.000236577594510, + 0.000244193600571, + 0.000251997976791, + 0.000259993570757, + 0.000268183221059, + 0.000276569754666, + 0.000285155985994, + 0.000293944714221, + 0.000302938722286, + 0.000312140774168, + 0.000321553613799, + 0.000331179962326, + 0.000341022516922, + 0.000351083948063, + 0.000361366898216, + 0.000371873979149, + 0.000382607770491, + 0.000393570817086, + 0.000404765627430, + 0.000416194671069, + 0.000427860376920, + 0.000439765130714, + 0.000451911273216, + 0.000464301097709, + 0.000476936848125, + 0.000489820716559, + 0.000502954841349, + 0.000516341304591, + 0.000529982130195, + 0.000543879281395, + 0.000558034658807, + 0.000572450097909, + 0.000587127367134, + 0.000602068165314, + 0.000617274119823, + 0.000632746783974, + 0.000648487635243, + 0.000664498072604, + 0.000680779414857, + 0.000697332897898, + 0.000714159673158, + 0.000731260804822, + 0.000748637268384, + 0.000766289947817, + 0.000784219634251, + 0.000802427023116, + 0.000820912712927, + 0.000839677202426, + 0.000858720889471, + 0.000878044068197, + 0.000897646927996, + 0.000917529550724, + 0.000937691909762, + 0.000958133867299, + 0.000978855173459, + 0.000999855463679, + 0.001021134257902, + 0.001042690958069, + 0.001064524847376, + 0.001086635087889, + 0.001109020719868, + 0.001131680659525, + 0.001154613698409, + 0.001177818501315, + 0.001201293605747, + 0.001225037419975, + 0.001249048222589, + 0.001273324160700, + 0.001297863249606, + 0.001322663371131, + 0.001347722273419, + 0.001373037569408, + 0.001398606736769, + 0.001424427116503, + 0.001450495913054, + 0.001476810193013, + 0.001503366885426, + 0.001530162780600, + 0.001557194530614, + 0.001584458648234, + 0.001611951507632, + 0.001639669343409, + 0.001667608251533, + 0.001695764188468, + 0.001724132972335, + 0.001752710282160, + 0.001781491659250, + 0.001810472506568, + 0.001839648090323, + 0.001869013539487, + 0.001898563847581, + 0.001928293872358, + 0.001958198337767, + 0.001988271833820, + 0.002018508818723, + 0.002048903618943, + 0.002079450431484, + 0.002110143324177, + 0.002140976238089, + 0.002171942988045, + 0.002203037265157, + 0.002234252637585, + 0.002265582553187, + 0.002297020340518, + 0.002328559211596, + 0.002360192263134, + 0.002391912479431, + 0.002423712733825, + 0.002455585791711, + 0.002487524312210, + 0.002519520851317, + 0.002551567863769, + 0.002583657706338, + 0.002615782639873, + 0.002647934832758, + 0.002680106363099, + 0.002712289222360, + 0.002744475317679, + 0.002776656475687, + 0.002808824444935, + 0.002840970899902, + 0.002873087443517, + 0.002905165611358, + 0.002937196874253, + 0.002969172642675, + 0.003001084269403, + 0.003032923054110, + 0.003064680246083, + 0.003096347048983, + 0.003127914623627, + 0.003159374092903, + 0.003190716544618, + 0.003221933036540, + 0.003253014599320, + 0.003283952241645, + 0.003314736953226, + 0.003345359710043, + 0.003375811477414, + 0.003406083215285, + 0.003436165881409, + 0.003466050436636, + 0.003495727848217, + 0.003525189095072, + 0.003554425171206, + 0.003583427090950, + 0.003612185892482, + 0.003640692643008, + 0.003668938442406, + 0.003696914428318, + 0.003724611779908, + 0.003752021722856, + 0.003779135533213, + 0.003805944542296, + 0.003832440140619, + 0.003858613782678, + 0.003884456990948, + 0.003909961360553, + 0.003935118563301, + 0.003959920352242, + 0.003984358565720, + 0.004008425131820, + 0.004032112072405, + 0.004055411507458, + 0.004078315659082, + 0.004100816855733, + 0.004122907536163, + 0.004144580253543, + 0.004165827679324, + 0.004186642607254, + 0.004207017957131, + 0.004226946778713, + 0.004246422255352, + 0.004265437707780, + 0.004283986597615, + 0.004302062531015, + 0.004319659262048, + 0.004336770696196, + 0.004353390893585, + 0.004369514072328, + 0.004385134611605, + 0.004400247054833, + 0.004414846112595, + 0.004428926665616, + 0.004442483767539, + 0.004455512647703, + 0.004468008713752, + 0.004479967554203, + 0.004491384940889, + 0.004502256831302, + 0.004512579370872, + 0.004522348895071, + 0.004531561931516, + 0.004540215201843, + 0.004548305623618, + 0.004555830311974, + 0.004562786581324, + 0.004569171946769, + 0.004574984125591, + 0.004580221038437, + 0.004584880810586, + 0.004588961772907, + 0.004592462462888, + 0.004595381625379, + 0.004597718213369, + 0.004599471388516, + 0.004600640521669, + 0.004601225193182, + 0.004601225193182, + 0.004600640521669, + 0.004599471388516, + 0.004597718213369, + 0.004595381625379, + 0.004592462462888, + 0.004588961772907, + 0.004584880810586, + 0.004580221038437, + 0.004574984125591, + 0.004569171946769, + 0.004562786581324, + 0.004555830311974, + 0.004548305623618, + 0.004540215201843, + 0.004531561931516, + 0.004522348895071, + 0.004512579370872, + 0.004502256831302, + 0.004491384940889, + 0.004479967554203, + 0.004468008713752, + 0.004455512647703, + 0.004442483767539, + 0.004428926665616, + 0.004414846112595, + 0.004400247054833, + 0.004385134611605, + 0.004369514072328, + 0.004353390893585, + 0.004336770696196, + 0.004319659262048, + 0.004302062531015, + 0.004283986597615, + 0.004265437707780, + 0.004246422255352, + 0.004226946778713, + 0.004207017957131, + 0.004186642607254, + 0.004165827679324, + 0.004144580253543, + 0.004122907536163, + 0.004100816855733, + 0.004078315659082, + 0.004055411507458, + 0.004032112072405, + 0.004008425131820, + 0.003984358565720, + 0.003959920352242, + 0.003935118563301, + 0.003909961360553, + 0.003884456990948, + 0.003858613782678, + 0.003832440140619, + 0.003805944542296, + 0.003779135533213, + 0.003752021722856, + 0.003724611779908, + 0.003696914428318, + 0.003668938442406, + 0.003640692643008, + 0.003612185892482, + 0.003583427090950, + 0.003554425171206, + 0.003525189095072, + 0.003495727848217, + 0.003466050436636, + 0.003436165881409, + 0.003406083215285, + 0.003375811477414, + 0.003345359710043, + 0.003314736953226, + 0.003283952241645, + 0.003253014599320, + 0.003221933036540, + 0.003190716544618, + 0.003159374092903, + 0.003127914623627, + 0.003096347048983, + 0.003064680246083, + 0.003032923054110, + 0.003001084269403, + 0.002969172642675, + 0.002937196874253, + 0.002905165611358, + 0.002873087443517, + 0.002840970899902, + 0.002808824444935, + 0.002776656475687, + 0.002744475317679, + 0.002712289222360, + 0.002680106363099, + 0.002647934832758, + 0.002615782639873, + 0.002583657706338, + 0.002551567863769, + 0.002519520851317, + 0.002487524312210, + 0.002455585791711, + 0.002423712733825, + 0.002391912479431, + 0.002360192263134, + 0.002328559211596, + 0.002297020340518, + 0.002265582553187, + 0.002234252637585, + 0.002203037265157, + 0.002171942988045, + 0.002140976238089, + 0.002110143324177, + 0.002079450431484, + 0.002048903618943, + 0.002018508818723, + 0.001988271833820, + 0.001958198337767, + 0.001928293872358, + 0.001898563847581, + 0.001869013539487, + 0.001839648090323, + 0.001810472506568, + 0.001781491659250, + 0.001752710282160, + 0.001724132972335, + 0.001695764188468, + 0.001667608251533, + 0.001639669343409, + 0.001611951507632, + 0.001584458648234, + 0.001557194530614, + 0.001530162780600, + 0.001503366885426, + 0.001476810193013, + 0.001450495913054, + 0.001424427116503, + 0.001398606736769, + 0.001373037569408, + 0.001347722273419, + 0.001322663371131, + 0.001297863249606, + 0.001273324160700, + 0.001249048222589, + 0.001225037419975, + 0.001201293605747, + 0.001177818501315, + 0.001154613698409, + 0.001131680659525, + 0.001109020719868, + 0.001086635087889, + 0.001064524847376, + 0.001042690958069, + 0.001021134257902, + 0.000999855463679, + 0.000978855173459, + 0.000958133867299, + 0.000937691909762, + 0.000917529550724, + 0.000897646927996, + 0.000878044068197, + 0.000858720889471, + 0.000839677202426, + 0.000820912712927, + 0.000802427023116, + 0.000784219634251, + 0.000766289947817, + 0.000748637268384, + 0.000731260804822, + 0.000714159673158, + 0.000697332897898, + 0.000680779414857, + 0.000664498072604, + 0.000648487635243, + 0.000632746783974, + 0.000617274119823, + 0.000602068165314, + 0.000587127367134, + 0.000572450097909, + 0.000558034658807, + 0.000543879281395, + 0.000529982130195, + 0.000516341304591, + 0.000502954841349, + 0.000489820716559, + 0.000476936848125, + 0.000464301097709, + 0.000451911273216, + 0.000439765130714, + 0.000427860376920, + 0.000416194671069, + 0.000404765627430, + 0.000393570817086, + 0.000382607770491, + 0.000371873979149, + 0.000361366898216, + 0.000351083948063, + 0.000341022516922, + 0.000331179962326, + 0.000321553613799, + 0.000312140774168, + 0.000302938722286, + 0.000293944714221, + 0.000285155985994, + 0.000276569754666, + 0.000268183221059, + 0.000259993570757, + 0.000251997976791, + 0.000244193600571, + 0.000236577594510, + 0.000229147102908, + 0.000221899264481, + 0.000214831213225, + 0.000207940080827, + 0.000201222997522, + 0.000194677094367, + 0.000188299504104, + 0.000182087363287, + 0.000176037813151, + 0.000170148001590, + 0.000164415084034, + 0.000158836225271, + 0.000153408600336, + 0.000148129396174, + 0.000142995812533, + 0.000138005063487, + 0.000133154378310, + 0.000128441002875, + 0.000123862200490, + 0.000119415253203, + 0.000115097462565, + 0.000110906150870, + 0.000106838661821, + 0.000102892361735, + 0.000099064640077, + 0.000095352910659, + 0.000091754612028, + 0.000088267208670, + 0.000084888191239, + 0.000081615077781, + 0.000078445413795, + 0.000075376773486, + 0.000072406759655, + 0.000069533004984, + 0.000066753171753, + 0.000064064953157, + 0.000061466072873, + 0.000058954286377, + 0.000056527380385, + 0.000054183174163, + 0.000051919518862, + 0.000049734298789, + 0.000047625430672, + 0.000045590864869, + 0.000043628584589, + 0.000041736607015, + 0.000039912982509, + 0.000038155795629, + 0.000036463164339, + 0.000034833240906, + 0.000033264211132, + 0.000031754295124, + 0.000030301746554, + 0.000028904853308, + 0.000027561936767, + 0.000026271352347, + 0.000025031488798, + 0.000023840768647, + 0.000022697647498, + 0.000021600614406, + 0.000020548191156, + 0.000019538932599, + 0.000018571425876, + 0.000017644290759, + 0.000016756178784, + 0.000015905773637, + 0.000015091790163, + 0.000014312974832, + 0.000013568104599, + 0.000012855987475, + 0.000012175461221, + 0.000011525394046, + 0.000010904683121, + 0.000010312255416, + 0.000009747066037, + 0.000009208099195, + 0.000008694366379, + 0.000008204907452, + 0.000007738788674, + 0.000007295103905, + 0.000006872972514, + 0.000006471540645, + 0.000006089979070, + 0.000005727484467, + 0.000005383277263, + 0.000005056602883, + 0.000004746729636, + 0.000004452949882, + 0.000004174578014, + 0.000003910951502, + 0.000003661429009, + 0.000003425391279, + 0.000003202239426, + 0.000002991395630, + 0.000002792301631, + 0.000002604419221, + 0.000002427228940, + 0.000002260230379, + 0.000002102941065, + 0.000001954896596, + 0.000001815649686, + 0.000001684770169, + 0.000001561844168, + 0.000001446474015, + 0.000001338277486, + 0.000001236887707, + 0.000001141952384, + 0.000001053133766, + 0.000000970107802, + 0.000000892564232, + 0.000000820205604, + 0.000000752747558, + 0.000000689917640, + 0.000000631455840, + 0.000000577113153, + 0.000000526652414, + 0.000000479846570, + 0.000000436479839, + 0.000000396345681, + 0.000000359248280, + 0.000000325000228, + 0.000000293424307, + 0.000000264350922, + 0.000000237620132, + 0.000000213078893, + 0.000000190583271, + 0.000000169995579, + 0.000000151186668, + 0.000000134033072, + 0.000000118419261, + 0.000000104234914, + 0.000000091377013, + 0.000000079747366, + 0.000000069254410, + 0.000000059811125, + 0.000000051336412, + 0.000000043753522, + 0.000000036990894, + 0.000000030981198, + 0.000000025661549, + 0.000000020973250, + 0.000000016861297, + 0.000000013274887, + 0.000000010166182, + 0.000000007491597, + 0.000000005209816, + 0.000000003283860, + 0.000000001678381, + 0.000000000362461, + -0.000000000693742, + -0.000000001515543, + -0.000000002127632, + -0.000000002550081, + -0.000000002802657, + -0.000000002900423, + -0.000000038736989, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_8_2.h b/core/src/dsp/multirate/decim/taps/fir_8_2.h new file mode 100644 index 0000000..1b8354b --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_8_2.h @@ -0,0 +1,21 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_8_2_len = 9; + const float fir_8_2_taps[] = { + -0.0096855460565f, + -0.0196926482904f, + 0.0627645107767f, + 0.2740445488509f, + 0.4025398240918f, + 0.2740445488509f, + 0.0627645107767f, + -0.0196926482904f, + -0.0096855460565f, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_8_4.h b/core/src/dsp/multirate/decim/taps/fir_8_4.h new file mode 100644 index 0000000..a01aaaa --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_8_4.h @@ -0,0 +1,39 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_8_4_len = 27; + const float fir_8_4_taps[] = { + -0.000069910742154, + -0.000552526802288, + -0.002127088129249, + -0.005633575976279, + -0.011315295341167, + -0.017735691906137, + -0.021011120930551, + -0.015296134618958, + 0.005014080997102, + 0.041970748926553, + 0.091347535728189, + 0.142430310818233, + 0.181170927236212, + 0.195642275183578, + 0.181170927236212, + 0.142430310818233, + 0.091347535728189, + 0.041970748926553, + 0.005014080997102, + -0.015296134618958, + -0.021011120930551, + -0.017735691906137, + -0.011315295341167, + -0.005633575976279, + -0.002127088129249, + -0.000552526802288, + -0.000069910742154, + }; +} diff --git a/core/src/dsp/multirate/decim/taps/fir_8_8.h b/core/src/dsp/multirate/decim/taps/fir_8_8.h new file mode 100644 index 0000000..b1d5de5 --- /dev/null +++ b/core/src/dsp/multirate/decim/taps/fir_8_8.h @@ -0,0 +1,292 @@ +#pragma once + +/* + This file was auto-generated by Ryzerth's magic optimized FIR script. + DO NOT EDIT MANUALLY!!! +*/ + +namespace dsp::multirate::decim { + const unsigned int fir_8_8_len = 280; + const float fir_8_8_taps[] = { + 0.0000052994842f, + 0.0000236531982f, + 0.0000454431541f, + 0.0000866606150f, + 0.0001454681461f, + 0.0002276460304f, + 0.0003345911923f, + 0.0004668904560f, + 0.0006220183860f, + 0.0007944666281f, + 0.0009753045793f, + 0.0011524547932f, + 0.0013112968761f, + 0.0014357836468f, + 0.0015099531702f, + 0.0015197416085f, + 0.0014549038561f, + 0.0013108132368f, + 0.0010898828479f, + 0.0008023617978f, + 0.0004663041298f, + 0.0001065892726f, + -0.0002470172936f, + -0.0005626469270f, + -0.0008097088243f, + -0.0009625110041f, + -0.0010036852815f, + -0.0009269528060f, + -0.0007387999373f, + -0.0004587307896f, + -0.0001179165349f, + 0.0002437426033f, + 0.0005819117379f, + 0.0008530352611f, + 0.0010198667279f, + 0.0010566109951f, + 0.0009529624621f, + 0.0007164088602f, + 0.0003723511050f, + -0.0000381502360f, + -0.0004628817408f, + -0.0008447972550f, + -0.0011294256831f, + -0.0012724326538f, + -0.0012463078782f, + -0.0010451923796f, + -0.0006870442177f, + -0.0002126532093f, + 0.0003185796904f, + 0.0008357346058f, + 0.0012655423999f, + 0.0015424876979f, + 0.0016184879319f, + 0.0014707552431f, + 0.0011066080375f, + 0.0005643461992f, + -0.0000901977407f, + -0.0007712304481f, + -0.0013838905368f, + -0.0018371322225f, + -0.0020568961991f, + -0.0019977090699f, + -0.0016509537671f, + -0.0010484135134f, + -0.0002602767483f, + 0.0006124690999f, + 0.0014505273627f, + 0.0021321900783f, + 0.0025505844320f, + 0.0026298818820f, + 0.0023380802069f, + 0.0016943083615f, + 0.0007692604372f, + -0.0003217361360f, + -0.0014324858797f, + -0.0024049762894f, + -0.0030913100580f, + -0.0033755493545f, + -0.0031923301613f, + -0.0025393728936f, + -0.0014817135720f, + -0.0001465338471f, + 0.0012912514887f, + 0.0026311543404f, + 0.0036743211895f, + 0.0042521988692f, + 0.0042526374291f, + 0.0036395284429f, + 0.0024627622943f, + 0.0008564752688f, + -0.0009748928184f, + -0.0027814968415f, + -0.0043010655579f, + -0.0052957555102f, + -0.0055878599029f, + -0.0050892037537f, + -0.0038196329489f, + -0.0019112679623f, + 0.0004029949855f, + 0.0028161150389f, + 0.0049858689474f, + 0.0065814235194f, + 0.0073314238254f, + 0.0070669002384f, + 0.0057525958483f, + 0.0035015266976f, + 0.0005695959447f, + -0.0026703422489f, + -0.0057727554561f, + -0.0082771418381f, + -0.0097720954139f, + -0.0099573040630f, + -0.0086947790176f, + -0.0060415019273f, + -0.0022576736745f, + 0.0022123488358f, + 0.0067858745476f, + 0.0108103047042f, + 0.0136467461009f, + 0.0147589153736f, + 0.0137961123447f, + 0.0106590975496f, + 0.0055392102924f, + -0.0010761158185f, + -0.0084344441235f, + -0.0155846252876f, + -0.0214724302300f, + -0.0250557443256f, + -0.0254266556205f, + -0.0219263229678f, + -0.0142387338262f, + -0.0024513843925f, + 0.0129256469755f, + 0.0309861862491f, + 0.0504987785185f, + 0.0700154216583f, + 0.0880072662488f, + 0.1030129814746f, + 0.1137837576738f, + 0.1194090364685f, + 0.1194090364685f, + 0.1137837576738f, + 0.1030129814746f, + 0.0880072662488f, + 0.0700154216583f, + 0.0504987785185f, + 0.0309861862491f, + 0.0129256469755f, + -0.0024513843925f, + -0.0142387338262f, + -0.0219263229678f, + -0.0254266556205f, + -0.0250557443256f, + -0.0214724302300f, + -0.0155846252876f, + -0.0084344441235f, + -0.0010761158185f, + 0.0055392102924f, + 0.0106590975496f, + 0.0137961123447f, + 0.0147589153736f, + 0.0136467461009f, + 0.0108103047042f, + 0.0067858745476f, + 0.0022123488358f, + -0.0022576736745f, + -0.0060415019273f, + -0.0086947790176f, + -0.0099573040630f, + -0.0097720954139f, + -0.0082771418381f, + -0.0057727554561f, + -0.0026703422489f, + 0.0005695959447f, + 0.0035015266976f, + 0.0057525958483f, + 0.0070669002384f, + 0.0073314238254f, + 0.0065814235194f, + 0.0049858689474f, + 0.0028161150389f, + 0.0004029949855f, + -0.0019112679623f, + -0.0038196329489f, + -0.0050892037537f, + -0.0055878599029f, + -0.0052957555102f, + -0.0043010655579f, + -0.0027814968415f, + -0.0009748928184f, + 0.0008564752688f, + 0.0024627622943f, + 0.0036395284429f, + 0.0042526374291f, + 0.0042521988692f, + 0.0036743211895f, + 0.0026311543404f, + 0.0012912514887f, + -0.0001465338471f, + -0.0014817135720f, + -0.0025393728936f, + -0.0031923301613f, + -0.0033755493545f, + -0.0030913100580f, + -0.0024049762894f, + -0.0014324858797f, + -0.0003217361360f, + 0.0007692604372f, + 0.0016943083615f, + 0.0023380802069f, + 0.0026298818820f, + 0.0025505844320f, + 0.0021321900783f, + 0.0014505273627f, + 0.0006124690999f, + -0.0002602767483f, + -0.0010484135134f, + -0.0016509537671f, + -0.0019977090699f, + -0.0020568961991f, + -0.0018371322225f, + -0.0013838905368f, + -0.0007712304481f, + -0.0000901977407f, + 0.0005643461992f, + 0.0011066080375f, + 0.0014707552431f, + 0.0016184879319f, + 0.0015424876979f, + 0.0012655423999f, + 0.0008357346058f, + 0.0003185796904f, + -0.0002126532093f, + -0.0006870442177f, + -0.0010451923796f, + -0.0012463078782f, + -0.0012724326538f, + -0.0011294256831f, + -0.0008447972550f, + -0.0004628817408f, + -0.0000381502360f, + 0.0003723511050f, + 0.0007164088602f, + 0.0009529624621f, + 0.0010566109951f, + 0.0010198667279f, + 0.0008530352611f, + 0.0005819117379f, + 0.0002437426033f, + -0.0001179165349f, + -0.0004587307896f, + -0.0007387999373f, + -0.0009269528060f, + -0.0010036852815f, + -0.0009625110041f, + -0.0008097088243f, + -0.0005626469270f, + -0.0002470172936f, + 0.0001065892726f, + 0.0004663041298f, + 0.0008023617978f, + 0.0010898828479f, + 0.0013108132368f, + 0.0014549038561f, + 0.0015197416085f, + 0.0015099531702f, + 0.0014357836468f, + 0.0013112968761f, + 0.0011524547932f, + 0.0009753045793f, + 0.0007944666281f, + 0.0006220183860f, + 0.0004668904560f, + 0.0003345911923f, + 0.0002276460304f, + 0.0001454681461f, + 0.0000866606150f, + 0.0000454431541f, + 0.0000236531982f, + 0.0000052994842f, + }; +} diff --git a/core/src/dsp/multirate/polyphase_bank.h b/core/src/dsp/multirate/polyphase_bank.h new file mode 100644 index 0000000..c9c50d7 --- /dev/null +++ b/core/src/dsp/multirate/polyphase_bank.h @@ -0,0 +1,62 @@ +#pragma once +#include +#include "../taps/tap.h" +#include "../buffer/buffer.h" + +namespace dsp::multirate { + template + struct PolyphaseBank { + int phaseCount; + int tapsPerPhase; + T** phases; + }; + + template + inline PolyphaseBank buildPolyphaseBank(int phaseCount, tap& taps) { + // Allocate bank + PolyphaseBank pb; + pb.phaseCount = phaseCount; + pb.phases = buffer::alloc(phaseCount); + + + // Allocate phases + pb.tapsPerPhase = (taps.size + phaseCount - 1) / phaseCount; + for (int i = 0; i < phaseCount; i++) { + pb.phases[i] = buffer::alloc(pb.tapsPerPhase); + buffer::clear(pb.phases[i], pb.tapsPerPhase); + } + + // Fill phases + int totTapCount = phaseCount * pb.tapsPerPhase; + for (int i = 0; i < totTapCount; i++) { + pb.phases[(phaseCount - 1) - (i % phaseCount)][i / phaseCount] = (i < taps.size) ? taps.taps[i] : 0; + } + + // int currentTap = 0; + // for (int tap = 0; tap < pb.tapsPerPhase; tap++) { + // for (int phase = 0; phase < phaseCount; phase++) { + // if (currentTap < taps.size) { + // pb.phases[(phaseCount - 1) - phase][tap] = taps.taps[currentTap++]; + // } + // else { + // pb.phases[(phaseCount - 1) - phase][tap] = 0; + // } + // } + // } + + return pb; + } + + template + inline void freePolyphaseBank(PolyphaseBank& bank) { + if (!bank.phases) { return; } + for (int i = 0; i < bank.phaseCount; i++) { + if (!bank.phases[i]) { continue; } + buffer::free(bank.phases[i]); + } + buffer::free(bank.phases); + bank.phases = NULL; + bank.phaseCount = 0; + bank.tapsPerPhase = 0; + } +} \ No newline at end of file diff --git a/core/src/dsp/multirate/polyphase_resampler.h b/core/src/dsp/multirate/polyphase_resampler.h new file mode 100644 index 0000000..d912d07 --- /dev/null +++ b/core/src/dsp/multirate/polyphase_resampler.h @@ -0,0 +1,126 @@ +#pragma once +#include "../processor.h" +#include "../taps/tap.h" +#include "polyphase_bank.h" + +namespace dsp::multirate { + template + class PolyphaseResampler : public Processor { + using base_type = Processor; + public: + PolyphaseResampler() {} + + PolyphaseResampler(stream* in, int interp, int decim, tap taps) { init(in, interp, decim, taps); } + + ~PolyphaseResampler() { + if (!base_type::_block_init) { return; } + base_type::stop(); + buffer::free(buffer); + freePolyphaseBank(phases); + } + + void init(stream* in, int interp, int decim, tap taps) { + _interp = interp; + _decim = decim; + _taps = taps; + + // Build filter bank + phases = buildPolyphaseBank(_interp, _taps); + + // Allocate delay buffer + buffer = buffer::alloc(STREAM_BUFFER_SIZE + 64000); + bufStart = &buffer[phases.tapsPerPhase - 1]; + buffer::clear(buffer, phases.tapsPerPhase - 1); + + base_type::init(in); + } + + void setRatio(int interp, int decim, tap& taps) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + + // Update settings + _interp = interp; + _decim = decim; + _taps = taps; + + // Re-generate polyphase bank + freePolyphaseBank(phases); + phases = buildPolyphaseBank(_interp, _taps); + + // Reset buffer + bufStart = &buffer[phases.tapsPerPhase - 1]; + reset(); + + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + buffer::clear(buffer, phases.tapsPerPhase - 1); + phase = 0; + offset = 0; + base_type::tempStart(); + } + + inline int process(int count, const T* in, T* out) { + int outCount = 0; + + // Copy input to buffer + memcpy(bufStart, in, count * sizeof(T)); + + while (offset < count) { + // Do convolution + if constexpr (std::is_same_v) { + volk_32f_x2_dot_prod_32f(&out[outCount++], &buffer[offset], phases.phases[phase], phases.tapsPerPhase); + } + if constexpr (std::is_same_v || std::is_same_v) { + volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&out[outCount++], (lv_32fc_t*)&buffer[offset], phases.phases[phase], phases.tapsPerPhase); + } + + // Increment phase + phase += _decim; + + // Branchless phase advance if phase wrap arround occurs + offset += phase / _interp; + + // Wrap around if needed + phase = phase % _interp; + } + offset -= count; + + // Move delay + memmove(buffer, &buffer[count], (phases.tapsPerPhase - 1) * sizeof(T)); + + return outCount; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + int _interp; + int _decim; + tap _taps; + PolyphaseBank phases; + int phase = 0; + int offset = 0; + T* buffer; + T* bufStart; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/multirate/power_decimator.h b/core/src/dsp/multirate/power_decimator.h new file mode 100644 index 0000000..0ad27b9 --- /dev/null +++ b/core/src/dsp/multirate/power_decimator.h @@ -0,0 +1,119 @@ +#pragma once +#include "../filter/decimating_fir.h" +#include "../taps/from_array.h" +#include "decim/plans.h" + +namespace dsp::multirate { + template + class PowerDecimator : public Processor { + using base_type = Processor; + public: + PowerDecimator() {} + + PowerDecimator(stream* in, unsigned int ratio) { init(in, ratio); } + + ~PowerDecimator() { + if (!base_type::_block_init) { return; } + base_type::stop(); + freeFirs(); + } + + void init(stream* in, unsigned int ratio) { + assert(checkRatio(ratio)); + _ratio = ratio; + reconfigure(); + base_type::init(in); + } + + static inline unsigned int getMaxRatio() { + return 1 << decim::plans_len; + } + + void setRatio(unsigned int ratio) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _ratio = ratio; + reconfigure(); + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + for (auto& fir : decimFirs) { + fir->reset(); + } + base_type::tempStart(); + } + + inline int process(int count, const T* in, T* out) { + // If the ratio is 1, no need to decimate + if (_ratio == 1) { + memcpy(out, in, count * sizeof(T)); + return count; + } + + // Process data through each stage + const T* data = in; + int last = stageCount - 1; + for (int i = 0; i < stageCount; i++) { + auto fir = decimFirs[i]; + count = fir->process(count, data, (i == last) ? out : fir->out.writeBuf); + data = fir->out.writeBuf; + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + void freeFirs() { + for (auto& fir : decimFirs) { delete fir; } + for (auto& taps : decimTaps) { taps::free(taps); } + decimFirs.clear(); + decimTaps.clear(); + } + + void reconfigure() { + // Delete DDC FIRs and taps + freeFirs(); + + // Generate filters based on DDC plan + if (_ratio > 1) { + int planId = log2(_ratio) - 1; + decim::plan plan = decim::plans[planId]; + stageCount = plan.stageCount; + for (int i = 0; i < stageCount; i++) { + tap taps = taps::fromArray(plan.stages[i].tapcount, plan.stages[i].taps); + auto fir = new filter::DecimatingFIR(NULL, taps, plan.stages[i].decimation); + decimTaps.push_back(taps); + decimFirs.push_back(fir); + } + } + } + + bool checkRatio(unsigned int ratio) { + // Make sure ratio is a power of two, non-zero and lower or equal to maximum + return ((ratio & (ratio - 1)) == 0) && ratio && ratio <= getMaxRatio(); + } + + std::vector*> decimFirs; + std::vector> decimTaps; + unsigned int _ratio; + int stageCount; + }; +} \ No newline at end of file diff --git a/core/src/dsp/multirate/rational_resampler.h b/core/src/dsp/multirate/rational_resampler.h new file mode 100644 index 0000000..5902f24 --- /dev/null +++ b/core/src/dsp/multirate/rational_resampler.h @@ -0,0 +1,155 @@ +#pragma once +#include +#include +#include "../processor.h" +#include "../filter/decimating_fir.h" +#include "../taps/from_array.h" +#include "polyphase_resampler.h" +#include "power_decimator.h" +#include "../taps/low_pass.h" +#include "../window/nuttall.h" + +namespace dsp::multirate { + template + class RationalResampler : public Processor { + using base_type = Processor; + public: + RationalResampler() {} + + RationalResampler(stream* in, double inSamplerate, double outSamplerate) { init(in, inSamplerate, outSamplerate); } + + void init(stream* in, double inSamplerate, double outSamplerate) { + _inSamplerate = inSamplerate; + _outSamplerate = outSamplerate; + + // Dummy initialization since only used for processing + rtaps = taps::lowPass(0.25, 0.1, 1.0); + decim.init(NULL, 2); + resamp.init(NULL, 1, 1, rtaps); + + // Proper configuration + reconfigure(); + + base_type::init(in); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + decim.reset(); + resamp.reset(); + base_type::tempStart(); + } + + void setInSamplerate(double inSamplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _inSamplerate = inSamplerate; + reconfigure(); + base_type::tempStart(); + } + + void setOutSamplerate(double outSamplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _outSamplerate = outSamplerate; + reconfigure(); + base_type::tempStart(); + } + + inline int process(int count, const T* in, T* out) { + switch(mode) { + case Mode::BOTH: + count = decim.process(count, in, decim.out.writeBuf); + return resamp.process(count, decim.out.writeBuf, out); + case Mode::DECIM_ONLY: + return decim.process(count, in, out); + case Mode::RESAMP_ONLY: + return resamp.process(count, in, out); + case Mode::NONE: + memcpy(out, in, count * sizeof(T)); + return count; + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + enum Mode { + BOTH, + DECIM_ONLY, + RESAMP_ONLY, + NONE + }; + + void reconfigure() { + // Calculate highest power-of-two decimation for the power decimator + int predecPower = std::min(floor(log2(_inSamplerate / _outSamplerate)), PowerDecimator::getMaxRatio()); + int predecRatio = std::min(1 << predecPower, PowerDecimator::getMaxRatio()); + double intSamplerate = _inSamplerate; + + // Configure the DDC + bool useDecim = (_inSamplerate > _outSamplerate && predecPower > 0); + if (useDecim) { + intSamplerate = _inSamplerate / (double)predecRatio; + decim.setRatio(predecRatio); + } + + // Calculate interpolation and decimation for polyphase resampler + int IntSR = round(intSamplerate); + int OutSR = round(_outSamplerate); + int gcd = std::gcd(IntSR, OutSR); + int interp = OutSR / gcd; + int decim = IntSR / gcd; + + // Check for excessive error + double actualOutSR = (double)IntSR * (double)interp / (double)decim; + double error = abs((actualOutSR - _outSamplerate) / _outSamplerate) * 100.0; + if (error > 0.01) { + fprintf(stderr, "Warning: resampling error is over 0.01%: %lf\n", error); + } + + // If the power decimator already did all the work, don't use the resampler + if (interp == decim) { + mode = useDecim ? Mode::DECIM_ONLY : Mode::NONE; + return; + } + + // Configure the polyphase resampler + double tapSamplerate = intSamplerate * (double)interp; + double tapBandwidth = std::min(_inSamplerate, _outSamplerate) / 2.0; + double tapTransWidth = tapBandwidth * 0.1; + taps::free(rtaps); + rtaps = taps::lowPass(tapBandwidth, tapTransWidth, tapSamplerate); + for (int i = 0; i < rtaps.size; i++) { rtaps.taps[i] *= (float)interp; } + resamp.setRatio(interp, decim, rtaps); + + printf("[Resamp] predec: %d, interp: %d, decim: %d, inacc: %lf%%, taps: %d\n", predecRatio, interp, decim, error, rtaps.size); + + mode = useDecim ? Mode::BOTH : Mode::RESAMP_ONLY; + } + + PowerDecimator decim; + PolyphaseResampler resamp; + tap rtaps; + double _inSamplerate; + double _outSamplerate; + Mode mode; + }; +} \ No newline at end of file diff --git a/core/src/dsp/noise_reduction/fm_if.h b/core/src/dsp/noise_reduction/fm_if.h new file mode 100644 index 0000000..6ad4868 --- /dev/null +++ b/core/src/dsp/noise_reduction/fm_if.h @@ -0,0 +1,149 @@ +#pragma once +#include "../processor.h" +#include "../window/nuttall.h" +#include + +namespace dsp::noise_reduction { + class FMIF : public Processor { + using base_type = Processor; + public: + FMIF() {} + + FMIF(stream* in, int bins) { init(in, bins); } + + ~FMIF() { + if (!base_type::_block_init) { return; } + base_type::stop(); + destroyBuffers(); + } + + void init(stream* in, int bins) { + _bins = bins; + initBuffers(); + base_type::init(in); + } + + void setBins(int bins) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _bins = bins; + destroyBuffers(); + initBuffers(); + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + buffer::clear(buffer, _bins - 1); + buffer::clear(backFFTIn, _bins); + base_type::tempStart(); + } + + int process(int count, const complex_t* in, complex_t* out) { + // Write new input data to buffer buffer + memcpy(bufferStart, in, count * sizeof(complex_t)); + + // Iterate the FFT + for (int i = 0; i < count; i++) { + // Apply windows + volk_32fc_32f_multiply_32fc((lv_32fc_t*)forwFFTIn, (lv_32fc_t*)&buffer[i], fftWin, _bins); + + // Do forward FFT + fftwf_execute(forwardPlan); + + // Process bins here + uint32_t idx; + volk_32fc_magnitude_32f(ampBuf, (lv_32fc_t*)forwFFTOut, _bins); + volk_32f_index_max_32u(&idx, ampBuf, _bins); + + // Keep only the bin of highest amplitude + backFFTIn[idx] = forwFFTOut[idx]; + + // Do reverse FFT and get first element + fftwf_execute(backwardPlan); + out[i] = backFFTOut[_bins / 2]; + + // Reset the input buffer + backFFTIn[idx] = { 0, 0 }; + } + + // Move buffer buffer + memmove(buffer, &buffer[count], (_bins - 1) * sizeof(complex_t)); + + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + void initBuffers() { + // Allocate FFT buffers + forwFFTIn = (complex_t*)fftwf_malloc(_bins * sizeof(complex_t)); + forwFFTOut = (complex_t*)fftwf_malloc(_bins * sizeof(complex_t)); + backFFTIn = (complex_t*)fftwf_malloc(_bins * sizeof(complex_t)); + backFFTOut = (complex_t*)fftwf_malloc(_bins * sizeof(complex_t)); + + // Allocate and clear delay buffer + buffer = buffer::alloc(STREAM_BUFFER_SIZE + 64000); + bufferStart = &buffer[_bins - 1]; + buffer::clear(buffer, _bins - 1); + + // Clear backward FFT input since only one value is changed and reset at a time + buffer::clear(backFFTIn, _bins); + + // Allocate amplitude buffer + ampBuf = buffer::alloc(_bins); + + // Allocate and generate Window + fftWin = buffer::alloc(_bins); + for (int i = 0; i < _bins; i++) { fftWin[i] = window::nuttall(i, _bins - 1); } + + // Plan FFTs + forwardPlan = fftwf_plan_dft_1d(_bins, (fftwf_complex*)forwFFTIn, (fftwf_complex*)forwFFTOut, FFTW_FORWARD, FFTW_ESTIMATE); + backwardPlan = fftwf_plan_dft_1d(_bins, (fftwf_complex*)backFFTIn, (fftwf_complex*)backFFTOut, FFTW_BACKWARD, FFTW_ESTIMATE); + } + + void destroyBuffers() { + fftwf_destroy_plan(forwardPlan); + fftwf_destroy_plan(backwardPlan); + fftwf_free(forwFFTIn); + fftwf_free(forwFFTOut); + fftwf_free(backFFTIn); + fftwf_free(backFFTOut); + buffer::free(buffer); + buffer::free(ampBuf); + buffer::free(fftWin); + } + + complex_t* forwFFTIn; + complex_t* forwFFTOut; + complex_t* backFFTIn; + complex_t* backFFTOut; + + fftwf_plan forwardPlan; + fftwf_plan backwardPlan; + + complex_t* buffer; + complex_t* bufferStart; + + float* fftWin; + + float* ampBuf; + + int _bins; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/noise_reduction/squelch.h b/core/src/dsp/noise_reduction/squelch.h new file mode 100644 index 0000000..f28e7f4 --- /dev/null +++ b/core/src/dsp/noise_reduction/squelch.h @@ -0,0 +1,56 @@ +#pragma once +#include "../processor.h" + +// TODO: Rewrite better!!!!! +namespace dsp::noise_reduction { + class Squelch : public Processor { + using base_type = Processor; + public: + Squelch() {} + + Squelch(stream* in, double level) {} + + void init(stream* in, double level) { + _level = level; + base_type::init(in); + } + + void setLevel(double level) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _level = level; + } + + inline int process(int count, const complex_t* in, complex_t* out) { + float sum; + volk_32fc_magnitude_32f(normBuffer, (lv_32fc_t*)in, count); + volk_32f_accumulator_s32f(&sum, normBuffer, count); + sum /= (float)count; + + if (10.0f * log10f(sum) >= _level) { + memcpy(out, in, count * sizeof(complex_t)); + } + else { + memset(out, 0, count * sizeof(complex_t)); + } + + return count; + } + + //DEFAULT_PROC_RUN(); + + int run() { + int count = _in->read(); + if (count < 0) { return -1; } + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + private: + float* normBuffer; + float _level = -50.0f; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/operator.h b/core/src/dsp/operator.h new file mode 100644 index 0000000..f45fb84 --- /dev/null +++ b/core/src/dsp/operator.h @@ -0,0 +1,63 @@ +#pragma once +#include "block.h" + +namespace dsp { + template + class Operator : public block { + using base_type = block; + public: + Operator() {} + + Operator(stream* a, stream* b) { init(a, b); } + + virtual void init(stream* a, stream* b) { + _a = a; + _b = b; + base_type::registerInput(_a); + base_type::registerInput(_b); + base_type::registerOutput(&out); + base_type::_block_init = true; + } + + virtual void setInputs(stream* a, stream* b) { + assert(_block_init); + std::lock_guard lck(ctrlMtx); + base_type::tempStop(); + base_type::unregisterInput(_a); + base_type::unregisterInput(_b); + _a = a; + _b = b; + base_type::registerInput(_a); + base_type::registerInput(_b); + base_type::tempStart(); + } + + virtual void setInputA(stream* a) { + assert(_block_init); + std::lock_guard lck(ctrlMtx); + base_type::tempStop(); + base_type::unregisterInput(_a); + _a = a; + base_type::registerInput(_a); + base_type::tempStart(); + } + + virtual void setInputB(stream* b) { + assert(_block_init); + std::lock_guard lck(ctrlMtx); + base_type::tempStop(); + base_type::unregisterInput(_b); + _b = b; + base_type::registerInput(_b); + base_type::tempStart(); + } + + virtual int run() = 0; + + stream out; + + protected: + stream* _a; + stream* _b; + }; +} diff --git a/core/src/dsp/processor.h b/core/src/dsp/processor.h new file mode 100644 index 0000000..e5a7d78 --- /dev/null +++ b/core/src/dsp/processor.h @@ -0,0 +1,74 @@ +#pragma once +#include "block.h" + +// These macros define a run() function using a specic expression for processing +// This is needed because not all process functions have the same arguments + +#define OVERRIDE_PROC_RUN(exp)\ + int run() {\ + int count = _in->read();\ + if (count < 0) {\ + return -1;\ + }\ + \ + exp;\ + \ + base_type::_in->flush();\ + if (!base_type::out.swap(count)) { return -1; }\ + return count;\ + } + +#define OVERRIDE_MULTIRATE_PROC_RUN(exp)\ + int run() {\ + int count = _in->read();\ + if (count < 0) {\ + return -1;\ + }\ + \ + int outCount = exp;\ + \ + base_type::_in->flush();\ + if (outCount) {\ + if (!base_type::out.swap(outCount)) { return -1; }\ + }\ + return count;\ + } + +#define DEFAULT_PROC_RUN OVERRIDE_PROC_RUN(process(count, base_type::_in->readBuf, base_type::out.writeBuf)) +#define DEFAULT_MULTIRATE_PROC_RUN OVERRIDE_MULTIRATE_PROC_RUN(process(count, base_type::_in->readBuf, base_type::out.writeBuf)) + +namespace dsp { + template + class Processor : public block { + public: + Processor() {} + + Processor(stream* in) { init(in); } + + virtual ~Processor() {} + + virtual void init(stream* in) { + _in = in; + registerInput(_in); + registerOutput(&out); + _block_init = true; + } + + virtual void setInput(stream* in) { + assert(_block_init); + std::lock_guard lck(ctrlMtx); + tempStop(); + unregisterInput(_in); + _in = in; + registerInput(_in); + tempStart(); + } + + virtual int run() = 0; + + stream out; + + protected: + stream* _in; + }; +} diff --git a/core/src/dsp/routing/splitter.h b/core/src/dsp/routing/splitter.h new file mode 100644 index 0000000..2988bfa --- /dev/null +++ b/core/src/dsp/routing/splitter.h @@ -0,0 +1,65 @@ +#pragma once +#include "../sink.h" + +namespace dsp::routing { + template + class Splitter : public Sink { + using base_type = Sink; + public: + Splitter() {} + + Splitter(stream* in) { base_type::init(in); } + + void bindStream(stream* stream) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + + // Check that the stream isn't already bound + if (std::find(streams.begin(), streams.end(), stream) != streams.end()) { + throw std::runtime_error("[Splitter] Tried to bind stream to that is already bound"); + } + + // Add to the list + base_type::tempStop(); + streams.push_back(stream); + base_type::tempStart(); + } + + void unbindStream(stream* stream) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + + // Check that the stream is bound + auto sit = std::find(streams.begin(), streams.end(), stream); + if (sit == streams.end()) { + throw std::runtime_error("[Splitter] Tried to unbind stream to that isn't bound"); + } + + // Add to the list + base_type::tempStop(); + streams.erase(sit); + base_type::tempStart(); + } + + int run() { + int count = _in->read(); + if (count < 0) { return -1; } + + for (const auto& stream : streams) { + memcpy(stream->writeBuf, _in->readBuf, count * sizeof(T)); + if (!stream->swap(count)) { + _in->flush(); + return -1; + } + } + + _in->flush(); + + return count; + } + + protected: + std::vector*> streams; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/sink/handler_sink.h b/core/src/dsp/sink/handler_sink.h new file mode 100644 index 0000000..925412e --- /dev/null +++ b/core/src/dsp/sink/handler_sink.h @@ -0,0 +1,34 @@ +#pragma once +#include "../sink.h" + +namespace dsp::sink { + template + class Handler : public Sink { + using base_type = Sink; + public: + Handler() {} + + Handler(stream* in, void (*handler)(T* data, int count, void* ctx), void* ctx) { init(in, handler, ctx); } + + void init(stream* in, void (*handler)(T* data, int count, void* ctx), void* ctx) { + _handler = handler; + _ctx = ctx; + base_type::init(in); + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + _handler(_in->readBuf, count, _ctx); + + base_type::_in->flush(); + return count; + } + + protected: + void (*_handler)(T* data, int count, void* ctx); + void* _ctx; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/sink/null_sink.h b/core/src/dsp/sink/null_sink.h new file mode 100644 index 0000000..93e980b --- /dev/null +++ b/core/src/dsp/sink/null_sink.h @@ -0,0 +1,20 @@ +#pragma once +#include "../sink.h" + +namespace dsp::sink { + template + class Null : public Sink { + using base_type = Sink; + public: + Null() {} + + Null(stream* in, void (*handler)(T* data, int count, void* ctx), void* ctx) { base_type::init(in); } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + base_type::_in->flush(); + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/taps/band_pass.h b/core/src/dsp/taps/band_pass.h new file mode 100644 index 0000000..9b6fbab --- /dev/null +++ b/core/src/dsp/taps/band_pass.h @@ -0,0 +1,23 @@ +#pragma once +#include "../types.h" +#include "windowed_sinc.h" +#include "estimate_tap_count.h" +#include "../window/nuttall.h" +#include "../math/phasor.h" +#include "../math/freq_to_omega.h" + +namespace dsp::taps { + template + inline tap bandPass(double bandStart, double bandStop, double transWidth, double sampleRate) { + assert(bandStop > bandStart); + float offsetOmega = math::freqToOmega((bandStart + bandStop) / 2.0, sampleRate); + return windowedSinc(estimateTapCount(transWidth, sampleRate), (bandStop - bandStart) / 2.0, sampleRate, [=](double n, double N) { + if constexpr (std::is_same_v) { + return cosf(offsetOmega * (float)n) * window::nuttall(n, N); + } + if constexpr (std::is_same_v) { + return math::phasor(offsetOmega * (float)n) * window::nuttall(n, N); + } + }); + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/estimate_tap_count.h b/core/src/dsp/taps/estimate_tap_count.h new file mode 100644 index 0000000..aa1ad57 --- /dev/null +++ b/core/src/dsp/taps/estimate_tap_count.h @@ -0,0 +1,7 @@ +#pragma once + +namespace dsp::taps { + inline int estimateTapCount(double transWidth, double samplerate) { + return 3.8 * samplerate / transWidth; + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/from_array.h b/core/src/dsp/taps/from_array.h new file mode 100644 index 0000000..fd960f5 --- /dev/null +++ b/core/src/dsp/taps/from_array.h @@ -0,0 +1,18 @@ +#pragma once +#include "tap.h" +#include "../math/sinc.h" +#include "../math/freq_to_omega.h" +#include "../window/nuttall.h" + +namespace dsp::taps { + template + inline tap fromArray(int count, const T* taps) { + // Allocate taps + tap _taps = taps::alloc(count); + + // Copy data + memcpy(_taps.taps, taps, count * sizeof(T)); + + return _taps; + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/high_pass.h b/core/src/dsp/taps/high_pass.h new file mode 100644 index 0000000..6f92558 --- /dev/null +++ b/core/src/dsp/taps/high_pass.h @@ -0,0 +1,12 @@ +#pragma once +#include "windowed_sinc.h" +#include "estimate_tap_count.h" +#include "../window/nuttall.h" + +namespace dsp::taps { + inline tap highPass(double cutoff, double transWidth, double sampleRate) { + return windowedSinc(estimateTapCount(transWidth, sampleRate), (sampleRate / 2.0) - cutoff, sampleRate, [=](double n, double N){ + return window::nuttall(n, N) * (((int)round(n) % 2) ? -1.0f : 1.0f); + }); + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/low_pass.h b/core/src/dsp/taps/low_pass.h new file mode 100644 index 0000000..67f6641 --- /dev/null +++ b/core/src/dsp/taps/low_pass.h @@ -0,0 +1,10 @@ +#pragma once +#include "windowed_sinc.h" +#include "estimate_tap_count.h" +#include "../window/nuttall.h" + +namespace dsp::taps { + inline tap lowPass(double cutoff, double transWidth, double sampleRate) { + return windowedSinc(estimateTapCount(transWidth, sampleRate), cutoff, sampleRate, window::nuttall); + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/raised_cosine.h b/core/src/dsp/taps/raised_cosine.h new file mode 100644 index 0000000..1f5164c --- /dev/null +++ b/core/src/dsp/taps/raised_cosine.h @@ -0,0 +1,33 @@ +#pragma once +#include +#include "tap.h" +#include "../math/constants.h" +#include "../math/sinc.h" + +namespace dsp::taps { + template + inline tap raisedCosine(int count, double beta, double Ts) { + // Allocate taps + tap taps = taps::alloc(count); + + // Generate taps + double half = (double)count / 2.0; + double limit = Ts / (2.0 * beta); + for (int i = 0; i < count; i++) { + double t = (double)i - half + 0.5; + if (t == limit || t == -limit) { + taps.taps[i] = math::sinc(1.0 / (2.0*beta)) * DB_M_PI / (4.0*Ts); + } + else { + taps.taps[i] = math::sinc(t / Ts) * DB_M_PI / (4.0*Ts); + } + } + + return taps; + } + + template + inline tap raisedCosine(int count, double beta, double symbolrate, double samplerate) { + return raisedCosine(count, beta, samplerate / symbolrate); + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/root_raised_cosine.h b/core/src/dsp/taps/root_raised_cosine.h new file mode 100644 index 0000000..d137ff6 --- /dev/null +++ b/core/src/dsp/taps/root_raised_cosine.h @@ -0,0 +1,35 @@ +#pragma once +#include +#include "tap.h" +#include "../math/constants.h" + +namespace dsp { + template + inline tap rootRaisedCosine(int count, double beta, double Ts) { + // Allocate taps + tap taps = taps::alloc(count); + + // Generate taps + double half = (double)count / 2.0; + double limit = Ts / (4.0 * beta); + for (int i = 0; i < count; i++) { + double t = (double)i - half + 0.5; + if (t == 0.0) { + taps.taps[i] = (1.0 + beta*(4.0/DB_M_PI - 1.0)) / Ts; + } + else if (t == limit || t == -limit) { + taps.taps[i] = ((1.0 + 2.0/DB_M_PI)*sin(DB_M_PI/(4.0*beta)) + (1.0 - 2.0/DB_M_PI)*cos(DB_M_PI/(4.0*beta))) * beta/(Ts*DB_M_SQRT2); + } + else { + taps.taps[i] = ((sin((1.0 - beta)*DB_M_PI*t/Ts) + cos((1.0 + beta)*DB_M_PI*t/Ts)*4.0*beta*t/Ts) / ((1.0 - (4.0*beta*t/Ts)*(4.0*beta*t/Ts))*DB_M_PI*t/Ts)) / Ts; + } + } + + return taps; + } + + template + inline tap rootRaisedCosine(int count, double beta, double symbolrate, double samplerate) { + return rootRaisedCosine(count, beta, samplerate / symbolrate); + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/tap.h b/core/src/dsp/taps/tap.h new file mode 100644 index 0000000..b6e6c7a --- /dev/null +++ b/core/src/dsp/taps/tap.h @@ -0,0 +1,29 @@ +#pragma once +#include + +namespace dsp { + template + class tap { + public: + T* taps = NULL; + unsigned int size = 0; + }; + + namespace taps { + template + inline tap alloc(int count) { + tap taps; + taps.size = count; + taps.taps = buffer::alloc(count); + return taps; + } + + template + inline void free(tap& taps) { + if (!taps.taps) { return; } + buffer::free(taps.taps); + taps.taps = NULL; + taps.size = 0; + } + } +} \ No newline at end of file diff --git a/core/src/dsp/taps/windowed_sinc.h b/core/src/dsp/taps/windowed_sinc.h new file mode 100644 index 0000000..98d19f2 --- /dev/null +++ b/core/src/dsp/taps/windowed_sinc.h @@ -0,0 +1,35 @@ +#pragma once +#include "tap.h" +#include "../math/sinc.h" +#include "../math/freq_to_omega.h" +#include "../window/nuttall.h" + +namespace dsp::taps { + template + inline tap windowedSinc(int count, double omega, Func window, double norm = 1.0) { + // Allocate taps + tap taps = taps::alloc(count); + + // Generate using window + double half = (double)count / 2.0; + double corr = norm * omega / DB_M_PI; + + for (int i = 0; i < count; i++) { + double t = (double)i - half + 0.5; + if constexpr (std::is_same_v) { + taps.taps[i] = math::sinc(t * omega) * window(t - half, count) * corr; + } + if constexpr (std::is_same_v) { + complex_t cplx = { math::sinc(t * omega), 0.0f }; + taps.taps[i] = cplx * window(t - half, count) * corr; + } + } + + return taps; + } + + template + inline tap windowedSinc(int count, double cutoff, double samplerate, Func window, double norm = 1.0) { + return windowedSinc(count, math::freqToOmega(cutoff, samplerate), window, norm); + } +} \ No newline at end of file diff --git a/core/src/dsp/window/blackman.h b/core/src/dsp/window/blackman.h new file mode 100644 index 0000000..48afc04 --- /dev/null +++ b/core/src/dsp/window/blackman.h @@ -0,0 +1,9 @@ +#pragma once +#include "cosine.h" + +namespace dsp::window { + inline double blackman(double n, double N) { + const double coefs[] = { 0.42, 0.5, 0.08 }; + return cosine(n, N, coefs, sizeof(coefs) / sizeof(double)); + } +} \ No newline at end of file diff --git a/core/src/dsp/window/blackman_harris.h b/core/src/dsp/window/blackman_harris.h new file mode 100644 index 0000000..e92d353 --- /dev/null +++ b/core/src/dsp/window/blackman_harris.h @@ -0,0 +1,10 @@ +#pragma once +#include +#include "cosine.h" + +namespace dsp::window { + inline double blackmanHarris(double n, double N) { + const double coefs[] = { 0.35875, 0.48829, 0.14128, 0.01168 }; + return cosine(n, N, coefs, sizeof(coefs) / sizeof(double)); + } +} \ No newline at end of file diff --git a/core/src/dsp/window/blackman_nuttall.h b/core/src/dsp/window/blackman_nuttall.h new file mode 100644 index 0000000..09dd29d --- /dev/null +++ b/core/src/dsp/window/blackman_nuttall.h @@ -0,0 +1,10 @@ +#pragma once +#include +#include "cosine.h" + +namespace dsp::window { + inline double blackmanNuttall(double n, double N) { + const double coefs[] = { 0.3635819, 0.4891775, 0.1365995, 0.0106411 }; + return cosine(n, N, coefs, sizeof(coefs) / sizeof(double)); + } +} \ No newline at end of file diff --git a/core/src/dsp/window/cosine.h b/core/src/dsp/window/cosine.h new file mode 100644 index 0000000..3223a7f --- /dev/null +++ b/core/src/dsp/window/cosine.h @@ -0,0 +1,17 @@ +#pragma once +#include +#include +#include "../math/constants.h" + +namespace dsp::window { + inline double cosine(double n, double N, const double* coefs, int coefCount) { + assert(coefCount > 0); + double win = 0.0; + double sign = 1.0; + for (int i = 0; i < coefCount; i++) { + win += sign * coefs[i] * cos((double)i * 2.0 * DB_M_PI * n / N); + sign = -sign; + } + return win; + } +} \ No newline at end of file diff --git a/core/src/dsp/window/hamming.h b/core/src/dsp/window/hamming.h new file mode 100644 index 0000000..acad750 --- /dev/null +++ b/core/src/dsp/window/hamming.h @@ -0,0 +1,9 @@ +#pragma once +#include "cosine.h" + +namespace dsp::window { + inline double hamming(double n, double N) { + const double coefs[] = { 0.54, 0.46 }; + return cosine(n, N, coefs, sizeof(coefs) / sizeof(double)); + } +} \ No newline at end of file diff --git a/core/src/dsp/window/hann.h b/core/src/dsp/window/hann.h new file mode 100644 index 0000000..51c9545 --- /dev/null +++ b/core/src/dsp/window/hann.h @@ -0,0 +1,9 @@ +#pragma once +#include "cosine.h" + +namespace dsp::window { + inline double hann(double n, double N) { + const double coefs[] = { 0.5, 0.5 }; + return cosine(n, N, coefs, sizeof(coefs) / sizeof(double)); + } +} \ No newline at end of file diff --git a/core/src/dsp/window/nuttall.h b/core/src/dsp/window/nuttall.h new file mode 100644 index 0000000..904ae6e --- /dev/null +++ b/core/src/dsp/window/nuttall.h @@ -0,0 +1,9 @@ +#pragma once +#include "cosine.h" + +namespace dsp::window { + inline double nuttall(double n, double N) { + const double coefs[] = { 0.355768, 0.487396, 0.144232, 0.012604 }; + return cosine(n, N, coefs, sizeof(coefs) / sizeof(double)); + } +} \ No newline at end of file diff --git a/core/src/dsp/window/rectangular.h b/core/src/dsp/window/rectangular.h new file mode 100644 index 0000000..bdb282b --- /dev/null +++ b/core/src/dsp/window/rectangular.h @@ -0,0 +1,8 @@ +#pragma once +#include "cosine.h" + +namespace dsp::window { + inline double rectangular(double n, double N) { + return 1.0; + } +} \ No newline at end of file diff --git a/core/src/signal_path/iq_frontend.cpp b/core/src/signal_path/iq_frontend.cpp new file mode 100644 index 0000000..6c29eaf --- /dev/null +++ b/core/src/signal_path/iq_frontend.cpp @@ -0,0 +1,303 @@ +#include "iq_frontend.h" +#include "../dsp/window/blackman.h" +#include "../dsp/window/nuttall.h" +#include +#include +#include + +IQFrontEnd::~IQFrontEnd() { + if (!_init) { return; } + stop(); + dsp::buffer::free(fftWindowBuf); + fftwf_destroy_plan(fftwPlan); + fftwf_free(fftInBuf); + fftwf_free(fftOutBuf); +} + +void IQFrontEnd::init(dsp::stream* in, double sampleRate, bool buffering, int decimRatio, bool dcBlocking, int fftSize, double fftRate, FFTWindow fftWindow, float* (*acquireFFTBuffer)(void* ctx), void (*releaseFFTBuffer)(void* ctx), void* fftCtx) { + _sampleRate = sampleRate; + _decimRatio = decimRatio; + _fftSize = fftSize; + _fftRate = fftRate; + _fftWindow = fftWindow; + _acquireFFTBuffer = acquireFFTBuffer; + _releaseFFTBuffer = releaseFFTBuffer; + _fftCtx = fftCtx; + + effectiveSr = _sampleRate / _decimRatio; + + inBuf.init(in); + inBuf.bypass = !buffering; + + decim.init(NULL, _decimRatio); + dcBlock.init(NULL, genDCBlockRate(effectiveSr)); + + preproc.init(&inBuf.out); + preproc.addBlock(&decim, _decimRatio > 1); + preproc.addBlock(&dcBlock, dcBlocking); + + split.init(preproc.out); + + // TODO: Do something to avoid basically repeating this code twice + int skip; + genReshapeParams(effectiveSr, _fftSize, _fftRate, skip, _nzFFTSize); + reshape.init(&fftIn, fftSize, skip); + fftSink.init(&reshape.out, handler, this); + + fftWindowBuf = dsp::buffer::alloc(_nzFFTSize); + if (_fftWindow == FFTWindow::RECTANGULAR) { + for (int i = 0; i < _nzFFTSize; i++) { fftWindowBuf[i] = 0; } + } + else if (_fftWindow == FFTWindow::BLACKMAN) { + for (int i = 0; i < _nzFFTSize; i++) { fftWindowBuf[i] = dsp::window::blackman(i, _nzFFTSize); } + } + else if (_fftWindow == FFTWindow::NUTTALL) { + for (int i = 0; i < _nzFFTSize; i++) { fftWindowBuf[i] = dsp::window::nuttall(i, _nzFFTSize); } + } + + fftInBuf = (fftwf_complex*)fftwf_malloc(_fftSize * sizeof(fftwf_complex)); + fftOutBuf = (fftwf_complex*)fftwf_malloc(_fftSize * sizeof(fftwf_complex)); + fftwPlan = fftwf_plan_dft_1d(_fftSize, fftInBuf, fftOutBuf, FFTW_FORWARD, FFTW_ESTIMATE); + + // Clear the rest of the FFT input buffer + dsp::buffer::clear(fftInBuf, _fftSize - _nzFFTSize, _nzFFTSize); + + split.bindStream(&fftIn); + + _init = true; +} + +void IQFrontEnd::setInput(dsp::stream* in) { + inBuf.setInput(in); +} + +void IQFrontEnd::setSampleRate(double sampleRate) { + // Temp stop the necessary blocks + dcBlock.tempStop(); + for (auto& [name, vfo] : vfos) { + vfo->tempStop(); + } + + // Update the samplerate + _sampleRate = sampleRate; + effectiveSr = _sampleRate / _decimRatio; + dcBlock.setRate(genDCBlockRate(effectiveSr)); + for (auto& [name, vfo] : vfos) { + vfo->setInSamplerate(effectiveSr); + } + + // Reconfigure the FFT + updateFFTPath(); + + // Restart blocks + dcBlock.tempStart(); + for (auto& [name, vfo] : vfos) { + vfo->tempStart(); + } +} + +void IQFrontEnd::setBuffering(bool enabled) { + inBuf.bypass = !enabled; +} + +void IQFrontEnd::setDecimation(int ratio) { + // Temp stop the decimator + decim.tempStop(); + + // Update the decimation ratio + _decimRatio = ratio; + if (_decimRatio > 1) { decim.setRatio(_decimRatio); } + setSampleRate(_sampleRate); + + // Restart the decimator if it was running + decim.tempStart(); + + // Enable or disable in the chain + preproc.setBlockEnabled(&decim, _decimRatio > 1, [=](dsp::stream* out){ split.setInput(out); }); + + // Update the DSP sample rate (TODO: Find a way to get rid of this) + core::setInputSampleRate(_sampleRate); +} + +void IQFrontEnd::setDCBlocking(bool enabled) { + preproc.setBlockEnabled(&dcBlock, enabled, [=](dsp::stream* out){ split.setInput(out); }); +} + +void IQFrontEnd::bindIQStream(dsp::stream* stream) { + split.bindStream(stream); +} + +void IQFrontEnd::unbindIQStream(dsp::stream* stream) { + split.unbindStream(stream); +} + +dsp::channel::RxVFO* IQFrontEnd::addVFO(std::string name, double sampleRate, double bandwidth, double offset) { + // Make sure no other VFO with that name already exists + if (vfos.find(name) != vfos.end()) { + spdlog::error("[IQFrontEnd] Tried to add VFO with existing name."); + return NULL; + } + + // Create VFO and its input stream + dsp::stream* vfoIn = new dsp::stream; + dsp::channel::RxVFO* vfo = new dsp::channel::RxVFO(vfoIn, effectiveSr, sampleRate, bandwidth, offset); + + // Register them + vfoStreams[name] = vfoIn; + vfos[name] = vfo; + bindIQStream(vfoIn); + + // Start VFO + vfo->start(); + + return vfo; +} + +void IQFrontEnd::removeVFO(std::string name) { + // Make sure that a VFO with that name exists + if (vfos.find(name) == vfos.end()) { + spdlog::error("[IQFrontEnd] Tried to remove a VFO that doesn't exist."); + return; + } + + // Remove the VFO and stream from registry + dsp::stream* vfoIn = vfoStreams[name]; + dsp::channel::RxVFO* vfo = vfos[name]; + + // Stop the VFO + vfo->stop(); + + unbindIQStream(vfoIn); + vfoStreams.erase(name); + vfos.erase(name); + + // Delete the VFO and its input stream + delete vfo; + delete vfoIn; +} + +void IQFrontEnd::setFFTSize(int size) { + _fftSize = size; + updateFFTPath(); +} + +void IQFrontEnd::setFFTRate(double rate) { + _fftRate = rate; + updateFFTPath(); +} + +void IQFrontEnd::setFFTWindow(FFTWindow fftWindow) { + _fftWindow = fftWindow; + updateFFTPath(); +} + +void IQFrontEnd::flushInputBuffer() { + inBuf.flush(); +} + +void IQFrontEnd::start() { + // Start input buffer + inBuf.start(); + + // Start pre-proc chain (automatically start all bound blocks) + preproc.start(); + + // Start IQ splitter + split.start(); + + // Start all VFOs + for (auto& [name, vfo] : vfos) { + vfo->start(); + } + + // Start FFT chain + reshape.start(); + fftSink.start(); +} + +void IQFrontEnd::stop() { + // Stop input buffer + inBuf.stop(); + + // Stop pre-proc chain (automatically start all bound blocks) + preproc.stop(); + + // Stop IQ splitter + split.stop(); + + // Stop all VFOs + for (auto& [name, vfo] : vfos) { + vfo->stop(); + } + + // Stop FFT chain + reshape.stop(); + fftSink.stop(); +} + +double IQFrontEnd::getEffectiveSamplerate() { + return effectiveSr; +} + +void IQFrontEnd::handler(dsp::complex_t* data, int count, void* ctx) { + IQFrontEnd* _this = (IQFrontEnd*)ctx; + + // Apply window + volk_32fc_32f_multiply_32fc((lv_32fc_t*)_this->fftInBuf, (lv_32fc_t*)data, _this->fftWindowBuf, _this->_nzFFTSize); + + // Execute FFT + fftwf_execute(_this->fftwPlan); + + // Aquire buffer + float* fftBuf = _this->_acquireFFTBuffer(_this->_fftCtx); + + // Convert the complex output of the FFT to dB amplitude + if (fftBuf) { + volk_32fc_s32f_power_spectrum_32f(fftBuf, (lv_32fc_t*)_this->fftOutBuf, _this->_fftSize, _this->_fftSize); + } + + // Release buffer + _this->_releaseFFTBuffer(_this->_fftCtx); +} + +void IQFrontEnd::updateFFTPath() { + // Temp stop branch + reshape.tempStop(); + fftSink.tempStop(); + + // Update reshaper settings + int skip; + genReshapeParams(effectiveSr, _fftSize, _fftRate, skip, _nzFFTSize); + reshape.setKeep(_nzFFTSize); + reshape.setSkip(skip); + + // Update window + dsp::buffer::free(fftWindowBuf); + fftWindowBuf = dsp::buffer::alloc(_nzFFTSize); + if (_fftWindow == FFTWindow::RECTANGULAR) { + for (int i = 0; i < _nzFFTSize; i++) { fftWindowBuf[i] = 1.0f * ((i % 2) ? -1.0f : 1.0f); } + } + else if (_fftWindow == FFTWindow::BLACKMAN) { + for (int i = 0; i < _nzFFTSize; i++) { fftWindowBuf[i] = dsp::window::blackman(i, _nzFFTSize) * ((i % 2) ? -1.0f : 1.0f); } + } + else if (_fftWindow == FFTWindow::NUTTALL) { + for (int i = 0; i < _nzFFTSize; i++) { fftWindowBuf[i] = dsp::window::nuttall(i, _nzFFTSize) * ((i % 2) ? -1.0f : 1.0f); } + } + + // Update FFT plan + fftwf_free(fftInBuf); + fftwf_free(fftOutBuf); + fftInBuf = (fftwf_complex*)fftwf_malloc(_fftSize * sizeof(fftwf_complex)); + fftOutBuf = (fftwf_complex*)fftwf_malloc(_fftSize * sizeof(fftwf_complex)); + fftwPlan = fftwf_plan_dft_1d(_fftSize, fftInBuf, fftOutBuf, FFTW_FORWARD, FFTW_ESTIMATE); + + // Clear the rest of the FFT input buffer + dsp::buffer::clear(fftInBuf, _fftSize - _nzFFTSize, _nzFFTSize); + + // Update waterfall (TODO: This is annoying, it makes this module non testable and will constantly clear the waterfall for any reason) + gui::waterfall.setRawFFTSize(_fftSize); + + // Restart branch + reshape.tempStart(); + fftSink.tempStart(); +} \ No newline at end of file diff --git a/core/src/signal_path/iq_frontend.h b/core/src/signal_path/iq_frontend.h new file mode 100644 index 0000000..fedce21 --- /dev/null +++ b/core/src/signal_path/iq_frontend.h @@ -0,0 +1,104 @@ +#pragma once +#include "../dsp/buffer/frame_buffer.h" +#include "../dsp/buffer/reshaper.h" +#include "../dsp/multirate/power_decimator.h" +#include "../dsp/correction/dc_blocker.h" +#include "../dsp/chain.h" +#include "../dsp/routing/splitter.h" +#include "../dsp/channel/rx_vfo.h" +#include "../dsp/sink/handler_sink.h" +#include + +class IQFrontEnd { +public: + ~IQFrontEnd(); + + enum FFTWindow { + RECTANGULAR, + BLACKMAN, + NUTTALL + }; + + void init(dsp::stream* in, double sampleRate, bool buffering, int decimRatio, bool dcBlocking, int fftSize, double fftRate, FFTWindow fftWindow, float* (*acquireFFTBuffer)(void* ctx), void (*releaseFFTBuffer)(void* ctx), void* fftCtx); + + void setInput(dsp::stream* in); + void setSampleRate(double sampleRate); + inline double getSampleRate() { return _sampleRate; } + + void setBuffering(bool enabled); + void setDecimation(int ratio); + void setDCBlocking(bool enabled); + + void bindIQStream(dsp::stream* stream); + void unbindIQStream(dsp::stream* stream); + + dsp::channel::RxVFO* addVFO(std::string name, double sampleRate, double bandwidth, double offset); + void removeVFO(std::string name); + + void setFFTSize(int size); + void setFFTRate(double rate); + void setFFTWindow(FFTWindow fftWindow); + + void flushInputBuffer(); + + void start(); + void stop(); + + double getEffectiveSamplerate(); + +protected: + static void handler(dsp::complex_t* data, int count, void* ctx); + void updateFFTPath(); + + static inline double genDCBlockRate(double sampleRate) { + return 50.0 / sampleRate; + } + + static inline void genReshapeParams(double sampleRate, int size, double rate, int& skip, int& nzSampCount) { + int fftInterval = round(sampleRate / rate); + nzSampCount = std::min(fftInterval, size); + skip = fftInterval - nzSampCount; + } + + // Input buffer + dsp::buffer::SampleFrameBuffer inBuf; + + // Pre-processing chain + dsp::multirate::PowerDecimator decim; + dsp::correction::DCBlocker dcBlock; + dsp::chain preproc; + + // Splitting + dsp::routing::Splitter split; + + // FFT + dsp::stream fftIn; + dsp::buffer::Reshaper reshape; + dsp::sink::Handler fftSink; + + // VFOs + std::map*> vfoStreams; + std::map vfos; + + // Parameters + double _sampleRate; + double _decimRatio; + int _fftSize; + double _fftRate; + FFTWindow _fftWindow; + float* (*_acquireFFTBuffer)(void* ctx); + void (*_releaseFFTBuffer)(void* ctx); + void* _fftCtx; + + // Processing data + int _nzFFTSize; + float* fftWindowBuf; + fftwf_complex *fftInBuf, *fftOutBuf; + fftwf_plan fftwPlan; + float* fftDbOut; + + double effectiveSr; + + bool _init = false; + +}; \ No newline at end of file From 36adc102eea59351eab384e0758b78aef8539660 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 17:34:23 +0200 Subject: [PATCH 03/39] attemt at a CI build with new DSP --- .github/workflows/build_all.yml | 6 +- core/src/dsp/bench/peak_level_meter.h | 14 +++- core/src/dsp/channel/rx_vfo.h | 8 +-- core/src/dsp/demod/am.h | 7 +- core/src/dsp/demod/broadcast_fm.h | 71 ++++++++++++++++--- core/src/dsp/demod/ssb.h | 2 +- core/src/dsp/loop/agc.h | 45 +++++++++--- core/src/dsp/loop/phase_control_loop.h | 5 ++ core/src/dsp/loop/pll.h | 10 +++ core/src/dsp/math/delay.h | 2 +- core/src/dsp/multirate/power_decimator.h | 4 +- core/src/dsp/multirate/rational_resampler.h | 4 +- core/src/dsp/routing/stream_link.h | 44 ++++++++++++ core/src/dsp/taps/band_pass.h | 9 ++- core/src/dsp/taps/high_pass.h | 6 +- core/src/dsp/taps/low_pass.h | 6 +- core/src/version.h | 2 +- decoder_modules/radio/src/demodulators/am.h | 2 +- decoder_modules/radio/src/demodulators/cw.h | 2 +- decoder_modules/radio/src/demodulators/dsb.h | 2 +- decoder_modules/radio/src/demodulators/lsb.h | 2 +- decoder_modules/radio/src/demodulators/usb.h | 2 +- decoder_modules/radio/src/demodulators/wfm.h | 4 ++ docker_builds/debian_bullseye/do_build.sh | 2 +- docker_builds/debian_buster/do_build.sh | 2 +- docker_builds/debian_sid/do_build.sh | 2 +- docker_builds/ubuntu_bionic/do_build.sh | 2 +- docker_builds/ubuntu_focal/do_build.sh | 2 +- docker_builds/ubuntu_hirsute/do_build.sh | 2 +- docker_builds/ubuntu_impish/do_build.sh | 2 +- docker_builds/ubuntu_jammy/do_build.sh | 2 +- misc_modules/frequency_manager/src/main.cpp | 1 + misc_modules/recorder/src/main.cpp | 30 ++++---- sink_modules/network_sink/src/main.cpp | 13 ++-- sink_modules/new_portaudio_sink/src/main.cpp | 8 +-- .../sdrpp_server_source/src/main.cpp | 12 ++-- .../src/sdrpp_server_client.cpp | 2 +- .../src/sdrpp_server_client.h | 10 +-- 38 files changed, 259 insertions(+), 92 deletions(-) create mode 100644 core/src/dsp/routing/stream_link.h diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index c3316f7..0dee4f9 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -58,7 +58,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON + run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF - name: Build working-directory: ${{runner.workspace}}/build @@ -106,7 +106,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release + run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release - name: Build working-directory: ${{runner.workspace}}/build @@ -309,7 +309,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON + run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF - name: Build working-directory: ${{runner.workspace}}/build diff --git a/core/src/dsp/bench/peak_level_meter.h b/core/src/dsp/bench/peak_level_meter.h index 64817d1..aaea6db 100644 --- a/core/src/dsp/bench/peak_level_meter.h +++ b/core/src/dsp/bench/peak_level_meter.h @@ -3,12 +3,22 @@ namespace dsp::bench { template - class PeakLevelMeter : Sink { + class PeakLevelMeter : public Sink { using base_type = Sink; public: PeakLevelMeter() {} - PeakLevelMeter(stream* in) { base_type::init(in); } + PeakLevelMeter(stream* in) { init(in); } + + void init(stream* in) { + if constexpr (std::is_same_v) { + level = 0.0f; + } + if constexpr (std::is_same_v || std::is_same_v) { + level = { 0.0f, 0.0f }; + } + base_type::init(in); + } T getLevel() { return level; diff --git a/core/src/dsp/channel/rx_vfo.h b/core/src/dsp/channel/rx_vfo.h index e1c6a20..556c1f9 100644 --- a/core/src/dsp/channel/rx_vfo.h +++ b/core/src/dsp/channel/rx_vfo.h @@ -82,12 +82,12 @@ namespace dsp::channel { } inline int process(int count, const complex_t* in, complex_t* out) { - xlator.process(count, in, xlator.out.writeBuf); + xlator.process(count, in, out); if (!filterNeeded) { - return resamp.process(count, xlator.out.writeBuf, out); + return resamp.process(count, out, out); } - count = resamp.process(count, xlator.out.writeBuf, resamp.out.writeBuf); - filter.process(count, resamp.out.writeBuf, out); + count = resamp.process(count, out, out); + filter.process(count, out, out); return count; } diff --git a/core/src/dsp/demod/am.h b/core/src/dsp/demod/am.h index a7949e7..e385cf9 100644 --- a/core/src/dsp/demod/am.h +++ b/core/src/dsp/demod/am.h @@ -18,8 +18,8 @@ namespace dsp::demod { void init(stream* in, AGCMode agcMode, double agcRate) { _agcMode = agcMode; - carrierAgc.init(NULL, 1.0, agcRate); - audioAgc.init(NULL, 1.0, agcRate); + carrierAgc.init(NULL, 1.0, agcRate, 10e6, 10.0); + audioAgc.init(NULL, 1.0, agcRate, 10e6, 10.0); base_type::init(in); } @@ -63,6 +63,9 @@ namespace dsp::demod { if (_agcMode == AGCMode::AUDIO) { audioAgc.process(count, out, out); } + else { + volk_32f_s32f_add_32f(out, out, -1.0f, count); + } return count; } diff --git a/core/src/dsp/demod/broadcast_fm.h b/core/src/dsp/demod/broadcast_fm.h index 81061c1..54c2c01 100644 --- a/core/src/dsp/demod/broadcast_fm.h +++ b/core/src/dsp/demod/broadcast_fm.h @@ -1,5 +1,6 @@ #pragma once #include "fm.h" +#include "../taps/low_pass.h" #include "../taps/band_pass.h" #include "../filter/fir.h" #include "../loop/pll.h" @@ -18,7 +19,7 @@ namespace dsp::demod { public: BroadcastFM() {} - BroadcastFM(stream* in, double deviation, double samplerate, bool stereo = true) { init(in, deviation, samplerate, stereo); } + BroadcastFM(stream* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true) { init(in, deviation, samplerate, stereo, lowPass); } ~BroadcastFM() { if (!base_type::_block_init) { return; } @@ -26,19 +27,26 @@ namespace dsp::demod { buffer::free(lmr); buffer::free(l); buffer::free(r); + taps::free(pilotFirTaps); + taps::free(audioFirTaps); } - virtual void init(stream* in, double deviation, double samplerate, bool stereo = true) { + virtual void init(stream* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true) { _deviation = deviation; _samplerate = samplerate; _stereo = stereo; + _lowPass = lowPass; demod.init(NULL, _deviation, _samplerate); - pilotFirTaps = taps::bandPass(18750.0, 19250.0, 3000.0, _samplerate); + pilotFirTaps = taps::bandPass(18750.0, 19250.0, 3000.0, _samplerate, true); pilotFir.init(NULL, pilotFirTaps); rtoc.init(NULL); - pilotPLL.init(NULL, 0.1/*TODO: adapt to samplerate*/, 0.0, math::freqToOmega(19000.0, _samplerate), math::freqToOmega(18750.0, _samplerate), math::freqToOmega(19250.0, _samplerate)); - delay.init(NULL, pilotFirTaps.size / 2.0); + pilotPLL.init(NULL, 25000.0 / _samplerate, 0.0, math::freqToOmega(19000.0, _samplerate), math::freqToOmega(18750.0, _samplerate), math::freqToOmega(19250.0, _samplerate)); + lprDelay.init(NULL, ((pilotFirTaps.size - 1) / 2) + 1); + lmrDelay.init(NULL, ((pilotFirTaps.size - 1) / 2) + 1); + audioFirTaps = taps::lowPass(15000.0, 4000.0, _samplerate); + alFir.init(NULL, audioFirTaps); + arFir.init(NULL, audioFirTaps); lmr = buffer::alloc(STREAM_BUFFER_SIZE); l = buffer::alloc(STREAM_BUFFER_SIZE); @@ -62,11 +70,18 @@ namespace dsp::demod { demod.setDeviation(_deviation, _samplerate); taps::free(pilotFirTaps); - pilotFirTaps = taps::bandPass(18750.0, 19250.0, 3000.0, samplerate); + pilotFirTaps = taps::bandPass(18750.0, 19250.0, 3000.0, samplerate, true); pilotFir.setTaps(pilotFirTaps); + pilotPLL.setFrequencyLimits(math::freqToOmega(18750.0, _samplerate), math::freqToOmega(19250.0, _samplerate)); pilotPLL.setInitialFreq(math::freqToOmega(19000.0, _samplerate)); - delay.setDelay(pilotFirTaps.size / 2); + lprDelay.setDelay(((pilotFirTaps.size - 1) / 2) + 1); + lmrDelay.setDelay(((pilotFirTaps.size - 1) / 2) + 1); + + taps::free(audioFirTaps); + audioFirTaps = taps::lowPass(15000.0, 4000.0, _samplerate); + alFir.setTaps(audioFirTaps); + arFir.setTaps(audioFirTaps); reset(); base_type::tempStart(); @@ -81,6 +96,15 @@ namespace dsp::demod { base_type::tempStart(); } + void setLowPass(bool lowPass) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _lowPass = lowPass; + reset(); + base_type::tempStart(); + } + void reset() { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -88,7 +112,10 @@ namespace dsp::demod { demod.reset(); pilotFir.reset(); pilotPLL.reset(); - delay.reset(); + lprDelay.reset(); + lmrDelay.reset(); + alFir.reset(); + arFir.reset(); base_type::tempStart(); } @@ -103,21 +130,40 @@ namespace dsp::demod { pilotFir.process(count, rtoc.out.writeBuf, pilotFir.out.writeBuf); pilotPLL.process(count, pilotFir.out.writeBuf, pilotPLL.out.writeBuf); - // Conjugate PLL output to down convert the L-R signal + // Delay + lprDelay.process(count, demod.out.writeBuf, demod.out.writeBuf); + lmrDelay.process(count, rtoc.out.writeBuf, rtoc.out.writeBuf); + + // Double and conjugate PLL output to down convert the L-R signal + math::Multiply::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); math::Conjugate::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf); // Convert output back to real for further processing convert::ComplexToReal::process(count, rtoc.out.writeBuf, lmr); + // Amplify by 2x + volk_32f_s32f_multiply_32f(lmr, lmr, 2.0f, count); + // Do L = (L+R) + (L-R), R = (L+R) - (L-R) math::Add::process(count, demod.out.writeBuf, lmr, l); math::Subtract::process(count, demod.out.writeBuf, lmr, r); + // Filter if needed + if (_lowPass) { + alFir.process(count, l, l); + arFir.process(count, r, r); + } + // Interleave into stereo convert::LRToStereo::process(count, l, r, out); } else { + // Filter if needed + if (_lowPass) { + alFir.process(count, demod.out.writeBuf, demod.out.writeBuf); + } + // Interleave raw MPX to stereo convert::LRToStereo::process(count, demod.out.writeBuf, demod.out.writeBuf, out); } @@ -140,13 +186,18 @@ namespace dsp::demod { double _deviation; double _samplerate; bool _stereo; + bool _lowPass = true; FM demod; tap pilotFirTaps; filter::FIR pilotFir; convert::RealToComplex rtoc; loop::PLL pilotPLL; - math::Delay delay; + math::Delay lprDelay; + math::Delay lmrDelay; + tap audioFirTaps; + filter::FIR arFir; + filter::FIR alFir; float* lmr; float* l; diff --git a/core/src/dsp/demod/ssb.h b/core/src/dsp/demod/ssb.h index fd7e21c..ed4378b 100644 --- a/core/src/dsp/demod/ssb.h +++ b/core/src/dsp/demod/ssb.h @@ -32,7 +32,7 @@ namespace dsp::demod { _bandwidth = bandwidth; _samplerate = samplerate; xlator.init(NULL, getTranslation(), _samplerate); - agc.init(NULL, 1.0, agcRate); + agc.init(NULL, 1.0, agcRate, 10e6, 10.0); base_type::init(in); } diff --git a/core/src/dsp/loop/agc.h b/core/src/dsp/loop/agc.h index 0463132..1cd58ab 100644 --- a/core/src/dsp/loop/agc.h +++ b/core/src/dsp/loop/agc.h @@ -8,11 +8,14 @@ namespace dsp::loop { public: AGC() {} - AGC(stream* in) { init(in); } + AGC(stream* in, double setPoint, double rate, double maxGain, double maxOutputAmp, double initGain = 1.0) { init(in, setPoint, rate, maxGain, maxOutputAmp, initGain); } - void init(stream* in, double setPoint, double rate, double initGain = 1.0) { + void init(stream* in, double setPoint, double rate, double maxGain, double maxOutputAmp, double initGain = 1.0) { _setPoint = setPoint; _rate = rate; + _invRate = 1.0f - _rate; + _maxGain = maxGain; + _maxOutputAmp = maxOutputAmp; _initGain = initGain; gain = _initGain; base_type::init(in); @@ -28,6 +31,19 @@ namespace dsp::loop { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); _rate = rate; + _invRate = 1.0f - _rate; + } + + void setMaxGain(double maxGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _maxGain = maxGain; + } + + void setMaxOutputAmp(double maxOutputAmp) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _maxOutputAmp = maxOutputAmp; } void setInitialGain(double initGain) { @@ -40,22 +56,29 @@ namespace dsp::loop { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); gain = _initGain; + amp = 1.0f; } inline int process(int count, T* in, T* out) { for (int i = 0; i < count; i++) { - // Scale output by gain - out[i] = in[i] * gain; - - // Update gain according to setpoint and rate + // Get signal amplitude + float inAmp; if constexpr (std::is_same_v) { - gain += (_setPoint - out[i].amplitude()) * _rate; + inAmp = in[i].amplitude(); } if constexpr (std::is_same_v) { - gain += (_setPoint - fabsf(out[i])) * _rate; + inAmp = fabsf(in[i]); } + + // Update average amplitude + if (inAmp != 0.0f) { + amp = (amp * _invRate) + (inAmp * _rate); + gain = std::min(_setPoint / amp, _maxGain); + } + + // Scale output by gain + out[i] = in[i] * gain; } - printf("%f\n", gain); return count; } @@ -73,9 +96,13 @@ namespace dsp::loop { protected: float _setPoint; float _rate; + float _invRate; + float _maxGain; + float _maxOutputAmp; float _initGain; float gain; + float amp = 1.0; }; } \ No newline at end of file diff --git a/core/src/dsp/loop/phase_control_loop.h b/core/src/dsp/loop/phase_control_loop.h index 7c9063d..2ad3215 100644 --- a/core/src/dsp/loop/phase_control_loop.h +++ b/core/src/dsp/loop/phase_control_loop.h @@ -35,6 +35,11 @@ namespace dsp::loop { beta = (4 * bandwidth * bandwidth) / denominator; } + void setCoefficients(T alpha, T beta) { + _alpha = alpha: + _beta = beta; + } + void setPhaseLimits(T minPhase, T maxPhase) { assert(maxPhase > minPhase); _minPhase = minPhase; diff --git a/core/src/dsp/loop/pll.h b/core/src/dsp/loop/pll.h index afb98f4..d3b9c19 100644 --- a/core/src/dsp/loop/pll.h +++ b/core/src/dsp/loop/pll.h @@ -24,6 +24,16 @@ namespace dsp::loop { base_type::init(in); } + void setBandwidth(double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + float alpha, beta; + PhaseControlLoop::criticallyDamped(bandwidth, alpha, beta); + + base_type::tempStart(); + } + void setInitialPhase(double initPhase) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); diff --git a/core/src/dsp/math/delay.h b/core/src/dsp/math/delay.h index 508e8e9..2b71ac5 100644 --- a/core/src/dsp/math/delay.h +++ b/core/src/dsp/math/delay.h @@ -19,7 +19,7 @@ namespace dsp::math { void init(stream* in, int delay) { _delay = delay; - buffer = buffer::alloc(STREAM_BUFFER_SIZE + 64000); + buffer = buffer::alloc(STREAM_BUFFER_SIZE + 64000); bufStart = &buffer[_delay]; buffer::clear(buffer, _delay); diff --git a/core/src/dsp/multirate/power_decimator.h b/core/src/dsp/multirate/power_decimator.h index 0ad27b9..f937e25 100644 --- a/core/src/dsp/multirate/power_decimator.h +++ b/core/src/dsp/multirate/power_decimator.h @@ -60,8 +60,8 @@ namespace dsp::multirate { int last = stageCount - 1; for (int i = 0; i < stageCount; i++) { auto fir = decimFirs[i]; - count = fir->process(count, data, (i == last) ? out : fir->out.writeBuf); - data = fir->out.writeBuf; + count = fir->process(count, data, out); + data = out; } return count; } diff --git a/core/src/dsp/multirate/rational_resampler.h b/core/src/dsp/multirate/rational_resampler.h index 5902f24..328cca4 100644 --- a/core/src/dsp/multirate/rational_resampler.h +++ b/core/src/dsp/multirate/rational_resampler.h @@ -63,8 +63,8 @@ namespace dsp::multirate { inline int process(int count, const T* in, T* out) { switch(mode) { case Mode::BOTH: - count = decim.process(count, in, decim.out.writeBuf); - return resamp.process(count, decim.out.writeBuf, out); + count = decim.process(count, in, out); + return resamp.process(count, out, out); case Mode::DECIM_ONLY: return decim.process(count, in, out); case Mode::RESAMP_ONLY: diff --git a/core/src/dsp/routing/stream_link.h b/core/src/dsp/routing/stream_link.h new file mode 100644 index 0000000..4d385ee --- /dev/null +++ b/core/src/dsp/routing/stream_link.h @@ -0,0 +1,44 @@ +#pragma once +#include "../sink.h" + +namespace dsp::routing { + template + class StreamLink : public Sink { + using base_type = Sink; + public: + StreamLink() {} + + StreamLink(stream* in, stream* out) { init(in, out); } + + void init(stream* in, stream* out) { + _out = out; + base_type::registerOutput(_out); + base_type::init(in); + } + + void setOutput(stream* out) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + base_type::unregisterOutput(_out); + _out = out; + base_type::registerOutput(_out); + base_type::tempStart(); + } + + int run() { + int count = _in->read(); + if (count < 0) { return -1; } + + memcpy(_out->writeBuf, _in->readBuf, count * sizeof(T)); + + _in->flush(); + if (!_out->swap(count)) { return -1; } + return count; + } + + protected: + stream* _out; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/taps/band_pass.h b/core/src/dsp/taps/band_pass.h index 9b6fbab..3d8a8eb 100644 --- a/core/src/dsp/taps/band_pass.h +++ b/core/src/dsp/taps/band_pass.h @@ -8,15 +8,18 @@ namespace dsp::taps { template - inline tap bandPass(double bandStart, double bandStop, double transWidth, double sampleRate) { + inline tap bandPass(double bandStart, double bandStop, double transWidth, double sampleRate, bool oddTapCount = false) { assert(bandStop > bandStart); float offsetOmega = math::freqToOmega((bandStart + bandStop) / 2.0, sampleRate); - return windowedSinc(estimateTapCount(transWidth, sampleRate), (bandStop - bandStart) / 2.0, sampleRate, [=](double n, double N) { + int count = estimateTapCount(transWidth, sampleRate); + if (oddTapCount && !(count % 2)) { count++; } + return windowedSinc(count, (bandStop - bandStart) / 2.0, sampleRate, [=](double n, double N) { if constexpr (std::is_same_v) { return cosf(offsetOmega * (float)n) * window::nuttall(n, N); } if constexpr (std::is_same_v) { - return math::phasor(offsetOmega * (float)n) * window::nuttall(n, N); + // The offset is negative to flip the taps. Complex bandpass are asymetric + return math::phasor(-offsetOmega * (float)n) * window::nuttall(n, N); } }); } diff --git a/core/src/dsp/taps/high_pass.h b/core/src/dsp/taps/high_pass.h index 6f92558..88fd7ae 100644 --- a/core/src/dsp/taps/high_pass.h +++ b/core/src/dsp/taps/high_pass.h @@ -4,8 +4,10 @@ #include "../window/nuttall.h" namespace dsp::taps { - inline tap highPass(double cutoff, double transWidth, double sampleRate) { - return windowedSinc(estimateTapCount(transWidth, sampleRate), (sampleRate / 2.0) - cutoff, sampleRate, [=](double n, double N){ + inline tap highPass(double cutoff, double transWidth, double sampleRate, bool oddTapCount = false) { + int count = estimateTapCount(transWidth, sampleRate); + if (oddTapCount && !(count % 2)) { count++; } + return windowedSinc(count, (sampleRate / 2.0) - cutoff, sampleRate, [=](double n, double N){ return window::nuttall(n, N) * (((int)round(n) % 2) ? -1.0f : 1.0f); }); } diff --git a/core/src/dsp/taps/low_pass.h b/core/src/dsp/taps/low_pass.h index 67f6641..1356a9c 100644 --- a/core/src/dsp/taps/low_pass.h +++ b/core/src/dsp/taps/low_pass.h @@ -4,7 +4,9 @@ #include "../window/nuttall.h" namespace dsp::taps { - inline tap lowPass(double cutoff, double transWidth, double sampleRate) { - return windowedSinc(estimateTapCount(transWidth, sampleRate), cutoff, sampleRate, window::nuttall); + inline tap lowPass(double cutoff, double transWidth, double sampleRate, bool oddTapCount = false) { + int count = estimateTapCount(transWidth, sampleRate); + if (oddTapCount && !(count % 2)) { count++; } + return windowedSinc(count, cutoff, sampleRate, window::nuttall); } } \ No newline at end of file diff --git a/core/src/version.h b/core/src/version.h index f1d7294..60ee5ef 100644 --- a/core/src/version.h +++ b/core/src/version.h @@ -1,3 +1,3 @@ #pragma once -#define VERSION_STR "1.0.6" \ No newline at end of file +#define VERSION_STR "1.1.0" \ No newline at end of file diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index a80cd04..808dc7e 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -20,7 +20,7 @@ namespace demod { this->name = name; // Define structure - demod.init(input, dsp::demod::AM::AGCMode::CARRIER, 200000.0 / getIFSampleRate()); + demod.init(input, dsp::demod::AM::AGCMode::CARRIER, 24.0 / getIFSampleRate()); m2s.init(&demod.out); } diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index 11c953c..095167e 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -34,7 +34,7 @@ namespace demod { // Define structure xlator.init(input, tone, getIFSampleRate()); c2r.init(&xlator.out); - agc.init(&c2r.out, 1.0, 200000.0 / getIFSampleRate()); + agc.init(&c2r.out, 1.0, 24.0 / getIFSampleRate(), 10e6, 10.0); m2s.init(&agc.out); } diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index dac1d10..7488c7e 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -20,7 +20,7 @@ namespace demod { this->name = name; // Define structure - demod.init(input, dsp::demod::SSB::Mode::DSB, bandwidth, getIFSampleRate(), 200000.0 / getIFSampleRate()); + demod.init(input, dsp::demod::SSB::Mode::DSB, bandwidth, getIFSampleRate(), 24.0 / getIFSampleRate()); m2s.init(&demod.out); } diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index 53a39b1..bab3450 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -20,7 +20,7 @@ namespace demod { this->name = name; // Define structure - demod.init(input, dsp::demod::SSB::Mode::LSB, bandwidth, getIFSampleRate(), 200000.0 / getIFSampleRate()); + demod.init(input, dsp::demod::SSB::Mode::LSB, bandwidth, getIFSampleRate(), 24.0 / getIFSampleRate()); m2s.init(&demod.out); } diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index eeb35ce..b25456b 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -20,7 +20,7 @@ namespace demod { this->name = name; // Define structure - demod.init(input, dsp::demod::SSB::Mode::USB, bandwidth, getIFSampleRate(), 200000.0 / getIFSampleRate()); + demod.init(input, dsp::demod::SSB::Mode::USB, bandwidth, getIFSampleRate(), 24.0 / getIFSampleRate()); m2s.init(&demod.out); } diff --git a/decoder_modules/radio/src/demodulators/wfm.h b/decoder_modules/radio/src/demodulators/wfm.h index 2291bcb..59d4dbc 100644 --- a/decoder_modules/radio/src/demodulators/wfm.h +++ b/decoder_modules/radio/src/demodulators/wfm.h @@ -47,6 +47,9 @@ namespace demod { _config->conf[name][getName()]["stereo"] = _stereo; _config->release(true); } + if (ImGui::Checkbox(("Low Pass##_radio_wfm_lowpass_" + name).c_str(), &_lowPass)) { + demod.setLowPass(_lowPass); + } } void setBandwidth(double bandwidth) { @@ -93,6 +96,7 @@ namespace demod { ConfigManager* _config = NULL; bool _stereo = false; + bool _lowPass = true; std::string name; EventHandler*> outputChangeHandler; diff --git a/docker_builds/debian_bullseye/do_build.sh b/docker_builds/debian_bullseye/do_build.sh index 05a0a32..224321e 100644 --- a/docker_builds/debian_bullseye/do_build.sh +++ b/docker_builds/debian_bullseye/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/debian_buster/do_build.sh b/docker_builds/debian_buster/do_build.sh index cbefd63..2367bf9 100644 --- a/docker_builds/debian_buster/do_build.sh +++ b/docker_builds/debian_buster/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/debian_sid/do_build.sh b/docker_builds/debian_sid/do_build.sh index 05a0a32..224321e 100644 --- a/docker_builds/debian_sid/do_build.sh +++ b/docker_builds/debian_sid/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_bionic/do_build.sh b/docker_builds/ubuntu_bionic/do_build.sh index 92d0a75..3ac017d 100644 --- a/docker_builds/ubuntu_bionic/do_build.sh +++ b/docker_builds/ubuntu_bionic/do_build.sh @@ -47,7 +47,7 @@ echo 'Cflags: -I/usr/include/codec2' >> /usr/share/pkgconfig/codec2.pc cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_OVERRIDE_STD_FILESYSTEM=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_OVERRIDE_STD_FILESYSTEM=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 # Generate package diff --git a/docker_builds/ubuntu_focal/do_build.sh b/docker_builds/ubuntu_focal/do_build.sh index 05a0a32..224321e 100644 --- a/docker_builds/ubuntu_focal/do_build.sh +++ b/docker_builds/ubuntu_focal/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_hirsute/do_build.sh b/docker_builds/ubuntu_hirsute/do_build.sh index 05a0a32..224321e 100644 --- a/docker_builds/ubuntu_hirsute/do_build.sh +++ b/docker_builds/ubuntu_hirsute/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_impish/do_build.sh b/docker_builds/ubuntu_impish/do_build.sh index 05a0a32..224321e 100644 --- a/docker_builds/ubuntu_impish/do_build.sh +++ b/docker_builds/ubuntu_impish/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_jammy/do_build.sh b/docker_builds/ubuntu_jammy/do_build.sh index 05a0a32..224321e 100644 --- a/docker_builds/ubuntu_jammy/do_build.sh +++ b/docker_builds/ubuntu_jammy/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF make VERBOSE=1 -j2 cd .. diff --git a/misc_modules/frequency_manager/src/main.cpp b/misc_modules/frequency_manager/src/main.cpp index 9c24461..849d3b6 100644 --- a/misc_modules/frequency_manager/src/main.cpp +++ b/misc_modules/frequency_manager/src/main.cpp @@ -12,6 +12,7 @@ #include #include #include +#include SDRPP_MOD_INFO{ /* Name: */ "frequency_manager", diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index 320172d..6d621d4 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -3,7 +3,10 @@ #include #include #include -#include +#include +#include +#include +#include #include #include #include @@ -72,7 +75,7 @@ public: config.release(created); // Init audio path - vol.init(&dummyStream, audioVolume); + vol.init(&dummyStream, audioVolume, false); audioSplit.init(&vol.out); audioSplit.bindStream(&meterStream); meter.init(&meterStream); @@ -269,13 +272,14 @@ private: if (recording) { style::endDisabled(); } double frameTime = 1.0 / ImGui::GetIO().Framerate; - lvlL = std::max(lvlL - (frameTime * 50.0), -90); - lvlR = std::max(lvlR - (frameTime * 50.0), -90); + lvlL = std::clamp(lvlL - (frameTime * 50.0), -90.0f, 10.0f); + lvlR = std::clamp(lvlR - (frameTime * 50.0), -90.0f, 10.0f); - float _lvlL = meter.getLeftLevel(); - float _lvlR = meter.getRightLevel(); - if (_lvlL > lvlL) { lvlL = _lvlL; } - if (_lvlR > lvlR) { lvlR = _lvlR; } + dsp::stereo_t rawLvl = meter.getLevel(); + meter.resetLevel(); + dsp::stereo_t dbLvl = { 10.0f * log10f(rawLvl.l), 10.0f * log10f(rawLvl.r) }; + if (dbLvl.l > lvlL) { lvlL = dbLvl.l; } + if (dbLvl.r > lvlR) { lvlR = dbLvl.r; } ImGui::VolumeMeter(lvlL, lvlL, -60, 10); ImGui::VolumeMeter(lvlR, lvlR, -60, 10); @@ -485,12 +489,12 @@ private: // Audio path dsp::stream* audioInput = NULL; - dsp::Volume vol; - dsp::Splitter audioSplit; + dsp::audio::Volume vol; + dsp::routing::Splitter audioSplit; dsp::stream meterStream; - dsp::LevelMeter meter; + dsp::bench::PeakLevelMeter meter; dsp::stream audioHandlerStream; - dsp::HandlerSink audioHandler; + dsp::sink::Handler audioHandler; WavWriter* audioWriter; std::vector streamNames; @@ -501,7 +505,7 @@ private: // Baseband path dsp::stream basebandStream; - dsp::HandlerSink basebandHandler; + dsp::sink::Handler basebandHandler; WavWriter* basebandWriter; uint64_t samplesWritten; diff --git a/sink_modules/network_sink/src/main.cpp b/sink_modules/network_sink/src/main.cpp index e2b2c58..09b747f 100644 --- a/sink_modules/network_sink/src/main.cpp +++ b/sink_modules/network_sink/src/main.cpp @@ -4,8 +4,9 @@ #include #include #include -#include -#include +#include +#include +#include #include #include #include @@ -271,10 +272,10 @@ private: } SinkManager::Stream* _stream; - dsp::Packer packer; - dsp::StereoToMono s2m; - dsp::HandlerSink monoSink; - dsp::HandlerSink stereoSink; + dsp::buffer::Packer packer; + dsp::convert::StereoToMono s2m; + dsp::sink::Handler monoSink; + dsp::sink::Handler stereoSink; std::string _streamName; diff --git a/sink_modules/new_portaudio_sink/src/main.cpp b/sink_modules/new_portaudio_sink/src/main.cpp index 85bc299..d2af130 100644 --- a/sink_modules/new_portaudio_sink/src/main.cpp +++ b/sink_modules/new_portaudio_sink/src/main.cpp @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -374,8 +374,8 @@ private: std::string selectedDevName; SinkManager::Stream* _stream; - dsp::Packer packer; - dsp::StereoToMono s2m; + dsp::buffer::Packer packer; + dsp::convert::StereoToMono s2m; PaStream* devStream; diff --git a/source_modules/sdrpp_server_source/src/main.cpp b/source_modules/sdrpp_server_source/src/main.cpp index 3493f1c..0eeb7e3 100644 --- a/source_modules/sdrpp_server_source/src/main.cpp +++ b/source_modules/sdrpp_server_source/src/main.cpp @@ -32,10 +32,10 @@ public: if (core::args["server"].b()) { return; } // Initialize lists - sampleTypeList.define("Int8", dsp::PCM_TYPE_I8); - sampleTypeList.define("Int16", dsp::PCM_TYPE_I16); - sampleTypeList.define("Float32", dsp::PCM_TYPE_F32); - sampleTypeId = sampleTypeList.valueId(dsp::PCM_TYPE_I16); + sampleTypeList.define("Int8", dsp::compression::PCM_TYPE_I8); + sampleTypeList.define("Int16", dsp::compression::PCM_TYPE_I16); + sampleTypeList.define("Float32", dsp::compression::PCM_TYPE_F32); + sampleTypeId = sampleTypeList.valueId(dsp::compression::PCM_TYPE_I16); handler.ctx = this; handler.selectHandler = menuSelected; @@ -238,7 +238,7 @@ private: devConfName = buf; // Load settings - sampleTypeId = sampleTypeList.valueId(dsp::PCM_TYPE_I16); + sampleTypeId = sampleTypeList.valueId(dsp::compression::PCM_TYPE_I16); if (config.conf["servers"][devConfName].contains("sampleType")) { std::string key = config.conf["servers"][devConfName]["sampleType"]; if (sampleTypeList.keyExists(key)) { sampleTypeId = sampleTypeList.keyId(key); } @@ -269,7 +269,7 @@ private: dsp::stream stream; SourceManager::SourceHandler handler; - OptionList sampleTypeList; + OptionList sampleTypeList; int sampleTypeId; bool compression = false; diff --git a/source_modules/sdrpp_server_source/src/sdrpp_server_client.cpp b/source_modules/sdrpp_server_source/src/sdrpp_server_client.cpp index cc29de9..6bd0521 100644 --- a/source_modules/sdrpp_server_source/src/sdrpp_server_client.cpp +++ b/source_modules/sdrpp_server_source/src/sdrpp_server_client.cpp @@ -109,7 +109,7 @@ namespace server { return currentSampleRate; } - void ClientClass::setSampleType(dsp::PCMType type) { + void ClientClass::setSampleType(dsp::compression::PCMType type) { s_cmd_data[0] = type; sendCommand(COMMAND_SET_SAMPLE_TYPE, 1); } diff --git a/source_modules/sdrpp_server_source/src/sdrpp_server_client.h b/source_modules/sdrpp_server_source/src/sdrpp_server_client.h index afdba72..d3b75fb 100644 --- a/source_modules/sdrpp_server_source/src/sdrpp_server_client.h +++ b/source_modules/sdrpp_server_source/src/sdrpp_server_client.h @@ -8,9 +8,9 @@ #include #include #include -#include +#include #include -#include +#include #include #define RFSPACE_MAX_SIZE 8192 @@ -85,7 +85,7 @@ namespace server { void setFrequency(double freq); double getSampleRate(); - void setSampleType(dsp::PCMType type); + void setSampleType(dsp::compression::PCMType type); void setCompression(bool enabled); void start(); @@ -115,8 +115,8 @@ namespace server { net::Conn client; dsp::stream decompIn; - dsp::DynamicRangeDecompressor decomp; - dsp::Link link; + dsp::compression::SampleStreamDecompressor decomp; + dsp::routing::StreamLink link; dsp::stream* output; uint8_t* rbuffer = NULL; From c5f30f6d6ae4423df136ea9177c94dc8e8b67f3a Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 17:40:52 +0200 Subject: [PATCH 04/39] bugfix --- core/src/dsp/routing/splitter.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/dsp/routing/splitter.h b/core/src/dsp/routing/splitter.h index 2988bfa..950d61e 100644 --- a/core/src/dsp/routing/splitter.h +++ b/core/src/dsp/routing/splitter.h @@ -42,18 +42,18 @@ namespace dsp::routing { } int run() { - int count = _in->read(); + int count = base_type::_in->read(); if (count < 0) { return -1; } for (const auto& stream : streams) { - memcpy(stream->writeBuf, _in->readBuf, count * sizeof(T)); + memcpy(stream->writeBuf, base_type::_in->readBuf, count * sizeof(T)); if (!stream->swap(count)) { - _in->flush(); + base_type::_in->flush(); return -1; } } - _in->flush(); + base_type::_in->flush(); return count; } From cb59b04b17c91963fb786eba05a8e63a09f6a095 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 17:53:07 +0200 Subject: [PATCH 05/39] more linux bugfix --- core/src/dsp/sink/handler_sink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/dsp/sink/handler_sink.h b/core/src/dsp/sink/handler_sink.h index 925412e..130ed9c 100644 --- a/core/src/dsp/sink/handler_sink.h +++ b/core/src/dsp/sink/handler_sink.h @@ -20,7 +20,7 @@ namespace dsp::sink { int count = base_type::_in->read(); if (count < 0) { return -1; } - _handler(_in->readBuf, count, _ctx); + _handler(base_type::_in->readBuf, count, _ctx); base_type::_in->flush(); return count; From 4f601405a106eb1da831f6bcb6e4979c177d86ce Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 18:01:27 +0200 Subject: [PATCH 06/39] More dumb linux bugfix --- core/src/dsp/routing/stream_link.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/dsp/routing/stream_link.h b/core/src/dsp/routing/stream_link.h index 4d385ee..e838faf 100644 --- a/core/src/dsp/routing/stream_link.h +++ b/core/src/dsp/routing/stream_link.h @@ -27,12 +27,12 @@ namespace dsp::routing { } int run() { - int count = _in->read(); + int count = base_type::_in->read(); if (count < 0) { return -1; } - memcpy(_out->writeBuf, _in->readBuf, count * sizeof(T)); + memcpy(_out->writeBuf, base_type::_in->readBuf, count * sizeof(T)); - _in->flush(); + base_type::_in->flush(); if (!_out->swap(count)) { return -1; } return count; } From ed3f87da29f021eaa9ed83612c61ec20a1b7e933 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 18:12:58 +0200 Subject: [PATCH 07/39] If one more build fails because of a missing namespace imma mc-fucking lose it... --- core/src/dsp/channel/rx_vfo.h | 6 +++--- core/src/dsp/filter/deephasis.h | 2 +- core/src/dsp/noise_reduction/squelch.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/dsp/channel/rx_vfo.h b/core/src/dsp/channel/rx_vfo.h index 556c1f9..9bd933e 100644 --- a/core/src/dsp/channel/rx_vfo.h +++ b/core/src/dsp/channel/rx_vfo.h @@ -92,13 +92,13 @@ namespace dsp::channel { } int run() { - int count = _in->read(); + int count = base_type::_in->read(); if (count < 0) { return -1; } - int outCount = process(count, _in->readBuf, out.writeBuf); + int outCount = process(count, base_type::_in->readBuf, out.writeBuf); // Swap if some data was generated - _in->flush(); + base_type::_in->flush(); if (outCount) { if (!out.swap(outCount)) { return -1; } } diff --git a/core/src/dsp/filter/deephasis.h b/core/src/dsp/filter/deephasis.h index daabae0..5a6df4d 100644 --- a/core/src/dsp/filter/deephasis.h +++ b/core/src/dsp/filter/deephasis.h @@ -79,7 +79,7 @@ namespace dsp::filter { //DEFAULT_PROC_RUN(); int run() { - int count = _in->read(); + int count = base_type::_in->read(); if (count < 0) { return -1; } process(count, base_type::_in->readBuf, base_type::out.writeBuf); base_type::_in->flush(); diff --git a/core/src/dsp/noise_reduction/squelch.h b/core/src/dsp/noise_reduction/squelch.h index f28e7f4..a663bcc 100644 --- a/core/src/dsp/noise_reduction/squelch.h +++ b/core/src/dsp/noise_reduction/squelch.h @@ -40,7 +40,7 @@ namespace dsp::noise_reduction { //DEFAULT_PROC_RUN(); int run() { - int count = _in->read(); + int count = base_type::_in->read(); if (count < 0) { return -1; } process(count, base_type::_in->readBuf, base_type::out.writeBuf); base_type::_in->flush(); From b9e269f9dc4fe4e4c5e4cfdd1c1309a91bc83828 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 18:37:02 +0200 Subject: [PATCH 08/39] roses are red, violets are blue, missing ';' on line 32 --- core/src/dsp/loop/phase_control_loop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/dsp/loop/phase_control_loop.h b/core/src/dsp/loop/phase_control_loop.h index 2ad3215..8099672 100644 --- a/core/src/dsp/loop/phase_control_loop.h +++ b/core/src/dsp/loop/phase_control_loop.h @@ -36,7 +36,7 @@ namespace dsp::loop { } void setCoefficients(T alpha, T beta) { - _alpha = alpha: + _alpha = alpha; _beta = beta; } From e06646367b0d20fa19007bbd9a4677feb5d49a3d Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 18:47:09 +0200 Subject: [PATCH 09/39] another synthax error --- misc_modules/recorder/src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index 6d621d4..5bb58e3 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include #include #include From 9b1ec79d61cb0351e026ce1010161a3d502c01a7 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 19:14:55 +0200 Subject: [PATCH 10/39] more stuff idk at this point$ --- core/src/dsp/demod/am.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/dsp/demod/am.h b/core/src/dsp/demod/am.h index e385cf9..cee5960 100644 --- a/core/src/dsp/demod/am.h +++ b/core/src/dsp/demod/am.h @@ -64,7 +64,10 @@ namespace dsp::demod { audioAgc.process(count, out, out); } else { - volk_32f_s32f_add_32f(out, out, -1.0f, count); + // TODO: Find a volk function for it + for (int i = 0; i < count; i++) { + out[i] -= 1.0; + } } return count; From ccc57cddc7069753e4e5c14998b6adec0be03cb0 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 17 Jun 2022 19:43:16 +0200 Subject: [PATCH 11/39] hopefully the final bugfix --- .github/workflows/build_all.yml | 2 +- make_windows_package.ps1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 0dee4f9..eca6ceb 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -87,7 +87,7 @@ jobs: run: brew update - name: Install dependencies - run: brew install fftw glfw airspy airspyhf portaudio hackrf rtl-sdr libbladerf codec2 && pip3 install mako zstd + run: brew install libusb fftw glfw airspy airspyhf portaudio hackrf rtl-sdr libbladerf codec2 && pip3 install mako zstd - name: Install volk run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ diff --git a/make_windows_package.ps1 b/make_windows_package.ps1 index f6de949..6ab11b8 100644 --- a/make_windows_package.ps1 +++ b/make_windows_package.ps1 @@ -56,10 +56,10 @@ cp $build_dir/sink_modules/network_sink/Release/network_sink.dll sdrpp_windows_x # Copy decoder modules -cp $build_dir/decoder_modules/m17_decoder/Release/m17_decoder.dll sdrpp_windows_x64/modules/ -cp "C:/Program Files/codec2/lib/libcodec2.dll" sdrpp_windows_x64/ +# cp $build_dir/decoder_modules/m17_decoder/Release/m17_decoder.dll sdrpp_windows_x64/modules/ +# cp "C:/Program Files/codec2/lib/libcodec2.dll" sdrpp_windows_x64/ -cp $build_dir/decoder_modules/meteor_demodulator/Release/meteor_demodulator.dll sdrpp_windows_x64/modules/ +# cp $build_dir/decoder_modules/meteor_demodulator/Release/meteor_demodulator.dll sdrpp_windows_x64/modules/ cp $build_dir/decoder_modules/radio/Release/radio.dll sdrpp_windows_x64/modules/ From 1dddbadd046072afb9a85ac799dca562e3152d52 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sat, 18 Jun 2022 00:33:08 +0200 Subject: [PATCH 12/39] More work --- .github/workflows/build_all.yml | 10 ++--- core/src/dsp/demod/am.h | 40 +++++++++++------ core/src/dsp/demod/ssb.h | 42 +++++------------- core/src/dsp/loop/agc.h | 31 ++++++++----- decoder_modules/radio/src/demodulators/am.h | 46 +++++++++++++++++++- decoder_modules/radio/src/demodulators/cw.h | 27 +++++++++++- decoder_modules/radio/src/demodulators/dsb.h | 36 ++++++++++++++- decoder_modules/radio/src/demodulators/lsb.h | 36 ++++++++++++++- decoder_modules/radio/src/demodulators/usb.h | 36 ++++++++++++++- decoder_modules/radio/src/demodulators/wfm.h | 8 +++- 10 files changed, 242 insertions(+), 70 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index eca6ceb..d6f6233 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -95,18 +95,18 @@ jobs: - name: Install SDRplay API run: wget https://www.sdrplay.com/software/SDRplay_RSP_API-MacOSX-3.07.3.pkg && sudo installer -pkg SDRplay_RSP_API-MacOSX-3.07.3.pkg -target / - - name: Install libiio - run: git clone https://github.com/analogdevicesinc/libiio && cd libiio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ + # - name: Install libiio + # run: git clone https://github.com/analogdevicesinc/libiio && cd libiio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ - - name: Install libad9361 - run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ + # - name: Install libad9361 + # run: git clone https://github.com/analogdevicesinc/libad9361-iio && cd libad9361-iio && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ - name: Install LimeSuite run: git clone https://github.com/myriadrf/LimeSuite && cd LimeSuite && mkdir builddir && cd builddir && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../ - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=ON -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release + run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=OFF -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release - name: Build working-directory: ${{runner.workspace}}/build diff --git a/core/src/dsp/demod/am.h b/core/src/dsp/demod/am.h index cee5960..fca79a7 100644 --- a/core/src/dsp/demod/am.h +++ b/core/src/dsp/demod/am.h @@ -1,6 +1,7 @@ #pragma once #include "../processor.h" #include "../loop/agc.h" +#include "../correction/dc_blocker.h" namespace dsp::demod { class AM : public Processor { @@ -13,13 +14,14 @@ namespace dsp::demod { AM() {} - AM(stream* in, AGCMode agcMode, double agcRate) { init(in, agcMode, agcRate); } + AM(stream* in, AGCMode agcMode, double agcAttack, double agcDecay, double dcBlockRate) { init(in, agcMode, agcAttack, agcDecay, dcBlockRate); } - void init(stream* in, AGCMode agcMode, double agcRate) { + void init(stream* in, AGCMode agcMode, double agcAttack, double agcDecay, double dcBlockRate) { _agcMode = agcMode; - carrierAgc.init(NULL, 1.0, agcRate, 10e6, 10.0); - audioAgc.init(NULL, 1.0, agcRate, 10e6, 10.0); + carrierAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); + audioAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); + dcBlock.init(NULL, dcBlockRate); base_type::init(in); } @@ -33,11 +35,24 @@ namespace dsp::demod { base_type::tempStart(); } - void setAGCRate(double agcRate) { + void setAGCAttack(double attack) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); - carrierAgc.setRate(agcRate); - audioAgc.setRate(agcRate); + carrierAgc.setAttack(attack); + audioAgc.setAttack(attack); + } + + void setAGCDecay(double decay) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + carrierAgc.setDecay(decay); + audioAgc.setDecay(decay); + } + + void setDCBlockRate(double rate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + dcBlock.setRate(rate); } void reset() { @@ -46,6 +61,7 @@ namespace dsp::demod { base_type::tempStop(); carrierAgc.reset(); audioAgc.reset(); + dcBlock.reset(); base_type::tempStart(); } @@ -56,19 +72,14 @@ namespace dsp::demod { in = carrierAgc.out.writeBuf; } - // Get magnitude of each sample (TODO: use block instead) + // Get magnitude of each sample and remove DC (TODO: use block instead) volk_32fc_magnitude_32f(out, (lv_32fc_t*)in, count); + dcBlock.process(count, out, out); // Apply audio AGC if needed if (_agcMode == AGCMode::AUDIO) { audioAgc.process(count, out, out); } - else { - // TODO: Find a volk function for it - for (int i = 0; i < count; i++) { - out[i] -= 1.0; - } - } return count; } @@ -89,6 +100,7 @@ namespace dsp::demod { loop::AGC carrierAgc; loop::AGC audioAgc; + correction::DCBlocker dcBlock; }; } \ No newline at end of file diff --git a/core/src/dsp/demod/ssb.h b/core/src/dsp/demod/ssb.h index ed4378b..1d53816 100644 --- a/core/src/dsp/demod/ssb.h +++ b/core/src/dsp/demod/ssb.h @@ -16,29 +16,17 @@ namespace dsp::demod { SSB() {} - /** Calls the init function - */ - SSB(stream* in, Mode mode, double bandwidth, double samplerate, double agcRate) { init(in, mode, bandwidth, samplerate, agcRate); } + SSB(stream* in, Mode mode, double bandwidth, double samplerate, double agcAttack, double agcDecay) { init(in, mode, bandwidth, samplerate, agcAttack, agcDecay); } - /** Initialize the SSB/DSB Demodulator - * \param in Input stream - * \param mode Demodulation mode, can be USB, LSB or DSB - * \param bandwidth Bandwidth needed to shift back the IQ correctly - * \param samplerate Samplerate of the IQ data - * \param agcRate Speed at which the AGC corrects the audio level. This is NOT automatically scaled to the samplerate. - */ - void init(stream* in, Mode mode, double bandwidth, double samplerate, double agcRate) { + void init(stream* in, Mode mode, double bandwidth, double samplerate, double agcAttack, double agcDecay) { _mode = mode; _bandwidth = bandwidth; _samplerate = samplerate; xlator.init(NULL, getTranslation(), _samplerate); - agc.init(NULL, 1.0, agcRate, 10e6, 10.0); + agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); base_type::init(in); } - /** Set demodulation mode - * \param mode Either USB, LSB or DSB - */ void setMode(Mode mode) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -48,9 +36,6 @@ namespace dsp::demod { base_type::tempStart(); } - /** Set bandwidth - * \param bandwidth Bandwidth in Hz - */ void setBandwidth(double bandwidth) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -60,9 +45,6 @@ namespace dsp::demod { base_type::tempStart(); } - /** Set samplerate - * \param samplerate Samplerate in Hz - */ void setSamplerate(double samplerate) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -72,20 +54,18 @@ namespace dsp::demod { base_type::tempStart(); } - /** Set AGC rate - * \param agcRate AGC rate in units per second - */ - void setAGCRate(double agcRate) { + void setAGCAttack(double attack) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); - agc.setRate(agcRate); + agc.setAttack(attack); + } + + void setAGCDecay(double decay) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + agc.setDecay(decay); } - /** Process data - * \param count Number of samples - * \param in Input buffer - * \param out Output buffer - */ int process(int count, const complex_t* in, float* out) { // Move back sideband xlator.process(count, in, xlator.out.writeBuf); diff --git a/core/src/dsp/loop/agc.h b/core/src/dsp/loop/agc.h index 1cd58ab..9c5a6ed 100644 --- a/core/src/dsp/loop/agc.h +++ b/core/src/dsp/loop/agc.h @@ -8,12 +8,14 @@ namespace dsp::loop { public: AGC() {} - AGC(stream* in, double setPoint, double rate, double maxGain, double maxOutputAmp, double initGain = 1.0) { init(in, setPoint, rate, maxGain, maxOutputAmp, initGain); } + AGC(stream* in, double setPoint, double attack, double decay, double maxGain, double maxOutputAmp, double initGain = 1.0) { init(in, setPoint, attack, decay, maxGain, maxOutputAmp, initGain); } - void init(stream* in, double setPoint, double rate, double maxGain, double maxOutputAmp, double initGain = 1.0) { + void init(stream* in, double setPoint, double attack, double decay, double maxGain, double maxOutputAmp, double initGain = 1.0) { _setPoint = setPoint; - _rate = rate; - _invRate = 1.0f - _rate; + _attack = attack; + _invAttack = 1.0f - _attack; + _decay = decay; + _invDecay = 1.0f - _decay; _maxGain = maxGain; _maxOutputAmp = maxOutputAmp; _initGain = initGain; @@ -27,11 +29,18 @@ namespace dsp::loop { _setPoint = setPoint; } - void setRate(double rate) { + void setAttack(double attack) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); - _rate = rate; - _invRate = 1.0f - _rate; + _attack = attack; + _invAttack = 1.0f - _attack; + } + + void setDecay(double decay) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _decay = decay; + _invDecay = 1.0f - _decay; } void setMaxGain(double maxGain) { @@ -72,7 +81,7 @@ namespace dsp::loop { // Update average amplitude if (inAmp != 0.0f) { - amp = (amp * _invRate) + (inAmp * _rate); + amp = (inAmp > amp) ? ((amp * _invAttack) + (inAmp * _attack)) : ((amp * _invDecay) + (inAmp * _decay)); gain = std::min(_setPoint / amp, _maxGain); } @@ -95,8 +104,10 @@ namespace dsp::loop { protected: float _setPoint; - float _rate; - float _invRate; + float _attack; + float _invAttack; + float _decay; + float _invDecay; float _maxGain; float _maxOutputAmp; float _initGain; diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index 808dc7e..2bafeba 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -18,9 +18,23 @@ namespace demod { void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { this->name = name; + _config = config; + + // Load config + config->acquire(); + if (config->conf[name][getName()].contains("agcAttack")) { + agcAttack = config->conf[name][getName()]["agcAttack"]; + } + if (config->conf[name][getName()].contains("agcDecay")) { + agcDecay = config->conf[name][getName()]["agcDecay"]; + } + if (config->conf[name][getName()].contains("carrierAgc")) { + carrierAgc = config->conf[name][getName()]["carrierAgc"]; + } + config->release(); // Define structure - demod.init(input, dsp::demod::AM::AGCMode::CARRIER, 24.0 / getIFSampleRate()); + demod.init(input, carrierAgc ? dsp::demod::AM::AGCMode::CARRIER : dsp::demod::AM::AGCMode::AUDIO, agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate(), 100.0 / getIFSampleRate()); m2s.init(&demod.out); } @@ -35,7 +49,29 @@ namespace demod { } void showMenu() { - // TODO: Adjust AGC settings + float menuWidth = ImGui::GetContentRegionAvail().x; + ImGui::LeftLabel("AGC Attack"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("##_radio_am_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + demod.setAGCAttack(agcAttack / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcAttack"] = agcAttack; + _config->release(true); + } + ImGui::LeftLabel("AGC Decay"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("AGC Decay##_radio_am_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + demod.setAGCDecay(agcDecay / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcDecay"] = agcDecay; + _config->release(true); + } + if (ImGui::Checkbox(("Carrier AGC (W.I.P.)##_radio_am_carrier_agc_" + name).c_str(), &carrierAgc)) { + demod.setAGCMode(carrierAgc ? dsp::demod::AM::AGCMode::CARRIER : dsp::demod::AM::AGCMode::AUDIO); + _config->acquire(); + _config->conf[name][getName()]["carrierAgc"] = carrierAgc; + _config->release(true); + } } void setBandwidth(double bandwidth) {} @@ -71,6 +107,12 @@ namespace demod { dsp::demod::AM demod; dsp::convert::MonoToStereo m2s; + ConfigManager* _config = NULL; + + float agcAttack = 40.0f; + float agcDecay = 5.0f; + bool carrierAgc = false; + std::string name; }; } \ No newline at end of file diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index 095167e..67b392e 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -26,6 +26,12 @@ namespace demod { // Load config config->acquire(); + if (config->conf[name][getName()].contains("agcAttack")) { + agcAttack = config->conf[name][getName()]["agcAttack"]; + } + if (config->conf[name][getName()].contains("agcDecay")) { + agcDecay = config->conf[name][getName()]["agcDecay"]; + } if (config->conf[name][getName()].contains("tone")) { tone = config->conf[name][getName()]["tone"]; } @@ -34,7 +40,7 @@ namespace demod { // Define structure xlator.init(input, tone, getIFSampleRate()); c2r.init(&xlator.out); - agc.init(&c2r.out, 1.0, 24.0 / getIFSampleRate(), 10e6, 10.0); + agc.init(&c2r.out, 1.0, agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate(), 10e6, 10.0); m2s.init(&agc.out); } @@ -53,6 +59,23 @@ namespace demod { } void showMenu() { + float menuWidth = ImGui::GetContentRegionAvail().x; + ImGui::LeftLabel("AGC Attack"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("##_radio_cw_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + agc.setAttack(agcAttack / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcAttack"] = agcAttack; + _config->release(true); + } + ImGui::LeftLabel("AGC Decay"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("AGC Decay##_radio_cw_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + agc.setDecay(agcDecay / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcDecay"] = agcDecay; + _config->release(true); + } ImGui::LeftLabel("Tone Frequency"); ImGui::FillWidth(); if (ImGui::InputInt(("Stereo##_radio_cw_tone_" + name).c_str(), &tone, 10, 100)) { @@ -103,6 +126,8 @@ namespace demod { std::string name; + float agcAttack = 40.0f; + float agcDecay = 5.0f; int tone = 800; double _bandwidth; diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index 7488c7e..50cab85 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -18,9 +18,20 @@ namespace demod { void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { this->name = name; + _config = config; + + // Load config + config->acquire(); + if (config->conf[name][getName()].contains("agcAttack")) { + agcAttack = config->conf[name][getName()]["agcAttack"]; + } + if (config->conf[name][getName()].contains("agcDecay")) { + agcDecay = config->conf[name][getName()]["agcDecay"]; + } + config->release(); // Define structure - demod.init(input, dsp::demod::SSB::Mode::DSB, bandwidth, getIFSampleRate(), 24.0 / getIFSampleRate()); + demod.init(input, dsp::demod::SSB::Mode::DSB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); m2s.init(&demod.out); } @@ -35,7 +46,23 @@ namespace demod { } void showMenu() { - // TODO: Adjust AGC settings + float menuWidth = ImGui::GetContentRegionAvail().x; + ImGui::LeftLabel("AGC Attack"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("##_radio_dsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + demod.setAGCAttack(agcAttack / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcAttack"] = agcAttack; + _config->release(true); + } + ImGui::LeftLabel("AGC Decay"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("AGC Decay##_radio_dsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + demod.setAGCDecay(agcDecay / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcDecay"] = agcDecay; + _config->release(true); + } } void setBandwidth(double bandwidth) { @@ -73,6 +100,11 @@ namespace demod { dsp::demod::SSB demod; dsp::convert::MonoToStereo m2s; + ConfigManager* _config; + + float agcAttack = 40.0f; + float agcDecay = 5.0f; + std::string name; }; } \ No newline at end of file diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index bab3450..3652374 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -18,9 +18,20 @@ namespace demod { void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { this->name = name; + _config = config; + + // Load config + config->acquire(); + if (config->conf[name][getName()].contains("agcAttack")) { + agcAttack = config->conf[name][getName()]["agcAttack"]; + } + if (config->conf[name][getName()].contains("agcDecay")) { + agcDecay = config->conf[name][getName()]["agcDecay"]; + } + config->release(); // Define structure - demod.init(input, dsp::demod::SSB::Mode::LSB, bandwidth, getIFSampleRate(), 24.0 / getIFSampleRate()); + demod.init(input, dsp::demod::SSB::Mode::LSB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); m2s.init(&demod.out); } @@ -35,7 +46,23 @@ namespace demod { } void showMenu() { - // TODO: Adjust AGC settings + float menuWidth = ImGui::GetContentRegionAvail().x; + ImGui::LeftLabel("AGC Attack"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("##_radio_lsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + demod.setAGCAttack(agcAttack / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcAttack"] = agcAttack; + _config->release(true); + } + ImGui::LeftLabel("AGC Decay"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("AGC Decay##_radio_lsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + demod.setAGCDecay(agcDecay / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcDecay"] = agcDecay; + _config->release(true); + } } void setBandwidth(double bandwidth) { @@ -73,6 +100,11 @@ namespace demod { dsp::demod::SSB demod; dsp::convert::MonoToStereo m2s; + ConfigManager* _config; + + float agcAttack = 40.0f; + float agcDecay = 5.0f; + std::string name; }; } \ No newline at end of file diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index b25456b..a802d85 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -18,9 +18,20 @@ namespace demod { void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { this->name = name; + _config = config; + + // Load config + config->acquire(); + if (config->conf[name][getName()].contains("agcAttack")) { + agcAttack = config->conf[name][getName()]["agcAttack"]; + } + if (config->conf[name][getName()].contains("agcDecay")) { + agcDecay = config->conf[name][getName()]["agcDecay"]; + } + config->release(); // Define structure - demod.init(input, dsp::demod::SSB::Mode::USB, bandwidth, getIFSampleRate(), 24.0 / getIFSampleRate()); + demod.init(input, dsp::demod::SSB::Mode::USB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); m2s.init(&demod.out); } @@ -35,7 +46,23 @@ namespace demod { } void showMenu() { - // TODO: Adjust AGC settings + float menuWidth = ImGui::GetContentRegionAvail().x; + ImGui::LeftLabel("AGC Attack"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("##_radio_usb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + demod.setAGCAttack(agcAttack / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcAttack"] = agcAttack; + _config->release(true); + } + ImGui::LeftLabel("AGC Decay"); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("AGC Decay##_radio_usb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + demod.setAGCDecay(agcDecay / getIFSampleRate()); + _config->acquire(); + _config->conf[name][getName()]["agcDecay"] = agcDecay; + _config->release(true); + } } void setBandwidth(double bandwidth) { @@ -73,6 +100,11 @@ namespace demod { dsp::demod::SSB demod; dsp::convert::MonoToStereo m2s; + ConfigManager* _config; + + float agcAttack = 40.0f; + float agcDecay = 5.0f; + std::string name; }; } \ No newline at end of file diff --git a/decoder_modules/radio/src/demodulators/wfm.h b/decoder_modules/radio/src/demodulators/wfm.h index 59d4dbc..43e2999 100644 --- a/decoder_modules/radio/src/demodulators/wfm.h +++ b/decoder_modules/radio/src/demodulators/wfm.h @@ -26,10 +26,13 @@ namespace demod { if (config->conf[name][getName()].contains("stereo")) { _stereo = config->conf[name][getName()]["stereo"]; } + if (config->conf[name][getName()].contains("lowPass")) { + _lowPass = config->conf[name][getName()]["lowPass"]; + } _config->release(modified); // Define structure - demod.init(input, bandwidth / 2.0f, getIFSampleRate(), _stereo); + demod.init(input, bandwidth / 2.0f, getIFSampleRate(), _stereo, _lowPass); } void start() { @@ -49,6 +52,9 @@ namespace demod { } if (ImGui::Checkbox(("Low Pass##_radio_wfm_lowpass_" + name).c_str(), &_lowPass)) { demod.setLowPass(_lowPass); + _config->acquire(); + _config->conf[name][getName()]["lowPass"] = _lowPass; + _config->release(true); } } From fd5970b35a0ccbac3ed2bee20ad88ddf98319692 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sun, 19 Jun 2022 23:03:55 +0200 Subject: [PATCH 13/39] maybe a macos compilation fix idk --- core/src/dsp/audio/volume.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/dsp/audio/volume.h b/core/src/dsp/audio/volume.h index 3b7f2e7..b07886a 100644 --- a/core/src/dsp/audio/volume.h +++ b/core/src/dsp/audio/volume.h @@ -60,7 +60,7 @@ namespace dsp::audio { if (lvl.l > maxLvl.l) { maxLvl.l = lvl.l; } if (lvl.r > maxLvl.r) { maxLvl.r = lvl.r; } } - stereo_t maxLvlDB = { 20.0 * log10f(maxLvl.l), 20.0 * log10f(maxLvl.r) }; + stereo_t maxLvlDB = { 20.0f * log10f(maxLvl.l), 20.0f * log10f(maxLvl.r) }; // Update max level { From 927bbab330061f786963b5c633d479e06056050d Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sun, 19 Jun 2022 23:30:02 +0200 Subject: [PATCH 14/39] another dumb macos fix --- core/src/dsp/taps/windowed_sinc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/dsp/taps/windowed_sinc.h b/core/src/dsp/taps/windowed_sinc.h index 98d19f2..84c3e1f 100644 --- a/core/src/dsp/taps/windowed_sinc.h +++ b/core/src/dsp/taps/windowed_sinc.h @@ -20,7 +20,7 @@ namespace dsp::taps { taps.taps[i] = math::sinc(t * omega) * window(t - half, count) * corr; } if constexpr (std::is_same_v) { - complex_t cplx = { math::sinc(t * omega), 0.0f }; + complex_t cplx = { (float)math::sinc(t * omega), 0.0f }; taps.taps[i] = cplx * window(t - half, count) * corr; } } From ce1b0d0170ac7ac9f776a3e53e48353d565627f2 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sun, 19 Jun 2022 23:50:34 +0200 Subject: [PATCH 15/39] MacOS do be wasting my time --- core/src/dsp/sink/ring_buffer.h | 39 ++++++++++++++++++++++++ sink_modules/portaudio_sink/src/main.cpp | 10 +++--- 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 core/src/dsp/sink/ring_buffer.h diff --git a/core/src/dsp/sink/ring_buffer.h b/core/src/dsp/sink/ring_buffer.h new file mode 100644 index 0000000..425d28d --- /dev/null +++ b/core/src/dsp/sink/ring_buffer.h @@ -0,0 +1,39 @@ +#pragma once +#include "../sink.h" +#include "../buffer/ring_buffer.h" + +// NOTE: THIS IS COMPLETELY UNTESTED AND PROBABLY BROKEN!!! + +namespace dsp::sink { + template + class RingBuffer : public Sink { + using base_type = Sink; + public: + RingBuffer() {} + + RingBuffer(stream* in) { base_type::init(in); } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + + + base_type::_in->flush(); + return count; + } + + buffer::RingBuffer data; + + private: + void doStop() { + base_type::_in->stopReader(); + data.stopWriter(); + if (base_type::workerThread.joinable()) { + base_type::workerThread.join(); + } + base_type::_in->clearReadStop(); + data.clearWriteStop(); + } + }; +} \ No newline at end of file diff --git a/sink_modules/portaudio_sink/src/main.cpp b/sink_modules/portaudio_sink/src/main.cpp index 9ad0c55..8f9f2e3 100644 --- a/sink_modules/portaudio_sink/src/main.cpp +++ b/sink_modules/portaudio_sink/src/main.cpp @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -249,9 +249,9 @@ private: SinkManager::Stream* _stream; - dsp::StereoToMono s2m; - dsp::RingBufferSink monoRB; - dsp::RingBufferSink stereoRB; + dsp::convert::StereoToMono s2m; + dsp::sink::RingBuffer monoRB; + dsp::sink::RingBuffer stereoRB; // dsp::Packer monoPacker; // dsp::Packer stereoPacker; From 53afaeda9ec82d88eec102d49d6302fab14a1488 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 20 Jun 2022 18:15:35 +0200 Subject: [PATCH 16/39] Fixes --- core/src/dsp/channel/rx_vfo.h | 11 +++++---- core/src/dsp/demod/am.h | 3 +++ core/src/dsp/demod/broadcast_fm.h | 5 ++++ core/src/dsp/demod/ssb.h | 4 ++++ core/src/dsp/filter/fir.h | 13 +++++++++-- core/src/dsp/loop/agc.h | 24 ++++++++++++++++---- core/src/dsp/multirate/power_decimator.h | 1 + core/src/dsp/multirate/rational_resampler.h | 3 +++ core/src/dsp/noise_reduction/squelch.h | 8 +++++++ core/src/dsp/stream.h | 10 ++++++-- core/src/signal_path/vfo_manager.cpp | 3 +++ core/src/signal_path/vfo_manager.h | 2 ++ decoder_modules/radio/src/demodulators/am.h | 6 ++--- decoder_modules/radio/src/demodulators/cw.h | 8 +++---- decoder_modules/radio/src/demodulators/dsb.h | 6 ++--- decoder_modules/radio/src/demodulators/lsb.h | 6 ++--- decoder_modules/radio/src/demodulators/usb.h | 6 ++--- 17 files changed, 90 insertions(+), 29 deletions(-) diff --git a/core/src/dsp/channel/rx_vfo.h b/core/src/dsp/channel/rx_vfo.h index 9bd933e..b1311b4 100644 --- a/core/src/dsp/channel/rx_vfo.h +++ b/core/src/dsp/channel/rx_vfo.h @@ -54,14 +54,13 @@ namespace dsp::channel { void setBandwidth(double bandwidth) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); - base_type::tempStop(); + std::lock_guard lck2(filterMtx); _bandwidth = bandwidth; filterNeeded = (_bandwidth != _outSamplerate); if (filterNeeded) { generateTaps(); filter.setTaps(ftaps); } - base_type::tempStart(); } void setOffset(double offset) { @@ -87,7 +86,10 @@ namespace dsp::channel { return resamp.process(count, out, out); } count = resamp.process(count, out, out); - filter.process(count, out, out); + { + std::lock_guard lck(filterMtx); + filter.process(count, out, out); + } return count; } @@ -110,7 +112,6 @@ namespace dsp::channel { taps::free(ftaps); double filterWidth = _bandwidth / 2.0; ftaps = taps::lowPass(filterWidth, filterWidth * 0.1, _outSamplerate); - printf("New taps just dropped: %lf %lf %lf\n", filterWidth, filterWidth*0.1, _outSamplerate); } FrequencyXlator xlator; @@ -123,5 +124,7 @@ namespace dsp::channel { double _outSamplerate; double _bandwidth; double _offset; + + std::mutex filterMtx; }; } \ No newline at end of file diff --git a/core/src/dsp/demod/am.h b/core/src/dsp/demod/am.h index fca79a7..7102660 100644 --- a/core/src/dsp/demod/am.h +++ b/core/src/dsp/demod/am.h @@ -22,6 +22,9 @@ namespace dsp::demod { carrierAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); audioAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); dcBlock.init(NULL, dcBlockRate); + + audioAgc.out.free(); + dcBlock.out.free(); base_type::init(in); } diff --git a/core/src/dsp/demod/broadcast_fm.h b/core/src/dsp/demod/broadcast_fm.h index 54c2c01..ca751d6 100644 --- a/core/src/dsp/demod/broadcast_fm.h +++ b/core/src/dsp/demod/broadcast_fm.h @@ -52,6 +52,11 @@ namespace dsp::demod { l = buffer::alloc(STREAM_BUFFER_SIZE); r = buffer::alloc(STREAM_BUFFER_SIZE); + lprDelay.out.free(); + lmrDelay.out.free(); + arFir.out.free(); + alFir.out.free(); + base_type::init(in); } diff --git a/core/src/dsp/demod/ssb.h b/core/src/dsp/demod/ssb.h index 1d53816..b67feeb 100644 --- a/core/src/dsp/demod/ssb.h +++ b/core/src/dsp/demod/ssb.h @@ -22,8 +22,12 @@ namespace dsp::demod { _mode = mode; _bandwidth = bandwidth; _samplerate = samplerate; + xlator.init(NULL, getTranslation(), _samplerate); agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); + + agc.out.free(); + base_type::init(in); } diff --git a/core/src/dsp/filter/fir.h b/core/src/dsp/filter/fir.h index 020aeb7..51b377b 100644 --- a/core/src/dsp/filter/fir.h +++ b/core/src/dsp/filter/fir.h @@ -33,12 +33,21 @@ namespace dsp::filter { std::lock_guard lck(base_type::ctrlMtx); base_type::tempStop(); + int oldTC = _taps.size; _taps = taps; - // Reset buffer + // Update start of buffer bufStart = &buffer[_taps.size - 1]; - buffer::clear(buffer, _taps.size - 1); + // Move existing data to make transition seemless + if (_taps.size < oldTC) { + memcpy(buffer, &buffer[oldTC - _taps.size], (_taps.size - 1) * sizeof(D)); + } + else if (_taps.size > oldTC) { + memcpy(&buffer[_taps.size - oldTC], buffer, (oldTC - 1) * sizeof(D)); + buffer::clear(buffer, _taps.size - oldTC); + } + base_type::tempStart(); } diff --git a/core/src/dsp/loop/agc.h b/core/src/dsp/loop/agc.h index 9c5a6ed..e20018b 100644 --- a/core/src/dsp/loop/agc.h +++ b/core/src/dsp/loop/agc.h @@ -19,7 +19,7 @@ namespace dsp::loop { _maxGain = maxGain; _maxOutputAmp = maxOutputAmp; _initGain = initGain; - gain = _initGain; + amp = _setPoint / _initGain; base_type::init(in); } @@ -64,14 +64,13 @@ namespace dsp::loop { void reset() { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); - gain = _initGain; - amp = 1.0f; + amp = _setPoint / _initGain; } inline int process(int count, T* in, T* out) { for (int i = 0; i < count; i++) { // Get signal amplitude - float inAmp; + float inAmp, gain; if constexpr (std::is_same_v) { inAmp = in[i].amplitude(); } @@ -85,6 +84,22 @@ namespace dsp::loop { gain = std::min(_setPoint / amp, _maxGain); } + // If clipping is detected look ahead and correct + if (inAmp*gain > _maxOutputAmp) { + float maxAmp = 0; + for (int j = i; j < count; j++) { + if constexpr (std::is_same_v) { + inAmp = in[i].amplitude(); + } + if constexpr (std::is_same_v) { + inAmp = fabsf(in[i]); + } + if (inAmp > maxAmp) { maxAmp = inAmp; } + } + amp = maxAmp; + gain = _setPoint / maxAmp; + } + // Scale output by gain out[i] = in[i] * gain; } @@ -112,7 +127,6 @@ namespace dsp::loop { float _maxOutputAmp; float _initGain; - float gain; float amp = 1.0; }; diff --git a/core/src/dsp/multirate/power_decimator.h b/core/src/dsp/multirate/power_decimator.h index f937e25..7e08c34 100644 --- a/core/src/dsp/multirate/power_decimator.h +++ b/core/src/dsp/multirate/power_decimator.h @@ -100,6 +100,7 @@ namespace dsp::multirate { for (int i = 0; i < stageCount; i++) { tap taps = taps::fromArray(plan.stages[i].tapcount, plan.stages[i].taps); auto fir = new filter::DecimatingFIR(NULL, taps, plan.stages[i].decimation); + fir->out.free(); decimTaps.push_back(taps); decimFirs.push_back(fir); } diff --git a/core/src/dsp/multirate/rational_resampler.h b/core/src/dsp/multirate/rational_resampler.h index 328cca4..2f61db2 100644 --- a/core/src/dsp/multirate/rational_resampler.h +++ b/core/src/dsp/multirate/rational_resampler.h @@ -27,6 +27,9 @@ namespace dsp::multirate { decim.init(NULL, 2); resamp.init(NULL, 1, 1, rtaps); + decim.out.free(); + resamp.out.free(); + // Proper configuration reconfigure(); diff --git a/core/src/dsp/noise_reduction/squelch.h b/core/src/dsp/noise_reduction/squelch.h index a663bcc..47e56fe 100644 --- a/core/src/dsp/noise_reduction/squelch.h +++ b/core/src/dsp/noise_reduction/squelch.h @@ -10,8 +10,16 @@ namespace dsp::noise_reduction { Squelch(stream* in, double level) {} + ~Squelch() { + if (!base_type::_block_init) { return; } + buffer::free(normBuffer); + } + void init(stream* in, double level) { _level = level; + + normBuffer = buffer::alloc(STREAM_BUFFER_SIZE); + base_type::init(in); } diff --git a/core/src/dsp/stream.h b/core/src/dsp/stream.h index e72df92..7a7205a 100644 --- a/core/src/dsp/stream.h +++ b/core/src/dsp/stream.h @@ -29,8 +29,7 @@ namespace dsp { } virtual ~stream() { - buffer::free(writeBuf); - buffer::free(readBuf); + free(); } virtual void setBufferSize(int samples) { @@ -115,6 +114,13 @@ namespace dsp { readerStop = false; } + void free() { + if (writeBuf) { buffer::free(writeBuf); } + if (readBuf) { buffer::free(readBuf); } + writeBuf = NULL; + readBuf = NULL; + } + T* writeBuf; T* readBuf; diff --git a/core/src/signal_path/vfo_manager.cpp b/core/src/signal_path/vfo_manager.cpp index 85f236c..f1743cb 100644 --- a/core/src/signal_path/vfo_manager.cpp +++ b/core/src/signal_path/vfo_manager.cpp @@ -4,6 +4,7 @@ VFOManager::VFO::VFO(std::string name, int reference, double offset, double bandwidth, double sampleRate, double minBandwidth, double maxBandwidth, bool bandwidthLocked) { this->name = name; + _bandwidth = bandwidth; dspVFO = sigpath::iqFrontEnd.addVFO(name, sampleRate, bandwidth, offset); wtfVFO = new ImGui::WaterfallVFO; wtfVFO->setReference(reference); @@ -41,6 +42,8 @@ void VFOManager::VFO::setCenterOffset(double offset) { } void VFOManager::VFO::setBandwidth(double bandwidth, bool updateWaterfall) { + if (_bandwidth == bandwidth) { return; } + _bandwidth = bandwidth; if (updateWaterfall) { wtfVFO->setBandwidth(bandwidth); } dspVFO->setBandwidth(bandwidth); } diff --git a/core/src/signal_path/vfo_manager.h b/core/src/signal_path/vfo_manager.h index d8a65d8..f8d3169 100644 --- a/core/src/signal_path/vfo_manager.h +++ b/core/src/signal_path/vfo_manager.h @@ -35,6 +35,8 @@ public: private: std::string name; + double _bandwidth; + }; VFOManager::VFO* createVFO(std::string name, int reference, double offset, double bandwidth, double sampleRate, double minBandwidth, double maxBandwidth, bool bandwidthLocked); diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index 2bafeba..9b00e02 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -52,7 +52,7 @@ namespace demod { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_am_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("##_radio_am_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -60,7 +60,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_am_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("AGC Decay##_radio_am_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; @@ -109,7 +109,7 @@ namespace demod { ConfigManager* _config = NULL; - float agcAttack = 40.0f; + float agcAttack = 50.0f; float agcDecay = 5.0f; bool carrierAgc = false; diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index 67b392e..a44c46b 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -62,7 +62,7 @@ namespace demod { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_cw_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("##_radio_cw_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { agc.setAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -70,7 +70,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_cw_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("AGC Decay##_radio_cw_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { agc.setDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; @@ -101,7 +101,7 @@ namespace demod { const char* getName() { return "CW"; } double getIFSampleRate() { return 3000.0; } double getAFSampleRate() { return getIFSampleRate(); } - double getDefaultBandwidth() { return 500.0; } + double getDefaultBandwidth() { return 200.0; } double getMinBandwidth() { return 50.0; } double getMaxBandwidth() { return 500.0; } bool getBandwidthLocked() { return false; } @@ -126,7 +126,7 @@ namespace demod { std::string name; - float agcAttack = 40.0f; + float agcAttack = 50.0f; float agcDecay = 5.0f; int tone = 800; double _bandwidth; diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index 50cab85..053abe0 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -49,7 +49,7 @@ namespace demod { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_dsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("##_radio_dsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -57,7 +57,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_dsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("AGC Decay##_radio_dsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; @@ -102,7 +102,7 @@ namespace demod { ConfigManager* _config; - float agcAttack = 40.0f; + float agcAttack = 50.0f; float agcDecay = 5.0f; std::string name; diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index 3652374..ffffd05 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -49,7 +49,7 @@ namespace demod { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_lsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("##_radio_lsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -57,7 +57,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_lsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("AGC Decay##_radio_lsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; @@ -102,7 +102,7 @@ namespace demod { ConfigManager* _config; - float agcAttack = 40.0f; + float agcAttack = 50.0f; float agcDecay = 5.0f; std::string name; diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index a802d85..82f8683 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -49,7 +49,7 @@ namespace demod { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_usb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("##_radio_usb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -57,7 +57,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_usb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 50.0f)) { + if (ImGui::SliderFloat(("AGC Decay##_radio_usb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; @@ -102,7 +102,7 @@ namespace demod { ConfigManager* _config; - float agcAttack = 40.0f; + float agcAttack = 50.0f; float agcDecay = 5.0f; std::string name; From 834890b69ad19f17b86fdfc8c11dc004e344a0ea Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 20 Jun 2022 19:55:13 +0200 Subject: [PATCH 17/39] maybe macOS fixes and other --- core/src/dsp/channel/rx_vfo.h | 6 ++++++ core/src/dsp/correction/dc_blocker.h | 7 ++++++- core/src/dsp/multirate/rational_resampler.h | 6 ++++++ core/src/dsp/noise_reduction/squelch.h | 1 + core/src/dsp/sink/ring_buffer.h | 2 +- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/src/dsp/channel/rx_vfo.h b/core/src/dsp/channel/rx_vfo.h index b1311b4..66292f0 100644 --- a/core/src/dsp/channel/rx_vfo.h +++ b/core/src/dsp/channel/rx_vfo.h @@ -10,6 +10,12 @@ namespace dsp::channel { RxVFO(stream* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) { init(in, inSamplerate, outSamplerate, bandwidth, offset); } + ~RxVFO() { + if (!base_type::_block_init) { return; } + base_type::stop(); + taps::free(ftaps); + } + void init(stream* in, double inSamplerate, double outSamplerate, double bandwidth, double offset) { _inSamplerate = inSamplerate; _outSamplerate = outSamplerate; diff --git a/core/src/dsp/correction/dc_blocker.h b/core/src/dsp/correction/dc_blocker.h index 7fcd497..18ca4c5 100644 --- a/core/src/dsp/correction/dc_blocker.h +++ b/core/src/dsp/correction/dc_blocker.h @@ -14,7 +14,12 @@ namespace dsp::correction { void init(stream* in, double rate) { _rate = rate; - reset(); + if constexpr (std::is_same_v) { + offset = 0.0f; + } + if constexpr (std::is_same_v || std::is_same_v) { + offset = { 0.0f, 0.0f }; + } base_type::init(in); } diff --git a/core/src/dsp/multirate/rational_resampler.h b/core/src/dsp/multirate/rational_resampler.h index 2f61db2..0b1286e 100644 --- a/core/src/dsp/multirate/rational_resampler.h +++ b/core/src/dsp/multirate/rational_resampler.h @@ -18,6 +18,12 @@ namespace dsp::multirate { RationalResampler(stream* in, double inSamplerate, double outSamplerate) { init(in, inSamplerate, outSamplerate); } + ~RationalResampler() { + if (!base_type::_block_init) { return; } + base_type::stop(); + taps::free(rtaps); + } + void init(stream* in, double inSamplerate, double outSamplerate) { _inSamplerate = inSamplerate; _outSamplerate = outSamplerate; diff --git a/core/src/dsp/noise_reduction/squelch.h b/core/src/dsp/noise_reduction/squelch.h index 47e56fe..c4ddbee 100644 --- a/core/src/dsp/noise_reduction/squelch.h +++ b/core/src/dsp/noise_reduction/squelch.h @@ -12,6 +12,7 @@ namespace dsp::noise_reduction { ~Squelch() { if (!base_type::_block_init) { return; } + base_type::stop(); buffer::free(normBuffer); } diff --git a/core/src/dsp/sink/ring_buffer.h b/core/src/dsp/sink/ring_buffer.h index 425d28d..e6bdbc9 100644 --- a/core/src/dsp/sink/ring_buffer.h +++ b/core/src/dsp/sink/ring_buffer.h @@ -17,7 +17,7 @@ namespace dsp::sink { int count = base_type::_in->read(); if (count < 0) { return -1; } - + if (data.write(_in->readBuf, count) < 0) { return -1; } base_type::_in->flush(); return count; From f7c566f65256881e6874430bf35bd4058839cc4e Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Tue, 21 Jun 2022 17:24:48 +0200 Subject: [PATCH 18/39] More work --- core/src/dsp/demod/am.h | 77 ++++++++++-- core/src/dsp/demod/broadcast_fm.h | 4 +- core/src/dsp/demod/cw.h | 87 +++++++++++++ core/src/dsp/demod/fm.h | 122 +++++++++++++------ core/src/dsp/demod/narrow_fm.h | 114 +++++++++++++++++ core/src/dsp/demod/quadrature.h | 69 +++++++++++ core/src/dsp/demod/ssb.h | 26 ++-- core/src/dsp/sink/ring_buffer.h | 2 +- core/src/gui/main_window.cpp | 11 +- core/src/signal_path/sink.cpp | 12 +- core/src/signal_path/sink.h | 2 +- decoder_modules/radio/src/demodulators/am.h | 35 ++---- decoder_modules/radio/src/demodulators/cw.h | 50 ++------ decoder_modules/radio/src/demodulators/dsb.h | 29 ++--- decoder_modules/radio/src/demodulators/lsb.h | 29 ++--- decoder_modules/radio/src/demodulators/nfm.h | 40 +++--- decoder_modules/radio/src/demodulators/usb.h | 28 ++--- 17 files changed, 519 insertions(+), 218 deletions(-) create mode 100644 core/src/dsp/demod/cw.h create mode 100644 core/src/dsp/demod/narrow_fm.h create mode 100644 core/src/dsp/demod/quadrature.h diff --git a/core/src/dsp/demod/am.h b/core/src/dsp/demod/am.h index 7102660..06248d1 100644 --- a/core/src/dsp/demod/am.h +++ b/core/src/dsp/demod/am.h @@ -2,10 +2,14 @@ #include "../processor.h" #include "../loop/agc.h" #include "../correction/dc_blocker.h" +#include "../convert/mono_to_stereo.h" +#include "../filter/fir.h" +#include "../taps/low_pass.h" namespace dsp::demod { - class AM : public Processor { - using base_type = Processor; + template + class AM : public Processor { + using base_type = Processor; public: enum AGCMode { CARRIER, @@ -14,17 +18,30 @@ namespace dsp::demod { AM() {} - AM(stream* in, AGCMode agcMode, double agcAttack, double agcDecay, double dcBlockRate) { init(in, agcMode, agcAttack, agcDecay, dcBlockRate); } + AM(stream* in, AGCMode agcMode, double bandwidth, double agcAttack, double agcDecay, double dcBlockRate, double samplerate) { init(in, agcMode, bandwidth, agcAttack, agcDecay, dcBlockRate, samplerate); } - void init(stream* in, AGCMode agcMode, double agcAttack, double agcDecay, double dcBlockRate) { + ~AM() { + if (!base_type::_block_init) { return; } + base_type::stop(); + taps::free(lpfTaps); + } + + void init(stream* in, AGCMode agcMode, double bandwidth, double agcAttack, double agcDecay, double dcBlockRate, double samplerate) { _agcMode = agcMode; + _bandwidth = bandwidth; + _samplerate = samplerate; carrierAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); audioAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); dcBlock.init(NULL, dcBlockRate); + lpfTaps = taps::lowPass(bandwidth / 2.0, (bandwidth / 2.0) * 0.1, samplerate); + lpf.init(NULL, lpfTaps); - audioAgc.out.free(); + if constexpr (std::is_same_v) { + audioAgc.out.free(); + } dcBlock.out.free(); + lpf.out.free(); base_type::init(in); } @@ -38,6 +55,17 @@ namespace dsp::demod { base_type::tempStart(); } + void setBandwidth(double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + if (bandwidth == _bandwidth) { return; } + _bandwidth = bandwidth; + std::lock_guard lck2(lpfMtx); + taps::free(lpfTaps); + lpfTaps = taps::lowPass(_bandwidth / 2.0, (_bandwidth / 2.0) * 0.1, _samplerate); + lpf.setTaps(lpfTaps); + } + void setAGCAttack(double attack) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -58,6 +86,8 @@ namespace dsp::demod { dcBlock.setRate(rate); } + // TODO: Implement setSamplerate + void reset() { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -68,20 +98,35 @@ namespace dsp::demod { base_type::tempStart(); } - int process(int count, complex_t* in, float* out) { + int process(int count, complex_t* in, T* out) { // Apply carrier AGC if needed if (_agcMode == AGCMode::CARRIER) { carrierAgc.process(count, in, carrierAgc.out.writeBuf); in = carrierAgc.out.writeBuf; } - // Get magnitude of each sample and remove DC (TODO: use block instead) - volk_32fc_magnitude_32f(out, (lv_32fc_t*)in, count); - dcBlock.process(count, out, out); - - // Apply audio AGC if needed - if (_agcMode == AGCMode::AUDIO) { - audioAgc.process(count, out, out); + if constexpr (std::is_same_v) { + volk_32fc_magnitude_32f(out, (lv_32fc_t*)in, count); + dcBlock.process(count, out, out); + if (_agcMode == AGCMode::AUDIO) { + audioAgc.process(count, out, out); + } + { + std::lock_guard lck(lpfMtx); + lpf.process(count, out, out); + } + } + if constexpr (std::is_same_v) { + volk_32fc_magnitude_32f(audioAgc.out.writeBuf, (lv_32fc_t*)in, count); + dcBlock.process(count, audioAgc.out.writeBuf, audioAgc.out.writeBuf); + if (_agcMode == AGCMode::AUDIO) { + audioAgc.process(count, audioAgc.out.writeBuf, audioAgc.out.writeBuf); + } + { + std::lock_guard lck(lpfMtx); + lpf.process(count, audioAgc.out.writeBuf, audioAgc.out.writeBuf); + } + convert::MonoToStereo::process(count, audioAgc.out.writeBuf, out); } return count; @@ -101,9 +146,15 @@ namespace dsp::demod { protected: AGCMode _agcMode; + double _samplerate; + double _bandwidth; + loop::AGC carrierAgc; loop::AGC audioAgc; correction::DCBlocker dcBlock; + tap lpfTaps; + filter::FIR lpf; + std::mutex lpfMtx; }; } \ No newline at end of file diff --git a/core/src/dsp/demod/broadcast_fm.h b/core/src/dsp/demod/broadcast_fm.h index ca751d6..f026982 100644 --- a/core/src/dsp/demod/broadcast_fm.h +++ b/core/src/dsp/demod/broadcast_fm.h @@ -1,5 +1,5 @@ #pragma once -#include "fm.h" +#include "quadrature.h" #include "../taps/low_pass.h" #include "../taps/band_pass.h" #include "../filter/fir.h" @@ -193,7 +193,7 @@ namespace dsp::demod { bool _stereo; bool _lowPass = true; - FM demod; + Quadrature demod; tap pilotFirTaps; filter::FIR pilotFir; convert::RealToComplex rtoc; diff --git a/core/src/dsp/demod/cw.h b/core/src/dsp/demod/cw.h new file mode 100644 index 0000000..29103e3 --- /dev/null +++ b/core/src/dsp/demod/cw.h @@ -0,0 +1,87 @@ +#pragma once +#include "../processor.h" +#include "../channel/frequency_xlator.h" +#include "../convert/complex_to_real.h" +#include "../loop/agc.h" +#include "../convert/mono_to_stereo.h" + +namespace dsp::demod { + template + class CW : public Processor { + using base_type = Processor; + public: + CW() {} + + CW(stream* in, double tone, double agcAttack, double agcDecay, double samplerate) { init(in, tone, agcAttack, agcDecay, samplerate); } + + void init(stream* in, double tone, double agcAttack, double agcDecay, double samplerate) { + _tone = tone; + + xlator.init(NULL, tone, samplerate); + agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); + + if constexpr (std::is_same_v) { + agc.out.free(); + } + + base_type::init(in); + } + + void setTone(double tone) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _tone = tone; + xlator.setOffset(_tone); + } + + void setAGCAttack(double attack) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + agc.setAttack(attack); + } + + void setAGCDecay(double decay) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + agc.setDecay(decay); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + xlator.setOffset(_tone, samplerate); + } + + inline int process(int count, const complex_t* in, T* out) { + xlator.process(count, in, xlator.out.writeBuf); + if constexpr (std::is_same_v) { + dsp::convert::ComplexToReal::process(count, xlator.out.writeBuf, out); + agc.process(count, out, out); + } + if constexpr (std::is_same_v) { + dsp::convert::ComplexToReal::process(count, xlator.out.writeBuf, agc.out.writeBuf); + agc.process(count, agc.out.writeBuf, agc.out.writeBuf); + convert::MonoToStereo::process(count, agc.out.writeBuf, out); + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + private: + double _tone; + + dsp::channel::FrequencyXlator xlator; + dsp::loop::AGC agc; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/fm.h b/core/src/dsp/demod/fm.h index efda274..8a79f50 100644 --- a/core/src/dsp/demod/fm.h +++ b/core/src/dsp/demod/fm.h @@ -1,54 +1,98 @@ #pragma once #include "../processor.h" -#include "../math/fast_atan2.h" -#include "../math/freq_to_omega.h" -#include "../math/norm_phase_diff.h" +#include "quadrature.h" +#include "../filter/fir.h" +#include "../taps/low_pass.h" +#include "../convert/mono_to_stereo.h" namespace dsp::demod { - class FM : public Processor { - using base_type = Processor; + template + class FM : public dsp::Processor { + using base_type = dsp::Processor; public: FM() {} - FM(stream* in, double deviation) { init(in, deviation); } + FM(dsp::stream* in, double samplerate, double bandwidth, bool lowPass) { init(in, samplerate, bandwidth, lowPass); } - FM(stream* in, double deviation, double samplerate) { init(in, deviation, samplerate); } - - - virtual void init(stream* in, double deviation) { - _invDeviation = 1.0 / deviation; - base_type::init(in); + ~FM() { + if (!base_type::_block_init) { return; } + base_type::stop(); + dsp::taps::free(lpfTaps); } - virtual void init(stream* in, double deviation, double samplerate) { - init(in, math::freqToOmega(deviation, samplerate)); - } + void init(dsp::stream* in, double samplerate, double bandwidth, bool lowPass) { + _samplerate = samplerate; + _bandwidth = bandwidth; + _lowPass = lowPass; - void setDeviation(double deviation) { - assert(base_type::_block_init); - std::lock_guard lck(base_type::ctrlMtx); - _invDeviation = 1.0 / deviation; - } + demod.init(NULL, bandwidth / 2.0, _samplerate); + lpfTaps = dsp::taps::lowPass(_bandwidth / 2.0, (_bandwidth / 2.0) * 0.1, _samplerate); + lpf.init(NULL, lpfTaps); - void setDeviation(double deviation, double samplerate) { - assert(base_type::_block_init); - std::lock_guard lck(base_type::ctrlMtx); - _invDeviation = 1.0 / math::freqToOmega(deviation, samplerate); - } - - inline int process(int count, complex_t* in, float* out) { - for (int i = 0; i < count; i++) { - float cphase = in[i].phase(); - out[i] = math::normPhaseDiff(cphase - phase) * _invDeviation; - phase = cphase; + if constexpr (std::is_same_v) { + demod.out.free(); } - return count; + lpf.out.free(); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _samplerate = samplerate; + demod.setDeviation(_bandwidth / 2.0, _samplerate); + dsp::taps::free(lpfTaps); + lpfTaps = dsp::taps::lowPass(_bandwidth / 2.0, (_bandwidth / 2.0) * 0.1, _samplerate); + lpf.setTaps(lpfTaps); + base_type::tempStart(); + } + + void setBandwidth(double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + if (bandwidth == _bandwidth) { return; } + _bandwidth = bandwidth; + std::lock_guard lck2(lpfMtx); + demod.setDeviation(_bandwidth / 2.0, _samplerate); + dsp::taps::free(lpfTaps); + lpfTaps = dsp::taps::lowPass(_bandwidth / 2, (_bandwidth / 2) * 0.1, _samplerate); + lpf.setTaps(lpfTaps); + } + + void setLowPass(bool lowPass) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + std::lock_guard lck2(lpfMtx); + _lowPass = lowPass; + lpf.reset(); } void reset() { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); - phase = 0.0f; + base_type::tempStop(); + demod.reset(); + lpf.reset(); + base_type::tempStart(); + } + + inline int process(int count, dsp::complex_t* in, T* out) { + if constexpr (std::is_same_v) { + demod.process(count, in, out); + if (_lowPass) { + std::lock_guard lck(lpfMtx); + lpf.process(count, out, out); + } + } + if constexpr (std::is_same_v) { + demod.process(count, in, demod.out.writeBuf); + if (_lowPass) { + std::lock_guard lck(lpfMtx); + lpf.process(count, demod.out.writeBuf, demod.out.writeBuf); + } + convert::MonoToStereo::process(count, demod.out.writeBuf, out); + } + return count; } int run() { @@ -62,8 +106,14 @@ namespace dsp::demod { return count; } - protected: - float _invDeviation; - float phase = 0.0f; + private: + double _samplerate; + double _bandwidth; + bool _lowPass; + + Quadrature demod; + tap lpfTaps; + filter::FIR lpf; + std::mutex lpfMtx; }; } \ No newline at end of file diff --git a/core/src/dsp/demod/narrow_fm.h b/core/src/dsp/demod/narrow_fm.h new file mode 100644 index 0000000..d16ab5e --- /dev/null +++ b/core/src/dsp/demod/narrow_fm.h @@ -0,0 +1,114 @@ +#pragma once +#include "../processor.h" +#include "fm.h" +#include "../filter/fir.h" +#include "../taps/low_pass.h" +#include "../convert/mono_to_stereo.h" + +namespace dsp::demod { + template + class NarrowFM : public dsp::Processor { + using base_type = dsp::Processor; + public: + NarrowFM() {} + + NarrowFM(dsp::stream* in, double samplerate, double bandwidth, bool lowPass) { init(in, samplerate, bandwidth, lowPass); } + + ~NarrowFM() { + if (!base_type::_block_init) { return; } + base_type::stop(); + dsp::taps::free(lpfTaps); + } + + void init(dsp::stream* in, double samplerate, double bandwidth, bool lowPass) { + _samplerate = samplerate; + _bandwidth = bandwidth; + _lowPass = lowPass; + + demod.init(NULL, bandwidth / 2.0, _samplerate); + lpfTaps = dsp::taps::lowPass(_bandwidth / 2, (_bandwidth / 2) * 0.1, _samplerate); + lpf.init(NULL, lpfTaps); + + if constexpr (std::is_same_v) { + demod.out.free(); + } + lpf.out.free(); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _samplerate = samplerate; + demod.setDeviation(_bandwidth / 2.0, _samplerate); + dsp::taps::free(lpfTaps); + lpfTaps = dsp::taps::lowPass(_bandwidth / 2, (_bandwidth / 2) * 0.1, _samplerate); + lpf.setTaps(lpfTaps); + base_type::tempStart(); + } + + void setBandwidth(double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + if (bandwidth == _bandwidth) { return; } + _bandwidth = bandwidth; + demod.setDeviation(_bandwidth / 2.0, _samplerate); + dsp::taps::free(lpfTaps); + lpfTaps = dsp::taps::lowPass(_bandwidth / 2, (_bandwidth / 2) * 0.1, _samplerate); + lpf.setTaps(lpfTaps); + } + + void setLowPass(bool lowPass) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _lowPass = lowPass; + lpf.reset(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + demod.reset(); + lpf.reset(); + base_type::tempStart(); + } + + inline int process(int count, dsp::complex_t* in, float* out) { + if constexpr (std::is_same_v) { + demod.process(count, in, out); + if (_lowPass) { + lpf.process(count, out, out); + } + } + if constexpr (std::is_same_v) { + demod.process(count, in, demod.out.writeBuf); + if (_lowPass) { + lpf.process(count, demod.out.writeBuf, demod.out.writeBuf); + } + convert::MonoToStereo::process(count, demod.out.writeBuf, out); + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + private: + double _samplerate; + double _bandwidth; + bool _lowPass; + + dsp::demod::FM demod; + dsp::tap lpfTaps; + dsp::filter::FIR lpf; + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/quadrature.h b/core/src/dsp/demod/quadrature.h new file mode 100644 index 0000000..9c5cd31 --- /dev/null +++ b/core/src/dsp/demod/quadrature.h @@ -0,0 +1,69 @@ +#pragma once +#include "../processor.h" +#include "../math/fast_atan2.h" +#include "../math/freq_to_omega.h" +#include "../math/norm_phase_diff.h" + +namespace dsp::demod { + class Quadrature : public Processor { + using base_type = Processor; + public: + Quadrature() {} + + Quadrature(stream* in, double deviation) { init(in, deviation); } + + Quadrature(stream* in, double deviation, double samplerate) { init(in, deviation, samplerate); } + + + virtual void init(stream* in, double deviation) { + _invDeviation = 1.0 / deviation; + base_type::init(in); + } + + virtual void init(stream* in, double deviation, double samplerate) { + init(in, math::freqToOmega(deviation, samplerate)); + } + + void setDeviation(double deviation) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _invDeviation = 1.0 / deviation; + } + + void setDeviation(double deviation, double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _invDeviation = 1.0 / math::freqToOmega(deviation, samplerate); + } + + inline int process(int count, complex_t* in, float* out) { + for (int i = 0; i < count; i++) { + float cphase = in[i].phase(); + out[i] = math::normPhaseDiff(cphase - phase) * _invDeviation; + phase = cphase; + } + return count; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + phase = 0.0f; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + float _invDeviation; + float phase = 0.0f; + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/ssb.h b/core/src/dsp/demod/ssb.h index b67feeb..3b25de6 100644 --- a/core/src/dsp/demod/ssb.h +++ b/core/src/dsp/demod/ssb.h @@ -3,10 +3,12 @@ #include "../channel/frequency_xlator.h" #include "../convert/complex_to_real.h" #include "../loop/agc.h" +#include "../convert/mono_to_stereo.h" namespace dsp::demod { - class SSB : public Processor { - using base_type = Processor; + template + class SSB : public Processor { + using base_type = Processor; public: enum Mode { USB, @@ -26,7 +28,9 @@ namespace dsp::demod { xlator.init(NULL, getTranslation(), _samplerate); agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); - agc.out.free(); + if constexpr (std::is_same_v) { + agc.out.free(); + } base_type::init(in); } @@ -70,15 +74,19 @@ namespace dsp::demod { agc.setDecay(decay); } - int process(int count, const complex_t* in, float* out) { + int process(int count, const complex_t* in, T* out) { // Move back sideband xlator.process(count, in, xlator.out.writeBuf); - // Extract the real component - convert::ComplexToReal::process(count, xlator.out.writeBuf, out); - - // Apply AGC - agc.process(count, out, out); + if constexpr (std::is_same_v) { + convert::ComplexToReal::process(count, xlator.out.writeBuf, out); + agc.process(count, out, out); + } + if constexpr (std::is_same_v) { + convert::ComplexToReal::process(count, xlator.out.writeBuf, agc.out.writeBuf); + agc.process(count, agc.out.writeBuf, agc.out.writeBuf); + convert::MonoToStereo::process(count, agc.out.writeBuf, out); + } return count; } diff --git a/core/src/dsp/sink/ring_buffer.h b/core/src/dsp/sink/ring_buffer.h index e6bdbc9..5298ae6 100644 --- a/core/src/dsp/sink/ring_buffer.h +++ b/core/src/dsp/sink/ring_buffer.h @@ -17,7 +17,7 @@ namespace dsp::sink { int count = base_type::_in->read(); if (count < 0) { return -1; } - if (data.write(_in->readBuf, count) < 0) { return -1; } + if (data.write(base_type::_in->readBuf, count) < 0) { return -1; } base_type::_in->flush(); return count; diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 2979dee..b6ec07b 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -259,6 +259,7 @@ void MainWindow::vfoAddedHandler(VFOManager::VFO* vfo, void* ctx) { void MainWindow::draw() { ImGui::Begin("Main", NULL, WINDOW_FLAGS); + ImVec4 textCol = ImGui::GetStyleColorVec4(ImGuiCol_Text); ImGui::WaterfallVFO* vfo = NULL; if (gui::waterfall.selectedVFO != "") { @@ -332,7 +333,7 @@ void MainWindow::draw() { // ImGui::BeginChild("TopBarChild", ImVec2(0, 49.0f * style::uiScale), false, ImGuiWindowFlags_HorizontalScrollbar); ImVec2 btnSize(30 * style::uiScale, 30 * style::uiScale); ImGui::PushID(ImGui::GetID("sdrpp_menu_btn")); - if (ImGui::ImageButton(icons::MENU, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5) || ImGui::IsKeyPressed(ImGuiKey_Menu, false)) { + if (ImGui::ImageButton(icons::MENU, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5, ImVec4(0, 0, 0, 0), textCol) || ImGui::IsKeyPressed(ImGuiKey_Menu, false)) { showMenu = !showMenu; core::configManager.acquire(); core::configManager.conf["showMenu"] = showMenu; @@ -346,14 +347,14 @@ void MainWindow::draw() { if (playButtonLocked && !tmpPlaySate) { style::beginDisabled(); } if (playing) { ImGui::PushID(ImGui::GetID("sdrpp_stop_btn")); - if (ImGui::ImageButton(icons::STOP, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5) || ImGui::IsKeyPressed(ImGuiKey_End, false)) { + if (ImGui::ImageButton(icons::STOP, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5, ImVec4(0, 0, 0, 0), textCol) || ImGui::IsKeyPressed(ImGuiKey_End, false)) { setPlayState(false); } ImGui::PopID(); } else { // TODO: Might need to check if there even is a device ImGui::PushID(ImGui::GetID("sdrpp_play_btn")); - if (ImGui::ImageButton(icons::PLAY, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5) || ImGui::IsKeyPressed(ImGuiKey_End, false)) { + if (ImGui::ImageButton(icons::PLAY, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5, ImVec4(0, 0, 0, 0), textCol) || ImGui::IsKeyPressed(ImGuiKey_End, false)) { setPlayState(true); } ImGui::PopID(); @@ -381,7 +382,7 @@ void MainWindow::draw() { ImGui::SetCursorPosY(origY); if (tuningMode == tuner::TUNER_MODE_CENTER) { ImGui::PushID(ImGui::GetID("sdrpp_ena_st_btn")); - if (ImGui::ImageButton(icons::CENTER_TUNING, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5)) { + if (ImGui::ImageButton(icons::CENTER_TUNING, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5, ImVec4(0, 0, 0, 0), textCol)) { tuningMode = tuner::TUNER_MODE_NORMAL; gui::waterfall.VFOMoveSingleClick = false; core::configManager.acquire(); @@ -392,7 +393,7 @@ void MainWindow::draw() { } else { // TODO: Might need to check if there even is a device ImGui::PushID(ImGui::GetID("sdrpp_dis_st_btn")); - if (ImGui::ImageButton(icons::NORMAL_TUNING, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5)) { + if (ImGui::ImageButton(icons::NORMAL_TUNING, btnSize, ImVec2(0, 0), ImVec2(1, 1), 5, ImVec4(0, 0, 0, 0), textCol)) { tuningMode = tuner::TUNER_MODE_CENTER; gui::waterfall.VFOMoveSingleClick = true; tuner::tune(tuner::TUNER_MODE_CENTER, gui::waterfall.selectedVFO, gui::freqSelect.frequency); diff --git a/core/src/signal_path/sink.cpp b/core/src/signal_path/sink.cpp index 8f513a4..9750214 100644 --- a/core/src/signal_path/sink.cpp +++ b/core/src/signal_path/sink.cpp @@ -239,7 +239,7 @@ void SinkManager::setStreamSink(std::string name, std::string providerName) { } } -void SinkManager::showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight, int btwBorder, bool sameLine) { +void SinkManager::showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight, int btnBorder, bool sameLine) { // TODO: Replace map with some hashmap for it to be faster float height = ImGui::GetTextLineHeightWithSpacing() + 2; float sliderHeight = height; @@ -254,11 +254,11 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w float dummy = 0.0f; style::beginDisabled(); ImGui::PushID(ImGui::GetID(("sdrpp_unmute_btn_" + name).c_str())); - ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder); + ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btnBorder, ImVec4(0, 0, 0, 0), ImGui::GetStyleColorVec4(ImGuiCol_Text)); ImGui::PopID(); ImGui::SameLine(); ImGui::SetNextItemWidth(width - height - sliderOffset); - ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btwBorder); + ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btnBorder); ImGui::SliderFloat((prefix + name).c_str(), &dummy, 0.0f, 1.0f, ""); style::endDisabled(); if (sameLine) { ImGui::SetCursorPosY(ypos); } @@ -269,7 +269,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w if (stream->volumeAjust.getMuted()) { ImGui::PushID(ImGui::GetID(("sdrpp_unmute_btn_" + name).c_str())); - if (ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) { + if (ImGui::ImageButton(icons::MUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btnBorder, ImVec4(0, 0, 0, 0), ImGui::GetStyleColorVec4(ImGuiCol_Text))) { stream->volumeAjust.setMuted(false); core::configManager.acquire(); saveStreamConfig(name); @@ -279,7 +279,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w } else { ImGui::PushID(ImGui::GetID(("sdrpp_mute_btn_" + name).c_str())); - if (ImGui::ImageButton(icons::UNMUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btwBorder)) { + if (ImGui::ImageButton(icons::UNMUTED, ImVec2(height, height), ImVec2(0, 0), ImVec2(1, 1), btnBorder, ImVec4(0, 0, 0, 0), ImGui::GetStyleColorVec4(ImGuiCol_Text))) { stream->volumeAjust.setMuted(true); core::configManager.acquire(); saveStreamConfig(name); @@ -291,7 +291,7 @@ void SinkManager::showVolumeSlider(std::string name, std::string prefix, float w ImGui::SameLine(); ImGui::SetNextItemWidth(width - height - sliderOffset); - ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btwBorder); + ImGui::SetCursorPosY(ypos + ((height - sliderHeight) / 2.0f) + btnBorder); if (ImGui::SliderFloat((prefix + name).c_str(), &stream->guiVolume, 0.0f, 1.0f, "")) { stream->setVolume(stream->guiVolume); core::configManager.acquire(); diff --git a/core/src/signal_path/sink.h b/core/src/signal_path/sink.h index acdd0be..a06ac1f 100644 --- a/core/src/signal_path/sink.h +++ b/core/src/signal_path/sink.h @@ -101,7 +101,7 @@ public: void setStreamSink(std::string name, std::string providerName); - void showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight = -1.0f, int btwBorder = 0, bool sameLine = false); + void showVolumeSlider(std::string name, std::string prefix, float width, float btnHeight = -1.0f, int btnBorder = 0, bool sameLine = false); dsp::stream* bindStream(std::string name); void unbindStream(std::string name, dsp::stream* stream); diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index 9b00e02..bb0a6c9 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -1,7 +1,6 @@ #pragma once #include "../demod.h" #include -#include namespace demod { class AM : public Demodulator { @@ -12,9 +11,7 @@ namespace demod { init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); } - ~AM() { - stop(); - } + ~AM() { stop(); } void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { this->name = name; @@ -34,25 +31,18 @@ namespace demod { config->release(); // Define structure - demod.init(input, carrierAgc ? dsp::demod::AM::AGCMode::CARRIER : dsp::demod::AM::AGCMode::AUDIO, agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate(), 100.0 / getIFSampleRate()); - m2s.init(&demod.out); + demod.init(input, carrierAgc ? dsp::demod::AM::AGCMode::CARRIER : dsp::demod::AM::AGCMode::AUDIO, bandwidth, agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate(), 100.0 / getIFSampleRate(), getIFSampleRate()); } - void start() { - demod.start(); - m2s.start(); - } + void start() { demod.start(); } - void stop() { - demod.stop(); - m2s.stop(); - } + void stop() { demod.stop(); } void showMenu() { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_am_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { + if (ImGui::SliderFloat(("##_radio_am_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 200.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -66,19 +56,17 @@ namespace demod { _config->conf[name][getName()]["agcDecay"] = agcDecay; _config->release(true); } - if (ImGui::Checkbox(("Carrier AGC (W.I.P.)##_radio_am_carrier_agc_" + name).c_str(), &carrierAgc)) { - demod.setAGCMode(carrierAgc ? dsp::demod::AM::AGCMode::CARRIER : dsp::demod::AM::AGCMode::AUDIO); + if (ImGui::Checkbox(("Carrier AGC##_radio_am_carrier_agc_" + name).c_str(), &carrierAgc)) { + demod.setAGCMode(carrierAgc ? dsp::demod::AM::AGCMode::CARRIER : dsp::demod::AM::AGCMode::AUDIO); _config->acquire(); _config->conf[name][getName()]["carrierAgc"] = carrierAgc; _config->release(true); } } - void setBandwidth(double bandwidth) {} + void setBandwidth(double bandwidth) { demod.setBandwidth(bandwidth); } - void setInput(dsp::stream* input) { - demod.setInput(input); - } + void setInput(dsp::stream* input) { demod.setInput(input); } void AFSampRateChanged(double newSR) {} @@ -101,11 +89,10 @@ namespace demod { bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return false; } - dsp::stream* getOutput() { return &m2s.out; } + dsp::stream* getOutput() { return &demod.out; } private: - dsp::demod::AM demod; - dsp::convert::MonoToStereo m2s; + dsp::demod::AM demod; ConfigManager* _config = NULL; diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index a44c46b..bc53f9c 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -1,9 +1,6 @@ #pragma once #include "../demod.h" -#include -#include -#include -#include +#include namespace demod { class CW : public Demodulator { @@ -21,7 +18,6 @@ namespace demod { void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { this->name = name; this->_config = config; - this->_bandwidth = bandwidth; this->afbwChangeHandler = afbwChangeHandler; // Load config @@ -38,32 +34,19 @@ namespace demod { config->release(); // Define structure - xlator.init(input, tone, getIFSampleRate()); - c2r.init(&xlator.out); - agc.init(&c2r.out, 1.0, agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate(), 10e6, 10.0); - m2s.init(&agc.out); + demod.init(input, tone, agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate(), getIFSampleRate()); } - void start() { - xlator.start(); - c2r.start(); - agc.start(); - m2s.start(); - } + void start() { demod.start(); } - void stop() { - xlator.stop(); - c2r.stop(); - agc.stop(); - m2s.stop(); - } + void stop() { demod.stop(); } void showMenu() { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_cw_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { - agc.setAttack(agcAttack / getIFSampleRate()); + if (ImGui::SliderFloat(("##_radio_cw_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 200.0f)) { + demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; _config->release(true); @@ -71,7 +54,7 @@ namespace demod { ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (ImGui::SliderFloat(("AGC Decay##_radio_cw_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { - agc.setDecay(agcDecay / getIFSampleRate()); + demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; _config->release(true); @@ -80,19 +63,16 @@ namespace demod { ImGui::FillWidth(); if (ImGui::InputInt(("Stereo##_radio_cw_tone_" + name).c_str(), &tone, 10, 100)) { tone = std::clamp(tone, 250, 1250); - xlator.setOffset(tone, getIFSampleRate()); - afbwChangeHandler.handler(getAFBandwidth(_bandwidth), afbwChangeHandler.ctx); + demod.setTone(tone); _config->acquire(); _config->conf[name][getName()]["tone"] = tone; _config->release(true); } } - void setBandwidth(double bandwidth) { _bandwidth = bandwidth; } + void setBandwidth(double bandwidth) {} - void setInput(dsp::stream* input) { - xlator.setInput(input); - } + void setInput(dsp::stream* input) { demod.setInput(input); } void AFSampRateChanged(double newSR) {} @@ -115,21 +95,17 @@ namespace demod { bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return false; } - dsp::stream* getOutput() { return &m2s.out; } + dsp::stream* getOutput() { return &demod.out; } private: ConfigManager* _config = NULL; - dsp::channel::FrequencyXlator xlator; - dsp::convert::ComplexToReal c2r; - dsp::loop::AGC agc; - dsp::convert::MonoToStereo m2s; + dsp::demod::CW demod; std::string name; - float agcAttack = 50.0f; + float agcAttack = 100.0f; float agcDecay = 5.0f; int tone = 800; - double _bandwidth; EventHandler afbwChangeHandler; }; diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index 053abe0..3401210 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -1,7 +1,6 @@ #pragma once #include "../demod.h" #include -#include namespace demod { class DSB : public Demodulator { @@ -31,25 +30,18 @@ namespace demod { config->release(); // Define structure - demod.init(input, dsp::demod::SSB::Mode::DSB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); - m2s.init(&demod.out); + demod.init(input, dsp::demod::SSB::Mode::DSB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); } - void start() { - demod.start(); - m2s.start(); - } + void start() { demod.start(); } - void stop() { - demod.stop(); - m2s.stop(); - } + void stop() { demod.stop(); } void showMenu() { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_dsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { + if (ImGui::SliderFloat(("##_radio_dsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 200.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -65,13 +57,9 @@ namespace demod { } } - void setBandwidth(double bandwidth) { - demod.setBandwidth(bandwidth); - } + void setBandwidth(double bandwidth) { demod.setBandwidth(bandwidth); } - void setInput(dsp::stream* input) { - demod.setInput(input); - } + void setInput(dsp::stream* input) { demod.setInput(input); } void AFSampRateChanged(double newSR) {} @@ -94,11 +82,10 @@ namespace demod { bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return true; } - dsp::stream* getOutput() { return &m2s.out; } + dsp::stream* getOutput() { return &demod.out; } private: - dsp::demod::SSB demod; - dsp::convert::MonoToStereo m2s; + dsp::demod::SSB demod; ConfigManager* _config; diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index ffffd05..a5ee770 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -1,7 +1,6 @@ #pragma once #include "../demod.h" #include -#include namespace demod { class LSB : public Demodulator { @@ -31,25 +30,18 @@ namespace demod { config->release(); // Define structure - demod.init(input, dsp::demod::SSB::Mode::LSB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); - m2s.init(&demod.out); + demod.init(input, dsp::demod::SSB::Mode::LSB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); } - void start() { - demod.start(); - m2s.start(); - } + void start() { demod.start(); } - void stop() { - demod.stop(); - m2s.stop(); - } + void stop() { demod.stop(); } void showMenu() { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_lsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { + if (ImGui::SliderFloat(("##_radio_lsb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 200.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -65,13 +57,9 @@ namespace demod { } } - void setBandwidth(double bandwidth) { - demod.setBandwidth(bandwidth); - } + void setBandwidth(double bandwidth) { demod.setBandwidth(bandwidth); } - void setInput(dsp::stream* input) { - demod.setInput(input); - } + void setInput(dsp::stream* input) { demod.setInput(input); } void AFSampRateChanged(double newSR) {} @@ -94,11 +82,10 @@ namespace demod { bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return true; } - dsp::stream* getOutput() { return &m2s.out; } + dsp::stream* getOutput() { return &demod.out; } private: - dsp::demod::SSB demod; - dsp::convert::MonoToStereo m2s; + dsp::demod::SSB demod; ConfigManager* _config; diff --git a/decoder_modules/radio/src/demodulators/nfm.h b/decoder_modules/radio/src/demodulators/nfm.h index f7315d3..b47a5d0 100644 --- a/decoder_modules/radio/src/demodulators/nfm.h +++ b/decoder_modules/radio/src/demodulators/nfm.h @@ -1,7 +1,6 @@ #pragma once #include "../demod.h" #include -#include namespace demod { class NFM : public Demodulator { @@ -12,37 +11,33 @@ namespace demod { init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); } - ~NFM() { - stop(); - } + ~NFM() { stop(); } void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { this->name = name; // Define structure - demod.init(input, bandwidth / 2.0, getIFSampleRate()); - m2s.init(&demod.out); + demod.init(input, getIFSampleRate(), bandwidth, _lowPass); } - void start() { - demod.start(); - m2s.start(); - } + void start() { demod.start(); } - void stop() { - demod.stop(); - m2s.stop(); - } + void stop() { demod.stop(); } - void showMenu() {} + void showMenu() { + if (ImGui::Checkbox(("Low Pass##_radio_wfm_lowpass_" + name).c_str(), &_lowPass)) { + demod.setLowPass(_lowPass); + // _config->acquire(); + // _config->conf[name][getName()]["lowPass"] = _lowPass; + // _config->release(true); + } + } void setBandwidth(double bandwidth) { - demod.setDeviation(bandwidth / 2.0, getIFSampleRate()); + demod.setBandwidth(bandwidth); } - void setInput(dsp::stream* input) { - demod.setInput(input); - } + void setInput(dsp::stream* input) { demod.setInput(input); } void AFSampRateChanged(double newSR) {} @@ -65,11 +60,12 @@ namespace demod { bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return true; } bool getNBAllowed() { return false; } - dsp::stream* getOutput() { return &m2s.out; } + dsp::stream* getOutput() { return &demod.out; } private: - dsp::demod::FM demod; - dsp::convert::MonoToStereo m2s; + dsp::demod::FM demod; + + bool _lowPass = true; std::string name; }; diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index 82f8683..49e5596 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -31,25 +31,18 @@ namespace demod { config->release(); // Define structure - demod.init(input, dsp::demod::SSB::Mode::USB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); - m2s.init(&demod.out); + demod.init(input, dsp::demod::SSB::Mode::USB, bandwidth, getIFSampleRate(), agcAttack / getIFSampleRate(), agcDecay / getIFSampleRate()); } - void start() { - demod.start(); - m2s.start(); - } + void start() { demod.start(); } - void stop() { - demod.stop(); - m2s.stop(); - } + void stop() { demod.stop(); } void showMenu() { float menuWidth = ImGui::GetContentRegionAvail().x; ImGui::LeftLabel("AGC Attack"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_usb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 100.0f)) { + if (ImGui::SliderFloat(("##_radio_usb_agc_attack_" + name).c_str(), &agcAttack, 1.0f, 200.0f)) { demod.setAGCAttack(agcAttack / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcAttack"] = agcAttack; @@ -65,13 +58,9 @@ namespace demod { } } - void setBandwidth(double bandwidth) { - demod.setBandwidth(bandwidth); - } + void setBandwidth(double bandwidth) { demod.setBandwidth(bandwidth); } - void setInput(dsp::stream* input) { - demod.setInput(input); - } + void setInput(dsp::stream* input) { demod.setInput(input); } void AFSampRateChanged(double newSR) {} @@ -94,11 +83,10 @@ namespace demod { bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return true; } - dsp::stream* getOutput() { return &m2s.out; } + dsp::stream* getOutput() { return &demod.out; } private: - dsp::demod::SSB demod; - dsp::convert::MonoToStereo m2s; + dsp::demod::SSB demod; ConfigManager* _config; From b943e6e8692999a3be9dc4bbdd1840d1c8fca18a Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Tue, 21 Jun 2022 19:54:03 +0200 Subject: [PATCH 19/39] Code cleanup, bugfix and optimisation --- core/src/dsp/demod/am.h | 4 +- core/src/dsp/demod/cw.h | 9 +- core/src/dsp/demod/ssb.h | 2 +- decoder_modules/radio/src/demod.h | 2 +- decoder_modules/radio/src/demodulators/am.h | 6 +- decoder_modules/radio/src/demodulators/cw.h | 6 +- decoder_modules/radio/src/demodulators/dsb.h | 6 +- decoder_modules/radio/src/demodulators/lsb.h | 6 +- decoder_modules/radio/src/demodulators/nfm.h | 6 +- decoder_modules/radio/src/demodulators/raw.h | 6 +- decoder_modules/radio/src/demodulators/usb.h | 6 +- decoder_modules/radio/src/demodulators/wfm.h | 6 +- decoder_modules/radio/src/radio_module.h | 98 +++++++++----------- 13 files changed, 78 insertions(+), 85 deletions(-) diff --git a/core/src/dsp/demod/am.h b/core/src/dsp/demod/am.h index 06248d1..b11772e 100644 --- a/core/src/dsp/demod/am.h +++ b/core/src/dsp/demod/am.h @@ -31,8 +31,8 @@ namespace dsp::demod { _bandwidth = bandwidth; _samplerate = samplerate; - carrierAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); - audioAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); + carrierAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0, INFINITY); + audioAgc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0, INFINITY); dcBlock.init(NULL, dcBlockRate); lpfTaps = taps::lowPass(bandwidth / 2.0, (bandwidth / 2.0) * 0.1, samplerate); lpf.init(NULL, lpfTaps); diff --git a/core/src/dsp/demod/cw.h b/core/src/dsp/demod/cw.h index 29103e3..dddd338 100644 --- a/core/src/dsp/demod/cw.h +++ b/core/src/dsp/demod/cw.h @@ -16,9 +16,10 @@ namespace dsp::demod { void init(stream* in, double tone, double agcAttack, double agcDecay, double samplerate) { _tone = tone; + _samplerate = samplerate; xlator.init(NULL, tone, samplerate); - agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); + agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0, INFINITY); if constexpr (std::is_same_v) { agc.out.free(); @@ -31,7 +32,7 @@ namespace dsp::demod { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); _tone = tone; - xlator.setOffset(_tone); + xlator.setOffset(_tone, _samplerate); } void setAGCAttack(double attack) { @@ -49,7 +50,8 @@ namespace dsp::demod { void setSamplerate(double samplerate) { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); - xlator.setOffset(_tone, samplerate); + _samplerate = samplerate; + xlator.setOffset(_tone, _samplerate); } inline int process(int count, const complex_t* in, T* out) { @@ -79,6 +81,7 @@ namespace dsp::demod { private: double _tone; + double _samplerate; dsp::channel::FrequencyXlator xlator; dsp::loop::AGC agc; diff --git a/core/src/dsp/demod/ssb.h b/core/src/dsp/demod/ssb.h index 3b25de6..59ef16b 100644 --- a/core/src/dsp/demod/ssb.h +++ b/core/src/dsp/demod/ssb.h @@ -26,7 +26,7 @@ namespace dsp::demod { _samplerate = samplerate; xlator.init(NULL, getTranslation(), _samplerate); - agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0); + agc.init(NULL, 1.0, agcAttack, agcDecay, 10e6, 10.0, INFINITY); if constexpr (std::is_same_v) { agc.out.free(); diff --git a/decoder_modules/radio/src/demod.h b/decoder_modules/radio/src/demod.h index 1f45604..06247e8 100644 --- a/decoder_modules/radio/src/demod.h +++ b/decoder_modules/radio/src/demod.h @@ -24,7 +24,7 @@ namespace demod { class Demodulator { public: virtual ~Demodulator() {} - virtual void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) = 0; + virtual void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) = 0; virtual void start() = 0; virtual void stop() = 0; virtual void showMenu() = 0; diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index bb0a6c9..e586ff3 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -7,13 +7,13 @@ namespace demod { public: AM() {} - AM(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + AM(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~AM() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; _config = config; diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index bc53f9c..6212bd3 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -7,15 +7,15 @@ namespace demod { public: CW() {} - CW(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + CW(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~CW() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; this->_config = config; this->afbwChangeHandler = afbwChangeHandler; diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index 3401210..e3cde0b 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -7,15 +7,15 @@ namespace demod { public: DSB() {} - DSB(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + DSB(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~DSB() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; _config = config; diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index a5ee770..d31086f 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -7,15 +7,15 @@ namespace demod { public: LSB() {} - LSB(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + LSB(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~LSB() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; _config = config; diff --git a/decoder_modules/radio/src/demodulators/nfm.h b/decoder_modules/radio/src/demodulators/nfm.h index b47a5d0..7dda517 100644 --- a/decoder_modules/radio/src/demodulators/nfm.h +++ b/decoder_modules/radio/src/demodulators/nfm.h @@ -7,13 +7,13 @@ namespace demod { public: NFM() {} - NFM(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + NFM(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~NFM() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; // Define structure diff --git a/decoder_modules/radio/src/demodulators/raw.h b/decoder_modules/radio/src/demodulators/raw.h index 8860fee..bab4c3b 100644 --- a/decoder_modules/radio/src/demodulators/raw.h +++ b/decoder_modules/radio/src/demodulators/raw.h @@ -7,15 +7,15 @@ namespace demod { public: RAW() {} - RAW(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + RAW(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~RAW() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; audioSampleRate = audioSR; diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index 49e5596..cd41d2b 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -8,15 +8,15 @@ namespace demod { public: USB() {} - USB(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + USB(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~USB() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; _config = config; diff --git a/decoder_modules/radio/src/demodulators/wfm.h b/decoder_modules/radio/src/demodulators/wfm.h index 43e2999..28ff2fb 100644 --- a/decoder_modules/radio/src/demodulators/wfm.h +++ b/decoder_modules/radio/src/demodulators/wfm.h @@ -7,15 +7,15 @@ namespace demod { public: WFM() {} - WFM(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { - init(name, config, input, bandwidth, outputChangeHandler, afbwChangeHandler, audioSR); + WFM(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { + init(name, config, input, bandwidth, audioSR); } ~WFM() { stop(); } - void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, EventHandler*> outputChangeHandler, EventHandler afbwChangeHandler, double audioSR) { + void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; this->outputChangeHandler = outputChangeHandler; _config = config; diff --git a/decoder_modules/radio/src/radio_module.h b/decoder_modules/radio/src/radio_module.h index e07becc..f504884 100644 --- a/decoder_modules/radio/src/radio_module.h +++ b/decoder_modules/radio/src/radio_module.h @@ -57,17 +57,6 @@ public: selectedDemodID = config.conf[name]["selectedDemodId"]; config.release(created); - // Create demodulator instances - demods.fill(NULL); - demods[RADIO_DEMOD_WFM] = new demod::WFM(); - demods[RADIO_DEMOD_NFM] = new demod::NFM(); - demods[RADIO_DEMOD_AM] = new demod::AM(); - demods[RADIO_DEMOD_USB] = new demod::USB(); - demods[RADIO_DEMOD_LSB] = new demod::LSB(); - demods[RADIO_DEMOD_DSB] = new demod::DSB(); - demods[RADIO_DEMOD_CW] = new demod::CW(); - demods[RADIO_DEMOD_RAW] = new demod::RAW(); - // Initialize the VFO vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 200000, 200000, 50000, 200000, false); onUserChangedBandwidthHandler.handler = vfoUserChangedBandwidthHandler; @@ -85,30 +74,6 @@ public: ifChain.addBlock(&squelch, false); ifChain.addBlock(&fmnr, false); - // Load configuration for and enabled all demodulators - EventHandler*> _demodOutputChangeHandler; - EventHandler _demodAfbwChangedHandler; - _demodOutputChangeHandler.handler = demodOutputChangeHandler; - _demodOutputChangeHandler.ctx = this; - _demodAfbwChangedHandler.handler = demodAfbwChangedHandler; - _demodAfbwChangedHandler.ctx = this; - for (auto& demod : demods) { - if (!demod) { continue; } - - // Default config - double bw = demod->getDefaultBandwidth(); - if (!config.conf[name].contains(demod->getName())) { - config.conf[name][demod->getName()]["bandwidth"] = bw; - config.conf[name][demod->getName()]["snapInterval"] = demod->getDefaultSnapInterval(); - config.conf[name][demod->getName()]["squelchLevel"] = MIN_SQUELCH; - config.conf[name][demod->getName()]["squelchEnabled"] = false; - } - bw = std::clamp(bw, demod->getMinBandwidth(), demod->getMaxBandwidth()); - - // Initialize - demod->init(name, &config, ifChain.out, bw, _demodOutputChangeHandler, _demodAfbwChangedHandler, stream.getSampleRate()); - } - // Initialize audio DSP chain afChain.init(&dummyAudioStream); @@ -297,8 +262,45 @@ private: if (!_this->enabled) { style::endDisabled(); } } + demod::Demodulator* instantiateDemod(DemodID id) { + demod::Demodulator* demod = NULL; + switch (id) { + case DemodID::RADIO_DEMOD_NFM: demod = new demod::NFM(); break; + case DemodID::RADIO_DEMOD_WFM: demod = new demod::WFM(); break; + case DemodID::RADIO_DEMOD_AM: demod = new demod::AM(); break; + case DemodID::RADIO_DEMOD_DSB: demod = new demod::DSB(); break; + case DemodID::RADIO_DEMOD_USB: demod = new demod::USB(); break; + case DemodID::RADIO_DEMOD_CW: demod = new demod::CW(); break; + case DemodID::RADIO_DEMOD_LSB: demod = new demod::LSB(); break; + case DemodID::RADIO_DEMOD_RAW: demod = new demod::RAW(); break; + default: demod = NULL; break; + } + if (!demod) { return NULL; } + + // Default config + double bw = demod->getDefaultBandwidth(); + config.acquire(); + if (!config.conf[name].contains(demod->getName())) { + config.conf[name][demod->getName()]["bandwidth"] = bw; + config.conf[name][demod->getName()]["snapInterval"] = demod->getDefaultSnapInterval(); + config.conf[name][demod->getName()]["squelchLevel"] = MIN_SQUELCH; + config.conf[name][demod->getName()]["squelchEnabled"] = false; + config.release(true); + } + else { + config.release(); + } + bw = std::clamp(bw, demod->getMinBandwidth(), demod->getMaxBandwidth()); + + // Initialize + demod->init(name, &config, ifChain.out, bw, stream.getSampleRate()); + + return demod; + } + void selectDemodByID(DemodID id) { - demod::Demodulator* demod = demods[id]; + auto startTime = std::chrono::high_resolution_clock::now(); + demod::Demodulator* demod = instantiateDemod(id); if (!demod) { spdlog::error("Demodulator {0} not implemented", id); return; @@ -310,11 +312,16 @@ private: config.acquire(); config.conf[name]["selectedDemodId"] = id; config.release(true); + auto endTime = std::chrono::high_resolution_clock::now(); + spdlog::warn("Demod switch took {0} us", (std::chrono::duration_cast(endTime - startTime)).count()); } void selectDemod(demod::Demodulator* demod) { // Stopcurrently selected demodulator and select new - if (selectedDemod) { selectedDemod->stop(); } + if (selectedDemod) { + selectedDemod->stop(); + delete selectedDemod; + } selectedDemod = demod; // Give the demodulator the most recent audio SR @@ -553,22 +560,6 @@ private: _this->setAudioSampleRate(sampleRate); } - static void demodOutputChangeHandler(dsp::stream* output, void* ctx) { - RadioModule* _this = (RadioModule*)ctx; - _this->afChain.setInput(output, [=](dsp::stream* out){ _this->stream.setInput(out); }); - } - - static void demodAfbwChangedHandler(float output, void* ctx) { - RadioModule* _this = (RadioModule*)ctx; - - float audioBW = std::min(_this->selectedDemod->getMaxAFBandwidth(), _this->selectedDemod->getAFBandwidth(_this->bandwidth)); - audioBW = std::min(audioBW, _this->audioSampleRate / 2.0); - - // _this->win.setCutoff(audioBW); - // _this->win.setTransWidth(audioBW); - // _this->resamp.block.updateWindow(&_this->win); - } - static void ifChainOutputChangeHandler(dsp::stream* output, void* ctx) { RadioModule* _this = (RadioModule*)ctx; if (!_this->selectedDemod) { return; } @@ -642,7 +633,6 @@ private: SinkManager::Stream stream; - std::array demods; demod::Demodulator* selectedDemod = NULL; OptionList deempModes; From f2b8418a2539f6f5302cf92fd7a39e034f8dedc0 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 22 Jun 2022 04:58:03 +0200 Subject: [PATCH 20/39] hopefully a fix for the linux crash --- core/src/dsp/loop/agc.h | 8 ++++---- core/src/dsp/sink/ring_buffer.h | 7 ++++++- decoder_modules/radio/src/radio_module.h | 2 ++ sink_modules/portaudio_sink/src/main.cpp | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/src/dsp/loop/agc.h b/core/src/dsp/loop/agc.h index e20018b..659dadb 100644 --- a/core/src/dsp/loop/agc.h +++ b/core/src/dsp/loop/agc.h @@ -89,17 +89,17 @@ namespace dsp::loop { float maxAmp = 0; for (int j = i; j < count; j++) { if constexpr (std::is_same_v) { - inAmp = in[i].amplitude(); + inAmp = in[j].amplitude(); } if constexpr (std::is_same_v) { - inAmp = fabsf(in[i]); + inAmp = fabsf(in[j]); } if (inAmp > maxAmp) { maxAmp = inAmp; } } amp = maxAmp; - gain = _setPoint / maxAmp; + gain = std::min(_setPoint / amp, _maxGain); } - + // Scale output by gain out[i] = in[i] * gain; } diff --git a/core/src/dsp/sink/ring_buffer.h b/core/src/dsp/sink/ring_buffer.h index 5298ae6..be07626 100644 --- a/core/src/dsp/sink/ring_buffer.h +++ b/core/src/dsp/sink/ring_buffer.h @@ -11,7 +11,12 @@ namespace dsp::sink { public: RingBuffer() {} - RingBuffer(stream* in) { base_type::init(in); } + RingBuffer(stream* in, int maxLatency) { init(in, maxLatency); } + + void init(stream* in, int maxLatency) { + data.init(maxLatency); + base_type::init(in); + } int run() { int count = base_type::_in->read(); diff --git a/decoder_modules/radio/src/radio_module.h b/decoder_modules/radio/src/radio_module.h index f504884..8470737 100644 --- a/decoder_modules/radio/src/radio_module.h +++ b/decoder_modules/radio/src/radio_module.h @@ -318,11 +318,13 @@ private: void selectDemod(demod::Demodulator* demod) { // Stopcurrently selected demodulator and select new + afChain.stop(); if (selectedDemod) { selectedDemod->stop(); delete selectedDemod; } selectedDemod = demod; + afChain.start(); // Give the demodulator the most recent audio SR selectedDemod->AFSampRateChanged(audioSampleRate); diff --git a/sink_modules/portaudio_sink/src/main.cpp b/sink_modules/portaudio_sink/src/main.cpp index 8f9f2e3..c17df33 100644 --- a/sink_modules/portaudio_sink/src/main.cpp +++ b/sink_modules/portaudio_sink/src/main.cpp @@ -34,8 +34,8 @@ public: _stream = stream; _streamName = streamName; s2m.init(_stream->sinkOut); - monoRB.init(&s2m.out); - stereoRB.init(_stream->sinkOut); + monoRB.init(&s2m.out, 480); + stereoRB.init(_stream->sinkOut, 480); // monoPacker.init(&s2m.out, 240); // stereoPacker.init(_stream->sinkOut, 240); From 218fd6ccf446a35ec29dbc1b4044c0db43cdb0bc Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 22 Jun 2022 05:20:40 +0200 Subject: [PATCH 21/39] another attempt at a fix --- decoder_modules/radio/src/radio_module.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/decoder_modules/radio/src/radio_module.h b/decoder_modules/radio/src/radio_module.h index 8470737..b86adb4 100644 --- a/decoder_modules/radio/src/radio_module.h +++ b/decoder_modules/radio/src/radio_module.h @@ -318,13 +318,12 @@ private: void selectDemod(demod::Demodulator* demod) { // Stopcurrently selected demodulator and select new - afChain.stop(); + afChain.setInput(&dummyAudioStream, [=](dsp::stream* out){ stream.setInput(out); }); if (selectedDemod) { selectedDemod->stop(); delete selectedDemod; } selectedDemod = demod; - afChain.start(); // Give the demodulator the most recent audio SR selectedDemod->AFSampRateChanged(audioSampleRate); From 01e1430847fd389b0bf3d37cef09a4081bc20b98 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 22 Jun 2022 05:28:03 +0200 Subject: [PATCH 22/39] final attempt at a fix --- core/src/dsp/demod/fm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/dsp/demod/fm.h b/core/src/dsp/demod/fm.h index 8a79f50..8a028f5 100644 --- a/core/src/dsp/demod/fm.h +++ b/core/src/dsp/demod/fm.h @@ -33,6 +33,8 @@ namespace dsp::demod { demod.out.free(); } lpf.out.free(); + + base_type::init(in); } void setSamplerate(double samplerate) { From 97643edf2f7f81bc1a1fe72a6c9a41c967cbad02 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 23 Jun 2022 01:10:24 +0200 Subject: [PATCH 23/39] Fixed crash on radio disable/enable --- core/src/dsp/routing/splitter.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/dsp/routing/splitter.h b/core/src/dsp/routing/splitter.h index 950d61e..50379c9 100644 --- a/core/src/dsp/routing/splitter.h +++ b/core/src/dsp/routing/splitter.h @@ -22,6 +22,7 @@ namespace dsp::routing { // Add to the list base_type::tempStop(); streams.push_back(stream); + base_type::registerOutput(stream); base_type::tempStart(); } @@ -37,6 +38,7 @@ namespace dsp::routing { // Add to the list base_type::tempStop(); + base_type::unregisterOutput(stream); streams.erase(sit); base_type::tempStart(); } From db034527e9edca6d7aa5ea94f2c5ef37dc6e8622 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 23 Jun 2022 21:30:38 +0200 Subject: [PATCH 24/39] cleanup and better defaultzs --- core/src/core.cpp | 2 +- decoder_modules/radio/src/demodulators/wfm.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/core.cpp b/core/src/core.cpp index d6ac74c..e7a2da1 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -117,7 +117,7 @@ int sdrpp_main(int argc, char* argv[]) { defConfig["fftHeight"] = 300; defConfig["fftRate"] = 20; defConfig["fftSize"] = 65536; - defConfig["fftWindow"] = 1; + defConfig["fftWindow"] = 2; defConfig["frequency"] = 100000000.0; defConfig["fullWaterfallUpdate"] = false; defConfig["max"] = 0.0; diff --git a/decoder_modules/radio/src/demodulators/wfm.h b/decoder_modules/radio/src/demodulators/wfm.h index 28ff2fb..c351176 100644 --- a/decoder_modules/radio/src/demodulators/wfm.h +++ b/decoder_modules/radio/src/demodulators/wfm.h @@ -17,7 +17,6 @@ namespace demod { void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; - this->outputChangeHandler = outputChangeHandler; _config = config; // Load config @@ -105,6 +104,5 @@ namespace demod { bool _lowPass = true; std::string name; - EventHandler*> outputChangeHandler; }; } \ No newline at end of file From fb0e0d732bf58763ec3aeaac6e1f977d173e018c Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 23 Jun 2022 22:21:25 +0200 Subject: [PATCH 25/39] Attempted cmake cleanup --- CMakeLists.txt | 20 +++++++++---------- core/CMakeLists.txt | 9 --------- .../falcon9_decoder/CMakeLists.txt | 8 -------- .../kg_sstv_decoder/CMakeLists.txt | 8 -------- decoder_modules/m17_decoder/CMakeLists.txt | 8 -------- .../meteor_demodulator/CMakeLists.txt | 8 -------- decoder_modules/radio/CMakeLists.txt | 8 -------- .../weather_sat_decoder/CMakeLists.txt | 8 -------- misc_modules/demo_module/CMakeLists.txt | 8 -------- .../discord_integration/CMakeLists.txt | 8 -------- misc_modules/frequency_manager/CMakeLists.txt | 8 -------- misc_modules/recorder/CMakeLists.txt | 8 -------- misc_modules/rigctl_server/CMakeLists.txt | 8 -------- misc_modules/scanner/CMakeLists.txt | 8 -------- misc_modules/scheduler/CMakeLists.txt | 8 -------- sink_modules/audio_sink/CMakeLists.txt | 8 -------- sink_modules/network_sink/CMakeLists.txt | 8 -------- .../new_portaudio_sink/CMakeLists.txt | 8 -------- sink_modules/portaudio_sink/CMakeLists.txt | 8 -------- source_modules/airspy_source/CMakeLists.txt | 8 -------- source_modules/airspyhf_source/CMakeLists.txt | 8 -------- source_modules/bladerf_source/CMakeLists.txt | 8 -------- source_modules/file_source/CMakeLists.txt | 8 -------- source_modules/hackrf_source/CMakeLists.txt | 8 -------- source_modules/limesdr_source/CMakeLists.txt | 8 -------- source_modules/plutosdr_source/CMakeLists.txt | 8 -------- source_modules/rfspace_source/CMakeLists.txt | 8 -------- source_modules/rtl_sdr_source/CMakeLists.txt | 8 -------- source_modules/rtl_tcp_source/CMakeLists.txt | 8 -------- source_modules/sddc_source/CMakeLists.txt | 8 -------- source_modules/sdrplay_source/CMakeLists.txt | 8 -------- .../sdrpp_server_source/CMakeLists.txt | 8 -------- source_modules/soapy_source/CMakeLists.txt | 8 -------- .../spyserver_source/CMakeLists.txt | 8 -------- 34 files changed, 9 insertions(+), 276 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bea7e9..dffb7c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,15 @@ if (ANDROID) set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++17") endif (ANDROID) +# Compiler arguments for each platform +if (MSVC) + target_compile_options(sdrpp PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(sdrpp PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(sdrpp PRIVATE -O3 -std=c++17) +endif () + # Backends option(OPT_BACKEND_GLFW "Use the GLFW backend" ON) option(OPT_BACKEND_ANDROID "Use the Android backend" OFF) @@ -209,23 +218,12 @@ endif (OPT_BUILD_SCHEDULER) add_executable(sdrpp "src/main.cpp" "win32/resources.rc") target_link_libraries(sdrpp PRIVATE sdrpp_core) -# Compiler arguments for each platform -if (MSVC) - target_compile_options(sdrpp PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(sdrpp PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(sdrpp PRIVATE -O3 -std=c++17) -endif () - - # Copy dynamic libs over if (MSVC) add_custom_target(do_always ALL xcopy /s \"$\\*.dll\" \"$\" /Y) add_custom_target(do_always_volk ALL xcopy /s \"C:/Program Files/PothosSDR/bin\\volk.dll\" \"$\" /Y) endif () - if (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") add_custom_target(do_always ALL cp \"$/libsdrpp_core.so\" \"$\") endif () diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 675cdee..4d8612e 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -29,15 +29,6 @@ endif (OPT_BACKEND_ANDROID) # Add code to dyn lib add_library(sdrpp_core SHARED ${SRC} ${BACKEND_SRC}) -# Set compiler options -if (MSVC) - target_compile_options(sdrpp_core PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(sdrpp_core PRIVATE -O3 -std=c++17) -else () - target_compile_options(sdrpp_core PRIVATE -O3 -std=c++17) -endif () - # Set the install prefix target_compile_definitions(sdrpp_core PUBLIC INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") diff --git a/decoder_modules/falcon9_decoder/CMakeLists.txt b/decoder_modules/falcon9_decoder/CMakeLists.txt index d08286a..6876f34 100644 --- a/decoder_modules/falcon9_decoder/CMakeLists.txt +++ b/decoder_modules/falcon9_decoder/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(falcon9_decoder PROPERTIES PREFIX "") target_include_directories(falcon9_decoder PRIVATE "src/") -if (MSVC) - target_compile_options(falcon9_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(falcon9_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(falcon9_decoder PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS falcon9_decoder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/kg_sstv_decoder/CMakeLists.txt b/decoder_modules/kg_sstv_decoder/CMakeLists.txt index 4bb74df..bff8079 100644 --- a/decoder_modules/kg_sstv_decoder/CMakeLists.txt +++ b/decoder_modules/kg_sstv_decoder/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(kg_sstv_decoder PROPERTIES PREFIX "") target_include_directories(kg_sstv_decoder PRIVATE "src/") -if (MSVC) - target_compile_options(kg_sstv_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(kg_sstv_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(kg_sstv_decoder PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS kg_sstv_decoder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/m17_decoder/CMakeLists.txt b/decoder_modules/m17_decoder/CMakeLists.txt index 4b44578..9f960b7 100644 --- a/decoder_modules/m17_decoder/CMakeLists.txt +++ b/decoder_modules/m17_decoder/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(m17_decoder PROPERTIES PREFIX "") target_include_directories(m17_decoder PRIVATE "src/") -if (MSVC) - target_compile_options(m17_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(m17_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(m17_decoder PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_include_directories(m17_decoder PRIVATE "C:/Program Files/codec2/include/") diff --git a/decoder_modules/meteor_demodulator/CMakeLists.txt b/decoder_modules/meteor_demodulator/CMakeLists.txt index e15042f..79df1a5 100644 --- a/decoder_modules/meteor_demodulator/CMakeLists.txt +++ b/decoder_modules/meteor_demodulator/CMakeLists.txt @@ -9,13 +9,5 @@ add_library(meteor_demodulator SHARED ${SRC}) target_link_libraries(meteor_demodulator PRIVATE sdrpp_core) set_target_properties(meteor_demodulator PROPERTIES PREFIX "") -if (MSVC) - target_compile_options(meteor_demodulator PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(meteor_demodulator PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(meteor_demodulator PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS meteor_demodulator DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/radio/CMakeLists.txt b/decoder_modules/radio/CMakeLists.txt index f554f2a..4c806bb 100644 --- a/decoder_modules/radio/CMakeLists.txt +++ b/decoder_modules/radio/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(radio PROPERTIES PREFIX "") target_include_directories(radio PRIVATE "src/") -if (MSVC) - target_compile_options(radio PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(radio PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(radio PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS radio DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/weather_sat_decoder/CMakeLists.txt b/decoder_modules/weather_sat_decoder/CMakeLists.txt index b687d75..4e1d0cf 100644 --- a/decoder_modules/weather_sat_decoder/CMakeLists.txt +++ b/decoder_modules/weather_sat_decoder/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(weather_sat_decoder PROPERTIES PREFIX "") target_include_directories(weather_sat_decoder PRIVATE "src/") -if (MSVC) - target_compile_options(weather_sat_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(weather_sat_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(weather_sat_decoder PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS weather_sat_decoder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/demo_module/CMakeLists.txt b/misc_modules/demo_module/CMakeLists.txt index 9a1fdb1..2b8ce39 100644 --- a/misc_modules/demo_module/CMakeLists.txt +++ b/misc_modules/demo_module/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(demo PROPERTIES PREFIX "") target_include_directories(demo PRIVATE "src/") -if (MSVC) - target_compile_options(demo PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(demo PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(demo PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS demo DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/discord_integration/CMakeLists.txt b/misc_modules/discord_integration/CMakeLists.txt index c0f54b1..a31e0d1 100644 --- a/misc_modules/discord_integration/CMakeLists.txt +++ b/misc_modules/discord_integration/CMakeLists.txt @@ -17,13 +17,5 @@ set_target_properties(discord_integration PROPERTIES PREFIX "") target_include_directories(discord_integration PRIVATE "src/" "discord-rpc/include" "../../decoder_modules/radio/src/") -if (MSVC) - target_compile_options(discord_integration PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(discord_integration PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(discord_integration PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS discord_integration DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/frequency_manager/CMakeLists.txt b/misc_modules/frequency_manager/CMakeLists.txt index a3397c9..91ca931 100644 --- a/misc_modules/frequency_manager/CMakeLists.txt +++ b/misc_modules/frequency_manager/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(frequency_manager PROPERTIES PREFIX "") target_include_directories(frequency_manager PRIVATE "src/" "../../decoder_modules/radio/src") -if (MSVC) - target_compile_options(frequency_manager PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(frequency_manager PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(frequency_manager PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS frequency_manager DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/recorder/CMakeLists.txt b/misc_modules/recorder/CMakeLists.txt index d72b938..0f91f97 100644 --- a/misc_modules/recorder/CMakeLists.txt +++ b/misc_modules/recorder/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(recorder PROPERTIES PREFIX "") target_include_directories(recorder PRIVATE "src/") -if (MSVC) - target_compile_options(recorder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(recorder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(recorder PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS recorder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/rigctl_server/CMakeLists.txt b/misc_modules/rigctl_server/CMakeLists.txt index 89a61df..665e78b 100644 --- a/misc_modules/rigctl_server/CMakeLists.txt +++ b/misc_modules/rigctl_server/CMakeLists.txt @@ -12,13 +12,5 @@ target_include_directories(rigctl_server PRIVATE "../recorder/src") target_include_directories(rigctl_server PRIVATE "../../decoder_modules/meteor_demodulator/src") target_include_directories(rigctl_server PRIVATE "../../decoder_modules/radio/src") -if (MSVC) - target_compile_options(rigctl_server PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(rigctl_server PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(rigctl_server PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS rigctl_server DESTINATION lib/sdrpp/plugins) diff --git a/misc_modules/scanner/CMakeLists.txt b/misc_modules/scanner/CMakeLists.txt index 98a380b..9e3e82d 100644 --- a/misc_modules/scanner/CMakeLists.txt +++ b/misc_modules/scanner/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(scanner PROPERTIES PREFIX "") target_include_directories(scanner PRIVATE "src/") -if (MSVC) - target_compile_options(scanner PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(scanner PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(scanner PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS scanner DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/scheduler/CMakeLists.txt b/misc_modules/scheduler/CMakeLists.txt index f51a8f5..fcf15ec 100644 --- a/misc_modules/scheduler/CMakeLists.txt +++ b/misc_modules/scheduler/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(scheduler PROPERTIES PREFIX "") target_include_directories(scheduler PRIVATE "src/") -if (MSVC) - target_compile_options(scheduler PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(scheduler PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(scheduler PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS scheduler DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/sink_modules/audio_sink/CMakeLists.txt b/sink_modules/audio_sink/CMakeLists.txt index e76fa43..b056716 100644 --- a/sink_modules/audio_sink/CMakeLists.txt +++ b/sink_modules/audio_sink/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(audio_sink PROPERTIES PREFIX "") target_include_directories(audio_sink PRIVATE "src/") -if (MSVC) - target_compile_options(audio_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(audio_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(audio_sink PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(audio_sink PRIVATE "C:/Program Files (x86)/RtAudio/lib") diff --git a/sink_modules/network_sink/CMakeLists.txt b/sink_modules/network_sink/CMakeLists.txt index b7ab9c7..46b9964 100644 --- a/sink_modules/network_sink/CMakeLists.txt +++ b/sink_modules/network_sink/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(network_sink PROPERTIES PREFIX "") target_include_directories(network_sink PRIVATE "src/") -if (MSVC) - target_compile_options(network_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(network_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(network_sink PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS network_sink DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/sink_modules/new_portaudio_sink/CMakeLists.txt b/sink_modules/new_portaudio_sink/CMakeLists.txt index 0d05291..44bf466 100644 --- a/sink_modules/new_portaudio_sink/CMakeLists.txt +++ b/sink_modules/new_portaudio_sink/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(new_portaudio_sink PROPERTIES PREFIX "") target_include_directories(new_portaudio_sink PRIVATE "src/") -if (MSVC) - target_compile_options(new_portaudio_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(new_portaudio_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(new_portaudio_sink PRIVATE -O3 -std=c++17) -endif () - if (MSVC) find_package(portaudio CONFIG REQUIRED) target_link_libraries(new_portaudio_sink PRIVATE portaudio) diff --git a/sink_modules/portaudio_sink/CMakeLists.txt b/sink_modules/portaudio_sink/CMakeLists.txt index d920989..377f763 100644 --- a/sink_modules/portaudio_sink/CMakeLists.txt +++ b/sink_modules/portaudio_sink/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(audio_sink PROPERTIES PREFIX "") target_include_directories(audio_sink PRIVATE "src/") -if (MSVC) - target_compile_options(audio_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(audio_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(audio_sink PRIVATE -O3 -std=c++17) -endif () - if (MSVC) find_package(portaudio CONFIG REQUIRED) target_link_libraries(audio_sink PRIVATE portaudio) diff --git a/source_modules/airspy_source/CMakeLists.txt b/source_modules/airspy_source/CMakeLists.txt index b206da9..9993ff0 100644 --- a/source_modules/airspy_source/CMakeLists.txt +++ b/source_modules/airspy_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(airspy_source PROPERTIES PREFIX "") target_include_directories(airspy_source PRIVATE "src/") -if (MSVC) - target_compile_options(airspy_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(airspy_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(airspy_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(airspy_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/airspyhf_source/CMakeLists.txt b/source_modules/airspyhf_source/CMakeLists.txt index 03446ad..28091df 100644 --- a/source_modules/airspyhf_source/CMakeLists.txt +++ b/source_modules/airspyhf_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(airspyhf_source PROPERTIES PREFIX "") target_include_directories(airspyhf_source PRIVATE "src/") -if (MSVC) - target_compile_options(airspyhf_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(airspyhf_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(airspyhf_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(airspyhf_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/bladerf_source/CMakeLists.txt b/source_modules/bladerf_source/CMakeLists.txt index bd801ce..ed8a989 100644 --- a/source_modules/bladerf_source/CMakeLists.txt +++ b/source_modules/bladerf_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(bladerf_source PROPERTIES PREFIX "") target_include_directories(bladerf_source PRIVATE "src/") -if (MSVC) - target_compile_options(bladerf_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(bladerf_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(bladerf_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(bladerf_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/file_source/CMakeLists.txt b/source_modules/file_source/CMakeLists.txt index 496c084..eb6ae93 100644 --- a/source_modules/file_source/CMakeLists.txt +++ b/source_modules/file_source/CMakeLists.txt @@ -9,13 +9,5 @@ set_target_properties(file_source PROPERTIES PREFIX "") target_include_directories(file_source PRIVATE "src/") -if (MSVC) - target_compile_options(file_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(file_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(file_source PRIVATE -O3 -std=c++17) -endif () - # Install directives install(TARGETS file_source DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/source_modules/hackrf_source/CMakeLists.txt b/source_modules/hackrf_source/CMakeLists.txt index 6b69c75..5e209e2 100644 --- a/source_modules/hackrf_source/CMakeLists.txt +++ b/source_modules/hackrf_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(hackrf_source PROPERTIES PREFIX "") target_include_directories(hackrf_source PRIVATE "src/") -if (MSVC) - target_compile_options(hackrf_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(hackrf_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(hackrf_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(hackrf_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/limesdr_source/CMakeLists.txt b/source_modules/limesdr_source/CMakeLists.txt index 9d07ae3..961e756 100644 --- a/source_modules/limesdr_source/CMakeLists.txt +++ b/source_modules/limesdr_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(limesdr_source PROPERTIES PREFIX "") target_include_directories(limesdr_source PRIVATE "src/") -if (MSVC) - target_compile_options(limesdr_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(limesdr_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(limesdr_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(limesdr_source PRIVATE "C:/Program Files/PothosSDR/lib") diff --git a/source_modules/plutosdr_source/CMakeLists.txt b/source_modules/plutosdr_source/CMakeLists.txt index 224a328..20e39e4 100644 --- a/source_modules/plutosdr_source/CMakeLists.txt +++ b/source_modules/plutosdr_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(plutosdr_source PROPERTIES PREFIX "") target_include_directories(plutosdr_source PRIVATE "src/") -if (MSVC) - target_compile_options(plutosdr_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(plutosdr_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(plutosdr_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(plutosdr_source PRIVATE "C:/Program Files/PothosSDR/lib/") diff --git a/source_modules/rfspace_source/CMakeLists.txt b/source_modules/rfspace_source/CMakeLists.txt index 3035589..7123260 100644 --- a/source_modules/rfspace_source/CMakeLists.txt +++ b/source_modules/rfspace_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(rfspace_source PROPERTIES PREFIX "") target_include_directories(rfspace_source PRIVATE "src/") -if (MSVC) - target_compile_options(rfspace_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(rfspace_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(rfspace_source PRIVATE -O3 -std=c++17) -endif () - if(WIN32) target_link_libraries(rfspace_source PRIVATE wsock32 ws2_32) endif() diff --git a/source_modules/rtl_sdr_source/CMakeLists.txt b/source_modules/rtl_sdr_source/CMakeLists.txt index 3df82b2..f35475b 100644 --- a/source_modules/rtl_sdr_source/CMakeLists.txt +++ b/source_modules/rtl_sdr_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(rtl_sdr_source PROPERTIES PREFIX "") target_include_directories(rtl_sdr_source PRIVATE "src/") -if (MSVC) - target_compile_options(rtl_sdr_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(rtl_sdr_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(rtl_sdr_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(rtl_sdr_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/rtl_tcp_source/CMakeLists.txt b/source_modules/rtl_tcp_source/CMakeLists.txt index a1e0a78..6cacf2f 100644 --- a/source_modules/rtl_tcp_source/CMakeLists.txt +++ b/source_modules/rtl_tcp_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(rtl_tcp_source PROPERTIES PREFIX "") target_include_directories(rtl_tcp_source PRIVATE "src/") -if (MSVC) - target_compile_options(rtl_tcp_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(rtl_tcp_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(rtl_tcp_source PRIVATE -O3 -std=c++17) -endif () - if(WIN32) target_link_libraries(rtl_tcp_source PRIVATE wsock32 ws2_32) endif() diff --git a/source_modules/sddc_source/CMakeLists.txt b/source_modules/sddc_source/CMakeLists.txt index 0882a1f..5c6890f 100644 --- a/source_modules/sddc_source/CMakeLists.txt +++ b/source_modules/sddc_source/CMakeLists.txt @@ -14,14 +14,6 @@ set_target_properties(sddc_source PROPERTIES PREFIX "") target_include_directories(sddc_source PRIVATE "src/" "src/libsddc/" "src/libsddc/Core/" "src/libsddc/Core/pffft/" "src/libsddc/libsddc/") -if (MSVC) - target_compile_options(sddc_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(sddc_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(sddc_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(sddc_source PRIVATE "C:/Program Files/PothosSDR/lib/") diff --git a/source_modules/sdrplay_source/CMakeLists.txt b/source_modules/sdrplay_source/CMakeLists.txt index 902d250..d23e0cd 100644 --- a/source_modules/sdrplay_source/CMakeLists.txt +++ b/source_modules/sdrplay_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(sdrplay_source PROPERTIES PREFIX "") target_include_directories(sdrplay_source PRIVATE "src/") -if (MSVC) - target_compile_options(sdrplay_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(sdrplay_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(sdrplay_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(sdrplay_source PRIVATE "C:/Program Files/SDRplay/API/x64") diff --git a/source_modules/sdrpp_server_source/CMakeLists.txt b/source_modules/sdrpp_server_source/CMakeLists.txt index 477e648..587a7a2 100644 --- a/source_modules/sdrpp_server_source/CMakeLists.txt +++ b/source_modules/sdrpp_server_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(sdrpp_server_source PROPERTIES PREFIX "") target_include_directories(sdrpp_server_source PRIVATE "src/") -if (MSVC) - target_compile_options(sdrpp_server_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(sdrpp_server_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(sdrpp_server_source PRIVATE -O3 -std=c++17) -endif () - if(WIN32) target_link_libraries(sdrpp_server_source PRIVATE wsock32 ws2_32) endif() diff --git a/source_modules/soapy_source/CMakeLists.txt b/source_modules/soapy_source/CMakeLists.txt index f6b40fe..5dfb2b7 100644 --- a/source_modules/soapy_source/CMakeLists.txt +++ b/source_modules/soapy_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(soapy_source PROPERTIES PREFIX "") target_include_directories(soapy_source PRIVATE "src/") -if (MSVC) - target_compile_options(soapy_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(soapy_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(soapy_source PRIVATE -O3 -std=c++17) -endif () - if (MSVC) # Lib path target_link_directories(soapy_source PRIVATE "C:/Program Files/PothosSDR/lib/") diff --git a/source_modules/spyserver_source/CMakeLists.txt b/source_modules/spyserver_source/CMakeLists.txt index db904df..823b75b 100644 --- a/source_modules/spyserver_source/CMakeLists.txt +++ b/source_modules/spyserver_source/CMakeLists.txt @@ -9,14 +9,6 @@ set_target_properties(spyserver_source PROPERTIES PREFIX "") target_include_directories(spyserver_source PRIVATE "src/") -if (MSVC) - target_compile_options(spyserver_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(spyserver_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(spyserver_source PRIVATE -O3 -std=c++17) -endif () - if(WIN32) target_link_libraries(spyserver_source PRIVATE wsock32 ws2_32) endif() From 7d64d78d67e6a54abb8d3c64dbe7534269fed9b4 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 23 Jun 2022 22:25:39 +0200 Subject: [PATCH 26/39] rollback --- CMakeLists.txt | 20 ++++++++++--------- core/CMakeLists.txt | 9 +++++++++ .../falcon9_decoder/CMakeLists.txt | 8 ++++++++ .../kg_sstv_decoder/CMakeLists.txt | 8 ++++++++ decoder_modules/m17_decoder/CMakeLists.txt | 8 ++++++++ .../meteor_demodulator/CMakeLists.txt | 8 ++++++++ decoder_modules/radio/CMakeLists.txt | 8 ++++++++ .../weather_sat_decoder/CMakeLists.txt | 8 ++++++++ misc_modules/demo_module/CMakeLists.txt | 8 ++++++++ .../discord_integration/CMakeLists.txt | 8 ++++++++ misc_modules/frequency_manager/CMakeLists.txt | 8 ++++++++ misc_modules/recorder/CMakeLists.txt | 8 ++++++++ misc_modules/rigctl_server/CMakeLists.txt | 8 ++++++++ misc_modules/scanner/CMakeLists.txt | 8 ++++++++ misc_modules/scheduler/CMakeLists.txt | 8 ++++++++ sink_modules/audio_sink/CMakeLists.txt | 8 ++++++++ sink_modules/network_sink/CMakeLists.txt | 8 ++++++++ .../new_portaudio_sink/CMakeLists.txt | 8 ++++++++ sink_modules/portaudio_sink/CMakeLists.txt | 8 ++++++++ source_modules/airspy_source/CMakeLists.txt | 8 ++++++++ source_modules/airspyhf_source/CMakeLists.txt | 8 ++++++++ source_modules/bladerf_source/CMakeLists.txt | 8 ++++++++ source_modules/file_source/CMakeLists.txt | 8 ++++++++ source_modules/hackrf_source/CMakeLists.txt | 8 ++++++++ source_modules/limesdr_source/CMakeLists.txt | 8 ++++++++ source_modules/plutosdr_source/CMakeLists.txt | 8 ++++++++ source_modules/rfspace_source/CMakeLists.txt | 8 ++++++++ source_modules/rtl_sdr_source/CMakeLists.txt | 8 ++++++++ source_modules/rtl_tcp_source/CMakeLists.txt | 8 ++++++++ source_modules/sddc_source/CMakeLists.txt | 8 ++++++++ source_modules/sdrplay_source/CMakeLists.txt | 8 ++++++++ .../sdrpp_server_source/CMakeLists.txt | 8 ++++++++ source_modules/soapy_source/CMakeLists.txt | 8 ++++++++ .../spyserver_source/CMakeLists.txt | 8 ++++++++ 34 files changed, 276 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dffb7c6..5bea7e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,15 +17,6 @@ if (ANDROID) set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=c++17") endif (ANDROID) -# Compiler arguments for each platform -if (MSVC) - target_compile_options(sdrpp PRIVATE /O2 /Ob2 /std:c++17 /EHsc) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - target_compile_options(sdrpp PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) -else () - target_compile_options(sdrpp PRIVATE -O3 -std=c++17) -endif () - # Backends option(OPT_BACKEND_GLFW "Use the GLFW backend" ON) option(OPT_BACKEND_ANDROID "Use the Android backend" OFF) @@ -218,12 +209,23 @@ endif (OPT_BUILD_SCHEDULER) add_executable(sdrpp "src/main.cpp" "win32/resources.rc") target_link_libraries(sdrpp PRIVATE sdrpp_core) +# Compiler arguments for each platform +if (MSVC) + target_compile_options(sdrpp PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(sdrpp PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(sdrpp PRIVATE -O3 -std=c++17) +endif () + + # Copy dynamic libs over if (MSVC) add_custom_target(do_always ALL xcopy /s \"$\\*.dll\" \"$\" /Y) add_custom_target(do_always_volk ALL xcopy /s \"C:/Program Files/PothosSDR/bin\\volk.dll\" \"$\" /Y) endif () + if (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") add_custom_target(do_always ALL cp \"$/libsdrpp_core.so\" \"$\") endif () diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 4d8612e..675cdee 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -29,6 +29,15 @@ endif (OPT_BACKEND_ANDROID) # Add code to dyn lib add_library(sdrpp_core SHARED ${SRC} ${BACKEND_SRC}) +# Set compiler options +if (MSVC) + target_compile_options(sdrpp_core PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(sdrpp_core PRIVATE -O3 -std=c++17) +else () + target_compile_options(sdrpp_core PRIVATE -O3 -std=c++17) +endif () + # Set the install prefix target_compile_definitions(sdrpp_core PUBLIC INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}") diff --git a/decoder_modules/falcon9_decoder/CMakeLists.txt b/decoder_modules/falcon9_decoder/CMakeLists.txt index 6876f34..d08286a 100644 --- a/decoder_modules/falcon9_decoder/CMakeLists.txt +++ b/decoder_modules/falcon9_decoder/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(falcon9_decoder PROPERTIES PREFIX "") target_include_directories(falcon9_decoder PRIVATE "src/") +if (MSVC) + target_compile_options(falcon9_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(falcon9_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(falcon9_decoder PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS falcon9_decoder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/kg_sstv_decoder/CMakeLists.txt b/decoder_modules/kg_sstv_decoder/CMakeLists.txt index bff8079..4bb74df 100644 --- a/decoder_modules/kg_sstv_decoder/CMakeLists.txt +++ b/decoder_modules/kg_sstv_decoder/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(kg_sstv_decoder PROPERTIES PREFIX "") target_include_directories(kg_sstv_decoder PRIVATE "src/") +if (MSVC) + target_compile_options(kg_sstv_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(kg_sstv_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(kg_sstv_decoder PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS kg_sstv_decoder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/m17_decoder/CMakeLists.txt b/decoder_modules/m17_decoder/CMakeLists.txt index 9f960b7..4b44578 100644 --- a/decoder_modules/m17_decoder/CMakeLists.txt +++ b/decoder_modules/m17_decoder/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(m17_decoder PROPERTIES PREFIX "") target_include_directories(m17_decoder PRIVATE "src/") +if (MSVC) + target_compile_options(m17_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(m17_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(m17_decoder PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_include_directories(m17_decoder PRIVATE "C:/Program Files/codec2/include/") diff --git a/decoder_modules/meteor_demodulator/CMakeLists.txt b/decoder_modules/meteor_demodulator/CMakeLists.txt index 79df1a5..e15042f 100644 --- a/decoder_modules/meteor_demodulator/CMakeLists.txt +++ b/decoder_modules/meteor_demodulator/CMakeLists.txt @@ -9,5 +9,13 @@ add_library(meteor_demodulator SHARED ${SRC}) target_link_libraries(meteor_demodulator PRIVATE sdrpp_core) set_target_properties(meteor_demodulator PROPERTIES PREFIX "") +if (MSVC) + target_compile_options(meteor_demodulator PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(meteor_demodulator PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(meteor_demodulator PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS meteor_demodulator DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/radio/CMakeLists.txt b/decoder_modules/radio/CMakeLists.txt index 4c806bb..f554f2a 100644 --- a/decoder_modules/radio/CMakeLists.txt +++ b/decoder_modules/radio/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(radio PROPERTIES PREFIX "") target_include_directories(radio PRIVATE "src/") +if (MSVC) + target_compile_options(radio PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(radio PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(radio PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS radio DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/decoder_modules/weather_sat_decoder/CMakeLists.txt b/decoder_modules/weather_sat_decoder/CMakeLists.txt index 4e1d0cf..b687d75 100644 --- a/decoder_modules/weather_sat_decoder/CMakeLists.txt +++ b/decoder_modules/weather_sat_decoder/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(weather_sat_decoder PROPERTIES PREFIX "") target_include_directories(weather_sat_decoder PRIVATE "src/") +if (MSVC) + target_compile_options(weather_sat_decoder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(weather_sat_decoder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(weather_sat_decoder PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS weather_sat_decoder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/demo_module/CMakeLists.txt b/misc_modules/demo_module/CMakeLists.txt index 2b8ce39..9a1fdb1 100644 --- a/misc_modules/demo_module/CMakeLists.txt +++ b/misc_modules/demo_module/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(demo PROPERTIES PREFIX "") target_include_directories(demo PRIVATE "src/") +if (MSVC) + target_compile_options(demo PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(demo PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(demo PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS demo DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/discord_integration/CMakeLists.txt b/misc_modules/discord_integration/CMakeLists.txt index a31e0d1..c0f54b1 100644 --- a/misc_modules/discord_integration/CMakeLists.txt +++ b/misc_modules/discord_integration/CMakeLists.txt @@ -17,5 +17,13 @@ set_target_properties(discord_integration PROPERTIES PREFIX "") target_include_directories(discord_integration PRIVATE "src/" "discord-rpc/include" "../../decoder_modules/radio/src/") +if (MSVC) + target_compile_options(discord_integration PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(discord_integration PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(discord_integration PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS discord_integration DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/frequency_manager/CMakeLists.txt b/misc_modules/frequency_manager/CMakeLists.txt index 91ca931..a3397c9 100644 --- a/misc_modules/frequency_manager/CMakeLists.txt +++ b/misc_modules/frequency_manager/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(frequency_manager PROPERTIES PREFIX "") target_include_directories(frequency_manager PRIVATE "src/" "../../decoder_modules/radio/src") +if (MSVC) + target_compile_options(frequency_manager PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(frequency_manager PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(frequency_manager PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS frequency_manager DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/recorder/CMakeLists.txt b/misc_modules/recorder/CMakeLists.txt index 0f91f97..d72b938 100644 --- a/misc_modules/recorder/CMakeLists.txt +++ b/misc_modules/recorder/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(recorder PROPERTIES PREFIX "") target_include_directories(recorder PRIVATE "src/") +if (MSVC) + target_compile_options(recorder PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(recorder PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(recorder PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS recorder DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/rigctl_server/CMakeLists.txt b/misc_modules/rigctl_server/CMakeLists.txt index 665e78b..89a61df 100644 --- a/misc_modules/rigctl_server/CMakeLists.txt +++ b/misc_modules/rigctl_server/CMakeLists.txt @@ -12,5 +12,13 @@ target_include_directories(rigctl_server PRIVATE "../recorder/src") target_include_directories(rigctl_server PRIVATE "../../decoder_modules/meteor_demodulator/src") target_include_directories(rigctl_server PRIVATE "../../decoder_modules/radio/src") +if (MSVC) + target_compile_options(rigctl_server PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(rigctl_server PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(rigctl_server PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS rigctl_server DESTINATION lib/sdrpp/plugins) diff --git a/misc_modules/scanner/CMakeLists.txt b/misc_modules/scanner/CMakeLists.txt index 9e3e82d..98a380b 100644 --- a/misc_modules/scanner/CMakeLists.txt +++ b/misc_modules/scanner/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(scanner PROPERTIES PREFIX "") target_include_directories(scanner PRIVATE "src/") +if (MSVC) + target_compile_options(scanner PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(scanner PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(scanner PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS scanner DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/misc_modules/scheduler/CMakeLists.txt b/misc_modules/scheduler/CMakeLists.txt index fcf15ec..f51a8f5 100644 --- a/misc_modules/scheduler/CMakeLists.txt +++ b/misc_modules/scheduler/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(scheduler PROPERTIES PREFIX "") target_include_directories(scheduler PRIVATE "src/") +if (MSVC) + target_compile_options(scheduler PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(scheduler PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(scheduler PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS scheduler DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/sink_modules/audio_sink/CMakeLists.txt b/sink_modules/audio_sink/CMakeLists.txt index b056716..e76fa43 100644 --- a/sink_modules/audio_sink/CMakeLists.txt +++ b/sink_modules/audio_sink/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(audio_sink PROPERTIES PREFIX "") target_include_directories(audio_sink PRIVATE "src/") +if (MSVC) + target_compile_options(audio_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(audio_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(audio_sink PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(audio_sink PRIVATE "C:/Program Files (x86)/RtAudio/lib") diff --git a/sink_modules/network_sink/CMakeLists.txt b/sink_modules/network_sink/CMakeLists.txt index 46b9964..b7ab9c7 100644 --- a/sink_modules/network_sink/CMakeLists.txt +++ b/sink_modules/network_sink/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(network_sink PROPERTIES PREFIX "") target_include_directories(network_sink PRIVATE "src/") +if (MSVC) + target_compile_options(network_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(network_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(network_sink PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS network_sink DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/sink_modules/new_portaudio_sink/CMakeLists.txt b/sink_modules/new_portaudio_sink/CMakeLists.txt index 44bf466..0d05291 100644 --- a/sink_modules/new_portaudio_sink/CMakeLists.txt +++ b/sink_modules/new_portaudio_sink/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(new_portaudio_sink PROPERTIES PREFIX "") target_include_directories(new_portaudio_sink PRIVATE "src/") +if (MSVC) + target_compile_options(new_portaudio_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(new_portaudio_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(new_portaudio_sink PRIVATE -O3 -std=c++17) +endif () + if (MSVC) find_package(portaudio CONFIG REQUIRED) target_link_libraries(new_portaudio_sink PRIVATE portaudio) diff --git a/sink_modules/portaudio_sink/CMakeLists.txt b/sink_modules/portaudio_sink/CMakeLists.txt index 377f763..d920989 100644 --- a/sink_modules/portaudio_sink/CMakeLists.txt +++ b/sink_modules/portaudio_sink/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(audio_sink PROPERTIES PREFIX "") target_include_directories(audio_sink PRIVATE "src/") +if (MSVC) + target_compile_options(audio_sink PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(audio_sink PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(audio_sink PRIVATE -O3 -std=c++17) +endif () + if (MSVC) find_package(portaudio CONFIG REQUIRED) target_link_libraries(audio_sink PRIVATE portaudio) diff --git a/source_modules/airspy_source/CMakeLists.txt b/source_modules/airspy_source/CMakeLists.txt index 9993ff0..b206da9 100644 --- a/source_modules/airspy_source/CMakeLists.txt +++ b/source_modules/airspy_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(airspy_source PROPERTIES PREFIX "") target_include_directories(airspy_source PRIVATE "src/") +if (MSVC) + target_compile_options(airspy_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(airspy_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(airspy_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(airspy_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/airspyhf_source/CMakeLists.txt b/source_modules/airspyhf_source/CMakeLists.txt index 28091df..03446ad 100644 --- a/source_modules/airspyhf_source/CMakeLists.txt +++ b/source_modules/airspyhf_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(airspyhf_source PROPERTIES PREFIX "") target_include_directories(airspyhf_source PRIVATE "src/") +if (MSVC) + target_compile_options(airspyhf_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(airspyhf_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(airspyhf_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(airspyhf_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/bladerf_source/CMakeLists.txt b/source_modules/bladerf_source/CMakeLists.txt index ed8a989..bd801ce 100644 --- a/source_modules/bladerf_source/CMakeLists.txt +++ b/source_modules/bladerf_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(bladerf_source PROPERTIES PREFIX "") target_include_directories(bladerf_source PRIVATE "src/") +if (MSVC) + target_compile_options(bladerf_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(bladerf_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(bladerf_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(bladerf_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/file_source/CMakeLists.txt b/source_modules/file_source/CMakeLists.txt index eb6ae93..496c084 100644 --- a/source_modules/file_source/CMakeLists.txt +++ b/source_modules/file_source/CMakeLists.txt @@ -9,5 +9,13 @@ set_target_properties(file_source PROPERTIES PREFIX "") target_include_directories(file_source PRIVATE "src/") +if (MSVC) + target_compile_options(file_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(file_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(file_source PRIVATE -O3 -std=c++17) +endif () + # Install directives install(TARGETS file_source DESTINATION lib/sdrpp/plugins) \ No newline at end of file diff --git a/source_modules/hackrf_source/CMakeLists.txt b/source_modules/hackrf_source/CMakeLists.txt index 5e209e2..6b69c75 100644 --- a/source_modules/hackrf_source/CMakeLists.txt +++ b/source_modules/hackrf_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(hackrf_source PROPERTIES PREFIX "") target_include_directories(hackrf_source PRIVATE "src/") +if (MSVC) + target_compile_options(hackrf_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(hackrf_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(hackrf_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(hackrf_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/limesdr_source/CMakeLists.txt b/source_modules/limesdr_source/CMakeLists.txt index 961e756..9d07ae3 100644 --- a/source_modules/limesdr_source/CMakeLists.txt +++ b/source_modules/limesdr_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(limesdr_source PROPERTIES PREFIX "") target_include_directories(limesdr_source PRIVATE "src/") +if (MSVC) + target_compile_options(limesdr_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(limesdr_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(limesdr_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(limesdr_source PRIVATE "C:/Program Files/PothosSDR/lib") diff --git a/source_modules/plutosdr_source/CMakeLists.txt b/source_modules/plutosdr_source/CMakeLists.txt index 20e39e4..224a328 100644 --- a/source_modules/plutosdr_source/CMakeLists.txt +++ b/source_modules/plutosdr_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(plutosdr_source PROPERTIES PREFIX "") target_include_directories(plutosdr_source PRIVATE "src/") +if (MSVC) + target_compile_options(plutosdr_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(plutosdr_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(plutosdr_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(plutosdr_source PRIVATE "C:/Program Files/PothosSDR/lib/") diff --git a/source_modules/rfspace_source/CMakeLists.txt b/source_modules/rfspace_source/CMakeLists.txt index 7123260..3035589 100644 --- a/source_modules/rfspace_source/CMakeLists.txt +++ b/source_modules/rfspace_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(rfspace_source PROPERTIES PREFIX "") target_include_directories(rfspace_source PRIVATE "src/") +if (MSVC) + target_compile_options(rfspace_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(rfspace_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(rfspace_source PRIVATE -O3 -std=c++17) +endif () + if(WIN32) target_link_libraries(rfspace_source PRIVATE wsock32 ws2_32) endif() diff --git a/source_modules/rtl_sdr_source/CMakeLists.txt b/source_modules/rtl_sdr_source/CMakeLists.txt index f35475b..3df82b2 100644 --- a/source_modules/rtl_sdr_source/CMakeLists.txt +++ b/source_modules/rtl_sdr_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(rtl_sdr_source PROPERTIES PREFIX "") target_include_directories(rtl_sdr_source PRIVATE "src/") +if (MSVC) + target_compile_options(rtl_sdr_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(rtl_sdr_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(rtl_sdr_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(rtl_sdr_source PRIVATE "C:/Program Files/PothosSDR/bin/") diff --git a/source_modules/rtl_tcp_source/CMakeLists.txt b/source_modules/rtl_tcp_source/CMakeLists.txt index 6cacf2f..a1e0a78 100644 --- a/source_modules/rtl_tcp_source/CMakeLists.txt +++ b/source_modules/rtl_tcp_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(rtl_tcp_source PROPERTIES PREFIX "") target_include_directories(rtl_tcp_source PRIVATE "src/") +if (MSVC) + target_compile_options(rtl_tcp_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(rtl_tcp_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(rtl_tcp_source PRIVATE -O3 -std=c++17) +endif () + if(WIN32) target_link_libraries(rtl_tcp_source PRIVATE wsock32 ws2_32) endif() diff --git a/source_modules/sddc_source/CMakeLists.txt b/source_modules/sddc_source/CMakeLists.txt index 5c6890f..0882a1f 100644 --- a/source_modules/sddc_source/CMakeLists.txt +++ b/source_modules/sddc_source/CMakeLists.txt @@ -14,6 +14,14 @@ set_target_properties(sddc_source PROPERTIES PREFIX "") target_include_directories(sddc_source PRIVATE "src/" "src/libsddc/" "src/libsddc/Core/" "src/libsddc/Core/pffft/" "src/libsddc/libsddc/") +if (MSVC) + target_compile_options(sddc_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(sddc_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(sddc_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(sddc_source PRIVATE "C:/Program Files/PothosSDR/lib/") diff --git a/source_modules/sdrplay_source/CMakeLists.txt b/source_modules/sdrplay_source/CMakeLists.txt index d23e0cd..902d250 100644 --- a/source_modules/sdrplay_source/CMakeLists.txt +++ b/source_modules/sdrplay_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(sdrplay_source PROPERTIES PREFIX "") target_include_directories(sdrplay_source PRIVATE "src/") +if (MSVC) + target_compile_options(sdrplay_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(sdrplay_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(sdrplay_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(sdrplay_source PRIVATE "C:/Program Files/SDRplay/API/x64") diff --git a/source_modules/sdrpp_server_source/CMakeLists.txt b/source_modules/sdrpp_server_source/CMakeLists.txt index 587a7a2..477e648 100644 --- a/source_modules/sdrpp_server_source/CMakeLists.txt +++ b/source_modules/sdrpp_server_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(sdrpp_server_source PROPERTIES PREFIX "") target_include_directories(sdrpp_server_source PRIVATE "src/") +if (MSVC) + target_compile_options(sdrpp_server_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(sdrpp_server_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(sdrpp_server_source PRIVATE -O3 -std=c++17) +endif () + if(WIN32) target_link_libraries(sdrpp_server_source PRIVATE wsock32 ws2_32) endif() diff --git a/source_modules/soapy_source/CMakeLists.txt b/source_modules/soapy_source/CMakeLists.txt index 5dfb2b7..f6b40fe 100644 --- a/source_modules/soapy_source/CMakeLists.txt +++ b/source_modules/soapy_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(soapy_source PROPERTIES PREFIX "") target_include_directories(soapy_source PRIVATE "src/") +if (MSVC) + target_compile_options(soapy_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(soapy_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(soapy_source PRIVATE -O3 -std=c++17) +endif () + if (MSVC) # Lib path target_link_directories(soapy_source PRIVATE "C:/Program Files/PothosSDR/lib/") diff --git a/source_modules/spyserver_source/CMakeLists.txt b/source_modules/spyserver_source/CMakeLists.txt index 823b75b..db904df 100644 --- a/source_modules/spyserver_source/CMakeLists.txt +++ b/source_modules/spyserver_source/CMakeLists.txt @@ -9,6 +9,14 @@ set_target_properties(spyserver_source PROPERTIES PREFIX "") target_include_directories(spyserver_source PRIVATE "src/") +if (MSVC) + target_compile_options(spyserver_source PRIVATE /O2 /Ob2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(spyserver_source PRIVATE -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + target_compile_options(spyserver_source PRIVATE -O3 -std=c++17) +endif () + if(WIN32) target_link_libraries(spyserver_source PRIVATE wsock32 ws2_32) endif() From c3ddffb3a9f02a3cb52d9360559a1c3e8a1843e4 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 23 Jun 2022 23:37:12 +0200 Subject: [PATCH 27/39] UI fix --- decoder_modules/radio/src/demodulators/am.h | 2 +- decoder_modules/radio/src/demodulators/cw.h | 2 +- decoder_modules/radio/src/demodulators/dsb.h | 2 +- decoder_modules/radio/src/demodulators/lsb.h | 2 +- decoder_modules/radio/src/demodulators/usb.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index e586ff3..6ee2126 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -50,7 +50,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_am_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { + if (ImGui::SliderFloat(("##_radio_am_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index 6212bd3..70e5fb3 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -53,7 +53,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_cw_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { + if (ImGui::SliderFloat(("##_radio_cw_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index e3cde0b..eb984c3 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -49,7 +49,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_dsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { + if (ImGui::SliderFloat(("##_radio_dsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index d31086f..7b957bb 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -49,7 +49,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_lsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { + if (ImGui::SliderFloat(("##_radio_lsb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index cd41d2b..b285eeb 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -50,7 +50,7 @@ namespace demod { } ImGui::LeftLabel("AGC Decay"); ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("AGC Decay##_radio_usb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { + if (ImGui::SliderFloat(("##_radio_usb_agc_decay_" + name).c_str(), &agcDecay, 1.0f, 20.0f)) { demod.setAGCDecay(agcDecay / getIFSampleRate()); _config->acquire(); _config->conf[name][getName()]["agcDecay"] = agcDecay; From 3f6687659ee2c71e4f9d6b5e3fb82e22e6c76899 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sun, 26 Jun 2022 03:42:22 +0200 Subject: [PATCH 28/39] Prototype noise blanker --- core/src/dsp/noise_reduction/noise_blanker.h | 78 ++++++++++++++++++++ decoder_modules/radio/src/demod.h | 4 - decoder_modules/radio/src/demodulators/am.h | 3 - decoder_modules/radio/src/demodulators/cw.h | 3 - decoder_modules/radio/src/demodulators/dsb.h | 3 - decoder_modules/radio/src/demodulators/lsb.h | 3 - decoder_modules/radio/src/demodulators/nfm.h | 3 - decoder_modules/radio/src/demodulators/raw.h | 3 - decoder_modules/radio/src/demodulators/usb.h | 3 - decoder_modules/radio/src/demodulators/wfm.h | 3 - decoder_modules/radio/src/radio_module.h | 74 +++++++++++++------ misc_modules/recorder/src/main.cpp | 15 ++++ 12 files changed, 143 insertions(+), 52 deletions(-) create mode 100644 core/src/dsp/noise_reduction/noise_blanker.h diff --git a/core/src/dsp/noise_reduction/noise_blanker.h b/core/src/dsp/noise_reduction/noise_blanker.h new file mode 100644 index 0000000..bbbb89b --- /dev/null +++ b/core/src/dsp/noise_reduction/noise_blanker.h @@ -0,0 +1,78 @@ +#pragma once +#include "../processor.h" + +namespace dsp::noise_reduction { + class NoiseBlanker : public Processor { + using base_type = Processor; + public: + NoiseBlanker() {} + + NoiseBlanker(stream* in, double rate, double level) { init(in, rate, level); } + + void init(stream* in, double rate, double level) { + _rate = rate; + _invRate = 1.0f - _rate; + _level = level; + base_type::init(in); + } + + void setRate(double rate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _rate = rate; + _invRate = 1.0f - _rate; + } + + void setLevel(double level) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _level = level; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + amp = 1.0f; + } + + inline int process(int count, complex_t* in, complex_t* out) { + for (int i = 0; i < count; i++) { + // Get signal amplitude + float inAmp = in[i].amplitude(); + + // Update average amplitude + float gain = 1.0f; + if (inAmp != 0.0f) { + amp = (amp * _invRate) + (inAmp * _rate); + float excess = inAmp / amp; + if (excess > _level) { + gain = 1.0f / excess; + } + } + + // Scale output by gain + out[i] = in[i] * gain; + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + float _rate; + float _invRate; + float _level; + + float amp = 1.0; + + }; +} \ No newline at end of file diff --git a/decoder_modules/radio/src/demod.h b/decoder_modules/radio/src/demod.h index 06247e8..b250aef 100644 --- a/decoder_modules/radio/src/demod.h +++ b/decoder_modules/radio/src/demod.h @@ -38,17 +38,13 @@ namespace demod { virtual double getMinBandwidth() = 0; virtual double getMaxBandwidth() = 0; virtual bool getBandwidthLocked() = 0; - virtual double getMaxAFBandwidth() = 0; virtual double getDefaultSnapInterval() = 0; virtual int getVFOReference() = 0; virtual bool getDeempAllowed() = 0; virtual bool getPostProcEnabled() = 0; virtual int getDefaultDeemphasisMode() = 0; - virtual double getAFBandwidth(double bandwidth) = 0; virtual bool getFMIFNRAllowed() = 0; virtual bool getNBAllowed() = 0; - - virtual bool getDynamicAFBandwidth() = 0; virtual dsp::stream* getOutput() = 0; }; } diff --git a/decoder_modules/radio/src/demodulators/am.h b/decoder_modules/radio/src/demodulators/am.h index 6ee2126..81d7180 100644 --- a/decoder_modules/radio/src/demodulators/am.h +++ b/decoder_modules/radio/src/demodulators/am.h @@ -79,14 +79,11 @@ namespace demod { double getMinBandwidth() { return 1000.0; } double getMaxBandwidth() { return getIFSampleRate(); } bool getBandwidthLocked() { return false; } - double getMaxAFBandwidth() { return getIFSampleRate() / 2.0; } double getDefaultSnapInterval() { return 1000.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_CENTER; } bool getDeempAllowed() { return false; } bool getPostProcEnabled() { return true; } int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; } - double getAFBandwidth(double bandwidth) { return bandwidth / 2.0; } - bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return false; } dsp::stream* getOutput() { return &demod.out; } diff --git a/decoder_modules/radio/src/demodulators/cw.h b/decoder_modules/radio/src/demodulators/cw.h index 70e5fb3..df2bdcf 100644 --- a/decoder_modules/radio/src/demodulators/cw.h +++ b/decoder_modules/radio/src/demodulators/cw.h @@ -85,14 +85,11 @@ namespace demod { double getMinBandwidth() { return 50.0; } double getMaxBandwidth() { return 500.0; } bool getBandwidthLocked() { return false; } - double getMaxAFBandwidth() { return getIFSampleRate() / 2.0; } double getDefaultSnapInterval() { return 10.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_CENTER; } bool getDeempAllowed() { return false; } bool getPostProcEnabled() { return true; } int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; } - double getAFBandwidth(double bandwidth) { return (bandwidth / 2.0) + (float)tone; } - bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return false; } dsp::stream* getOutput() { return &demod.out; } diff --git a/decoder_modules/radio/src/demodulators/dsb.h b/decoder_modules/radio/src/demodulators/dsb.h index eb984c3..2c56565 100644 --- a/decoder_modules/radio/src/demodulators/dsb.h +++ b/decoder_modules/radio/src/demodulators/dsb.h @@ -72,14 +72,11 @@ namespace demod { double getMinBandwidth() { return 1000.0; } double getMaxBandwidth() { return getIFSampleRate() / 2.0; } bool getBandwidthLocked() { return false; } - double getMaxAFBandwidth() { return getIFSampleRate() / 2.0; } double getDefaultSnapInterval() { return 100.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_CENTER; } bool getDeempAllowed() { return false; } bool getPostProcEnabled() { return true; } int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; } - double getAFBandwidth(double bandwidth) { return bandwidth / 2.0; } - bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return true; } dsp::stream* getOutput() { return &demod.out; } diff --git a/decoder_modules/radio/src/demodulators/lsb.h b/decoder_modules/radio/src/demodulators/lsb.h index 7b957bb..e442a87 100644 --- a/decoder_modules/radio/src/demodulators/lsb.h +++ b/decoder_modules/radio/src/demodulators/lsb.h @@ -72,14 +72,11 @@ namespace demod { double getMinBandwidth() { return 500.0; } double getMaxBandwidth() { return getIFSampleRate() / 2.0; } bool getBandwidthLocked() { return false; } - double getMaxAFBandwidth() { return getIFSampleRate() / 2.0; } double getDefaultSnapInterval() { return 100.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_UPPER; } bool getDeempAllowed() { return false; } bool getPostProcEnabled() { return true; } int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; } - double getAFBandwidth(double bandwidth) { return bandwidth; } - bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return true; } dsp::stream* getOutput() { return &demod.out; } diff --git a/decoder_modules/radio/src/demodulators/nfm.h b/decoder_modules/radio/src/demodulators/nfm.h index 7dda517..d504d41 100644 --- a/decoder_modules/radio/src/demodulators/nfm.h +++ b/decoder_modules/radio/src/demodulators/nfm.h @@ -50,14 +50,11 @@ namespace demod { double getMinBandwidth() { return 1000.0; } double getMaxBandwidth() { return getIFSampleRate(); } bool getBandwidthLocked() { return false; } - double getMaxAFBandwidth() { return getIFSampleRate() / 2.0; } double getDefaultSnapInterval() { return 2500.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_CENTER; } bool getDeempAllowed() { return true; } bool getPostProcEnabled() { return true; } int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; } - double getAFBandwidth(double bandwidth) { return bandwidth / 2.0; } - bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return true; } bool getNBAllowed() { return false; } dsp::stream* getOutput() { return &demod.out; } diff --git a/decoder_modules/radio/src/demodulators/raw.h b/decoder_modules/radio/src/demodulators/raw.h index bab4c3b..094494d 100644 --- a/decoder_modules/radio/src/demodulators/raw.h +++ b/decoder_modules/radio/src/demodulators/raw.h @@ -52,14 +52,11 @@ namespace demod { double getMinBandwidth() { return audioSampleRate; } double getMaxBandwidth() { return audioSampleRate; } bool getBandwidthLocked() { return true; } - double getMaxAFBandwidth() { return audioSampleRate; } double getDefaultSnapInterval() { return 2500.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_CENTER; } bool getDeempAllowed() { return false; } bool getPostProcEnabled() { return false; } int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; } - double getAFBandwidth(double bandwidth) { return bandwidth; } - bool getDynamicAFBandwidth() { return false; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return true; } dsp::stream* getOutput() { return &c2s.out; } diff --git a/decoder_modules/radio/src/demodulators/usb.h b/decoder_modules/radio/src/demodulators/usb.h index b285eeb..41195ba 100644 --- a/decoder_modules/radio/src/demodulators/usb.h +++ b/decoder_modules/radio/src/demodulators/usb.h @@ -73,14 +73,11 @@ namespace demod { double getMinBandwidth() { return 500.0; } double getMaxBandwidth() { return getIFSampleRate() / 2.0; } bool getBandwidthLocked() { return false; } - double getMaxAFBandwidth() { return getIFSampleRate() / 2.0; } double getDefaultSnapInterval() { return 100.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_LOWER; } bool getDeempAllowed() { return false; } bool getPostProcEnabled() { return true; } int getDefaultDeemphasisMode() { return DEEMP_MODE_NONE; } - double getAFBandwidth(double bandwidth) { return bandwidth; } - bool getDynamicAFBandwidth() { return true; } bool getFMIFNRAllowed() { return false; } bool getNBAllowed() { return true; } dsp::stream* getOutput() { return &demod.out; } diff --git a/decoder_modules/radio/src/demodulators/wfm.h b/decoder_modules/radio/src/demodulators/wfm.h index c351176..7938586 100644 --- a/decoder_modules/radio/src/demodulators/wfm.h +++ b/decoder_modules/radio/src/demodulators/wfm.h @@ -76,14 +76,11 @@ namespace demod { double getMinBandwidth() { return 50000.0; } double getMaxBandwidth() { return getIFSampleRate(); } bool getBandwidthLocked() { return false; } - double getMaxAFBandwidth() { return 16000.0; } double getDefaultSnapInterval() { return 100000.0; } int getVFOReference() { return ImGui::WaterfallVFO::REF_CENTER; } bool getDeempAllowed() { return true; } bool getPostProcEnabled() { return true; } int getDefaultDeemphasisMode() { return DEEMP_MODE_50US; } - double getAFBandwidth(double bandwidth) { return 16000.0; } - bool getDynamicAFBandwidth() { return false; } bool getFMIFNRAllowed() { return true; } bool getNBAllowed() { return false; } dsp::stream* getOutput() { return &demod.out; } diff --git a/decoder_modules/radio/src/radio_module.h b/decoder_modules/radio/src/radio_module.h index b86adb4..65057d3 100644 --- a/decoder_modules/radio/src/radio_module.h +++ b/decoder_modules/radio/src/radio_module.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -68,9 +69,11 @@ public: ifChainOutputChanged.handler = ifChainOutputChangeHandler; ifChain.init(vfo->output); + nb.init(NULL, 500.0 / 24000.0, 10.0); fmnr.init(NULL, 32); squelch.init(NULL, MIN_SQUELCH); + ifChain.addBlock(&nb, false); ifChain.addBlock(&squelch, false); ifChain.addBlock(&fmnr, false); @@ -228,6 +231,18 @@ private: } } + // Noise blanker + if (ImGui::Checkbox(("Noise blanker (W.I.P.)##_radio_nb_ena_" + _this->name).c_str(), &_this->nbEnabled)) { + _this->setNBEnabled(_this->nbEnabled); + } + if (!_this->nbEnabled && _this->enabled) { style::beginDisabled(); } + ImGui::SameLine(); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("##_radio_nb_lvl_" + _this->name).c_str(), &_this->nbLevel, _this->MIN_NB, _this->MAX_NB, "%.3fdB")) { + _this->setNBLevel(_this->nbLevel); + } + if (!_this->nbEnabled && _this->enabled) { style::endDisabled(); } + // Squelch if (ImGui::Checkbox(("Squelch##_radio_sqelch_ena_" + _this->name).c_str(), &_this->squelchEnabled)) { _this->setSquelchEnabled(_this->squelchEnabled); @@ -351,6 +366,7 @@ private: nbAllowed = selectedDemod->getNBAllowed(); nbEnabled = false; nbLevel = 0.0f; + double ifSamplerate = selectedDemod->getIFSampleRate(); config.acquire(); if (config.conf[name][selectedDemod->getName()].contains("bandwidth")) { bandwidth = config.conf[name][selectedDemod->getName()]["bandwidth"]; @@ -387,9 +403,6 @@ private: if (config.conf[name][selectedDemod->getName()].contains("noiseBlankerEnabled")) { nbEnabled = config.conf[name][selectedDemod->getName()]["noiseBlankerEnabled"]; } - if (config.conf[name][selectedDemod->getName()].contains("noiseBlankerEnabled")) { - nbEnabled = config.conf[name][selectedDemod->getName()]["noiseBlankerEnabled"]; - } if (config.conf[name][selectedDemod->getName()].contains("noiseBlankerLevel")) { nbLevel = config.conf[name][selectedDemod->getName()]["noiseBlankerLevel"]; } @@ -400,18 +413,23 @@ private: vfo->setBandwidthLimits(minBandwidth, maxBandwidth, selectedDemod->getBandwidthLocked()); vfo->setReference(selectedDemod->getVFOReference()); vfo->setSnapInterval(snapInterval); - vfo->setSampleRate(selectedDemod->getIFSampleRate(), bandwidth); + vfo->setSampleRate(ifSamplerate, bandwidth); } // Configure bandwidth setBandwidth(bandwidth); + // Configure noise blanker + nb.setRate(500.0 / ifSamplerate); + setNBLevel(nbLevel); + setNBEnabled(nbEnabled); + // Configure FM IF Noise Reduction setIFNRPreset((selectedDemodID == RADIO_DEMOD_NFM) ? ifnrPresets[fmIFPresetId] : IFNR_PRESET_BROADCAST); setFMIFNREnabled(FMIFNRAllowed ? FMIFNREnabled : false); // Configure squelch - squelch.setLevel(squelchLevel); + setSquelchLevel(squelchLevel); setSquelchEnabled(squelchEnabled); // Configure AF chain @@ -439,18 +457,9 @@ private: bw = std::clamp(bw, minBandwidth, maxBandwidth); bandwidth = bw; if (!selectedDemod) { return; } - float audioBW = std::min(selectedDemod->getMaxAFBandwidth(), selectedDemod->getAFBandwidth(bandwidth)); - audioBW = std::min(audioBW, audioSampleRate / 2.0); vfo->setBandwidth(bandwidth); selectedDemod->setBandwidth(bandwidth); - // // Only bother with setting the resampling setting if we're actually post processing and dynamic bw is enabled - // if (selectedDemod->getDynamicAFBandwidth() && postProcEnabled) { - // win.setCutoff(audioBW); - // win.setTransWidth(audioBW); - // resamp.block.updateWindow(&win); - // } - config.acquire(); config.conf[name][selectedDemod->getName()]["bandwidth"] = bandwidth; config.release(true); @@ -469,17 +478,10 @@ private: vfo->setSampleRate(selectedDemod->getIFSampleRate(), bandwidth); return; } - float audioBW = std::min(selectedDemod->getMaxAFBandwidth(), selectedDemod->getAFBandwidth(bandwidth)); - audioBW = std::min(audioBW, audioSampleRate / 2.0); afChain.stop(); - // // Configure resampler - // resamp.block.setOutSampleRate(audioSampleRate); - // win.setSampleRate(selectedDemod->getAFSampleRate() * resamp.block.getInterpolation()); - // win.setCutoff(audioBW); - // win.setTransWidth(audioBW); - // resamp.block.updateWindow(&win); + // Configure resampler resamp.setOutSamplerate(audioSampleRate); // Configure deemphasis sample rate @@ -501,6 +503,27 @@ private: config.release(true); } + void setNBEnabled(bool enable) { + nbEnabled = enable; + if (!selectedDemod) { return; } + ifChain.setBlockEnabled(&nb, nbEnabled, [=](dsp::stream* out){ selectedDemod->setInput(out); }); + + // Save config + config.acquire(); + config.conf[name][selectedDemod->getName()]["noiseBlankerEnabled"] = nbEnabled; + config.release(true); + } + + void setNBLevel(float level) { + nbLevel = std::clamp(level, MIN_NB, MAX_NB); + nb.setLevel(nbLevel); + + // Save config + config.acquire(); + config.conf[name][selectedDemod->getName()]["noiseBlankerLevel"] = nbLevel; + config.release(true); + } + void setSquelchEnabled(bool enable) { squelchEnabled = enable; if (!selectedDemod) { return; } @@ -623,6 +646,7 @@ private: // IF chain dsp::chain ifChain; + dsp::noise_reduction::NoiseBlanker nb; dsp::noise_reduction::FMIF fmnr; dsp::noise_reduction::Squelch squelch; @@ -663,9 +687,11 @@ private: float notchWidth = 500; bool nbAllowed; - bool nbEnabled; - float nbLevel = -100.0f; + bool nbEnabled = false; + float nbLevel = 10.0f; + const double MIN_NB = 1.0; + const double MAX_NB = 10.0; const double MIN_SQUELCH = -100.0; const double MAX_SQUELCH = 0.0; diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index 5bb58e3..c95387d 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -67,11 +67,15 @@ public: if (!config.conf[name].contains("audioVolume")) { config.conf[name]["audioVolume"] = 1.0; } + if (!config.conf[name].contains("ignoreSilence")) { + config.conf[name]["ignoreSilence"] = false; + } recMode = config.conf[name]["mode"]; folderSelect.setPath(config.conf[name]["recPath"]); selectedStreamName = config.conf[name]["audioStream"]; audioVolume = config.conf[name]["audioVolume"]; + ignoreSilence = config.conf[name]["ignoreSilence"]; config.release(created); // Init audio path @@ -291,6 +295,12 @@ private: } ImGui::PopItemWidth(); + if (ImGui::Checkbox(CONCAT("Ignore silence##_recorder_ing_silence_", name), &ignoreSilence)) { + config.acquire(); + config.conf[name]["ignoreSilence"] = ignoreSilence; + config.release(true); + } + if (!folderSelect.pathIsValid() || selectedStreamName == "") { style::beginDisabled(); } if (!recording) { if (ImGui::Button(CONCAT("Record##_recorder_rec_", name), ImVec2(menuColumnWidth, 0))) { @@ -314,6 +324,9 @@ private: static void _audioHandler(dsp::stereo_t* data, int count, void* ctx) { RecorderModule* _this = (RecorderModule*)ctx; + if (_this->ignoreSilence && data[0].l == 0.0f && data[0].r == 0.0f) { + return; + } volk_32f_s32f_convert_16i(_this->wavSampleBuf, (float*)data, 32767.0f, count * 2); _this->audioWriter->writeSamples(_this->wavSampleBuf, count * 2 * sizeof(int16_t)); _this->samplesWritten += count; @@ -514,6 +527,8 @@ private: EventHandler streamRegisteredHandler; EventHandler streamUnregisterHandler; EventHandler streamUnregisteredHandler; + + bool ignoreSilence = false; }; struct RecorderContext_t { From ff6754099fb93e672e55ef51ac7f0bbbe00234c9 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sun, 26 Jun 2022 23:36:31 +0200 Subject: [PATCH 29/39] More cleanup --- core/src/credits.cpp | 1 + core/src/dsp/loop/carrier_tracking_pll.h | 16 ++++++++ core/src/dsp/loop/costas.h | 41 +++++++++++++++++++ core/src/dsp/loop/pll.h | 2 +- core/src/dsp/math/step.h | 8 ++++ core/src/dsp/multirate/decim/plans.h | 5 ++- .../dsp/multirate/decim/taps/fir_1024_64.h | 2 +- .../src/dsp/multirate/decim/taps/fir_128_16.h | 2 +- core/src/dsp/multirate/decim/taps/fir_16_8.h | 2 +- .../dsp/multirate/decim/taps/fir_2048_64.h | 2 +- .../src/dsp/multirate/decim/taps/fir_256_32.h | 2 +- core/src/dsp/multirate/decim/taps/fir_2_2.h | 2 +- core/src/dsp/multirate/decim/taps/fir_32_8.h | 2 +- .../dsp/multirate/decim/taps/fir_4096_64.h | 2 +- core/src/dsp/multirate/decim/taps/fir_4_2.h | 2 +- .../src/dsp/multirate/decim/taps/fir_512_32.h | 2 +- core/src/dsp/multirate/decim/taps/fir_64_8.h | 2 +- .../dsp/multirate/decim/taps/fir_8192_128.h | 2 +- core/src/dsp/multirate/decim/taps/fir_8_4.h | 2 +- readme.md | 1 + 20 files changed, 85 insertions(+), 15 deletions(-) create mode 100644 core/src/dsp/loop/carrier_tracking_pll.h create mode 100644 core/src/dsp/loop/costas.h create mode 100644 core/src/dsp/math/step.h diff --git a/core/src/credits.cpp b/core/src/credits.cpp index b30d7bb..2cc9347 100644 --- a/core/src/credits.cpp +++ b/core/src/credits.cpp @@ -22,6 +22,7 @@ namespace sdrpp_credits { "Syne Ardwin (WI9SYN)", "Szymon Zakrent", "Tobias Mädel", + "Youssef Touil", "Zimm" }; diff --git a/core/src/dsp/loop/carrier_tracking_pll.h b/core/src/dsp/loop/carrier_tracking_pll.h new file mode 100644 index 0000000..1790f00 --- /dev/null +++ b/core/src/dsp/loop/carrier_tracking_pll.h @@ -0,0 +1,16 @@ +#pragma once +#include "pll.h" + +namespace dsp::loop { + class CarrierTrackingPLL : public PLL { + using base_type = PLL; + public: + inline int process(int count, complex_t* in, complex_t* out) { + for (int i = 0; i < count; i++) { + out[i] = in[i] * math::phasor(-pcl.phase); + pcl.advance(math::normPhaseDiff(in[i].phase() - pcl.phase)); + } + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/costas.h b/core/src/dsp/loop/costas.h new file mode 100644 index 0000000..2947564 --- /dev/null +++ b/core/src/dsp/loop/costas.h @@ -0,0 +1,41 @@ +#pragma once +#include "pll.h" +#include "../math/step.h" + +namespace dsp::loop { + template + class Costas : public PLL { + static_assert(ORDER == 2 || ORDER == 4 || ORDER == 8, "Invalid costas order"); + using base_type = PLL; + public: + inline int process(int count, complex_t* in, complex_t* out) { + for (int i = 0; i < count; i++) { + out[i] = in[i] * math::phasor(-pcl.phase); + pcl.advance(errorFunction(out[i])); + } + return count; + } + + protected: + inline float errorFunction(complex_t val) { + float err; + if constexpr (ORDER == 2) { + err = val.re * val.im; + } + if constexpr (ORDER == 4) { + err = (math::step(val.re) * val.im) - (math::step(val.im) * val.re); + } + if constexpr (ORDER == 8) { + // The way this works is it compresses order 4 constellations into the quadrants + const float K = sqrtf(2.0) - 1.0; + if (fabsf(outVal.re) >= fabsf(outVal.im)) { + err = (math::step(val.re) * val.im) - (math::step(val.im) * val.re * K); + } + else { + err = (math::step(val.re) * val.im * K) - (math::step(val.im) * val.re); + } + } + return std::clamp(err, -1.0f, 1.0f); + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/pll.h b/core/src/dsp/loop/pll.h index d3b9c19..47d4170 100644 --- a/core/src/dsp/loop/pll.h +++ b/core/src/dsp/loop/pll.h @@ -61,7 +61,7 @@ namespace dsp::loop { base_type::tempStart(); } - inline int process(int count, complex_t* in, complex_t* out) { + virtual inline int process(int count, complex_t* in, complex_t* out) { for (int i = 0; i < count; i++) { out[i] = math::phasor(pcl.phase); pcl.advance(math::normPhaseDiff(in[i].phase() - pcl.phase)); diff --git a/core/src/dsp/math/step.h b/core/src/dsp/math/step.h new file mode 100644 index 0000000..961308f --- /dev/null +++ b/core/src/dsp/math/step.h @@ -0,0 +1,8 @@ +#pragma once + +namespace dsp::math { + template + inline T step(T x) { + return (x > 0.0) ? 1.0 : -1.0; + } +} \ No newline at end of file diff --git a/core/src/dsp/multirate/decim/plans.h b/core/src/dsp/multirate/decim/plans.h index 94a8278..7e2f269 100644 --- a/core/src/dsp/multirate/decim/plans.h +++ b/core/src/dsp/multirate/decim/plans.h @@ -14,7 +14,10 @@ #include "taps/fir_8_4.h" /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. + It uses an implementation of Youssef Touil's optimized plan generation algo, see + generation code for more info. + DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_1024_64.h b/core/src/dsp/multirate/decim/taps/fir_1024_64.h index 110cb08..6582754 100644 --- a/core/src/dsp/multirate/decim/taps/fir_1024_64.h +++ b/core/src/dsp/multirate/decim/taps/fir_1024_64.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_128_16.h b/core/src/dsp/multirate/decim/taps/fir_128_16.h index 878cc70..bc86ca2 100644 --- a/core/src/dsp/multirate/decim/taps/fir_128_16.h +++ b/core/src/dsp/multirate/decim/taps/fir_128_16.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_16_8.h b/core/src/dsp/multirate/decim/taps/fir_16_8.h index d1a2196..1e56b53 100644 --- a/core/src/dsp/multirate/decim/taps/fir_16_8.h +++ b/core/src/dsp/multirate/decim/taps/fir_16_8.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_2048_64.h b/core/src/dsp/multirate/decim/taps/fir_2048_64.h index a583dfb..a625199 100644 --- a/core/src/dsp/multirate/decim/taps/fir_2048_64.h +++ b/core/src/dsp/multirate/decim/taps/fir_2048_64.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_256_32.h b/core/src/dsp/multirate/decim/taps/fir_256_32.h index d47c58e..c8ada29 100644 --- a/core/src/dsp/multirate/decim/taps/fir_256_32.h +++ b/core/src/dsp/multirate/decim/taps/fir_256_32.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_2_2.h b/core/src/dsp/multirate/decim/taps/fir_2_2.h index bc9ac46..7438a94 100644 --- a/core/src/dsp/multirate/decim/taps/fir_2_2.h +++ b/core/src/dsp/multirate/decim/taps/fir_2_2.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_32_8.h b/core/src/dsp/multirate/decim/taps/fir_32_8.h index 31b9e6f..e382ae7 100644 --- a/core/src/dsp/multirate/decim/taps/fir_32_8.h +++ b/core/src/dsp/multirate/decim/taps/fir_32_8.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_4096_64.h b/core/src/dsp/multirate/decim/taps/fir_4096_64.h index 071fa7c..15d1fe7 100644 --- a/core/src/dsp/multirate/decim/taps/fir_4096_64.h +++ b/core/src/dsp/multirate/decim/taps/fir_4096_64.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_4_2.h b/core/src/dsp/multirate/decim/taps/fir_4_2.h index d565846..f945bb4 100644 --- a/core/src/dsp/multirate/decim/taps/fir_4_2.h +++ b/core/src/dsp/multirate/decim/taps/fir_4_2.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_512_32.h b/core/src/dsp/multirate/decim/taps/fir_512_32.h index 0ce8baa..c058c17 100644 --- a/core/src/dsp/multirate/decim/taps/fir_512_32.h +++ b/core/src/dsp/multirate/decim/taps/fir_512_32.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_64_8.h b/core/src/dsp/multirate/decim/taps/fir_64_8.h index 7e19493..755d767 100644 --- a/core/src/dsp/multirate/decim/taps/fir_64_8.h +++ b/core/src/dsp/multirate/decim/taps/fir_64_8.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_8192_128.h b/core/src/dsp/multirate/decim/taps/fir_8192_128.h index c547d94..15f6417 100644 --- a/core/src/dsp/multirate/decim/taps/fir_8192_128.h +++ b/core/src/dsp/multirate/decim/taps/fir_8192_128.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/core/src/dsp/multirate/decim/taps/fir_8_4.h b/core/src/dsp/multirate/decim/taps/fir_8_4.h index a01aaaa..5f0dc5e 100644 --- a/core/src/dsp/multirate/decim/taps/fir_8_4.h +++ b/core/src/dsp/multirate/decim/taps/fir_8_4.h @@ -1,7 +1,7 @@ #pragma once /* - This file was auto-generated by Ryzerth's magic optimized FIR script. + This file was auto-generated by the magic optimized FIR script. DO NOT EDIT MANUALLY!!! */ diff --git a/readme.md b/readme.md index 37d4d8a..14ed3e4 100644 --- a/readme.md +++ b/readme.md @@ -449,6 +449,7 @@ I will soon publish a contributing.md listing the code style to use. * [Syne Ardwin (WI9SYN)](https://esaille.me/) * [Szymon Zakrent](https://github.com/zakrent) * [Tobias Mädel](https://github.com/Manawyrm) +* Youssef Touil * [Zimm](https://github.com/invader-zimm) From 74fd30f08c5cef621f1795f8a0d035738dd364ee Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sat, 2 Jul 2022 16:53:09 +0200 Subject: [PATCH 30/39] Added back the digital demodulators --- .github/workflows/build_all.yml | 6 +- CMakeLists.txt | 4 +- core/src/dsp/clock_recovery/mm.h | 199 ++++++++++++++++++ core/src/dsp/demod/gmsk.h | 162 ++++++++++++++ core/src/dsp/demod/psk.h | 170 +++++++++++++++ core/src/dsp/loop/fast_agc.h | 100 +++++++++ core/src/dsp/loop/phase_control_loop.h | 4 +- core/src/dsp/math/step.h | 12 +- core/src/dsp/routing/doubler.h | 45 ++++ core/src/dsp/taps/root_raised_cosine.h | 2 +- decoder_modules/m17_decoder/src/m17dsp.h | 185 ++++++++-------- decoder_modules/m17_decoder/src/main.cpp | 30 +-- .../meteor_demodulator/src/main.cpp | 26 +-- docker_builds/debian_bullseye/do_build.sh | 2 +- docker_builds/debian_buster/do_build.sh | 2 +- docker_builds/debian_sid/do_build.sh | 2 +- docker_builds/ubuntu_bionic/do_build.sh | 2 +- docker_builds/ubuntu_focal/do_build.sh | 2 +- docker_builds/ubuntu_hirsute/do_build.sh | 2 +- docker_builds/ubuntu_impish/do_build.sh | 2 +- docker_builds/ubuntu_jammy/do_build.sh | 2 +- root/res/bandplans/qo-100.json | 69 ++++++ 22 files changed, 881 insertions(+), 149 deletions(-) create mode 100644 core/src/dsp/clock_recovery/mm.h create mode 100644 core/src/dsp/demod/gmsk.h create mode 100644 core/src/dsp/demod/psk.h create mode 100644 core/src/dsp/loop/fast_agc.h create mode 100644 core/src/dsp/routing/doubler.h create mode 100644 root/res/bandplans/qo-100.json diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index d6f6233..1203bca 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -58,7 +58,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF + run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON - name: Build working-directory: ${{runner.workspace}}/build @@ -106,7 +106,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=OFF -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release + run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_PLUTOSDR_SOURCE=OFF -DOPT_BUILD_SOAPY_SOURCE=OFF -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_AUDIO_SINK=OFF -DOPT_BUILD_PORTAUDIO_SINK=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DUSE_BUNDLE_DEFAULTS=ON -DCMAKE_BUILD_TYPE=Release - name: Build working-directory: ${{runner.workspace}}/build @@ -309,7 +309,7 @@ jobs: - name: Prepare CMake working-directory: ${{runner.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF + run: cmake $GITHUB_WORKSPACE -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON - name: Build working-directory: ${{runner.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bea7e9..1f05a9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,8 +51,8 @@ option(OPT_BUILD_NEW_PORTAUDIO_SINK "Build the new PortAudio Sink Module (Depend # Decoders option(OPT_BUILD_FALCON9_DECODER "Build the falcon9 live decoder (Dependencies: ffplay)" OFF) option(OPT_BUILD_KG_SSTV_DECODER "Build the M17 decoder module (no dependencies required)" OFF) -option(OPT_BUILD_M17_DECODER "Build the M17 decoder module (no dependencies required)" OFF) -option(OPT_BUILD_METEOR_DEMODULATOR "Build the meteor demodulator module (no dependencies required)" OFF) +option(OPT_BUILD_M17_DECODER "Build the M17 decoder module (Dependencies: codec2)" OFF) +option(OPT_BUILD_METEOR_DEMODULATOR "Build the meteor demodulator module (no dependencies required)" ON) option(OPT_BUILD_RADIO "Main audio modulation decoder (AM, FM, SSB, etc...)" ON) option(OPT_BUILD_WEATHER_SAT_DECODER "Build the HRPT decoder module (no dependencies required)" OFF) diff --git a/core/src/dsp/clock_recovery/mm.h b/core/src/dsp/clock_recovery/mm.h new file mode 100644 index 0000000..9c84a8c --- /dev/null +++ b/core/src/dsp/clock_recovery/mm.h @@ -0,0 +1,199 @@ +#pragma once +#include "../processor.h" +#include "../loop/phase_control_loop.h" +#include "../taps/windowed_sinc.h" +#include "../multirate/polyphase_bank.h" +#include "../math/step.h" + +namespace dsp::clock_recovery { + template + class MM : public Processor { + using base_type = Processor ; + public: + MM() {} + + MM(stream* in, double omega, double omegaGain, double muGain, double omegaRelLimit, int interpPhaseCount = 128, int interpTapCount = 8) { init(in, omega, omegaGain, muGain, omegaRelLimit, interpPhaseCount, interpTapCount); } + + ~MM() { + if (!base_type::_block_init) { return; } + base_type::stop(); + dsp::multirate::freePolyphaseBank(interpBank); + buffer::free(buffer); + } + + void init(stream* in, double omega, double omegaGain, double muGain, double omegaRelLimit, int interpPhaseCount = 128, int interpTapCount = 8) { + _omega = omega; + _omegaGain = omegaGain; + _muGain = muGain; + _omegaRelLimit = omegaRelLimit; + _interpPhaseCount = interpPhaseCount; + _interpTapCount = interpTapCount; + + pcl.init(_muGain, _omegaGain, 0.0, 0.0, 1.0, _omega, _omega * (1.0 - omegaRelLimit), _omega * (1.0 + omegaRelLimit)); + generateInterpTaps(); + buffer = buffer::alloc(STREAM_BUFFER_SIZE + _interpTapCount); + bufStart = &buffer[_interpTapCount - 1]; + + base_type::init(in); + } + + void setOmega(double omega) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _omega = omega; + offset = 0; + pcl.phase = 0.0f; + pcl.freq = _omega; + pcl.setFreqLimits(_omega * (1.0 - _omegaRelLimit), _omega * (1.0 + _omegaRelLimit)); + base_type::tempStart(); + } + + void setOmegaGain(double omegaGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _omegaGain = omegaGain; + pcl.setCoefficients(_muGain, _omegaGain); + } + + void setMuGain(double muGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _muGain = muGain; + pcl.setCoefficients(_muGain, _omegaGain); + } + + void setOmegaRelLimit(double omegaRelLimit) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _omegaRelLimit = omegaRelLimit; + pcl.setFreqLimits(_omega * (1.0 - _omegaRelLimit), _omega * (1.0 + _omegaRelLimit)); + } + + void setInterpParams(int interpPhaseCount, int interpTapCount) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _interpPhaseCount = interpPhaseCount; + _interpTapCount = interpTapCount; + dsp::multirate::freePolyphaseBank(interpBank); + buffer::free(buffer); + generateInterpTaps(); + buffer = buffer::alloc(STREAM_BUFFER_SIZE + _interpTapCount); + bufStart = &buffer[_interpTapCount - 1]; + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + offset = 0; + pcl.phase = 0.0f; + pcl.freq = _omega; + lastOut = 0.0f; + _p_0T = { 0.0f, 0.0f }; _p_1T = { 0.0f, 0.0f }; _p_2T = { 0.0f, 0.0f }; + _c_0T = { 0.0f, 0.0f }; _c_1T = { 0.0f, 0.0f }; _c_2T = { 0.0f, 0.0f }; + base_type::tempStart(); + } + + inline int process(int count, const T* in, T* out) { + // Copy data to work buffer + memcpy(bufStart, in, count * sizeof(T)); + + // Process all samples + int outCount = 0; + while (offset < count) { + float error; + T outVal; + + // Calculate new output value + int phase = std::clamp(floorf(pcl.phase * (float)_interpPhaseCount), 0, _interpPhaseCount - 1); + if constexpr (std::is_same_v) { + volk_32f_x2_dot_prod_32f(&outVal, &buffer[offset], interpBank.phases[phase], _interpTapCount); + } + if constexpr (std::is_same_v) { + volk_32fc_32f_dot_prod_32fc((lv_32fc_t*)&outVal, (lv_32fc_t*)&buffer[offset], interpBank.phases[phase], _interpTapCount); + } + out[outCount++] = outVal; + + // Calculate symbol phase error + if constexpr (std::is_same_v) { + error = (math::step(lastOut) * outVal) - (lastOut * math::step(outVal)); + lastOut = outVal; + } + if constexpr (std::is_same_v) { + // Propagate delay + _p_2T = _p_1T; + _p_1T = _p_0T; + _c_2T = _c_1T; + _c_1T = _c_0T; + + // Update the T0 values + _p_0T = outVal; + _c_0T = math::step(outVal); + + // Error + error = (((_p_0T - _p_2T) * _c_1T.conj()) - ((_c_0T - _c_2T) * _p_1T.conj())).re; + } + + // Clamp symbol phase error + if (error > 1.0f) { error = 1.0f; } + if (error < -1.0f) { error = -1.0f; } + + // Advance symbol offset and phase + pcl.advance(error); + float delta = floorf(pcl.phase); + offset += delta; + pcl.phase -= delta; + } + offset -= count; + + // Update delay buffer + memmove(buffer, &buffer[count], (_interpTapCount - 1) * sizeof(T)); + + return outCount; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + void generateInterpTaps() { + double bw = 0.5 / (double)_interpPhaseCount; + dsp::tap lp = dsp::taps::windowedSinc(_interpPhaseCount * _interpTapCount, dsp::math::freqToOmega(bw, 1.0), dsp::window::nuttall, _interpPhaseCount); + interpBank = dsp::multirate::buildPolyphaseBank(_interpPhaseCount, lp); + taps::free(lp); + } + + dsp::multirate::PolyphaseBank interpBank; + loop::PhaseControlLoop pcl; + + double _omega; + double _omegaGain; + double _muGain; + double _omegaRelLimit; + int _interpPhaseCount; + int _interpTapCount; + + // Previous output storage + float lastOut = 0.0f; + complex_t _p_0T = { 0.0f, 0.0f }, _p_1T = { 0.0f, 0.0f }, _p_2T = { 0.0f, 0.0f }; + complex_t _c_0T = { 0.0f, 0.0f }, _c_1T = { 0.0f, 0.0f }, _c_2T = { 0.0f, 0.0f }; + + int offset = 0; + T* buffer; + T* bufStart; + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/gmsk.h b/core/src/dsp/demod/gmsk.h new file mode 100644 index 0000000..b153394 --- /dev/null +++ b/core/src/dsp/demod/gmsk.h @@ -0,0 +1,162 @@ +#pragma once +#include "quadrature.h" +#include "../taps/root_raised_cosine.h" +#include "../filter/fir.h" +#include "../clock_recovery/mm.h" + +namespace dsp::demod { + // Note: I don't like how this demodulator reuses 90% of the code from the PSK demod. Same will be for the PM demod... + class GMSK : public Processor { + using base_type = Processor; + public: + GMSK() {} + + GMSK(stream* in, double symbolrate, double samplerate, double deviation, int rrcTapCount, double rrcBeta, double omegaGain, double muGain, double omegaRelLimit = 0.01) { + init(in, symbolrate, samplerate, deviation, rrcTapCount, rrcBeta, omegaGain, muGain); + } + + ~GMSK() { + if (!base_type::_block_init) { return; } + base_type::stop(); + taps::free(rrcTaps); + } + + void init(stream* in, double symbolrate, double samplerate, double deviation, int rrcTapCount, double rrcBeta, double omegaGain, double muGain, double omegaRelLimit = 0.01) { + _symbolrate = symbolrate; + _samplerate = samplerate; + _deviation = deviation; + _rrcTapCount = rrcTapCount; + _rrcBeta = rrcBeta; + + demod.init(NULL, _deviation, _samplerate); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.init(NULL, rrcTaps); + recov.init(NULL, _samplerate / _symbolrate, omegaGain, muGain, omegaRelLimit); + + demod.out.free(); + rrc.out.free(); + recov.out.free(); + + base_type::init(in); + } + + void setSymbolrate(double symbolrate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _symbolrate = symbolrate; + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.setTaps(rrcTaps); + recov.setOmega(_samplerate / _symbolrate); + base_type::tempStart(); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _samplerate = samplerate; + demod.setDeviation(_deviation, _samplerate); + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.setTaps(rrcTaps); + recov.setOmega(_samplerate / _symbolrate); + base_type::tempStart(); + } + + void setDeviation(double deviation) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _deviation = deviation; + demod.setDeviation(_deviation, _samplerate); + } + + void setRRCParams(int rrcTapCount, double rrcBeta) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _rrcTapCount = rrcTapCount; + _rrcBeta = rrcBeta; + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + base_type::tempStart(); + } + + void setRRCTapCount(int rrcTapCount) { + setRRCParams(rrcTapCount, _rrcBeta); + } + + void setRRCBeta(int rrcBeta) { + setRRCParams(_rrcTapCount, rrcBeta); + } + + void setMMParams(double omegaGain, double muGain, double omegaRelLimit = 0.01) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaGain(omegaGain); + recov.setMuGain(muGain); + recov.setOmegaRelLimit(omegaRelLimit); + } + + void setOmegaGain(double omegaGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaGain(omegaGain); + } + + void setMuGain(double muGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setMuGain(muGain); + } + + void setOmegaRelLimit(double omegaRelLimit) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaRelLimit(omegaRelLimit); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + demod.reset(); + rrc.reset(); + recov.reset(); + base_type::tempStart(); + } + + inline int process(int count, complex_t* in, float* out) { + demod.process(count, in, out); + rrc.process(count, out, out); + return recov.process(count, out, out); + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + double _symbolrate; + double _samplerate; + double _deviation; + int _rrcTapCount; + double _rrcBeta; + + Quadrature demod; + tap rrcTaps; + filter::FIR rrc; + clock_recovery::MM recov; + }; +} \ No newline at end of file diff --git a/core/src/dsp/demod/psk.h b/core/src/dsp/demod/psk.h new file mode 100644 index 0000000..280a84f --- /dev/null +++ b/core/src/dsp/demod/psk.h @@ -0,0 +1,170 @@ +#pragma once +#include "../taps/root_raised_cosine.h" +#include "../filter/fir.h" +#include "../loop/fast_agc.h" +#include "../loop/costas.h" +#include "../clock_recovery/mm.h" + +namespace dsp::demod { + template + class PSK : public Processor { + using base_type = Processor; + public: + PSK() {} + + PSK(stream* in, double symbolrate, double samplerate, int rrcTapCount, double rrcBeta, double agcRate, double costasBandwidth, double omegaGain, double muGain, double omegaRelLimit = 0.01) { + init(in, symbolrate, samplerate, rrcTapCount, rrcBeta, agcRate, costasBandwidth, omegaGain, muGain); + } + + ~PSK() { + if (!base_type::_block_init) { return; } + base_type::stop(); + taps::free(rrcTaps); + } + + void init(stream* in, double symbolrate, double samplerate, int rrcTapCount, double rrcBeta, double agcRate, double costasBandwidth, double omegaGain, double muGain, double omegaRelLimit = 0.01) { + _symbolrate = symbolrate; + _samplerate = samplerate; + _rrcTapCount = rrcTapCount; + _rrcBeta = rrcBeta; + + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.init(NULL, rrcTaps); + agc.init(NULL, 1.0, 10e6, agcRate); + costas.init(NULL, costasBandwidth); + recov.init(NULL, _samplerate / _symbolrate, omegaGain, muGain, omegaRelLimit); + + rrc.out.free(); + agc.out.free(); + costas.out.free(); + recov.out.free(); + + base_type::init(in); + } + + void setSymbolrate(double symbolrate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _symbolrate = symbolrate; + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.setTaps(rrcTaps); + recov.setOmega(_samplerate / _symbolrate); + base_type::tempStart(); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _samplerate = samplerate; + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.setTaps(rrcTaps); + recov.setOmega(_samplerate / _symbolrate); + base_type::tempStart(); + } + + void setRRCParams(int rrcTapCount, double rrcBeta) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _rrcTapCount = rrcTapCount; + _rrcBeta = rrcBeta; + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + base_type::tempStart(); + } + + void setRRCTapCount(int rrcTapCount) { + setRRCParams(rrcTapCount, _rrcBeta); + } + + void setRRCBeta(int rrcBeta) { + setRRCParams(_rrcTapCount, rrcBeta); + } + + void setAGCRate(double agcRate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + agc.setRate(agcRate); + } + + void setCostasBandwidth(double bandwidth) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + costas.setBandwidth(bandwidth); + } + + void setMMParams(double omegaGain, double muGain, double omegaRelLimit = 0.01) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaGain(omegaGain); + recov.setMuGain(muGain); + recov.setOmegaRelLimit(omegaRelLimit); + } + + void setOmegaGain(double omegaGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaGain(omegaGain); + } + + void setMuGain(double muGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setMuGain(muGain); + } + + void setOmegaRelLimit(double omegaRelLimit) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaRelLimit(omegaRelLimit); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + rrc.reset(); + agc.reset(); + costas.reset(); + recov.reset(); + base_type::tempStart(); + } + + inline int process(int count, const complex_t* in, complex_t* out) { + rrc.process(count, in, out); + agc.process(count, out, out); + costas.process(count, out, out); + return recov.process(count, out, out); + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + double _symbolrate; + double _samplerate; + int _rrcTapCount; + double _rrcBeta; + + tap rrcTaps; + filter::FIR rrc; + loop::FastAGC agc; + loop::Costas costas; + clock_recovery::MM recov; + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/fast_agc.h b/core/src/dsp/loop/fast_agc.h new file mode 100644 index 0000000..db6ad71 --- /dev/null +++ b/core/src/dsp/loop/fast_agc.h @@ -0,0 +1,100 @@ +#pragma once +#include "../processor.h" + +namespace dsp::loop { + template + class FastAGC : public Processor { + using base_type = Processor; + public: + FastAGC() {} + + FastAGC(stream* in, double setPoint, double maxGain, double rate, double initGain = 1.0) { init(in, setPoint, maxGain, rate, initGain); } + + void init(stream* in, double setPoint, double maxGain, double rate, double initGain = 1.0) { + _setPoint = setPoint; + _maxGain = maxGain; + _rate = rate; + _initGain = initGain; + + _gain = _initGain; + + base_type::init(in); + } + + void setSetPoint(double setPoint) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _setPoint = setPoint; + } + + void setMaxGain(double maxGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _maxGain = maxGain; + } + + void setRate(double rate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _rate = rate; + } + + void setInitGain(double initGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _initGain = initGain; + } + + void setGain(double gain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _gain = gain; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _gain = _initGain; + } + + inline int process(int count, T* in, T* out) { + for (int i = 0; i < count; i++) { + // Output scaled input + out[i] = in[i] * _gain; + + // Calculate output amplitude + float amp; + if constexpr (std::is_same_v) { + amp = fabsf(out[i]); + } + if constexpr (std::is_same_v) { + amp = out[i].amplitude(); + } + + // Update and clamp gain + _gain += (_setPoint - amp) * _rate; + if (_gain > _maxGain) { _gain = _maxGain; } + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + float _gain; + float _setPoint; + float _rate; + float _maxGain; + float _initGain; + + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/phase_control_loop.h b/core/src/dsp/loop/phase_control_loop.h index 8099672..f5999bb 100644 --- a/core/src/dsp/loop/phase_control_loop.h +++ b/core/src/dsp/loop/phase_control_loop.h @@ -4,7 +4,7 @@ #include "../types.h" namespace dsp::loop { - template + template class PhaseControlLoop { public: PhaseControlLoop() {} @@ -62,7 +62,7 @@ namespace dsp::loop { // Increment and clamp phase phase += freq + (_alpha * error); - clampPhase(); + if constexpr(CLAMP_PHASE) { clampPhase(); } } T freq; diff --git a/core/src/dsp/math/step.h b/core/src/dsp/math/step.h index 961308f..5f17572 100644 --- a/core/src/dsp/math/step.h +++ b/core/src/dsp/math/step.h @@ -1,8 +1,18 @@ #pragma once +#include "../types.h" namespace dsp::math { template inline T step(T x) { - return (x > 0.0) ? 1.0 : -1.0; + // TODO: Switch to cursed bit manipulation instead! + if constexpr (std::is_same_v) { + return { (x.re > 0.0f) ? 1.0f : -1.0f, (x.im > 0.0f) ? 1.0f : -1.0f }; + } + else if constexpr (std::is_same_v) { + return { (x.l > 0.0f) ? 1.0f : -1.0f, (x.r > 0.0f) ? 1.0f : -1.0f }; + } + else { + return (x > 0.0) ? 1.0 : -1.0; + } } } \ No newline at end of file diff --git a/core/src/dsp/routing/doubler.h b/core/src/dsp/routing/doubler.h new file mode 100644 index 0000000..9852282 --- /dev/null +++ b/core/src/dsp/routing/doubler.h @@ -0,0 +1,45 @@ +#pragma once +#include "../sink.h" + +namespace dsp::routing { + template + class Doubler : public Sink { + using base_type = Sink; + public: + Doubler() {} + + Doubler(stream* in) { init(in); } + + void init(stream* in) { + base_type::registerOutput(&outA); + base_type::registerOutput(&outB); + base_type::init(in); + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + memcpy(outA.writeBuf, base_type::_in->readBuf, count * sizeof(T)); + memcpy(outB.writeBuf, base_type::_in->readBuf, count * sizeof(T)); + if (!outA.swap(count)) { + base_type::_in->flush(); + return -1; + } + if (!outB.swap(count)) { + base_type::_in->flush(); + return -1; + } + + base_type::_in->flush(); + + return count; + } + + stream outA; + stream outB; + + protected: + + }; +} \ No newline at end of file diff --git a/core/src/dsp/taps/root_raised_cosine.h b/core/src/dsp/taps/root_raised_cosine.h index d137ff6..86f775e 100644 --- a/core/src/dsp/taps/root_raised_cosine.h +++ b/core/src/dsp/taps/root_raised_cosine.h @@ -3,7 +3,7 @@ #include "tap.h" #include "../math/constants.h" -namespace dsp { +namespace dsp::taps { template inline tap rootRaisedCosine(int count, double beta, double Ts) { // Allocate taps diff --git a/decoder_modules/m17_decoder/src/m17dsp.h b/decoder_modules/m17_decoder/src/m17dsp.h index 5429905..577650e 100644 --- a/decoder_modules/m17_decoder/src/m17dsp.h +++ b/decoder_modules/m17_decoder/src/m17dsp.h @@ -1,8 +1,11 @@ #pragma once #include +#include +#include +#include +#include #include #include -#include #include #include @@ -86,7 +89,7 @@ const uint8_t M17_PUNCTURING_P2[12] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 }; static const correct_convolutional_polynomial_t correct_conv_m17_polynomial[] = { 0b11001, 0b10111 }; namespace dsp { - class M17Slice4FSK : public generic_block { + class M17Slice4FSK : public block { public: M17Slice4FSK() {} @@ -94,19 +97,19 @@ namespace dsp { void init(stream* in) { _in = in; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; + block::registerInput(_in); + block::registerOutput(&out); + block::_block_init = true; } void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + block::unregisterInput(_in); _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); + block::registerInput(_in); + block::tempStart(); } int run() { @@ -132,15 +135,15 @@ namespace dsp { stream* _in; }; - class M17FrameDemux : public generic_block { + class M17FrameDemux : public block { public: M17FrameDemux() {} M17FrameDemux(stream* in) { init(in); } ~M17FrameDemux() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); + if (!block::_block_init) { return; } + block::stop(); delete[] delay; } @@ -149,22 +152,22 @@ namespace dsp { delay = new uint8_t[STREAM_BUFFER_SIZE]; - generic_block::registerInput(_in); - generic_block::registerOutput(&linkSetupOut); - generic_block::registerOutput(&lichOut); - generic_block::registerOutput(&streamOut); - generic_block::registerOutput(&packetOut); - generic_block::_block_init = true; + block::registerInput(_in); + block::registerOutput(&linkSetupOut); + block::registerOutput(&lichOut); + block::registerOutput(&streamOut); + block::registerOutput(&packetOut); + block::_block_init = true; } void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + block::unregisterInput(_in); _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); + block::registerInput(_in); + block::tempStart(); } int run() { @@ -268,15 +271,15 @@ namespace dsp { int outCount = 0; }; - class M17LSFDecoder : public generic_block { + class M17LSFDecoder : public block { public: M17LSFDecoder() {} M17LSFDecoder(stream* in, void (*handler)(M17LSF& lsf, void* ctx), void* ctx) { init(in, handler, ctx); } ~M17LSFDecoder() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); + if (!block::_block_init) { return; } + block::stop(); correct_convolutional_destroy(conv); } @@ -287,18 +290,18 @@ namespace dsp { conv = correct_convolutional_create(2, 5, correct_conv_m17_polynomial); - generic_block::registerInput(_in); - generic_block::_block_init = true; + block::registerInput(_in); + block::_block_init = true; } void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + block::unregisterInput(_in); _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); + block::registerInput(_in); + block::tempStart(); } int run() { @@ -346,15 +349,15 @@ namespace dsp { correct_convolutional* conv; }; - class M17PayloadFEC : public generic_block { + class M17PayloadFEC : public block { public: M17PayloadFEC() {} M17PayloadFEC(stream* in) { init(in); } ~M17PayloadFEC() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); + if (!block::_block_init) { return; } + block::stop(); correct_convolutional_destroy(conv); } @@ -363,19 +366,19 @@ namespace dsp { conv = correct_convolutional_create(2, 5, correct_conv_m17_polynomial); - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; + block::registerInput(_in); + block::registerOutput(&out); + block::_block_init = true; } void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + block::unregisterInput(_in); _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); + block::registerInput(_in); + block::tempStart(); } int run() { @@ -419,15 +422,15 @@ namespace dsp { correct_convolutional* conv; }; - class M17Codec2Decode : public generic_block { + class M17Codec2Decode : public block { public: M17Codec2Decode() {} M17Codec2Decode(stream* in) { init(in); } ~M17Codec2Decode() { - if (!generic_block::_block_init) { return; } - generic_block::stop(); + if (!block::_block_init) { return; } + block::stop(); codec2_destroy(codec); delete[] int16Audio; delete[] floatAudio; @@ -442,19 +445,19 @@ namespace dsp { int16Audio = new int16_t[sampsPerC2FrameDouble]; floatAudio = new float[sampsPerC2FrameDouble]; - generic_block::registerInput(_in); - generic_block::registerOutput(&out); - generic_block::_block_init = true; + block::registerInput(_in); + block::registerOutput(&out); + block::_block_init = true; } void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + block::unregisterInput(_in); _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); + block::registerInput(_in); + block::tempStart(); } int run() { @@ -490,7 +493,7 @@ namespace dsp { int sampsPerC2FrameDouble = 0; }; - class M17LICHDecoder : public generic_block { + class M17LICHDecoder : public block { public: M17LICHDecoder() {} @@ -500,18 +503,18 @@ namespace dsp { _in = in; _handler = handler; _ctx = ctx; - generic_block::registerInput(_in); - generic_block::_block_init = true; + block::registerInput(_in); + block::_block_init = true; } void setInput(stream* in) { - assert(generic_block::_block_init); - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); - generic_block::unregisterInput(_in); + assert(block::_block_init); + std::lock_guard lck(block::ctrlMtx); + block::tempStop(); + block::unregisterInput(_in); _in = in; - generic_block::registerInput(_in); - generic_block::tempStart(); + block::registerInput(_in); + block::tempStart(); } int run() { @@ -590,7 +593,7 @@ namespace dsp { int lastId = 0; }; - class M17Decoder : public generic_hier_block { + class M17Decoder : public hier_block { public: M17Decoder() {} @@ -601,11 +604,8 @@ namespace dsp { void init(stream* input, float sampleRate, void (*handler)(M17LSF& lsf, void* ctx), void* ctx) { _sampleRate = sampleRate; - demod.init(input, _sampleRate, M17_DEVIATION); - rrc.init(31, _sampleRate, M17_BAUDRATE, M17_RRC_ALPHA); - fir.init(&demod.out, &rrc); - recov.init(&fir.out, _sampleRate / M17_BAUDRATE, 1e-6f, 0.01f, 0.01f); - doubler.init(&recov.out); + demod.init(input, M17_BAUDRATE, sampleRate, M17_DEVIATION, 31, M17_RRC_ALPHA, 1e-6f, 0.01f, 0.01f); + doubler.init(&demod.out); slice.init(&doubler.outA); demux.init(&slice.out); lsfFEC.init(&demux.linkSetupOut, handler, ctx); @@ -618,24 +618,22 @@ namespace dsp { diagOut = &doubler.outB; out = &decodeAudio.out; - generic_hier_block::registerBlock(&demod); - generic_hier_block::registerBlock(&fir); - generic_hier_block::registerBlock(&recov); - generic_hier_block::registerBlock(&doubler); - generic_hier_block::registerBlock(&slice); - generic_hier_block::registerBlock(&demux); - generic_hier_block::registerBlock(&lsfFEC); - generic_hier_block::registerBlock(&payloadFEC); - generic_hier_block::registerBlock(&decodeLICH); - generic_hier_block::registerBlock(&decodeAudio); + hier_block::registerBlock(&demod); + hier_block::registerBlock(&doubler); + hier_block::registerBlock(&slice); + hier_block::registerBlock(&demux); + hier_block::registerBlock(&lsfFEC); + hier_block::registerBlock(&payloadFEC); + hier_block::registerBlock(&decodeLICH); + hier_block::registerBlock(&decodeAudio); - generic_hier_block::registerBlock(&ns2); + hier_block::registerBlock(&ns2); - generic_hier_block::_block_init = true; + hier_block::_block_init = true; } void setInput(stream* input) { - assert(generic_hier_block::_block_init); + assert(hier_block::_block_init); demod.setInput(input); } @@ -643,11 +641,8 @@ namespace dsp { stream* out = NULL; private: - FloatFMDemod demod; - RRCTaps rrc; - FIR fir; - MMClockRecovery recov; - StreamDoubler doubler; + demod::GMSK demod; + routing::Doubler doubler; M17Slice4FSK slice; M17FrameDemux demux; M17LSFDecoder lsfFEC; @@ -655,7 +650,7 @@ namespace dsp { M17LICHDecoder decodeLICH; M17Codec2Decode decodeAudio; - NullSink ns2; + dsp::sink::Null ns2; float _sampleRate; diff --git a/decoder_modules/m17_decoder/src/main.cpp b/decoder_modules/m17_decoder/src/main.cpp index b02a569..3822445 100644 --- a/decoder_modules/m17_decoder/src/main.cpp +++ b/decoder_modules/m17_decoder/src/main.cpp @@ -6,14 +6,10 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include #include @@ -61,12 +57,7 @@ public: // Initialize DSP here decoder.init(vfo->output, INPUT_SAMPLE_RATE, lsfHandler, this); - - resampWin.init(4000, 4000, audioSampRate); - resamp.init(decoder.out, &resampWin, 8000, audioSampRate); - resampWin.setSampleRate(8000 * resamp.getInterpolation()); - resamp.updateWindow(&resampWin); - + resamp.init(decoder.out, 8000, audioSampRate); reshape.init(decoder.diagOut, 480, 0); diagHandler.init(&reshape.out, _diagHandler, this); @@ -250,11 +241,8 @@ private: M17DecoderModule* _this = (M17DecoderModule*)ctx; // TODO: If too slow, change all demods here and not when setting _this->audioSampRate = sampleRate; - _this->resampWin.setCutoff(std::min(sampleRate / 2, 4000)); _this->resamp.tempStop(); - _this->resamp.setOutSampleRate(sampleRate); - _this->resampWin.setSampleRate(8000 * _this->resamp.getInterpolation()); - _this->resamp.updateWindow(&_this->resampWin); + _this->resamp.setOutSamplerate(sampleRate); _this->resamp.tempStart(); } @@ -273,11 +261,9 @@ private: dsp::M17Decoder decoder; - dsp::Reshaper reshape; - dsp::HandlerSink diagHandler; - - dsp::filter_window::BlackmanWindow resampWin; - dsp::PolyphaseResampler resamp; + dsp::buffer::Reshaper reshape; + dsp::sink::Handler diagHandler; + dsp::multirate::RationalResampler resamp; ImGui::SymbolDiagram diag; diff --git a/decoder_modules/meteor_demodulator/src/main.cpp b/decoder_modules/meteor_demodulator/src/main.cpp index 35c4777..9002c28 100644 --- a/decoder_modules/meteor_demodulator/src/main.cpp +++ b/decoder_modules/meteor_demodulator/src/main.cpp @@ -6,14 +6,10 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -60,8 +56,8 @@ public: config.release(created); vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 150000, INPUT_SAMPLE_RATE, 150000, 150000, true); - demod.init(vfo->output, INPUT_SAMPLE_RATE, 72000.0f, 32, 0.6f, 0.1f, 0.005f); - split.init(demod.out); + demod.init(vfo->output, 72000.0f, INPUT_SAMPLE_RATE, 33, 0.6f, 0.1f, 0.005f, (0.01 * 0.01) / 4.0, 0.01); + split.init(&demod.out); split.bindStream(&symSinkStream); split.bindStream(&sinkStream); reshape.init(&symSinkStream, 1024, (72000 / 30) - 1024); @@ -220,14 +216,14 @@ private: // DSP Chain VFOManager::VFO* vfo; - dsp::PSKDemod<4, false> demod; - dsp::Splitter split; + dsp::demod::PSK<4> demod; + dsp::routing::Splitter split; dsp::stream symSinkStream; dsp::stream sinkStream; - dsp::Reshaper reshape; - dsp::HandlerSink symSink; - dsp::HandlerSink sink; + dsp::buffer::Reshaper reshape; + dsp::sink::Handler symSink; + dsp::sink::Handler sink; ImGui::ConstellationDiagram constDiagram; diff --git a/docker_builds/debian_bullseye/do_build.sh b/docker_builds/debian_bullseye/do_build.sh index 224321e..05a0a32 100644 --- a/docker_builds/debian_bullseye/do_build.sh +++ b/docker_builds/debian_bullseye/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/debian_buster/do_build.sh b/docker_builds/debian_buster/do_build.sh index 2367bf9..cbefd63 100644 --- a/docker_builds/debian_buster/do_build.sh +++ b/docker_builds/debian_buster/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/debian_sid/do_build.sh b/docker_builds/debian_sid/do_build.sh index 224321e..05a0a32 100644 --- a/docker_builds/debian_sid/do_build.sh +++ b/docker_builds/debian_sid/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_bionic/do_build.sh b/docker_builds/ubuntu_bionic/do_build.sh index 3ac017d..92d0a75 100644 --- a/docker_builds/ubuntu_bionic/do_build.sh +++ b/docker_builds/ubuntu_bionic/do_build.sh @@ -47,7 +47,7 @@ echo 'Cflags: -I/usr/include/codec2' >> /usr/share/pkgconfig/codec2.pc cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_OVERRIDE_STD_FILESYSTEM=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_OVERRIDE_STD_FILESYSTEM=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 # Generate package diff --git a/docker_builds/ubuntu_focal/do_build.sh b/docker_builds/ubuntu_focal/do_build.sh index 224321e..05a0a32 100644 --- a/docker_builds/ubuntu_focal/do_build.sh +++ b/docker_builds/ubuntu_focal/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_hirsute/do_build.sh b/docker_builds/ubuntu_hirsute/do_build.sh index 224321e..05a0a32 100644 --- a/docker_builds/ubuntu_hirsute/do_build.sh +++ b/docker_builds/ubuntu_hirsute/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_impish/do_build.sh b/docker_builds/ubuntu_impish/do_build.sh index 224321e..05a0a32 100644 --- a/docker_builds/ubuntu_impish/do_build.sh +++ b/docker_builds/ubuntu_impish/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 cd .. diff --git a/docker_builds/ubuntu_jammy/do_build.sh b/docker_builds/ubuntu_jammy/do_build.sh index 224321e..05a0a32 100644 --- a/docker_builds/ubuntu_jammy/do_build.sh +++ b/docker_builds/ubuntu_jammy/do_build.sh @@ -18,7 +18,7 @@ cp inc/* /usr/include/ cd SDRPlusPlus mkdir build cd build -cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=OFF +cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON make VERBOSE=1 -j2 cd .. diff --git a/root/res/bandplans/qo-100.json b/root/res/bandplans/qo-100.json new file mode 100644 index 0000000..7109be2 --- /dev/null +++ b/root/res/bandplans/qo-100.json @@ -0,0 +1,69 @@ +{ + "name": "QO-100", + "country_name": "Worldwide", + "country_code": "--", + "author_name": "Ryzerth", + "author_url": "https://github.com/AlexandreRouma", + "bands": [ + { + "name": "Beacon", + "type": "broadcast", + "start": 10489500000, + "end": 10489505000 + }, + { + "name": "CW", + "type": "amateur", + "start": 10489505000, + "end": 10489540000 + }, + { + "name": "NB Digi", + "type": "amateur", + "start": 10489540000, + "end": 10489580000 + }, + { + "name": "Digi", + "type": "amateur", + "start": 10489580000, + "end": 10489650000 + }, + { + "name": "SSB", + "type": "amateur", + "start": 10489650000, + "end": 10489745000 + }, + { + "name": "Beacon", + "type": "broadcast", + "start": 10489745000, + "end": 10489755000 + }, + { + "name": "SSB", + "type": "amateur", + "start": 10489755000, + "end": 10489850000 + }, + { + "name": "Emergency", + "type": "amateur", + "start": 10489850000, + "end": 10489870000 + }, + { + "name": "Mixed/Contest", + "type": "amateur", + "start": 10489870000, + "end": 10489990000 + }, + { + "name": "Beacon", + "type": "broadcast", + "start": 10489990000, + "end": 10490000000 + } + ] +} \ No newline at end of file From 46f17019a7dc826c923e329dcd7bc2552991e457 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sat, 2 Jul 2022 18:30:13 +0200 Subject: [PATCH 31/39] cleanup + bugfix --- core/src/dsp/demod/gfsk.h | 162 +++++++++++++++++++++++ core/src/dsp/loop/costas.h | 2 +- decoder_modules/m17_decoder/src/m17dsp.h | 4 +- 3 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 core/src/dsp/demod/gfsk.h diff --git a/core/src/dsp/demod/gfsk.h b/core/src/dsp/demod/gfsk.h new file mode 100644 index 0000000..1287684 --- /dev/null +++ b/core/src/dsp/demod/gfsk.h @@ -0,0 +1,162 @@ +#pragma once +#include "quadrature.h" +#include "../taps/root_raised_cosine.h" +#include "../filter/fir.h" +#include "../clock_recovery/mm.h" + +namespace dsp::demod { + // Note: I don't like how this demodulator reuses 90% of the code from the PSK demod. Same will be for the PM demod... + class GFSK : public Processor { + using base_type = Processor; + public: + GFSK() {} + + GFSK(stream* in, double symbolrate, double samplerate, double deviation, int rrcTapCount, double rrcBeta, double omegaGain, double muGain, double omegaRelLimit = 0.01) { + init(in, symbolrate, samplerate, deviation, rrcTapCount, rrcBeta, omegaGain, muGain); + } + + ~GFSK() { + if (!base_type::_block_init) { return; } + base_type::stop(); + taps::free(rrcTaps); + } + + void init(stream* in, double symbolrate, double samplerate, double deviation, int rrcTapCount, double rrcBeta, double omegaGain, double muGain, double omegaRelLimit = 0.01) { + _symbolrate = symbolrate; + _samplerate = samplerate; + _deviation = deviation; + _rrcTapCount = rrcTapCount; + _rrcBeta = rrcBeta; + + demod.init(NULL, _deviation, _samplerate); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.init(NULL, rrcTaps); + recov.init(NULL, _samplerate / _symbolrate, omegaGain, muGain, omegaRelLimit); + + demod.out.free(); + rrc.out.free(); + recov.out.free(); + + base_type::init(in); + } + + void setSymbolrate(double symbolrate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _symbolrate = symbolrate; + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.setTaps(rrcTaps); + recov.setOmega(_samplerate / _symbolrate); + base_type::tempStart(); + } + + void setSamplerate(double samplerate) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _samplerate = samplerate; + demod.setDeviation(_deviation, _samplerate); + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + rrc.setTaps(rrcTaps); + recov.setOmega(_samplerate / _symbolrate); + base_type::tempStart(); + } + + void setDeviation(double deviation) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _deviation = deviation; + demod.setDeviation(_deviation, _samplerate); + } + + void setRRCParams(int rrcTapCount, double rrcBeta) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _rrcTapCount = rrcTapCount; + _rrcBeta = rrcBeta; + taps::free(rrcTaps); + rrcTaps = taps::rootRaisedCosine(_rrcTapCount, _rrcBeta, _symbolrate, _samplerate); + base_type::tempStart(); + } + + void setRRCTapCount(int rrcTapCount) { + setRRCParams(rrcTapCount, _rrcBeta); + } + + void setRRCBeta(int rrcBeta) { + setRRCParams(_rrcTapCount, rrcBeta); + } + + void setMMParams(double omegaGain, double muGain, double omegaRelLimit = 0.01) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaGain(omegaGain); + recov.setMuGain(muGain); + recov.setOmegaRelLimit(omegaRelLimit); + } + + void setOmegaGain(double omegaGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaGain(omegaGain); + } + + void setMuGain(double muGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setMuGain(muGain); + } + + void setOmegaRelLimit(double omegaRelLimit) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + recov.setOmegaRelLimit(omegaRelLimit); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + demod.reset(); + rrc.reset(); + recov.reset(); + base_type::tempStart(); + } + + inline int process(int count, complex_t* in, float* out) { + demod.process(count, in, out); + rrc.process(count, out, out); + return recov.process(count, out, out); + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + double _symbolrate; + double _samplerate; + double _deviation; + int _rrcTapCount; + double _rrcBeta; + + Quadrature demod; + tap rrcTaps; + filter::FIR rrc; + clock_recovery::MM recov; + }; +} \ No newline at end of file diff --git a/core/src/dsp/loop/costas.h b/core/src/dsp/loop/costas.h index 2947564..6287461 100644 --- a/core/src/dsp/loop/costas.h +++ b/core/src/dsp/loop/costas.h @@ -28,7 +28,7 @@ namespace dsp::loop { if constexpr (ORDER == 8) { // The way this works is it compresses order 4 constellations into the quadrants const float K = sqrtf(2.0) - 1.0; - if (fabsf(outVal.re) >= fabsf(outVal.im)) { + if (fabsf(val.re) >= fabsf(val.im)) { err = (math::step(val.re) * val.im) - (math::step(val.im) * val.re * K); } else { diff --git a/decoder_modules/m17_decoder/src/m17dsp.h b/decoder_modules/m17_decoder/src/m17dsp.h index 577650e..96398b1 100644 --- a/decoder_modules/m17_decoder/src/m17dsp.h +++ b/decoder_modules/m17_decoder/src/m17dsp.h @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include @@ -641,7 +641,7 @@ namespace dsp { stream* out = NULL; private: - demod::GMSK demod; + demod::GFSK demod; routing::Doubler doubler; M17Slice4FSK slice; M17FrameDemux demux; From edf22ccfe8ea2c70c5b272cda486c49d400e3356 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 6 Jul 2022 22:11:49 +0200 Subject: [PATCH 32/39] Added basic RDS support, no error correction yet --- core/src/dsp/clock_recovery/fd.h | 189 +++++++++++++ core/src/dsp/clock_recovery/mm.h | 2 +- core/src/dsp/demod/broadcast_fm.h | 46 +++- core/src/dsp/digital/binary_slicer.h | 31 +++ core/src/dsp/digital/differentia_decoder.h | 64 +++++ core/src/dsp/digital/differential_decoder.h | 65 +++++ core/src/dsp/digital/manchester_decoder.h | 47 ++++ core/src/gui/style.h | 10 +- .../meteor_demodulator/src/main.cpp | 2 +- decoder_modules/radio/src/demodulators/wfm.h | 105 +++++++- decoder_modules/radio/src/radio_module.h | 23 +- decoder_modules/radio/src/rds.cpp | 251 ++++++++++++++++++ decoder_modules/radio/src/rds.h | 179 +++++++++++++ make_windows_package.ps1 | 6 +- 14 files changed, 992 insertions(+), 28 deletions(-) create mode 100644 core/src/dsp/clock_recovery/fd.h create mode 100644 core/src/dsp/digital/binary_slicer.h create mode 100644 core/src/dsp/digital/differentia_decoder.h create mode 100644 core/src/dsp/digital/differential_decoder.h create mode 100644 core/src/dsp/digital/manchester_decoder.h create mode 100644 decoder_modules/radio/src/rds.cpp create mode 100644 decoder_modules/radio/src/rds.h diff --git a/core/src/dsp/clock_recovery/fd.h b/core/src/dsp/clock_recovery/fd.h new file mode 100644 index 0000000..01759c9 --- /dev/null +++ b/core/src/dsp/clock_recovery/fd.h @@ -0,0 +1,189 @@ +#pragma once +#include "../processor.h" +#include "../loop/phase_control_loop.h" +#include "../taps/windowed_sinc.h" +#include "../multirate/polyphase_bank.h" +#include "../math/step.h" + +namespace dsp::clock_recovery { + class FD : public Processor { + using base_type = Processor ; + public: + FD() {} + + FD(stream* in, double omega, double omegaGain, double muGain, double omegaRelLimit, int interpPhaseCount = 128, int interpTapCount = 8) { init(in, omega, omegaGain, muGain, omegaRelLimit, interpPhaseCount, interpTapCount); } + + ~FD() { + if (!base_type::_block_init) { return; } + base_type::stop(); + dsp::multirate::freePolyphaseBank(interpBank); + buffer::free(buffer); + } + + void init(stream* in, double omega, double omegaGain, double muGain, double omegaRelLimit, int interpPhaseCount = 128, int interpTapCount = 8) { + _omega = omega; + _omegaGain = omegaGain; + _muGain = muGain; + _omegaRelLimit = omegaRelLimit; + _interpPhaseCount = interpPhaseCount; + _interpTapCount = interpTapCount; + + pcl.init(_muGain, _omegaGain, 0.0, 0.0, 1.0, _omega, _omega * (1.0 - omegaRelLimit), _omega * (1.0 + omegaRelLimit)); + generateInterpTaps(); + buffer = buffer::alloc(STREAM_BUFFER_SIZE + _interpTapCount); + bufStart = &buffer[_interpTapCount - 1]; + + base_type::init(in); + } + + void setOmega(double omega) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _omega = omega; + offset = 0; + pcl.phase = 0.0f; + pcl.freq = _omega; + pcl.setFreqLimits(_omega * (1.0 - _omegaRelLimit), _omega * (1.0 + _omegaRelLimit)); + base_type::tempStart(); + } + + void setOmegaGain(double omegaGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _omegaGain = omegaGain; + pcl.setCoefficients(_muGain, _omegaGain); + } + + void setMuGain(double muGain) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _muGain = muGain; + pcl.setCoefficients(_muGain, _omegaGain); + } + + void setOmegaRelLimit(double omegaRelLimit) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _omegaRelLimit = omegaRelLimit; + pcl.setFreqLimits(_omega * (1.0 - _omegaRelLimit), _omega * (1.0 + _omegaRelLimit)); + } + + void setInterpParams(int interpPhaseCount, int interpTapCount) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _interpPhaseCount = interpPhaseCount; + _interpTapCount = interpTapCount; + dsp::multirate::freePolyphaseBank(interpBank); + buffer::free(buffer); + generateInterpTaps(); + buffer = buffer::alloc(STREAM_BUFFER_SIZE + _interpTapCount); + bufStart = &buffer[_interpTapCount - 1]; + base_type::tempStart(); + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + offset = 0; + pcl.phase = 0.0f; + pcl.freq = _omega; + base_type::tempStart(); + } + + inline int process(int count, const float* in, float* out) { + // Copy data to work buffer + memcpy(bufStart, in, count * sizeof(float)); + + // Process all samples + int outCount = 0; + while (offset < count) { + float error; + float outVal; + float dfdt; + + // Calculate new output value + int phase = std::clamp(floorf(pcl.phase * (float)_interpPhaseCount), 0, _interpPhaseCount - 1); + volk_32f_x2_dot_prod_32f(&outVal, &buffer[offset], interpBank.phases[phase], _interpTapCount); + out[outCount++] = outVal; + + // Calculate derivative of the signal + if (phase == 0) { + float fT1; + volk_32f_x2_dot_prod_32f(&fT1, &buffer[offset], interpBank.phases[phase+1], _interpTapCount); + dfdt = fT1 - outVal; + } + else if (phase == _interpPhaseCount - 1) { + float fT_1; + volk_32f_x2_dot_prod_32f(&fT_1, &buffer[offset], interpBank.phases[phase-1], _interpTapCount); + dfdt = outVal - fT_1; + } + else { + float fT_1; + float fT1; + volk_32f_x2_dot_prod_32f(&fT_1, &buffer[offset], interpBank.phases[phase-1], _interpTapCount); + volk_32f_x2_dot_prod_32f(&fT1, &buffer[offset], interpBank.phases[phase+1], _interpTapCount); + dfdt = (fT1 - fT_1) * 0.5f; + } + + // Calculate error + error = dfdt * math::step(outVal); + + // Clamp symbol phase error + if (error > 1.0f) { error = 1.0f; } + if (error < -1.0f) { error = -1.0f; } + + // Advance symbol offset and phase + pcl.advance(error); + float delta = floorf(pcl.phase); + offset += delta; + pcl.phase -= delta; + } + offset -= count; + + // Update delay buffer + memmove(buffer, &buffer[count], (_interpTapCount - 1) * sizeof(float)); + + return outCount; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + loop::PhaseControlLoop pcl; + + protected: + void generateInterpTaps() { + double bw = 0.5 / (double)_interpPhaseCount; + dsp::tap lp = dsp::taps::windowedSinc(_interpPhaseCount * _interpTapCount, dsp::math::freqToOmega(bw, 1.0), dsp::window::nuttall, _interpPhaseCount); + interpBank = dsp::multirate::buildPolyphaseBank(_interpPhaseCount, lp); + taps::free(lp); + } + + dsp::multirate::PolyphaseBank interpBank; + + double _omega; + double _omegaGain; + double _muGain; + double _omegaRelLimit; + int _interpPhaseCount; + int _interpTapCount; + + int offset = 0; + float* buffer; + float* bufStart; + }; +} \ No newline at end of file diff --git a/core/src/dsp/clock_recovery/mm.h b/core/src/dsp/clock_recovery/mm.h index 9c84a8c..60f78e3 100644 --- a/core/src/dsp/clock_recovery/mm.h +++ b/core/src/dsp/clock_recovery/mm.h @@ -178,7 +178,7 @@ namespace dsp::clock_recovery { } dsp::multirate::PolyphaseBank interpBank; - loop::PhaseControlLoop pcl; + loop::PhaseControlLoop pcl; double _omega; double _omegaGain; diff --git a/core/src/dsp/demod/broadcast_fm.h b/core/src/dsp/demod/broadcast_fm.h index f026982..7eff447 100644 --- a/core/src/dsp/demod/broadcast_fm.h +++ b/core/src/dsp/demod/broadcast_fm.h @@ -12,6 +12,7 @@ #include "../math/multiply.h" #include "../math/add.h" #include "../math/subtract.h" +#include "../multirate/rational_resampler.h" namespace dsp::demod { class BroadcastFM : public Processor { @@ -19,7 +20,7 @@ namespace dsp::demod { public: BroadcastFM() {} - BroadcastFM(stream* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true) { init(in, deviation, samplerate, stereo, lowPass); } + BroadcastFM(stream* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true, bool rdsOut = false) { init(in, deviation, samplerate, stereo, lowPass); } ~BroadcastFM() { if (!base_type::_block_init) { return; } @@ -31,11 +32,12 @@ namespace dsp::demod { taps::free(audioFirTaps); } - virtual void init(stream* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true) { + virtual void init(stream* in, double deviation, double samplerate, bool stereo = true, bool lowPass = true, bool rdsOut = false) { _deviation = deviation; _samplerate = samplerate; _stereo = stereo; _lowPass = lowPass; + _rdsOut = rdsOut; demod.init(NULL, _deviation, _samplerate); pilotFirTaps = taps::bandPass(18750.0, 19250.0, 3000.0, _samplerate, true); @@ -47,6 +49,7 @@ namespace dsp::demod { audioFirTaps = taps::lowPass(15000.0, 4000.0, _samplerate); alFir.init(NULL, audioFirTaps); arFir.init(NULL, audioFirTaps); + rdsResamp.init(NULL, samplerate, 5000.0); lmr = buffer::alloc(STREAM_BUFFER_SIZE); l = buffer::alloc(STREAM_BUFFER_SIZE); @@ -56,6 +59,7 @@ namespace dsp::demod { lmrDelay.out.free(); arFir.out.free(); alFir.out.free(); + rdsResamp.out.free(); base_type::init(in); } @@ -88,6 +92,8 @@ namespace dsp::demod { alFir.setTaps(audioFirTaps); arFir.setTaps(audioFirTaps); + rdsResamp.setInSamplerate(samplerate); + reset(); base_type::tempStart(); } @@ -110,6 +116,15 @@ namespace dsp::demod { base_type::tempStart(); } + void setRDSOut(bool rdsOut) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + _rdsOut = rdsOut; + reset(); + base_type::tempStart(); + } + void reset() { assert(base_type::_block_init); std::lock_guard lck(base_type::ctrlMtx); @@ -124,7 +139,7 @@ namespace dsp::demod { base_type::tempStart(); } - inline int process(int count, complex_t* in, stereo_t* out) { + inline int process(int count, complex_t* in, stereo_t* out, int& rdsOutCount, float* rdsout = NULL) { // Demodulate demod.process(count, in, demod.out.writeBuf); if (_stereo) { @@ -139,10 +154,19 @@ namespace dsp::demod { lprDelay.process(count, demod.out.writeBuf, demod.out.writeBuf); lmrDelay.process(count, rtoc.out.writeBuf, rtoc.out.writeBuf); - // Double and conjugate PLL output to down convert the L-R signal - math::Multiply::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); + // conjugate PLL output to down convert twice the L-R signal math::Conjugate::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf); + math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf); + + // Do RDS demod + if (_rdsOut) { + // Since the PLL output is no longer needed after this, use it as the output + math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); + convert::ComplexToReal::process(count, pilotPLL.out.writeBuf, rdsout); + volk_32f_s32f_multiply_32f(rdsout, rdsout, 100.0, count); + rdsOutCount = rdsResamp.process(count, rdsout, rdsout); + } // Convert output back to real for further processing convert::ComplexToReal::process(count, rtoc.out.writeBuf, lmr); @@ -180,18 +204,25 @@ namespace dsp::demod { int count = base_type::_in->read(); if (count < 0) { return -1; } - process(count, base_type::_in->readBuf, base_type::out.writeBuf); + int rdsOutCount = 0; + process(count, base_type::_in->readBuf, base_type::out.writeBuf, rdsOutCount, rdsOut.writeBuf); base_type::_in->flush(); if (!base_type::out.swap(count)) { return -1; } + if (rdsOutCount && _rdsOut) { + if (!rdsOut.swap(rdsOutCount)) { return -1; } + } return count; } + stream rdsOut; + protected: double _deviation; double _samplerate; bool _stereo; - bool _lowPass = true; + bool _lowPass; + bool _rdsOut; Quadrature demod; tap pilotFirTaps; @@ -203,6 +234,7 @@ namespace dsp::demod { tap audioFirTaps; filter::FIR arFir; filter::FIR alFir; + multirate::RationalResampler rdsResamp; float* lmr; float* l; diff --git a/core/src/dsp/digital/binary_slicer.h b/core/src/dsp/digital/binary_slicer.h new file mode 100644 index 0000000..edf6394 --- /dev/null +++ b/core/src/dsp/digital/binary_slicer.h @@ -0,0 +1,31 @@ +#pragma once +#include "../processor.h" + +namespace dsp::digital { + class BinarySlicer : public Processor { + using base_type = Processor; + public: + BinarySlicer() {} + + BinarySlicer(stream *in) { base_type::init(in); } + + static inline int process(int count, const float* in, uint8_t* out) { + // TODO: Switch to volk + for (int i = 0; i < count; i++) { + out[i] = in[i] > 0.0f; + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + }; +} \ No newline at end of file diff --git a/core/src/dsp/digital/differentia_decoder.h b/core/src/dsp/digital/differentia_decoder.h new file mode 100644 index 0000000..c524c9e --- /dev/null +++ b/core/src/dsp/digital/differentia_decoder.h @@ -0,0 +1,64 @@ +#pragma once +#include "../processor.h" + +namespace dsp::digital { + class DifferentialDecoder : public Processor { + using base_type = Processor; + public: + DifferentialDecoder() {} + + DifferentialDecoder(stream *in) { base_type::init(in); } + + void init(stream *in, uint8_t modulus, uint8_t initSym = 0) { + _modulus = modulus; + _initSym = initSym; + + last = _initSym; + + base_type::init(in); + } + + void setModulus(uint8_t modulus) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _modulus = modulus; + } + + void setInitSym(uint8_t initSym) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _initSym = initSym; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + last = _initSym; + base_type::tempStart(); + } + + inline int process(int count, const uint8_t* in, uint8_t* out) { + for (int i = 0; i < count; i++) { + out[i] = (in[i] - last) % _modulus; + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + uint8_t last; + uint8_t _initSym; + uint8_t _modulus; + }; +} \ No newline at end of file diff --git a/core/src/dsp/digital/differential_decoder.h b/core/src/dsp/digital/differential_decoder.h new file mode 100644 index 0000000..0aa54c7 --- /dev/null +++ b/core/src/dsp/digital/differential_decoder.h @@ -0,0 +1,65 @@ +#pragma once +#include "../processor.h" + +namespace dsp::digital { + class DifferentialDecoder : public Processor { + using base_type = Processor; + public: + DifferentialDecoder() {} + + DifferentialDecoder(stream *in) { base_type::init(in); } + + void init(stream *in, uint8_t modulus, uint8_t initSym = 0) { + _modulus = modulus; + _initSym = initSym; + + last = _initSym; + + base_type::init(in); + } + + void setModulus(uint8_t modulus) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _modulus = modulus; + } + + void setInitSym(uint8_t initSym) { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + _initSym = initSym; + } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + last = _initSym; + base_type::tempStart(); + } + + inline int process(int count, const uint8_t* in, uint8_t* out) { + for (int i = 0; i < count; i++) { + out[i] = (in[i] - last + _modulus) % _modulus; + last = in[i]; + } + return count; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + base_type::_in->flush(); + if (!base_type::out.swap(count)) { return -1; } + return count; + } + + protected: + uint8_t last; + uint8_t _initSym; + uint8_t _modulus; + }; +} \ No newline at end of file diff --git a/core/src/dsp/digital/manchester_decoder.h b/core/src/dsp/digital/manchester_decoder.h new file mode 100644 index 0000000..119489a --- /dev/null +++ b/core/src/dsp/digital/manchester_decoder.h @@ -0,0 +1,47 @@ +#pragma once +#include "../processor.h" + +namespace dsp::digital { + class ManchesterDecoder : public Processor { + using base_type = Processor; + public: + ManchesterDecoder() {} + + ManchesterDecoder(stream *in) { base_type::init(in); } + + void reset() { + assert(base_type::_block_init); + std::lock_guard lck(base_type::ctrlMtx); + base_type::tempStop(); + offset = 0; + base_type::tempStart(); + } + + inline int process(int count, const uint8_t* in, uint8_t* out) { + // TODO: NOT THIS BULLSHIT + int outCount = 0; + for (; offset < count; offset += 2) { + out[outCount++] = in[offset]; + } + offset -= count; + return outCount; + } + + int run() { + int count = base_type::_in->read(); + if (count < 0) { return -1; } + + int outCount = process(count, base_type::_in->readBuf, base_type::out.writeBuf); + + // Swap if some data was generated + base_type::_in->flush(); + if (outCount) { + if (!base_type::out.swap(outCount)) { return -1; } + } + return outCount; + } + + protected: + int offset = 0; + }; +} \ No newline at end of file diff --git a/core/src/gui/style.h b/core/src/gui/style.h index 5f75b8e..edd79b4 100644 --- a/core/src/gui/style.h +++ b/core/src/gui/style.h @@ -1,13 +1,13 @@ #pragma once #include #include +#include namespace style { - extern ImFont* baseFont; - extern ImFont* bigFont; - extern ImFont* hugeFont; - - extern float uiScale; + SDRPP_EXPORT ImFont* baseFont; + SDRPP_EXPORT ImFont* bigFont; + SDRPP_EXPORT ImFont* hugeFont; + SDRPP_EXPORT float uiScale; bool setDefaultStyle(std::string resDir); bool loadFonts(std::string resDir); diff --git a/decoder_modules/meteor_demodulator/src/main.cpp b/decoder_modules/meteor_demodulator/src/main.cpp index 9002c28..300f3ad 100644 --- a/decoder_modules/meteor_demodulator/src/main.cpp +++ b/decoder_modules/meteor_demodulator/src/main.cpp @@ -56,7 +56,7 @@ public: config.release(created); vfo = sigpath::vfoManager.createVFO(name, ImGui::WaterfallVFO::REF_CENTER, 0, 150000, INPUT_SAMPLE_RATE, 150000, 150000, true); - demod.init(vfo->output, 72000.0f, INPUT_SAMPLE_RATE, 33, 0.6f, 0.1f, 0.005f, (0.01 * 0.01) / 4.0, 0.01); + demod.init(vfo->output, 72000.0f, INPUT_SAMPLE_RATE, 33, 0.6f, 0.1f, 0.005f, 1e-6, 0.01); split.init(&demod.out); split.bindStream(&symSinkStream); split.bindStream(&sinkStream); diff --git a/decoder_modules/radio/src/demodulators/wfm.h b/decoder_modules/radio/src/demodulators/wfm.h index 7938586..2761b28 100644 --- a/decoder_modules/radio/src/demodulators/wfm.h +++ b/decoder_modules/radio/src/demodulators/wfm.h @@ -1,6 +1,15 @@ #pragma once #include "../demod.h" #include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace demod { class WFM : public Demodulator { @@ -13,12 +22,17 @@ namespace demod { ~WFM() { stop(); + gui::waterfall.onFFTRedraw.unbindHandler(&fftRedrawHandler); } void init(std::string name, ConfigManager* config, dsp::stream* input, double bandwidth, double audioSR) { this->name = name; _config = config; + fftRedrawHandler.handler = fftRedraw; + fftRedrawHandler.ctx = this; + gui::waterfall.onFFTRedraw.bindHandler(&fftRedrawHandler); + // Load config _config->acquire(); bool modified = false; @@ -28,18 +42,36 @@ namespace demod { if (config->conf[name][getName()].contains("lowPass")) { _lowPass = config->conf[name][getName()]["lowPass"]; } + if (config->conf[name][getName()].contains("rds")) { + _rds = config->conf[name][getName()]["rds"]; + } _config->release(modified); // Define structure - demod.init(input, bandwidth / 2.0f, getIFSampleRate(), _stereo, _lowPass); + demod.init(input, bandwidth / 2.0f, getIFSampleRate(), _stereo, _lowPass, _rds); + recov.init(&demod.rdsOut, 5000.0 / 2375, omegaGain, muGain, 0.01); + slice.init(&recov.out); + manch.init(&slice.out); + diff.init(&manch.out, 2); + hs.init(&diff.out, rdsHandler, this); } void start() { demod.start(); + recov.start(); + slice.start(); + manch.start(); + diff.start(); + hs.start(); } void stop() { demod.stop(); + recov.stop(); + slice.stop(); + manch.stop(); + diff.stop(); + hs.stop(); } void showMenu() { @@ -55,6 +87,21 @@ namespace demod { _config->conf[name][getName()]["lowPass"] = _lowPass; _config->release(true); } + if (ImGui::Checkbox(("Decode RDS##_radio_wfm_rds_" + name).c_str(), &_rds)) { + demod.setRDSOut(_rds); + _config->acquire(); + _config->conf[name][getName()]["rds"] = _rds; + _config->release(true); + } + + // if (_rds) { + // if (rdsDecode.countryCodeValid()) { ImGui::Text("Country code: %d", rdsDecode.getCountryCode()); } + // if (rdsDecode.programCoverageValid()) { ImGui::Text("Program coverage: %d", rdsDecode.getProgramCoverage()); } + // if (rdsDecode.programRefNumberValid()) { ImGui::Text("Reference number: %d", rdsDecode.getProgramRefNumber()); } + // if (rdsDecode.programTypeValid()) { ImGui::Text("Program type: %d", rdsDecode.getProgramType()); } + // if (rdsDecode.PSNameValid()) { ImGui::Text("Program name: [%s]", rdsDecode.getPSName().c_str()); } + // if (rdsDecode.radioTextValid()) { ImGui::Text("Radiotext: [%s]", rdsDecode.getRadioText().c_str()); } + // } } void setBandwidth(double bandwidth) { @@ -93,12 +140,68 @@ namespace demod { } private: + static void rdsHandler(uint8_t* data, int count, void* ctx) { + WFM* _this = (WFM*)ctx; + _this->rdsDecode.process(data, count); + } + + static void fftRedraw(ImGui::WaterFall::FFTRedrawArgs args, void* ctx) { + WFM* _this = (WFM*)ctx; + if (!_this->_rds) { return; } + + // Generate string depending on RDS mode + char buf[256]; + if (_this->rdsDecode.PSNameValid() && _this->rdsDecode.radioTextValid()) { + sprintf(buf, "RDS: %s - %s", _this->rdsDecode.getPSName().c_str(), _this->rdsDecode.getRadioText().c_str()); + } + else if (_this->rdsDecode.PSNameValid()) { + sprintf(buf, "RDS: %s", _this->rdsDecode.getPSName().c_str()); + } + else if (_this->rdsDecode.radioTextValid()) { + sprintf(buf, "RDS: %s", _this->rdsDecode.getRadioText().c_str()); + } + else { + return; + } + + // Calculate paddings + ImVec2 min = args.min; + min.x += 5.0f * style::uiScale; + min.y += 5.0f * style::uiScale; + ImVec2 tmin = min; + tmin.x += 5.0f * style::uiScale; + tmin.y += 5.0f * style::uiScale; + ImVec2 tmax = ImGui::CalcTextSize(buf); + tmax.x += tmin.x; + tmax.y += tmin.y; + ImVec2 max = tmax; + max.x += 5.0f * style::uiScale; + max.y += 5.0f * style::uiScale; + + // Draw back drop + args.window->DrawList->AddRectFilled(min, max, IM_COL32(0, 0, 0, 128)); + + // Draw text + args.window->DrawList->AddText(tmin, IM_COL32(255, 255, 0, 255), buf); + } + dsp::demod::BroadcastFM demod; + dsp::clock_recovery::FD recov; + dsp::digital::BinarySlicer slice; + dsp::digital::ManchesterDecoder manch; + dsp::digital::DifferentialDecoder diff; + dsp::sink::Handler hs; + EventHandler fftRedrawHandler; + + rds::RDSDecoder rdsDecode; ConfigManager* _config = NULL; bool _stereo = false; bool _lowPass = true; + bool _rds = false; + float muGain = 0.01; + float omegaGain = (0.01*0.01)/4.0; std::string name; }; diff --git a/decoder_modules/radio/src/radio_module.h b/decoder_modules/radio/src/radio_module.h index 65057d3..cfa236e 100644 --- a/decoder_modules/radio/src/radio_module.h +++ b/decoder_modules/radio/src/radio_module.h @@ -232,16 +232,19 @@ private: } // Noise blanker - if (ImGui::Checkbox(("Noise blanker (W.I.P.)##_radio_nb_ena_" + _this->name).c_str(), &_this->nbEnabled)) { - _this->setNBEnabled(_this->nbEnabled); + if (_this->nbAllowed) { + if (ImGui::Checkbox(("Noise blanker (W.I.P.)##_radio_nb_ena_" + _this->name).c_str(), &_this->nbEnabled)) { + _this->setNBEnabled(_this->nbEnabled); + } + if (!_this->nbEnabled && _this->enabled) { style::beginDisabled(); } + ImGui::SameLine(); + ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); + if (ImGui::SliderFloat(("##_radio_nb_lvl_" + _this->name).c_str(), &_this->nbLevel, _this->MIN_NB, _this->MAX_NB, "%.3fdB")) { + _this->setNBLevel(_this->nbLevel); + } + if (!_this->nbEnabled && _this->enabled) { style::endDisabled(); } } - if (!_this->nbEnabled && _this->enabled) { style::beginDisabled(); } - ImGui::SameLine(); - ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); - if (ImGui::SliderFloat(("##_radio_nb_lvl_" + _this->name).c_str(), &_this->nbLevel, _this->MIN_NB, _this->MAX_NB, "%.3fdB")) { - _this->setNBLevel(_this->nbLevel); - } - if (!_this->nbEnabled && _this->enabled) { style::endDisabled(); } + // Squelch if (ImGui::Checkbox(("Squelch##_radio_sqelch_ena_" + _this->name).c_str(), &_this->squelchEnabled)) { @@ -422,7 +425,7 @@ private: // Configure noise blanker nb.setRate(500.0 / ifSamplerate); setNBLevel(nbLevel); - setNBEnabled(nbEnabled); + setNBEnabled(nbAllowed&& nbEnabled); // Configure FM IF Noise Reduction setIFNRPreset((selectedDemodID == RADIO_DEMOD_NFM) ? ifnrPresets[fmIFPresetId] : IFNR_PRESET_BROADCAST); diff --git a/decoder_modules/radio/src/rds.cpp b/decoder_modules/radio/src/rds.cpp new file mode 100644 index 0000000..c947e97 --- /dev/null +++ b/decoder_modules/radio/src/rds.cpp @@ -0,0 +1,251 @@ +#include "rds.h" +#include +#include +#include + +namespace rds { + std::map SYNDROMES = { + { 0b1111011000, BLOCK_TYPE_A }, + { 0b1111010100, BLOCK_TYPE_B }, + { 0b1001011100, BLOCK_TYPE_C }, + { 0b1111001100, BLOCK_TYPE_CP }, + { 0b1001011000, BLOCK_TYPE_D } + }; + + std::map OFFSETS = { + { BLOCK_TYPE_A, 0b0011111100 }, + { BLOCK_TYPE_B, 0b0110011000 }, + { BLOCK_TYPE_C, 0b0101101000 }, + { BLOCK_TYPE_CP, 0b1101010000 }, + { BLOCK_TYPE_D, 0b0110110100 } + }; + + // This parity check matrix is given in annex B2.1 of the specificiation + const uint16_t PARITY_CHECK_MAT[] = { + 0b1000000000, + 0b0100000000, + 0b0010000000, + 0b0001000000, + 0b0000100000, + 0b0000010000, + 0b0000001000, + 0b0000000100, + 0b0000000010, + 0b0000000001, + 0b1011011100, + 0b0101101110, + 0b0010110111, + 0b1010000111, + 0b1110011111, + 0b1100010011, + 0b1101010101, + 0b1101110110, + 0b0110111011, + 0b1000000001, + 0b1111011100, + 0b0111101110, + 0b0011110111, + 0b1010100111, + 0b1110001111, + 0b1100011011 + }; + + const int BLOCK_LEN = 26; + const int DATA_LEN = 16; + const int POLY_LEN = 10; + const uint16_t LFSR_POLY = 0x5B9; + const uint16_t IN_POLY = 0x31B; + + void RDSDecoder::process(uint8_t* symbols, int count) { + for (int i = 0; i < count; i++) { + // Shift in the bit + shiftReg = ((shiftReg << 1) & 0x3FFFFFF) | (symbols[i] & 1); + + // Skip if we need to shift in new data + if (--skip > 0) { + continue; + } + + // Calculate the syndrome and update sync status + uint16_t syn = calcSyndrome(shiftReg); + auto synIt = SYNDROMES.find(syn); + bool knownSyndrome = synIt != SYNDROMES.end(); + sync = std::clamp(knownSyndrome ? ++sync : --sync, 0, 4); + + // if (knownSyndrome) { + // printf("Found known syn: %04X\n", syn); + // } + + // If we're still no longer in sync, try to resync + if (!sync) { continue; } + + // Figure out which block we've got + BlockType type; + if (knownSyndrome) { + type = SYNDROMES[syn]; + } + else { + type = (BlockType)((lastType + 1) % _BLOCK_TYPE_COUNT); + } + + // Save block while correcting errors (NOT YET) + blocks[type] = shiftReg;//correctErrors(shiftReg, type); + + //printf("Block type: %d, Sync: %d, KnownSyndrome: %s, contGroup: %d, offset: %d\n", type, sync, knownSyndrome ? "yes" : "no", contGroup, i); + + // Update continous group count + if (type == BLOCK_TYPE_A) { contGroup = 1; } + else if (type == BLOCK_TYPE_B && lastType == BLOCK_TYPE_A) { contGroup++; } + else if ((type == BLOCK_TYPE_C || type == BLOCK_TYPE_CP) && lastType == BLOCK_TYPE_B) { contGroup++; } + else if (type == BLOCK_TYPE_D && (lastType == BLOCK_TYPE_C || lastType == BLOCK_TYPE_CP)) { contGroup++; } + else { contGroup = 0; } + + // If we've got an entire group, process it + if (contGroup >= 4) { + contGroup = 0; + decodeGroup(); + } + + // // Remember the last block type and skip to new block + lastType = type; + skip = BLOCK_LEN; + } + } + + uint16_t RDSDecoder::calcSyndrome(uint32_t block) { + // Perform vector/matrix dot product between block and parity matrix + uint16_t syn = 0; + for(int i = 0; i < BLOCK_LEN; i++) { + syn ^= PARITY_CHECK_MAT[BLOCK_LEN - 1 - i] * ((block >> i) & 1); + } + return syn; + } + + uint32_t RDSDecoder::correctErrors(uint32_t block, BlockType type) { + // Init the syndrome and output + uint16_t syn = 0; + uint32_t out = block; + + // Subtract the offset from block + block ^= (uint32_t)OFFSETS[type]; + + // Feed in the data + for (int i = BLOCK_LEN - 1; i >= 0; i--) { + // Shift the syndrome and keep the output + uint8_t outBit = (syn >> (POLY_LEN - 1)) & 1; + syn = (syn << 1) & 0b1111111111; + + // Apply LFSR polynomial + syn ^= LFSR_POLY * outBit; + + // Apply input polynomial. + syn ^= IN_POLY * ((block >> i) & 1); + } + + // Use the syndrome register to do error correction + // TODO: For some reason there's always zeros in the syn when starting + uint8_t errorFound = 0; + for (int i = DATA_LEN - 1; i >= 0; i--) { + // Check if the 5 leftmost bits are all zero + errorFound |= !(syn & 0b11111); + + // Write output + uint8_t outBit = (syn >> (POLY_LEN - 1)) & 1; + out ^= (errorFound & outBit) << (i + POLY_LEN); + + // Shift syndrome + syn = (syn << 1) & 0b1111111111; + syn ^= LFSR_POLY * outBit * !errorFound; + } + + // TODO: mark block as irrecoverable if too damaged + + if (errorFound) { + printf("Error found\n"); + } + + return out; + } + + void RDSDecoder::decodeGroup() { + std::lock_guard lck(groupMtx); + auto now = std::chrono::high_resolution_clock::now(); + anyGroupLastUpdate = now; + + // Decode PI code + countryCode = (blocks[BLOCK_TYPE_A] >> 22) & 0xF; + programCoverage = (AreaCoverage)((blocks[BLOCK_TYPE_A] >> 18) & 0xF); + programRefNumber = (blocks[BLOCK_TYPE_A] >> 10) & 0xFF; + + // Decode group type and version + uint8_t groupType = (blocks[BLOCK_TYPE_B] >> 22) & 0xF; + GroupVersion groupVer = (GroupVersion)((blocks[BLOCK_TYPE_B] >> 21) & 1); + + // Decode traffic program and program type + trafficProgram = (blocks[BLOCK_TYPE_B] >> 20) & 1; + programType = (ProgramType)((blocks[BLOCK_TYPE_B] >> 15) & 0x1F); + + if (groupType == 0) { + group0LastUpdate = now; + trafficAnnouncement = (blocks[BLOCK_TYPE_B] >> 14) & 1; + music = (blocks[BLOCK_TYPE_B] >> 13) & 1; + uint8_t diBit = (blocks[BLOCK_TYPE_B] >> 12) & 1; + uint8_t offset = ((blocks[BLOCK_TYPE_B] >> 10) & 0b11); + uint8_t diOffset = 3 - offset; + uint8_t psOffset = offset * 2; + + if (groupVer == GROUP_VER_A) { + alternateFrequency = (blocks[BLOCK_TYPE_C] >> 10) & 0xFFFF; + } + + // Write DI bit to the decoder identification + decoderIdent &= ~(1 << diOffset); + decoderIdent |= (diBit << diOffset); + + // Write chars at offset the PSName + programServiceName[psOffset] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; + programServiceName[psOffset + 1] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + } + else if (groupType == 2) { + group2LastUpdate = now; + // Get char offset and write chars in the Radiotext + bool nAB = (blocks[BLOCK_TYPE_B] >> 14) & 1; + uint8_t offset = (blocks[BLOCK_TYPE_B] >> 10) & 0xF; + + // Clear text field if the A/B flag changed + if (nAB != rtAB) { + radioText = " "; + } + rtAB = nAB; + + // Write char at offset in Radiotext + if (groupVer == GROUP_VER_A) { + uint8_t rtOffset = offset * 4; + radioText[rtOffset] = (blocks[BLOCK_TYPE_C] >> 18) & 0xFF; + radioText[rtOffset + 1] = (blocks[BLOCK_TYPE_C] >> 10) & 0xFF; + radioText[rtOffset + 2] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; + radioText[rtOffset + 3] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + } + else { + uint8_t rtOffset = offset * 2; + radioText[rtOffset] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; + radioText[rtOffset + 1] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + } + } + } + + bool RDSDecoder::anyGroupValid() { + auto now = std::chrono::high_resolution_clock::now(); + return (std::chrono::duration_cast(now - anyGroupLastUpdate)).count() < 5000.0; + } + + bool RDSDecoder::group0Valid() { + auto now = std::chrono::high_resolution_clock::now(); + return (std::chrono::duration_cast(now - group0LastUpdate)).count() < 5000.0; + } + + bool RDSDecoder::group2Valid() { + auto now = std::chrono::high_resolution_clock::now(); + return (std::chrono::duration_cast(now - group2LastUpdate)).count() < 5000.0; + } +} \ No newline at end of file diff --git a/decoder_modules/radio/src/rds.h b/decoder_modules/radio/src/rds.h new file mode 100644 index 0000000..4c775b2 --- /dev/null +++ b/decoder_modules/radio/src/rds.h @@ -0,0 +1,179 @@ +#pragma once +#include +#include +#include +#include + +namespace rds { + enum BlockType { + BLOCK_TYPE_A, + BLOCK_TYPE_B, + BLOCK_TYPE_C, + BLOCK_TYPE_CP, + BLOCK_TYPE_D, + _BLOCK_TYPE_COUNT + }; + + enum GroupVersion { + GROUP_VER_A, + GROUP_VER_B + }; + + enum AreaCoverage { + AREA_COVERAGE_LOCAL, + AREA_COVERAGE_INTERNATIONAL, + AREA_COVERAGE_NATIONAL, + AREA_COVERAGE_SUPRA_NATIONAL, + AREA_COVERAGE_REGIONAL1, + AREA_COVERAGE_REGIONAL2, + AREA_COVERAGE_REGIONAL3, + AREA_COVERAGE_REGIONAL4, + AREA_COVERAGE_REGIONAL5, + AREA_COVERAGE_REGIONAL6, + AREA_COVERAGE_REGIONAL7, + AREA_COVERAGE_REGIONAL8, + AREA_COVERAGE_REGIONAL9, + AREA_COVERAGE_REGIONAL10, + AREA_COVERAGE_REGIONAL11, + AREA_COVERAGE_REGIONAL12 + }; + + enum ProgramType { + // US Types + PROGRAM_TYPE_US_NONE = 0, + PROGRAM_TYPE_US_NEWS = 1, + PROGRAM_TYPE_US_INFOMATION = 2, + PROGRAM_TYPE_US_SPORTS = 3, + PROGRAM_TYPE_US_TALK = 4, + PROGRAM_TYPE_US_ROCK = 5, + PROGRAM_TYPE_US_CLASSIC_ROCK = 6, + PROGRAM_TYPE_US_ADULT_HITS = 7, + PROGRAM_TYPE_US_SOFT_ROCK = 8, + PROGRAM_TYPE_US_TOP_40 = 9, + PROGRAM_TYPE_US_COUNTRY = 10, + PROGRAM_TYPE_US_OLDIES = 11, + PROGRAM_TYPE_US_SOFT = 12, + PROGRAM_TYPE_US_NOSTALGIA = 13, + PROGRAM_TYPE_US_JAZZ = 14, + PROGRAM_TYPE_US_CLASSICAL = 15, + PROGRAM_TYPE_US_RHYTHM_AND_BLUES = 16, + PROGRAM_TYPE_US_SOFT_RHYTHM_AND_BLUES = 17, + PROGRAM_TYPE_US_FOREIGN_LANGUAGE = 18, + PROGRAM_TYPE_US_RELIGIOUS_MUSIC = 19, + PROGRAM_TYPE_US_RELIGIOUS_TALK = 20, + PROGRAM_TYPE_US_PERSONALITY = 21, + PROGRAM_TYPE_US_PUBLIC = 22, + PROGRAM_TYPE_US_COLLEGE = 23, + PROGRAM_TYPE_US_UNASSIGNED0 = 24, + PROGRAM_TYPE_US_UNASSIGNED1 = 25, + PROGRAM_TYPE_US_UNASSIGNED2 = 26, + PROGRAM_TYPE_US_UNASSIGNED3 = 27, + PROGRAM_TYPE_US_UNASSIGNED4 = 28, + PROGRAM_TYPE_US_WEATHER = 29, + PROGRAM_TYPE_US_EMERGENCY_TEST = 30, + PROGRAM_TYPE_US_EMERGENCY = 31, + + // EU Types + PROGRAM_TYPE_EU_NONE = 0, + PROGRAM_TYPE_EU_NEWS = 1, + PROGRAM_TYPE_EU_CURRENT_AFFAIRS = 2, + PROGRAM_TYPE_EU_INFORMATION = 3, + PROGRAM_TYPE_EU_SPORTS = 4, + PROGRAM_TYPE_EU_EDUCATION = 5, + PROGRAM_TYPE_EU_DRAMA = 6, + PROGRAM_TYPE_EU_CULTURE = 7, + PROGRAM_TYPE_EU_SCIENCE = 8, + PROGRAM_TYPE_EU_VARIED = 9, + PROGRAM_TYPE_EU_POP_MUSIC = 10, + PROGRAM_TYPE_EU_ROCK_MUSIC = 11, + PROGRAM_TYPE_EU_EASY_LISTENING_MUSIC = 12, + PROGRAM_TYPE_EU_LIGHT_CLASSICAL = 13, + PROGRAM_TYPE_EU_SERIOUS_CLASSICAL = 14, + PROGRAM_TYPE_EU_OTHER_MUSIC = 15, + PROGRAM_TYPE_EU_WEATHER = 16, + PROGRAM_TYPE_EU_FINANCE = 17, + PROGRAM_TYPE_EU_CHILDRENS_PROGRAM = 18, + PROGRAM_TYPE_EU_SOCIAL_AFFAIRS = 19, + PROGRAM_TYPE_EU_RELIGION = 20, + PROGRAM_TYPE_EU_PHONE_IN = 21, + PROGRAM_TYPE_EU_TRAVEL = 22, + PROGRAM_TYPE_EU_LEISURE = 23, + PROGRAM_TYPE_EU_JAZZ_MUSIC = 24, + PROGRAM_TYPE_EU_COUNTRY_MUSIC = 25, + PROGRAM_TYPE_EU_NATIONAL_MUSIC = 26, + PROGRAM_TYPE_EU_OLDIES_MUSIC = 27, + PROGRAM_TYPE_EU_FOLK_MUSIC = 28, + PROGRAM_TYPE_EU_DOCUMENTARY = 29, + PROGRAM_TYPE_EU_ALARM_TEST = 30, + PROGRAM_TYPE_EU_ALARM = 31 + }; + + enum DecoderIdentification { + DECODER_IDENT_STEREO = (1 << 0), + DECODER_IDENT_ARTIFICIAL_HEAD = (1 << 1), + DECODER_IDENT_COMPRESSED = (1 << 2), + DECODER_IDENT_VARIABLE_PTY = (1 << 0) + }; + + class RDSDecoder { + public: + void process(uint8_t* symbols, int count); + + bool countryCodeValid() { std::lock_guard lck(groupMtx); return anyGroupValid(); } + uint8_t getCountryCode() { std::lock_guard lck(groupMtx); return countryCode; } + bool programCoverageValid() { std::lock_guard lck(groupMtx); return anyGroupValid(); } + uint8_t getProgramCoverage() { std::lock_guard lck(groupMtx); return programCoverage; } + bool programRefNumberValid() { std::lock_guard lck(groupMtx); return anyGroupValid(); } + uint8_t getProgramRefNumber() { std::lock_guard lck(groupMtx); return programRefNumber; } + bool programTypeValid() { std::lock_guard lck(groupMtx); return anyGroupValid(); } + ProgramType getProgramType() { std::lock_guard lck(groupMtx); return programType; } + + bool musicValid() { std::lock_guard lck(groupMtx); return group0Valid(); } + bool getMusic() { std::lock_guard lck(groupMtx); return music; } + bool PSNameValid() { std::lock_guard lck(groupMtx); return group0Valid(); } + std::string getPSName() { std::lock_guard lck(groupMtx); return programServiceName; } + + bool radioTextValid() { std::lock_guard lck(groupMtx); return group2Valid(); } + std::string getRadioText() { std::lock_guard lck(groupMtx); return radioText; } + + private: + static uint16_t calcSyndrome(uint32_t block); + static uint32_t correctErrors(uint32_t block, BlockType type); + void decodeGroup(); + + bool anyGroupValid(); + bool group0Valid(); + bool group2Valid(); + + // State machine + uint32_t shiftReg = 0; + int sync = 0; + int skip = 0; + BlockType lastType = BLOCK_TYPE_A; + int contGroup = 0; + uint32_t blocks[_BLOCK_TYPE_COUNT]; + + // All groups + std::mutex groupMtx; + std::chrono::steady_clock::time_point anyGroupLastUpdate; + uint8_t countryCode; + AreaCoverage programCoverage; + uint8_t programRefNumber; + bool trafficProgram; + ProgramType programType; + + // Group type 0 + std::chrono::steady_clock::time_point group0LastUpdate; + bool trafficAnnouncement; + bool music; + uint8_t decoderIdent; + uint16_t alternateFrequency; + std::string programServiceName = " "; + + // Group type 2 + std::chrono::steady_clock::time_point group2LastUpdate; + bool rtAB = false; + std::string radioText = " "; + + }; +} \ No newline at end of file diff --git a/make_windows_package.ps1 b/make_windows_package.ps1 index 6ab11b8..f6de949 100644 --- a/make_windows_package.ps1 +++ b/make_windows_package.ps1 @@ -56,10 +56,10 @@ cp $build_dir/sink_modules/network_sink/Release/network_sink.dll sdrpp_windows_x # Copy decoder modules -# cp $build_dir/decoder_modules/m17_decoder/Release/m17_decoder.dll sdrpp_windows_x64/modules/ -# cp "C:/Program Files/codec2/lib/libcodec2.dll" sdrpp_windows_x64/ +cp $build_dir/decoder_modules/m17_decoder/Release/m17_decoder.dll sdrpp_windows_x64/modules/ +cp "C:/Program Files/codec2/lib/libcodec2.dll" sdrpp_windows_x64/ -# cp $build_dir/decoder_modules/meteor_demodulator/Release/meteor_demodulator.dll sdrpp_windows_x64/modules/ +cp $build_dir/decoder_modules/meteor_demodulator/Release/meteor_demodulator.dll sdrpp_windows_x64/modules/ cp $build_dir/decoder_modules/radio/Release/radio.dll sdrpp_windows_x64/modules/ From b5857e20783a9670760264784fcae0114ef92193 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 6 Jul 2022 22:32:27 +0200 Subject: [PATCH 33/39] bugfix because std::chrono is stupid --- decoder_modules/radio/src/rds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decoder_modules/radio/src/rds.h b/decoder_modules/radio/src/rds.h index 4c775b2..2230d0c 100644 --- a/decoder_modules/radio/src/rds.h +++ b/decoder_modules/radio/src/rds.h @@ -155,7 +155,7 @@ namespace rds { // All groups std::mutex groupMtx; - std::chrono::steady_clock::time_point anyGroupLastUpdate; + std::chrono::time_point anyGroupLastUpdate; uint8_t countryCode; AreaCoverage programCoverage; uint8_t programRefNumber; @@ -163,7 +163,7 @@ namespace rds { ProgramType programType; // Group type 0 - std::chrono::steady_clock::time_point group0LastUpdate; + std::chrono::time_point group0LastUpdate; bool trafficAnnouncement; bool music; uint8_t decoderIdent; @@ -171,7 +171,7 @@ namespace rds { std::string programServiceName = " "; // Group type 2 - std::chrono::steady_clock::time_point group2LastUpdate; + std::chrono::time_point group2LastUpdate; bool rtAB = false; std::string radioText = " "; From 06210ae825a197c5b8ea658f3eabbd4144540845 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 7 Jul 2022 00:45:15 +0200 Subject: [PATCH 34/39] Fixed RDS not enabled when in mono even if RDS checkbox checked --- core/src/dsp/demod/broadcast_fm.h | 25 ++++++++++++++++++++ sink_modules/android_audio_sink/src/main.cpp | 5 ++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/core/src/dsp/demod/broadcast_fm.h b/core/src/dsp/demod/broadcast_fm.h index 7eff447..df6ae2b 100644 --- a/core/src/dsp/demod/broadcast_fm.h +++ b/core/src/dsp/demod/broadcast_fm.h @@ -188,6 +188,31 @@ namespace dsp::demod { convert::LRToStereo::process(count, l, r, out); } else { + // Process RDS if needed. Note: find a way to not have to copy half the code from the stereo demod + if (_rdsOut) { + // Convert to complex + rtoc.process(count, demod.out.writeBuf, rtoc.out.writeBuf); + + // Filter out pilot and run through PLL + pilotFir.process(count, rtoc.out.writeBuf, pilotFir.out.writeBuf); + pilotPLL.process(count, pilotFir.out.writeBuf, pilotPLL.out.writeBuf); + + // Delay + lprDelay.process(count, demod.out.writeBuf, demod.out.writeBuf); + lmrDelay.process(count, rtoc.out.writeBuf, rtoc.out.writeBuf); + + // conjugate PLL output to down convert twice the L-R signal + math::Conjugate::process(count, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); + math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf); + math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, rtoc.out.writeBuf); + + // Since the PLL output is no longer needed after this, use it as the output + math::Multiply::process(count, rtoc.out.writeBuf, pilotPLL.out.writeBuf, pilotPLL.out.writeBuf); + convert::ComplexToReal::process(count, pilotPLL.out.writeBuf, rdsout); + volk_32f_s32f_multiply_32f(rdsout, rdsout, 100.0, count); + rdsOutCount = rdsResamp.process(count, rdsout, rdsout); + } + // Filter if needed if (_lowPass) { alFir.process(count, demod.out.writeBuf, demod.out.writeBuf); diff --git a/sink_modules/android_audio_sink/src/main.cpp b/sink_modules/android_audio_sink/src/main.cpp index 4a28906..c32c578 100644 --- a/sink_modules/android_audio_sink/src/main.cpp +++ b/sink_modules/android_audio_sink/src/main.cpp @@ -3,8 +3,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -125,7 +124,7 @@ private: AAudioStream *stream = NULL; SinkManager::Stream* _stream; - dsp::Packer packer; + dsp::buffer::Packer packer; std::string _streamName; double sampleRate; From ae149b256b404214fb85a60ee1d905601d80eb02 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 7 Jul 2022 20:07:13 +0200 Subject: [PATCH 35/39] Fixed recorder bug --- core/src/dsp/audio/volume.h | 1 + core/src/dsp/routing/splitter.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/dsp/audio/volume.h b/core/src/dsp/audio/volume.h index b07886a..708fb9e 100644 --- a/core/src/dsp/audio/volume.h +++ b/core/src/dsp/audio/volume.h @@ -12,6 +12,7 @@ namespace dsp::audio { void init(stream* in, double volume, bool muted) { _volume = powf(volume, 2); + _muted = muted; level = { -150.0f, -150.0f }; base_type::init(in); } diff --git a/core/src/dsp/routing/splitter.h b/core/src/dsp/routing/splitter.h index 50379c9..bb50db7 100644 --- a/core/src/dsp/routing/splitter.h +++ b/core/src/dsp/routing/splitter.h @@ -21,8 +21,8 @@ namespace dsp::routing { // Add to the list base_type::tempStop(); - streams.push_back(stream); base_type::registerOutput(stream); + streams.push_back(stream); base_type::tempStart(); } @@ -38,8 +38,8 @@ namespace dsp::routing { // Add to the list base_type::tempStop(); - base_type::unregisterOutput(stream); streams.erase(sit); + base_type::unregisterOutput(stream); base_type::tempStart(); } From bdd4998b1bb1fe0c617add1e4c23fb2ecce68907 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Thu, 7 Jul 2022 22:14:40 +0200 Subject: [PATCH 36/39] fixed blury icon and recorder level meter --- core/backends/glfw/backend.cpp | 18 +++++++++--------- misc_modules/recorder/src/main.cpp | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/core/backends/glfw/backend.cpp b/core/backends/glfw/backend.cpp index 542e94f..13ba5be 100644 --- a/core/backends/glfw/backend.cpp +++ b/core/backends/glfw/backend.cpp @@ -112,15 +112,6 @@ namespace backend { break; } - #endif - - // Add callback for max/min if GLFW supports it - #if (GLFW_VERSION_MAJOR == 3) && (GLFW_VERSION_MINOR >= 3) - if (maximized) { - glfwMaximizeWindow(window); - } - - glfwSetWindowMaximizeCallback(window, maximized_callback); #endif // Load app icon @@ -164,6 +155,15 @@ namespace backend { free(icons[i].pixels); } + // Add callback for max/min if GLFW supports it + #if (GLFW_VERSION_MAJOR == 3) && (GLFW_VERSION_MINOR >= 3) + if (maximized) { + glfwMaximizeWindow(window); + } + + glfwSetWindowMaximizeCallback(window, maximized_callback); + #endif + // Setup Dear ImGui context IMGUI_CHECKVERSION(); ImGui::CreateContext(); diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index c95387d..50201c7 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -279,9 +279,10 @@ private: lvlL = std::clamp(lvlL - (frameTime * 50.0), -90.0f, 10.0f); lvlR = std::clamp(lvlR - (frameTime * 50.0), -90.0f, 10.0f); + // Note: Yes, using the natural log is on purpose, it just gives a more beautiful result. dsp::stereo_t rawLvl = meter.getLevel(); meter.resetLevel(); - dsp::stereo_t dbLvl = { 10.0f * log10f(rawLvl.l), 10.0f * log10f(rawLvl.r) }; + dsp::stereo_t dbLvl = { 10.0f * logf(rawLvl.l), 10.0f * logf(rawLvl.r) }; if (dbLvl.l > lvlL) { lvlL = dbLvl.l; } if (dbLvl.r > lvlR) { lvlR = dbLvl.r; } ImGui::VolumeMeter(lvlL, lvlL, -60, 10); From 96f5b37f76ac4aafa3df8f3dafca0b1cb7e55315 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 8 Jul 2022 01:02:36 +0200 Subject: [PATCH 37/39] Added RDS error correction (still needs better clock recovery) --- decoder_modules/radio/src/rds.cpp | 89 ++++++++++++++++++------------- decoder_modules/radio/src/rds.h | 3 +- 2 files changed, 53 insertions(+), 39 deletions(-) diff --git a/decoder_modules/radio/src/rds.cpp b/decoder_modules/radio/src/rds.cpp index c947e97..6388a8c 100644 --- a/decoder_modules/radio/src/rds.cpp +++ b/decoder_modules/radio/src/rds.cpp @@ -53,8 +53,10 @@ namespace rds { const int BLOCK_LEN = 26; const int DATA_LEN = 16; const int POLY_LEN = 10; - const uint16_t LFSR_POLY = 0x5B9; - const uint16_t IN_POLY = 0x31B; + + // 9876543210 + const uint16_t LFSR_POLY = 0b0110111001; + const uint16_t IN_POLY = 0b1100011011; void RDSDecoder::process(uint8_t* symbols, int count) { for (int i = 0; i < count; i++) { @@ -71,10 +73,6 @@ namespace rds { auto synIt = SYNDROMES.find(syn); bool knownSyndrome = synIt != SYNDROMES.end(); sync = std::clamp(knownSyndrome ? ++sync : --sync, 0, 4); - - // if (knownSyndrome) { - // printf("Found known syn: %04X\n", syn); - // } // If we're still no longer in sync, try to resync if (!sync) { continue; } @@ -89,9 +87,7 @@ namespace rds { } // Save block while correcting errors (NOT YET) - blocks[type] = shiftReg;//correctErrors(shiftReg, type); - - //printf("Block type: %d, Sync: %d, KnownSyndrome: %s, contGroup: %d, offset: %d\n", type, sync, knownSyndrome ? "yes" : "no", contGroup, i); + blocks[type] = correctErrors(shiftReg, type, blockAvail[type]); // Update continous group count if (type == BLOCK_TYPE_A) { contGroup = 1; } @@ -121,14 +117,14 @@ namespace rds { return syn; } - uint32_t RDSDecoder::correctErrors(uint32_t block, BlockType type) { + uint32_t RDSDecoder::correctErrors(uint32_t block, BlockType type, bool& recovered) { + // Subtract the offset from block + block ^= (uint32_t)OFFSETS[type]; + // Init the syndrome and output uint16_t syn = 0; uint32_t out = block; - // Subtract the offset from block - block ^= (uint32_t)OFFSETS[type]; - // Feed in the data for (int i = BLOCK_LEN - 1; i >= 0; i--) { // Shift the syndrome and keep the output @@ -142,27 +138,33 @@ namespace rds { syn ^= IN_POLY * ((block >> i) & 1); } - // Use the syndrome register to do error correction - // TODO: For some reason there's always zeros in the syn when starting + uint16_t firstSyn = syn; + + // Use the syndrome register to do error correction if errors are present uint8_t errorFound = 0; - for (int i = DATA_LEN - 1; i >= 0; i--) { - // Check if the 5 leftmost bits are all zero - errorFound |= !(syn & 0b11111); + if (syn) { + for (int i = DATA_LEN - 1; i >= 0; i--) { + // Check if the 5 leftmost bits are all zero + errorFound |= !(syn & 0b11111); - // Write output - uint8_t outBit = (syn >> (POLY_LEN - 1)) & 1; - out ^= (errorFound & outBit) << (i + POLY_LEN); + // Write output + uint8_t outBit = (syn >> (POLY_LEN - 1)) & 1; + out ^= (errorFound & outBit) << (i + POLY_LEN); - // Shift syndrome - syn = (syn << 1) & 0b1111111111; - syn ^= LFSR_POLY * outBit * !errorFound; + // Shift syndrome + syn = (syn << 1) & 0b1111111111; + syn ^= LFSR_POLY * outBit * !errorFound; + } } + recovered = !(syn & 0b11111); - // TODO: mark block as irrecoverable if too damaged - - if (errorFound) { - printf("Error found\n"); - } + // // One last check + // if (errorFound) { + // printf("Error found: %04X -> %04X, %08X -> %08X\n", firstSyn, syn, block, out); + // } + // else if (!recovered) { + // printf("Non recoverable error\n"); + // } return out; } @@ -172,6 +174,9 @@ namespace rds { auto now = std::chrono::high_resolution_clock::now(); anyGroupLastUpdate = now; + // Make sure blocks A and B are available + if (!blockAvail[BLOCK_TYPE_A] || !blockAvail[BLOCK_TYPE_B]) { return; } + // Decode PI code countryCode = (blocks[BLOCK_TYPE_A] >> 22) & 0xF; programCoverage = (AreaCoverage)((blocks[BLOCK_TYPE_A] >> 18) & 0xF); @@ -194,7 +199,7 @@ namespace rds { uint8_t diOffset = 3 - offset; uint8_t psOffset = offset * 2; - if (groupVer == GROUP_VER_A) { + if (groupVer == GROUP_VER_A && blockAvail[BLOCK_TYPE_C]) { alternateFrequency = (blocks[BLOCK_TYPE_C] >> 10) & 0xFFFF; } @@ -203,8 +208,10 @@ namespace rds { decoderIdent |= (diBit << diOffset); // Write chars at offset the PSName - programServiceName[psOffset] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; - programServiceName[psOffset + 1] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + if (blockAvail[BLOCK_TYPE_D]) { + programServiceName[psOffset] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; + programServiceName[psOffset + 1] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + } } else if (groupType == 2) { group2LastUpdate = now; @@ -221,15 +228,21 @@ namespace rds { // Write char at offset in Radiotext if (groupVer == GROUP_VER_A) { uint8_t rtOffset = offset * 4; - radioText[rtOffset] = (blocks[BLOCK_TYPE_C] >> 18) & 0xFF; - radioText[rtOffset + 1] = (blocks[BLOCK_TYPE_C] >> 10) & 0xFF; - radioText[rtOffset + 2] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; - radioText[rtOffset + 3] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + if (blockAvail[BLOCK_TYPE_C]) { + radioText[rtOffset] = (blocks[BLOCK_TYPE_C] >> 18) & 0xFF; + radioText[rtOffset + 1] = (blocks[BLOCK_TYPE_C] >> 10) & 0xFF; + } + if (blockAvail[BLOCK_TYPE_D]) { + radioText[rtOffset + 2] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; + radioText[rtOffset + 3] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + } } else { uint8_t rtOffset = offset * 2; - radioText[rtOffset] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; - radioText[rtOffset + 1] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + if (blockAvail[BLOCK_TYPE_D]) { + radioText[rtOffset] = (blocks[BLOCK_TYPE_D] >> 18) & 0xFF; + radioText[rtOffset + 1] = (blocks[BLOCK_TYPE_D] >> 10) & 0xFF; + } } } } diff --git a/decoder_modules/radio/src/rds.h b/decoder_modules/radio/src/rds.h index 2230d0c..075197f 100644 --- a/decoder_modules/radio/src/rds.h +++ b/decoder_modules/radio/src/rds.h @@ -138,7 +138,7 @@ namespace rds { private: static uint16_t calcSyndrome(uint32_t block); - static uint32_t correctErrors(uint32_t block, BlockType type); + static uint32_t correctErrors(uint32_t block, BlockType type, bool& recovered); void decodeGroup(); bool anyGroupValid(); @@ -152,6 +152,7 @@ namespace rds { BlockType lastType = BLOCK_TYPE_A; int contGroup = 0; uint32_t blocks[_BLOCK_TYPE_COUNT]; + bool blockAvail[_BLOCK_TYPE_COUNT]; // All groups std::mutex groupMtx; From 3ab8badb6ad9c1338a2ebe40df200907f105a6af Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 8 Jul 2022 16:02:50 +0200 Subject: [PATCH 38/39] Fixed waterfall being cleared for no reason --- core/src/signal_path/iq_frontend.cpp | 6 +++--- core/src/signal_path/iq_frontend.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/signal_path/iq_frontend.cpp b/core/src/signal_path/iq_frontend.cpp index 6c29eaf..c77ce16 100644 --- a/core/src/signal_path/iq_frontend.cpp +++ b/core/src/signal_path/iq_frontend.cpp @@ -178,7 +178,7 @@ void IQFrontEnd::removeVFO(std::string name) { void IQFrontEnd::setFFTSize(int size) { _fftSize = size; - updateFFTPath(); + updateFFTPath(true); } void IQFrontEnd::setFFTRate(double rate) { @@ -260,7 +260,7 @@ void IQFrontEnd::handler(dsp::complex_t* data, int count, void* ctx) { _this->_releaseFFTBuffer(_this->_fftCtx); } -void IQFrontEnd::updateFFTPath() { +void IQFrontEnd::updateFFTPath(bool updateWaterfall) { // Temp stop branch reshape.tempStop(); fftSink.tempStop(); @@ -295,7 +295,7 @@ void IQFrontEnd::updateFFTPath() { dsp::buffer::clear(fftInBuf, _fftSize - _nzFFTSize, _nzFFTSize); // Update waterfall (TODO: This is annoying, it makes this module non testable and will constantly clear the waterfall for any reason) - gui::waterfall.setRawFFTSize(_fftSize); + if (updateWaterfall) { gui::waterfall.setRawFFTSize(_fftSize); } // Restart branch reshape.tempStart(); diff --git a/core/src/signal_path/iq_frontend.h b/core/src/signal_path/iq_frontend.h index fedce21..4a60327 100644 --- a/core/src/signal_path/iq_frontend.h +++ b/core/src/signal_path/iq_frontend.h @@ -48,7 +48,7 @@ public: protected: static void handler(dsp::complex_t* data, int count, void* ctx); - void updateFFTPath(); + void updateFFTPath(bool updateWaterfall = false); static inline double genDCBlockRate(double sampleRate) { return 50.0 / sampleRate; From 30b6c2b1daf03ade0b4255bcffd10c2539162a09 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 8 Jul 2022 17:30:43 +0200 Subject: [PATCH 39/39] Code cleanup and optimisation$ --- core/src/dsp/audio/volume.h | 36 --------------- decoder_modules/radio/src/rds.cpp | 75 +++++++------------------------ 2 files changed, 15 insertions(+), 96 deletions(-) diff --git a/core/src/dsp/audio/volume.h b/core/src/dsp/audio/volume.h index 708fb9e..ab69771 100644 --- a/core/src/dsp/audio/volume.h +++ b/core/src/dsp/audio/volume.h @@ -13,7 +13,6 @@ namespace dsp::audio { void init(stream* in, double volume, bool muted) { _volume = powf(volume, 2); _muted = muted; - level = { -150.0f, -150.0f }; base_type::init(in); } @@ -35,41 +34,8 @@ namespace dsp::audio { return _muted; } - stereo_t getOutputLevel() { - assert(base_type::_block_init); - std::lock_guard lck0(base_type::ctrlMtx); - std::lock_guard lck1(lvlMtx); - stereo_t lvl = level; - level = { -150.0f, -150.0f }; - return lvl; - } - - void reset() { - assert(base_type::_block_init); - std::lock_guard lck(base_type::ctrlMtx); - level = { -150.0f, -150.0f }; - } - inline int process(int count, const stereo_t* in, stereo_t* out) { - // Apply volume factor volk_32f_s32f_multiply_32f((float*)out, (float*)in, _muted ? 0.0f : _volume, count * 2); - - // Measure block level - stereo_t maxLvl = { 0, 0 }; - for (int i = 0; i < count; i++) { - stereo_t lvl = { fabsf(out[i].l), fabsf(out[i].r) }; - if (lvl.l > maxLvl.l) { maxLvl.l = lvl.l; } - if (lvl.r > maxLvl.r) { maxLvl.r = lvl.r; } - } - stereo_t maxLvlDB = { 20.0f * log10f(maxLvl.l), 20.0f * log10f(maxLvl.r) }; - - // Update max level - { - std::lock_guard lck(lvlMtx); - if (maxLvlDB.l > level.l) { level.l = maxLvlDB.l; } - if (maxLvlDB.r > level.r) { level.r = maxLvlDB.r; } - } - return count; } @@ -87,8 +53,6 @@ namespace dsp::audio { private: float _volume; bool _muted; - std::mutex lvlMtx; - stereo_t level; }; } \ No newline at end of file diff --git a/decoder_modules/radio/src/rds.cpp b/decoder_modules/radio/src/rds.cpp index 6388a8c..f15fd74 100644 --- a/decoder_modules/radio/src/rds.cpp +++ b/decoder_modules/radio/src/rds.cpp @@ -20,53 +20,21 @@ namespace rds { { BLOCK_TYPE_D, 0b0110110100 } }; - // This parity check matrix is given in annex B2.1 of the specificiation - const uint16_t PARITY_CHECK_MAT[] = { - 0b1000000000, - 0b0100000000, - 0b0010000000, - 0b0001000000, - 0b0000100000, - 0b0000010000, - 0b0000001000, - 0b0000000100, - 0b0000000010, - 0b0000000001, - 0b1011011100, - 0b0101101110, - 0b0010110111, - 0b1010000111, - 0b1110011111, - 0b1100010011, - 0b1101010101, - 0b1101110110, - 0b0110111011, - 0b1000000001, - 0b1111011100, - 0b0111101110, - 0b0011110111, - 0b1010100111, - 0b1110001111, - 0b1100011011 - }; + // 9876543210 + const uint16_t LFSR_POLY = 0b0110111001; + const uint16_t IN_POLY = 0b1100011011; const int BLOCK_LEN = 26; const int DATA_LEN = 16; const int POLY_LEN = 10; - // 9876543210 - const uint16_t LFSR_POLY = 0b0110111001; - const uint16_t IN_POLY = 0b1100011011; - void RDSDecoder::process(uint8_t* symbols, int count) { for (int i = 0; i < count; i++) { // Shift in the bit shiftReg = ((shiftReg << 1) & 0x3FFFFFF) | (symbols[i] & 1); // Skip if we need to shift in new data - if (--skip > 0) { - continue; - } + if (--skip > 0) { continue; } // Calculate the syndrome and update sync status uint16_t syn = calcSyndrome(shiftReg); @@ -109,23 +77,9 @@ namespace rds { } uint16_t RDSDecoder::calcSyndrome(uint32_t block) { - // Perform vector/matrix dot product between block and parity matrix uint16_t syn = 0; - for(int i = 0; i < BLOCK_LEN; i++) { - syn ^= PARITY_CHECK_MAT[BLOCK_LEN - 1 - i] * ((block >> i) & 1); - } - return syn; - } - uint32_t RDSDecoder::correctErrors(uint32_t block, BlockType type, bool& recovered) { - // Subtract the offset from block - block ^= (uint32_t)OFFSETS[type]; - - // Init the syndrome and output - uint16_t syn = 0; - uint32_t out = block; - - // Feed in the data + // Calculate the syndrome using a LFSR for (int i = BLOCK_LEN - 1; i >= 0; i--) { // Shift the syndrome and keep the output uint8_t outBit = (syn >> (POLY_LEN - 1)) & 1; @@ -138,7 +92,16 @@ namespace rds { syn ^= IN_POLY * ((block >> i) & 1); } - uint16_t firstSyn = syn; + return syn; + } + + uint32_t RDSDecoder::correctErrors(uint32_t block, BlockType type, bool& recovered) { + // Subtract the offset from block + block ^= (uint32_t)OFFSETS[type]; + uint32_t out = block; + + // Calculate syndrome of corrected block + uint16_t syn = calcSyndrome(block); // Use the syndrome register to do error correction if errors are present uint8_t errorFound = 0; @@ -158,14 +121,6 @@ namespace rds { } recovered = !(syn & 0b11111); - // // One last check - // if (errorFound) { - // printf("Error found: %04X -> %04X, %08X -> %08X\n", firstSyn, syn, block, out); - // } - // else if (!recovered) { - // printf("Non recoverable error\n"); - // } - return out; }