mirror of
				https://github.com/AlexandreRouma/SDRPlusPlus.git
				synced 2025-10-30 00:18:10 +01:00 
			
		
		
		
	More cleanup
This commit is contained in:
		| @@ -22,6 +22,7 @@ namespace sdrpp_credits { | ||||
|         "Syne Ardwin (WI9SYN)", | ||||
|         "Szymon Zakrent", | ||||
|         "Tobias Mädel", | ||||
|         "Youssef Touil", | ||||
|         "Zimm" | ||||
|     }; | ||||
|  | ||||
|   | ||||
							
								
								
									
										16
									
								
								core/src/dsp/loop/carrier_tracking_pll.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								core/src/dsp/loop/carrier_tracking_pll.h
									
									
									
									
									
										Normal file
									
								
							| @@ -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; | ||||
|         } | ||||
|     }; | ||||
| } | ||||
							
								
								
									
										41
									
								
								core/src/dsp/loop/costas.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								core/src/dsp/loop/costas.h
									
									
									
									
									
										Normal file
									
								
							| @@ -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); | ||||
|         } | ||||
|     }; | ||||
| } | ||||
| @@ -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)); | ||||
|   | ||||
							
								
								
									
										8
									
								
								core/src/dsp/math/step.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								core/src/dsp/math/step.h
									
									
									
									
									
										Normal file
									
								
							| @@ -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; | ||||
|     } | ||||
| } | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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!!! | ||||
| */ | ||||
|  | ||||
|   | ||||
| @@ -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) | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user