dsplib
1.1.0
C++ DSP library for MATLAB-like coding
Loading...
Searching...
No Matches
include
dsplib
hilbert.h
1
#pragma once
2
3
#include <dsplib/delay.h>
4
#include <dsplib/fir.h>
5
6
namespace
dsplib {
7
8
// calculation of the analytical signal using DFT
9
arr_cmplx hilbert(span_real x);
10
11
// uses an n-point FFT
12
arr_cmplx hilbert(span_real x,
int
n);
13
19
class
HilbertFilter
20
{
21
public
:
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
46
private
:
47
FirFilter<real_t>
_fir;
48
DelayReal
_d;
49
};
50
51
}
// namespace dsplib
dsplib::Delay< real_t >
dsplib::FirFilter
FIR filter class.
Definition
fir.h:17
dsplib::HilbertFilter
Hilbert filter (FIR filter based)
Definition
hilbert.h:20
dsplib::base_array< cmplx_t >
dsplib::span_t
Definition
span.h:295
Generated by
1.9.8