TVec *Hilbert(TVec *Vec, THilbertMethod method = THilbertMethod::hmMethod1) const;
The fast hilbert transform (FFT based).
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vec | TVec * | |
| 2 | method = THilbertMethod::hmMethod1 | THilbertMethod |
Remarks:
The method forms the imaginary orthogonal part (90 degrees phase shifted version of the original) from the real series by using the fast hilbert transform (FFT based) and saves the complex result in the calling vector. No windowing is performed. Vec must be a real vector or an exception is raised. The Vector::Length and Vector::Complex properties of the calling vector are set implicitly to match Vec vector.
Examples
#include "MtxExpr.h"
#include "Units.MtxExpr.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxExpr;
void Example()
{
Vector a, b, Re, Im;
double azero;
a.SetIt(false, DewArray<double>{1, 2, 3, 4, 5, 6, 7, 8});
b.Hilbert(a);
Re.RealPart(b);
Im.ImagPart(b);
azero = DotProd(Re, Im);
// if Re is orthogonal to Im, azero becomes 0
}
See Also: Vector::FFT, Vector::DCT
Declared in Dew::Math::Vector · Dew.Math/MtxExpr.h · Cross-compiler