consolidated TDR bandpass/lowpass mode, configuration dialog for TDR

This commit is contained in:
Jan Käberich 2020-12-01 22:28:32 +01:00
parent 2039c8f74d
commit b8ccca5ebc
14 changed files with 613 additions and 243 deletions

View file

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