pull/801/head
AlexandreRouma 2022-06-26 23:36:31 +02:00
rodzic 3f6687659e
commit ff6754099f
20 zmienionych plików z 85 dodań i 15 usunięć

Wyświetl plik

@ -22,6 +22,7 @@ namespace sdrpp_credits {
"Syne Ardwin (WI9SYN)",
"Szymon Zakrent",
"Tobias Mädel",
"Youssef Touil",
"Zimm"
};

Wyświetl plik

@ -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;
}
};
}

Wyświetl plik

@ -0,0 +1,41 @@
#pragma once
#include "pll.h"
#include "../math/step.h"
namespace dsp::loop {
template<int ORDER>
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<float>(err, -1.0f, 1.0f);
}
};
}

Wyświetl plik

@ -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));

Wyświetl plik

@ -0,0 +1,8 @@
#pragma once
namespace dsp::math {
template <class T>
inline T step(T x) {
return (x > 0.0) ? 1.0 : -1.0;
}
}

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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!!!
*/

Wyświetl plik

@ -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)