mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
consolidated TDR bandpass/lowpass mode, configuration dialog for TDR
This commit is contained in:
parent
2039c8f74d
commit
b8ccca5ebc
14 changed files with 613 additions and 243 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include "fftcomplex.h"
|
||||
#include <algorithm>
|
||||
|
||||
using std::complex;
|
||||
using std::size_t;
|
||||
|
|
@ -150,3 +151,15 @@ static size_t reverseBits(size_t val, int width) {
|
|||
result = (result << 1) | (val & 1U);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Fft::shift(std::vector<std::complex<double> > &vec, bool inverse)
|
||||
{
|
||||
int rotate_len = vec.size() / 2;
|
||||
if(vec.size() % 0x01 != 0) {
|
||||
// odd size, behavior depends on whether this is an inverse shift
|
||||
if(!inverse) {
|
||||
rotate_len++;
|
||||
}
|
||||
}
|
||||
std::rotate(vec.begin(), vec.begin() + rotate_len, vec.end());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue