From bfb23ad6988c59707747ea7af9dd9a5c21ca70d7 Mon Sep 17 00:00:00 2001 From: Thijs Hekman Date: Wed, 6 Nov 2024 17:08:51 +0100 Subject: [PATCH] fixed threshold at 1e-13 --- cpp_src/dsp/lasp_avpowerspectra.cpp | 5 +++-- cpp_src/dsp/lasp_siggen_impl.h | 2 ++ cpp_src/pybind11/lasp_siggen.cpp | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cpp_src/dsp/lasp_avpowerspectra.cpp b/cpp_src/dsp/lasp_avpowerspectra.cpp index 60b7cf1..558a626 100644 --- a/cpp_src/dsp/lasp_avpowerspectra.cpp +++ b/cpp_src/dsp/lasp_avpowerspectra.cpp @@ -235,7 +235,8 @@ ccube AvSweepPowerSpectra::compute(const dmat &timedata) _n_averages = vd(nfreq, arma::fill::zeros); } - d threshold = arma::mean(arma::real(temp.slice(0).col(0))); + // d threshold = arma::mean(arma::real(temp.slice(0).col(0))); + d threshold = 1e-13; for (us f=0; f < nfreq; f++) { @@ -252,7 +253,7 @@ ccube AvSweepPowerSpectra::compute(const dmat &timedata) _est.row(f) = (static_cast(_n_averages[f] - 1) / _n_averages[f]) * _est.row(f) + temp.row(f) / _n_averages[f]; // _est.subcube(f, 0, 0, f, ncols - 1, ncols - 1) = (static_cast(_n_averages[f] - 1) / _n_averages[f]) * _est.subcube(f, 0, 0, f, ncols - 1, ncols - 1) + - // temp.subcube(f, 0, 0, f, ncols - 1, ncols - 1) / _n_averages[f]; + // temp.subcube(f, 0, 0, f, ncols - 1, ncols - 1) / _n_averages[f]; } } } diff --git a/cpp_src/dsp/lasp_siggen_impl.h b/cpp_src/dsp/lasp_siggen_impl.h index e5847cc..272573e 100644 --- a/cpp_src/dsp/lasp_siggen_impl.h +++ b/cpp_src/dsp/lasp_siggen_impl.h @@ -75,6 +75,8 @@ class Periodic: public Siggen { virtual vd genSignalUnscaled(const us nframes) override final; + vd getA() const { return A_; } + ~Periodic() = default; }; diff --git a/cpp_src/pybind11/lasp_siggen.cpp b/cpp_src/pybind11/lasp_siggen.cpp index 0161069..bebdb5f 100644 --- a/cpp_src/pybind11/lasp_siggen.cpp +++ b/cpp_src/pybind11/lasp_siggen.cpp @@ -51,6 +51,10 @@ void init_siggen(py::module &m) { periodic.def("getSequence", [](const Sweep &s) { return ColToNpy(s.getSequence()); }); + periodic.def("getA", + [](const Sweep &s) { return ColToNpy(s.getA()); }); + + py::class_> sweep(m, "Sweep", periodic); sweep.def(py::init()); sweep.def("getfn",