mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-07 07:23:43 +00:00
CSV export + DFT math operation
This commit is contained in:
parent
79a990af47
commit
6e55eb02dd
27 changed files with 935 additions and 52 deletions
|
|
@ -30,7 +30,7 @@ WindowFunction::WindowFunction(WindowFunction::Type type)
|
|||
chebyshev_alpha = 5;
|
||||
}
|
||||
|
||||
void WindowFunction::apply(std::vector<std::complex<double> > &data)
|
||||
void WindowFunction::apply(std::vector<std::complex<double> > &data) const
|
||||
{
|
||||
unsigned int N = data.size();
|
||||
for(unsigned int n = 0;n<N;n++) {
|
||||
|
|
@ -38,6 +38,14 @@ void WindowFunction::apply(std::vector<std::complex<double> > &data)
|
|||
}
|
||||
}
|
||||
|
||||
void WindowFunction::reverse(std::vector<std::complex<double> > &data) const
|
||||
{
|
||||
unsigned int N = data.size();
|
||||
for(unsigned int n = 0;n<N;n++) {
|
||||
data[n] /= getFactor(n, N);
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *WindowFunction::createEditor()
|
||||
{
|
||||
auto top = new QWidget();
|
||||
|
|
@ -148,7 +156,7 @@ void WindowFunction::fromJSON(nlohmann::json j)
|
|||
}
|
||||
}
|
||||
|
||||
double WindowFunction::getFactor(unsigned int n, unsigned int N)
|
||||
double WindowFunction::getFactor(unsigned int n, unsigned int N) const
|
||||
{
|
||||
// all formulas from https://en.wikipedia.org/wiki/Window_function
|
||||
switch(type) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue