SoDaRadio-5.0.3-master:8901fb5
Public Member Functions | Private Attributes | List of all members
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::SoDaBase

Public Member Functions

 HilbertTransformer (unsigned int inout_buffer_length, unsigned int filter_length=256)
 constructor – build a Hilbert Transformer More...
 
unsigned int applyIQ (std::complex< float > *inbuf, std::complex< float > *outbuf, float gain=1.0)
 Perform a hilbert transform on the QUADRATURE signal in the input buffer. More...
 
unsigned int apply (std::complex< float > *inbuf, std::complex< float > *outbuf, bool pos_sided=true, float gain=1.0)
 Perform a hilbert transform on the INPHASE signal in the input buffer. More...
 
unsigned int apply (float *inbuf, 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. More...
 
std::ostream & dump (std::ostream &os)
 
- Public Member Functions inherited from SoDa::SoDaBase
 SoDaBase (const std::string &oname)
 The constructor – pass a name for the object. More...
 
std::string & getObjName ()
 get the name of this object More...
 
SoDaBasefindSoDaObject (const std::string &oname)
 find a SoDa Object by name. More...
 
double getTime ()
 Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS). More...
 

Private Attributes

unsigned int M
 these are the salient dimensions for this Overlap/Save widget (for terminology, see Lyons pages 719ff More...
 
unsigned int Q
 the filter length More...
 
unsigned int N
 the total length of the transform N > (M + Q-1) More...
 
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. More...
 
std::complex< float > * HTl_filter
 The DFT image of the hilbert transform – lower sideband. More...
 
std::complex< float > * Pass_U_filter
 The DFT image of a Q/2 delay transform – used in USB. More...
 
std::complex< float > * Pass_L_filter
 The DFT image of a Q/2 delay transform – used in LSB. More...
 
float passthrough_gain
 the gain of the direct passthrough path. More...
 
float H_transform_gain
 the gain of the Hilbert Transform path More...
 

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 54 of file HilbertTransformer.hxx.

Constructor & Destructor Documentation

◆ HilbertTransformer()

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

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

Definition at line 52 of file HilbertTransformer.cxx.

References backward_I_plan, backward_Q_plan, fft_I_input, fft_I_output, fft_Q_input, fft_Q_output, forward_I_plan, forward_Q_plan, H_transform_gain, HTl_filter, HTu_filter, ifft_I_input, ifft_I_output, ifft_Q_input, ifft_Q_output, M, N, Pass_L_filter, Pass_U_filter, passthrough_gain, and Q.

Member Function Documentation

◆ apply() [1/2]

unsigned int SoDa::HilbertTransformer::apply ( std::complex< float > *  inbuf,
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.

Definition at line 205 of file HilbertTransformer.cxx.

References backward_I_plan, backward_Q_plan, dbgctr, fft_I_input, fft_I_output, forward_I_plan, H_transform_gain, HTl_filter, HTu_filter, ifft_I_input, ifft_I_output, ifft_Q_input, ifft_Q_output, M, N, Pass_L_filter, Pass_U_filter, passthrough_gain, and Q.

Referenced by apply(), doPMTest(), doSSBTest(), dumpTest(), and SoDa::BaseBandTX::modulateAM().

◆ apply() [2/2]

unsigned int SoDa::HilbertTransformer::apply ( float *  inbuf,
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.

Definition at line 259 of file HilbertTransformer.cxx.

References apply(), and M.

◆ applyIQ()

unsigned int SoDa::HilbertTransformer::applyIQ ( std::complex< float > *  inbuf,
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.

Definition at line 284 of file HilbertTransformer.cxx.

References backward_I_plan, backward_Q_plan, dbgctr, fft_I_input, fft_I_output, fft_Q_input, fft_Q_output, forward_I_plan, forward_Q_plan, H_transform_gain, HTu_filter, ifft_I_input, ifft_I_output, ifft_Q_input, ifft_Q_output, M, N, Pass_U_filter, passthrough_gain, and Q.

Referenced by SoDa::BaseBandRX::demodulateSSB(), doSSBTest(), and dumpTest().

◆ dump()

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

Definition at line 337 of file HilbertTransformer.cxx.

References HTl_filter, HTu_filter, N, Pass_L_filter, and Pass_U_filter.

Member Data Documentation

◆ backward_I_plan

fftwf_plan SoDa::HilbertTransformer::backward_I_plan
private

Definition at line 115 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ backward_Q_plan

fftwf_plan SoDa::HilbertTransformer::backward_Q_plan
private

Definition at line 115 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ fft_I_input

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

Definition at line 108 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ fft_I_output

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

Definition at line 109 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ fft_Q_input

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

Definition at line 108 of file HilbertTransformer.hxx.

Referenced by applyIQ(), and HilbertTransformer().

◆ fft_Q_output

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

Definition at line 109 of file HilbertTransformer.hxx.

Referenced by applyIQ(), and HilbertTransformer().

◆ forward_I_plan

fftwf_plan SoDa::HilbertTransformer::forward_I_plan
private

Definition at line 115 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ forward_Q_plan

fftwf_plan SoDa::HilbertTransformer::forward_Q_plan
private

Definition at line 115 of file HilbertTransformer.hxx.

Referenced by applyIQ(), and HilbertTransformer().

◆ H_transform_gain

float SoDa::HilbertTransformer::H_transform_gain
private

the gain of the Hilbert Transform path

Definition at line 123 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ HTl_filter

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

The DFT image of the hilbert transform – lower sideband.

Definition at line 118 of file HilbertTransformer.hxx.

Referenced by apply(), dump(), and HilbertTransformer().

◆ HTu_filter

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

The DFT image of the hilbert transform – upper sideband.

Definition at line 117 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), dump(), and HilbertTransformer().

◆ ifft_I_input

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

Definition at line 110 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ ifft_I_output

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

Definition at line 111 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ ifft_Q_input

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

Definition at line 110 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ ifft_Q_output

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

Definition at line 111 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ 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 103 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ N

unsigned int SoDa::HilbertTransformer::N
private

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

Definition at line 105 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), dump(), and HilbertTransformer().

◆ 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 120 of file HilbertTransformer.hxx.

Referenced by apply(), dump(), and HilbertTransformer().

◆ 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 119 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), dump(), and HilbertTransformer().

◆ passthrough_gain

float SoDa::HilbertTransformer::passthrough_gain
private

the gain of the direct passthrough path.

Definition at line 122 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().

◆ Q

unsigned int SoDa::HilbertTransformer::Q
private

the filter length

Definition at line 104 of file HilbertTransformer.hxx.

Referenced by apply(), applyIQ(), and HilbertTransformer().


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