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 | Public Attributes | Private Attributes | List of all members
leansdr::scaler< Tscale, Tin, Tout > Struct Template Reference

#include <dsp.h>

+ Inheritance diagram for leansdr::scaler< Tscale, Tin, Tout >:
+ Collaboration diagram for leansdr::scaler< Tscale, Tin, Tout >:

Public Member Functions

 scaler (scheduler *sch, Tscale _scale, pipebuf< Tin > &_in, pipebuf< 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 ()
 

Public Attributes

Tscale scale
 
- Public Attributes inherited from leansdr::runnable_common
const char * name
 

Private Attributes

pipereader< Tin > in
 
pipewriter< Tout > out
 

Additional Inherited Members

- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

template<typename Tscale, typename Tin, typename Tout>
struct leansdr::scaler< Tscale, Tin, Tout >

Definition at line 172 of file dsp.h.

Constructor & Destructor Documentation

◆ scaler()

template<typename Tscale , typename Tin , typename Tout >
leansdr::scaler< Tscale, Tin, Tout >::scaler ( scheduler sch,
Tscale  _scale,
pipebuf< Tin > &  _in,
pipebuf< Tout > &  _out 
)
inline

Definition at line 175 of file dsp.h.

177  : runnable(sch, "scaler"),
178  scale(_scale),
179  in(_in), out(_out)
180  {
181  }
pipereader< Tin > in
Definition: dsp.h:194
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
pipewriter< Tout > out
Definition: dsp.h:195
scheduler * sch
Definition: framework.h:199
Tscale scale
Definition: dsp.h:174

Member Function Documentation

◆ run()

template<typename Tscale , typename Tin , typename Tout >
void leansdr::scaler< Tscale, Tin, Tout >::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 182 of file dsp.h.

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

183  {
184  unsigned long count = min(in.readable(), out.writable());
185  Tin *pin = in.rd(), *pend = pin + count;
186  Tout *pout = out.wr();
187  for (; pin < pend; ++pin, ++pout)
188  *pout = *pin * scale;
189  in.read(count);
190  out.written(count);
191  }
pipereader< Tin > in
Definition: dsp.h:194
pipewriter< Tout > out
Definition: dsp.h:195
void written(unsigned long n)
Definition: framework.h:308
Tscale scale
Definition: dsp.h:174
void read(unsigned long n)
Definition: framework.h:367
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 Tscale , typename Tin , typename Tout >
pipereader<Tin> leansdr::scaler< Tscale, Tin, Tout >::in
private

Definition at line 194 of file dsp.h.

◆ out

template<typename Tscale , typename Tin , typename Tout >
pipewriter<Tout> leansdr::scaler< Tscale, Tin, Tout >::out
private

Definition at line 195 of file dsp.h.

◆ scale

template<typename Tscale , typename Tin , typename Tout >
Tscale leansdr::scaler< Tscale, Tin, Tout >::scale

Definition at line 174 of file dsp.h.


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