HARDT - The Ham Radio DSP Toolkit
Public Member Functions | List of all members
HIqFirDecimator< T > Class Template Reference

#include <hiqfirdecimator.h>

Inheritance diagram for HIqFirDecimator< T >:
Inheritance graph
[legend]
Collaboration diagram for HIqFirDecimator< T >:
Collaboration graph
[legend]

Public Member Functions

 HIqFirDecimator (HWriter< T > *writer, int factor, float *coefficients, int points, size_t blocksize, bool collect=true, HProbe< T > *probe=nullptr)
 
 HIqFirDecimator (HWriterConsumer< T > *consumer, int factor, float *coefficients, int points, size_t blocksize, bool collect=true, HProbe< T > *probe=nullptr)
 
 HIqFirDecimator (HReader< T > *reader, int factor, float *coefficients, int points, size_t blocksize, bool collect=true, HProbe< T > *probe=nullptr)
 
void SetWriter (HWriter< T > *writer)
 
 ~HIqFirDecimator ()
 
int Write (T *src, size_t blocksize)
 
int Read (T *dest, size_t blocksize)
 
bool Start ()
 
bool Stop ()
 
bool Command (HCommand *command)
 
- Public Member Functions inherited from HReader< T >
virtual ~HReader ()=default
 
HReader< T > * Reader ()
 
- Public Member Functions inherited from HObject
 HObject ()
 
- Public Member Functions inherited from HWriter< T >
virtual ~HWriter ()=default
 
HWriter< T > * Writer ()
 
- Public Member Functions inherited from HWriterConsumer< T >
HWriterConsumer< T > * Consumer ()
 

Detailed Description

template<class T>
class HIqFirDecimator< T >

Implements a fir-decimator that can reduce the incomming samplerate by a given factor

Constructor & Destructor Documentation

◆ HIqFirDecimator() [1/3]

template<class T >
HIqFirDecimator< T >::HIqFirDecimator ( HWriter< T > *  writer,
int  factor,
float *  coefficients,
int  points,
size_t  blocksize,
bool  collect = true,
HProbe< T > *  probe = nullptr 
)

Construct a new HIqFirDecimator that handle writers.

Parameters
writerThe downstream writer
factorDecimation factor, 1 or larger
coefficientsFIR coefficients
pointsNumber of FIR coefficients
blocksizeThe expected input and output blocksize
collectNormally you want to use the same blocksize for alle writers in a chain, but if you are going to use a decimator in a parallel demultiplexed chain (processing IQ data), it is very important to write chunks from both branches alternating. In that case, set 'collect=false'. A write of 1024 samples will then immediately result in a write of 1024/factor samples to the next writer.
probeProbe

◆ HIqFirDecimator() [2/3]

template<class T >
HIqFirDecimator< T >::HIqFirDecimator ( HWriterConsumer< T > *  consumer,
int  factor,
float *  coefficients,
int  points,
size_t  blocksize,
bool  collect = true,
HProbe< T > *  probe = nullptr 
)

Construct a new HIqFirDecimator that handle writer consumers.

Parameters
consumerUpstream consumer
factorDecimation factor, 1 or larger
coefficientsFIR coefficients
pointsNumber of FIR coefficients
blocksizeThe expected input and output blocksize
collectNormally you want to use the same blocksize for alle writers in a chain, but if you are going to use a decimator in a parallel demultiplexed chain (processing IQ data), it is very important to write chunks from both branches alternating. In that case, set 'collect=false'. A write of 1024 samples will then immediately result in a write of 1024/factor samples to the next writer.
probeProbe

◆ HIqFirDecimator() [3/3]

template<class T >
HIqFirDecimator< T >::HIqFirDecimator ( HReader< T > *  reader,
int  factor,
float *  coefficients,
int  points,
size_t  blocksize,
bool  collect = true,
HProbe< T > *  probe = nullptr 
)

Construct a new HIqFirDecimator that handle readers.

Parameters
reader= The upstream reader
factorDecimation factor, 1 or larger
coefficientsFIR coefficients
pointsNumber of FIR coefficients
blocksizeThe expected input and output blocksize
collectNormally you want to use the same blocksize for alle readers in a chain, but if you are going to use a decimator in a parallel demultiplexed chain (processing IQ data), it is very important to write chunks from both branches alternating. In that case, set 'collect=false'. A write of 1024 samples will then immediately result in a read of 1024 samples from the previous reader and return only 1024/factor samples.
probeProbe

◆ ~HIqFirDecimator()

template<class T >
HIqFirDecimator< T >::~HIqFirDecimator

Default destructor

Member Function Documentation

◆ Command()

template<class T >
bool HIqFirDecimator< T >::Command ( HCommand command)
inlinevirtual

Execute or carry through a command

Implements HReader< T >.

◆ Read()

template<class T >
int HIqFirDecimator< T >::Read ( T *  dest,
size_t  blocksize 
)
virtual

Read a block of samples

Parameters
destDestination buffer
blocksizeNumber of samples to write

Implements HReader< T >.

◆ SetWriter()

template<class T >
void HIqFirDecimator< T >::SetWriter ( HWriter< T > *  writer)
inlinevirtual

◆ Start()

template<class T >
bool HIqFirDecimator< T >::Start ( )
inlinevirtual

Call Start() on up- or downstream components

Reimplemented from HReader< T >.

◆ Stop()

template<class T >
bool HIqFirDecimator< T >::Stop ( )
inlinevirtual

Call Stop() on up- or downstream components

Reimplemented from HReader< T >.

◆ Write()

template<class T >
int HIqFirDecimator< T >::Write ( T *  src,
size_t  blocksize 
)
virtual

Write a block of samples

Parameters
srcSource buffer
blocksizeNumber of samples to write

Implements HWriter< T >.


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