SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDa::HilbertTransformer Class Reference

In several places we have a real valued signal x(t) that needs to be converted to an analytic signal g(t) such that real(g(t)) == x(t) and imag(g(t)) = shift_by_90degrees(x(t));. More...

#include <HilbertTransformer.hxx>

Inheritance diagram for SoDa::HilbertTransformer:
SoDa::Base

Public Member Functions

unsigned int applyIQ (std::vector< std::complex< float > > &inbuf, std::vector< std::complex< float > > &outbuf, float gain=1.0)
 Perform a hilbert transform on the QUADRATURE signal in the input buffer.
unsigned int apply (std::vector< std::complex< float > > &inbuf, std::vector< std::complex< float > > &outbuf, bool pos_sided=true, float gain=1.0)
 Perform a hilbert transform on the INPHASE signal in the input buffer.
unsigned int apply (std::vector< float > &inbuf, std::vector< std::complex< float > > &outbuf, bool pos_sided=true, float gain=1.0)
 Perform a hilbert transform on the signal in the floating point input buffer.
std::ostream & dump (std::ostream &os)
Public Member Functions inherited from SoDa::Base
 Base (const std::string &oname)
 The constructor – pass a name for the object.
void registerSelf (BasePtr ptr)
std::string & getObjName ()
 get the name of this object
BasePtr findSoDaObject (const std::string &oname)
 find a SoDa Object by name.
double getTime ()
 Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS).
BasePtr getSelfPtr ()
 get a pointer to myself.

Static Public Member Functions

static HilbertTransformerPtr make (unsigned int inout_buffer_length, unsigned int filter_length=256)

Protected Member Functions

 HilbertTransformer (unsigned int inout_buffer_length, unsigned int filter_length=256)
 constructor – build a Hilbert Transformer

Private Attributes

unsigned int M
 these are the salient dimensions for this Overlap/Save widget (for terminology, see Lyons pages 719ff
unsigned int Q
 the filter length
unsigned int N
 the total length of the transform N > (M + Q-1)
std::complex< float > * fft_I_input
std::complex< float > * fft_Q_input
std::complex< float > * fft_I_output
std::complex< float > * fft_Q_output
std::complex< float > * ifft_I_input
std::complex< float > * ifft_Q_input
std::complex< float > * ifft_I_output
std::complex< float > * ifft_Q_output
fftwf_plan forward_I_plan
fftwf_plan forward_Q_plan
fftwf_plan backward_I_plan
fftwf_plan backward_Q_plan
std::complex< float > * HTu_filter
 The DFT image of the hilbert transform – upper sideband.
std::complex< float > * HTl_filter
 The DFT image of the hilbert transform – lower sideband.
std::complex< float > * Pass_U_filter
 The DFT image of a Q/2 delay transform – used in USB.
std::complex< float > * Pass_L_filter
 The DFT image of a Q/2 delay transform – used in LSB.
float passthrough_gain
 the gain of the direct passthrough path.
float H_transform_gain
 the gain of the Hilbert Transform path

Detailed Description

In several places we have a real valued signal x(t) that needs to be converted to an analytic signal g(t) such that real(g(t)) == x(t) and imag(g(t)) = shift_by_90degrees(x(t));.

HilbertTransformer provides the apply functions to convert x(t) as a float or complex<float>. Hilbert Transformer also provides a function (applyIQ) to convert a complex x(t) into g(t) such that real(g(t)) = real(x(t + tau)) and imag(g(t)) = shift_by_90deg(imag(x(t + tau)))

Definition at line 56 of file HilbertTransformer.hxx.

Constructor & Destructor Documentation

◆ HilbertTransformer()

SoDa::HilbertTransformer::HilbertTransformer ( unsigned int inout_buffer_length,
unsigned int filter_length = 256 )
protected

constructor – build a Hilbert Transformer

Parameters
inout_buffer_lengththe length of the input and output buffers
filter_lengththe minimum length of the hilbert transform impulse response

Referenced by make().

Member Function Documentation

◆ apply() [1/2]

unsigned int SoDa::HilbertTransformer::apply ( std::vector< float > & inbuf,
std::vector< std::complex< float > > & outbuf,
bool pos_sided = true,
float gain = 1.0 )

Perform a hilbert transform on the signal in the floating point input buffer.

Parameters
inbufinput buffer of real (float) samples
outbufcomplex output buffer real is input delayed, and imag is Hilbert(input)
pos_sidedif true, swap I and Q outputs
gainfactor to apply to output buffer.
Returns
M – length of input buffer.

◆ apply() [2/2]

unsigned int SoDa::HilbertTransformer::apply ( std::vector< std::complex< float > > & inbuf,
std::vector< std::complex< float > > & outbuf,
bool pos_sided = true,
float gain = 1.0 )

Perform a hilbert transform on the INPHASE signal in the input buffer.

It is assumed that the QUADRATURE signal is zero, if not, the result is broken.

Parameters
inbufcomplex input buffer of I (real) and Q (imag) samples
outbufcomplex output buffer real is input.real delayed, and imag is Hilbert(input.real)
pos_sidedif true, swap I and Q outputs
gainfactor to apply to output buffer.
Returns
M – length of input buffer.

◆ applyIQ()

unsigned int SoDa::HilbertTransformer::applyIQ ( std::vector< std::complex< float > > & inbuf,
std::vector< std::complex< float > > & outbuf,
float gain = 1.0 )

Perform a hilbert transform on the QUADRATURE signal in the input buffer.

Pass the Inphase signal through a delay filter that matches the hilbert transform

Parameters
inbufcomplex input buffer of I (real) and Q (imag) samples
outbufcomplex output buffer real is input.real delayed, and imag is Hilbert(input.imag)
gainfactor to apply to output buffer.
Returns
M – length of input buffer.

◆ dump()

std::ostream & SoDa::HilbertTransformer::dump ( std::ostream & os)

◆ make()

HilbertTransformerPtr SoDa::HilbertTransformer::make ( unsigned int inout_buffer_length,
unsigned int filter_length = 256 )
inlinestatic

Definition at line 66 of file HilbertTransformer.hxx.

References HilbertTransformer().

Member Data Documentation

◆ backward_I_plan

fftwf_plan SoDa::HilbertTransformer::backward_I_plan
private

Definition at line 131 of file HilbertTransformer.hxx.

◆ backward_Q_plan

fftwf_plan SoDa::HilbertTransformer::backward_Q_plan
private

Definition at line 131 of file HilbertTransformer.hxx.

◆ fft_I_input

std::complex<float>* SoDa::HilbertTransformer::fft_I_input
private

Definition at line 124 of file HilbertTransformer.hxx.

◆ fft_I_output

std::complex<float>* SoDa::HilbertTransformer::fft_I_output
private

Definition at line 125 of file HilbertTransformer.hxx.

◆ fft_Q_input

std::complex<float> * SoDa::HilbertTransformer::fft_Q_input
private

Definition at line 124 of file HilbertTransformer.hxx.

◆ fft_Q_output

std::complex<float> * SoDa::HilbertTransformer::fft_Q_output
private

Definition at line 125 of file HilbertTransformer.hxx.

◆ forward_I_plan

fftwf_plan SoDa::HilbertTransformer::forward_I_plan
private

Definition at line 131 of file HilbertTransformer.hxx.

◆ forward_Q_plan

fftwf_plan SoDa::HilbertTransformer::forward_Q_plan
private

Definition at line 131 of file HilbertTransformer.hxx.

◆ H_transform_gain

float SoDa::HilbertTransformer::H_transform_gain
private

the gain of the Hilbert Transform path

Definition at line 139 of file HilbertTransformer.hxx.

◆ HTl_filter

std::complex<float>* SoDa::HilbertTransformer::HTl_filter
private

The DFT image of the hilbert transform – lower sideband.

Definition at line 134 of file HilbertTransformer.hxx.

◆ HTu_filter

std::complex<float>* SoDa::HilbertTransformer::HTu_filter
private

The DFT image of the hilbert transform – upper sideband.

Definition at line 133 of file HilbertTransformer.hxx.

◆ ifft_I_input

std::complex<float>* SoDa::HilbertTransformer::ifft_I_input
private

Definition at line 126 of file HilbertTransformer.hxx.

◆ ifft_I_output

std::complex<float>* SoDa::HilbertTransformer::ifft_I_output
private

Definition at line 127 of file HilbertTransformer.hxx.

◆ ifft_Q_input

std::complex<float> * SoDa::HilbertTransformer::ifft_Q_input
private

Definition at line 126 of file HilbertTransformer.hxx.

◆ ifft_Q_output

std::complex<float> * SoDa::HilbertTransformer::ifft_Q_output
private

Definition at line 127 of file HilbertTransformer.hxx.

◆ M

unsigned int SoDa::HilbertTransformer::M
private

these are the salient dimensions for this Overlap/Save widget (for terminology, see Lyons pages 719ff

the input buffer length;

Definition at line 119 of file HilbertTransformer.hxx.

◆ N

unsigned int SoDa::HilbertTransformer::N
private

the total length of the transform N > (M + Q-1)

Definition at line 121 of file HilbertTransformer.hxx.

◆ Pass_L_filter

std::complex<float>* SoDa::HilbertTransformer::Pass_L_filter
private

The DFT image of a Q/2 delay transform – used in LSB.

Definition at line 136 of file HilbertTransformer.hxx.

◆ Pass_U_filter

std::complex<float>* SoDa::HilbertTransformer::Pass_U_filter
private

The DFT image of a Q/2 delay transform – used in USB.

Definition at line 135 of file HilbertTransformer.hxx.

◆ passthrough_gain

float SoDa::HilbertTransformer::passthrough_gain
private

the gain of the direct passthrough path.

Definition at line 138 of file HilbertTransformer.hxx.

◆ Q

unsigned int SoDa::HilbertTransformer::Q
private

the filter length

Definition at line 120 of file HilbertTransformer.hxx.


The documentation for this class was generated from the following file: