mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 06:53:37 +00:00
signal ID improved
This commit is contained in:
parent
735e7096f4
commit
3055564a27
4 changed files with 53 additions and 12 deletions
14
Software/VNA_embedded/Application/Util.cpp
Normal file
14
Software/VNA_embedded/Application/Util.cpp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "Util.hpp"
|
||||
|
||||
uint32_t Util::Alias(int64_t f, uint32_t f_s) {
|
||||
// move into f_s range
|
||||
f %= f_s;
|
||||
if (f < 0) {
|
||||
f += f_s;
|
||||
}
|
||||
// fold at half the samplerate
|
||||
if(f >= f_s / 2) {
|
||||
f = f_s - f;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue