dsplib 1.1.0
C++ DSP library for MATLAB-like coding
Loading...
Searching...
No Matches
hilbert.h
1#pragma once
2
3#include <dsplib/delay.h>
4#include <dsplib/fir.h>
5
6namespace dsplib {
7
8// calculation of the analytical signal using DFT
9arr_cmplx hilbert(span_real x);
10
11// uses an n-point FFT
12arr_cmplx hilbert(span_real x, int n);
13
20{
21public:
22 //default bandpass filter IR
23 //flen - FIR filter length
24 //tw - transition bandwidth
25 explicit HilbertFilter(int flen = 51, real_t tw = 0.01);
26
27 explicit HilbertFilter(span_real h);
28
29 //main processing
30 arr_cmplx process(span_real s);
31
32 //impulse response
33 [[nodiscard]] span_real impz() const;
34
35 arr_cmplx operator()(span_real x) {
36 return this->process(x);
37 }
38
39 // Design complex Hilbert FIR (Window Method)
40 // see: https://www.dsprelated.com/freebooks/sasp/Filtering_Windowing_Ideal_Hilbert_Transform.html
41 // flen - FIR filter length
42 // fs - sample rate (Hz)
43 // f1 - lower pass-band limit = transition bandwidth (Hz)
44 static arr_cmplx design_fir(int flen, real_t fs, real_t f1);
45
46private:
48 DelayReal _d;
49};
50
51} // namespace dsplib
FIR filter class.
Definition fir.h:17
Hilbert filter (FIR filter based)
Definition hilbert.h:20
Definition span.h:295