SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Attributes | List of all members
leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd > Struct Template Reference

#include <dsp.h>

+ Inheritance diagram for leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >:
+ Collaboration diagram for leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >:

Public Member Functions

 cconverter (scheduler *sch, pipebuf< complex< Tin >> &_in, pipebuf< complex< Tout >> &_out)
 
void run ()
 
- Public Member Functions inherited from leansdr::runnable
 runnable (scheduler *_sch, const char *name)
 
- Public Member Functions inherited from leansdr::runnable_common
 runnable_common (const char *_name)
 
virtual ~runnable_common ()
 
virtual void shutdown ()
 

Private Attributes

pipereader< complex< Tin > > in
 
pipewriter< complex< Tout > > out
 

Additional Inherited Members

- Public Attributes inherited from leansdr::runnable_common
const char * name
 
- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

template<typename Tin, int Zin, typename Tout, int Zout, int Gn, int Gd>
struct leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >

Definition at line 34 of file dsp.h.

Constructor & Destructor Documentation

◆ cconverter()

template<typename Tin , int Zin, typename Tout , int Zout, int Gn, int Gd>
leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >::cconverter ( scheduler sch,
pipebuf< complex< Tin >> &  _in,
pipebuf< complex< Tout >> &  _out 
)
inline

Definition at line 36 of file dsp.h.

38  : runnable(sch, "cconverter"),
39  in(_in), out(_out)
40  {
41  }
pipewriter< complex< Tout > > out
Definition: dsp.h:58
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
scheduler * sch
Definition: framework.h:199
pipereader< complex< Tin > > in
Definition: dsp.h:57

Member Function Documentation

◆ run()

template<typename Tin , int Zin, typename Tout , int Zout, int Gn, int Gd>
void leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 42 of file dsp.h.

References leansdr::complex< T >::im, leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >::in, leansdr::min(), leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >::out, and leansdr::complex< T >::re.

43  {
44  unsigned long count = min(in.readable(), out.writable());
45  complex<Tin> *pin = in.rd(), *pend = pin + count;
46  complex<Tout> *pout = out.wr();
47  for (; pin < pend; ++pin, ++pout)
48  {
49  pout->re = Zout + (pin->re - (Tin)Zin) * Gn / Gd;
50  pout->im = Zout + (pin->im - (Tin)Zin) * Gn / Gd;
51  }
52  in.read(count);
53  out.written(count);
54  }
pipewriter< complex< Tout > > out
Definition: dsp.h:58
pipereader< complex< Tin > > in
Definition: dsp.h:57
T min(const T &x, const T &y)
Definition: framework.h:440
+ Here is the call graph for this function:

Member Data Documentation

◆ in

template<typename Tin , int Zin, typename Tout , int Zout, int Gn, int Gd>
pipereader<complex<Tin> > leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >::in
private

◆ out

template<typename Tin , int Zin, typename Tout , int Zout, int Gn, int Gd>
pipewriter<complex<Tout> > leansdr::cconverter< Tin, Zin, Tout, Zout, Gn, Gd >::out
private

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