mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-09 16:33:41 +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
48
Software/PC_Application/Traces/Math/windowfunction.h
Normal file
48
Software/PC_Application/Traces/Math/windowfunction.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#ifndef WINDOWFUNCTION_H
|
||||
#define WINDOWFUNCTION_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <complex>
|
||||
#include <vector>
|
||||
|
||||
class WindowFunction : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
enum class Type {
|
||||
Rectangular,
|
||||
// Kaiser,
|
||||
Gaussian,
|
||||
Chebyshev,
|
||||
Hann,
|
||||
Hamming,
|
||||
Blackman,
|
||||
// always has to be the last entry
|
||||
Last,
|
||||
};
|
||||
static QString typeToName(Type type);
|
||||
|
||||
WindowFunction(Type type = Type::Hamming);
|
||||
|
||||
void apply(std::vector<std::complex<double>>& data);
|
||||
|
||||
QWidget *createEditor();
|
||||
|
||||
Type getType() const;
|
||||
QString getDescription();
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
private:
|
||||
double getFactor(unsigned int n, unsigned int N);
|
||||
Type type;
|
||||
// parameters for the different types. Not all windows use one and most only one.
|
||||
// But keeping all parameters for all windows allows switching between window types
|
||||
// while remembering the settings for each type
|
||||
double kaiser_alpha;
|
||||
double gaussian_sigma;
|
||||
double chebyshev_alpha;
|
||||
};
|
||||
|
||||
#endif // WINDOWFUNCTION_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue