diff options
Diffstat (limited to 'fourier.cpp')
-rw-r--r-- | fourier.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fourier.cpp b/fourier.cpp index 7808989..8943521 100644 --- a/fourier.cpp +++ b/fourier.cpp @@ -71,7 +71,7 @@ Real energy(const std::vector<Real>& C, const std::vector<Real>& R, unsigned p, std::tuple<std::vector<Complex>, std::vector<Complex>> RddfCtdfCt(FourierTransform& fft, const std::vector<Real>& C, const std::vector<Real>& R, unsigned p, unsigned s, Real λ) { std::vector<Real> RddfC(C.size()); - for (unsigned i = 0; i < C.size(); i++) { + for (unsigned i = 0; i < C.size() / 2; i++) { RddfC[i] = R[i] * ddf(λ, p, s, C[i]); } std::vector<Complex> RddfCt = fft.fourier(RddfC); @@ -84,3 +84,9 @@ std::tuple<std::vector<Complex>, std::vector<Complex>> RddfCtdfCt(FourierTransfo return {RddfCt, dfCt}; } + +Real estimateZ(FourierTransform& fft, const std::vector<Real>& C, const std::vector<Complex>& Ct, const std::vector<Real>& R, const std::vector<Complex>& Rt, unsigned p, unsigned s, Real λ, Real y) { + auto [RddfCt, dfCt] = RddfCtdfCt(fft, C, R, p, s, λ); + + return ((std::conj(Rt[0]) + pow(y, 2) * (RddfCt[0] * Ct[0] + dfCt[0] * std::conj(Rt[0]))) / Ct[0]).real(); +} |