Flan
Public Member Functions | List of all members
r8b::CDSPProcessor Class Referenceabstract

The base virtual class for DSP processing algorithms. More...

#include <CDSPProcessor.h>

Inheritance diagram for r8b::CDSPProcessor:
Inheritance graph
[legend]
Collaboration diagram for r8b::CDSPProcessor:
Collaboration graph
[legend]

Public Member Functions

virtual int getLatency () const =0
 
virtual double getLatencyFrac () const =0
 
virtual int getMaxOutLen (const int MaxInLen) const =0
 
virtual void clear ()=0
 Function clears (resets) the state of *this object and returns it to the state after construction. More...
 
virtual int process (double *ip, int l0, double *&op0)=0
 Function performs DSP processing. More...
 

Detailed Description

The base virtual class for DSP processing algorithms.

This class can be used as a base class for various DSP processing algorithms (processors). DSP processors that are derived from this class can be seamlessly integrated into various DSP processing graphs.

Member Function Documentation

◆ clear()

virtual void r8b::CDSPProcessor::clear ( )
pure virtual

Function clears (resets) the state of *this object and returns it to the state after construction.

All input data accumulated in the internal buffer so far will be discarded.

Implemented in r8b::CDSPFracInterpolator, r8b::CDSPHBUpsampler, r8b::CDSPResampler, r8b::CDSPBlockConvolver, and r8b::CDSPHBDownsampler.

◆ getLatency()

virtual int r8b::CDSPProcessor::getLatency ( ) const
pure virtual
Returns
The latency, in samples, which is present in the output signal. This value is usually zero if the DSP processor "consumes" the latency automatically.

Implemented in r8b::CDSPFracInterpolator, r8b::CDSPHBUpsampler, r8b::CDSPResampler, r8b::CDSPBlockConvolver, and r8b::CDSPHBDownsampler.

◆ getLatencyFrac()

virtual double r8b::CDSPProcessor::getLatencyFrac ( ) const
pure virtual
Returns
Fractional latency, in samples, which is present in the output signal. This value is usually zero if a linear-phase filtering is used. With minimum-phase filters in use, this value can be non-zero even if the getLatency() function returns zero.

Implemented in r8b::CDSPFracInterpolator, r8b::CDSPHBUpsampler, r8b::CDSPResampler, r8b::CDSPBlockConvolver, and r8b::CDSPHBDownsampler.

◆ getMaxOutLen()

virtual int r8b::CDSPProcessor::getMaxOutLen ( const int  MaxInLen) const
pure virtual
Parameters
MaxInLenThe number of samples planned to process at once, at most.
Returns
The maximal length of the output buffer required when processing the "MaxInLen" number of input samples.

Implemented in r8b::CDSPFracInterpolator, r8b::CDSPHBUpsampler, r8b::CDSPResampler, r8b::CDSPBlockConvolver, and r8b::CDSPHBDownsampler.

◆ process()

virtual int r8b::CDSPProcessor::process ( double *  ip,
int  l0,
double *&  op0 
)
pure virtual

Function performs DSP processing.

Parameters
ipInput data pointer.
l0How many samples to process.
[out]op0Output data pointer. The capacity of this buffer should be equal to the value returned by the getMaxOutLen() function for the given "l0". This buffer can be equal to "ip" only if the getMaxOutLen( l0 ) function returned a value lesser than "l0". This pointer can be incremented on function's return if latency compensation was performed by the processor. Note that on function's return, this pointer may point to some internal buffers, including the "ip" buffer, ignoring the originally passed value.
Returns
The number of output samples written to the "op0" buffer and available after processing. This value can be smaller or larger in comparison to the original "l0" value due to processing and filter's latency compensation that took place, and due to resampling if it was performed.

Implemented in r8b::CDSPFracInterpolator, r8b::CDSPHBUpsampler, r8b::CDSPResampler, r8b::CDSPBlockConvolver, and r8b::CDSPHBDownsampler.


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