SAL
A C++ library for spatial audio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
sal::DelayFilter Class Reference

#include <delayfilter.h>

Inheritance diagram for sal::DelayFilter:

Public Member Functions

 DelayFilter (const Int latency, Int max_latency) noexcept
 
 ~DelayFilter () noexcept
 
void Write (const Sample sample) noexcept
 
void Write (const Sample *samples, const Int num_samples) noexcept
 
virtual void Reset () noexcept
 
Sample Read () const noexcept
 
const SampleReadAt (const Int delay_tap) const noexcept
 
void Read (const Int num_samples, Sample *output_data) const noexcept
 
Sample FractionalReadAt (const Time fractional_delay_tap) const noexcept
 
void Tick () noexcept
 
void Tick (const Int num_samples) noexcept
 
void SetLatency (const Int) noexcept
 
Int latency () const noexcept
 
Int max_latency () const noexcept
 
DelayFilteroperator= (const DelayFilter &)
 
 DelayFilter (const DelayFilter &)
 
virtual mcl::Real Filter (const mcl::Real input) noexcept
 

Static Public Member Functions

static bool Test ()
 

Protected Attributes

Samplestart_
 
Sampleend_
 
Samplewrite_index_
 
Sampleread_index_
 
sal::Int latency_
 
sal::Int max_latency_
 

Constructor & Destructor Documentation

sal::DelayFilter::DelayFilter ( const Int  latency,
Int  max_latency 
)
noexcept

Constructs a delay filter object with intial latency given by latency. A maximum latency has to be given to allocate the maximum amount of memory of the circular memory.

sal::DelayFilter::~DelayFilter ( )
inlinenoexcept
sal::DelayFilter::DelayFilter ( const DelayFilter copy)

Member Function Documentation

mcl::Real sal::DelayFilter::Filter ( const mcl::Real  input)
virtualnoexcept
Sample sal::DelayFilter::FractionalReadAt ( const Time  fractional_delay_tap) const
inlinenoexcept
Int sal::DelayFilter::latency ( ) const
noexcept

Returns the current latency of the delay filter

Int sal::DelayFilter::max_latency ( ) const
noexcept

Returns the maximum latency of the delay filter

DelayFilter & sal::DelayFilter::operator= ( const DelayFilter other)
Sample sal::DelayFilter::Read ( ) const
inlinenoexcept

Returns the current sample from the filter. Between two Tick() operation it will give always the same output.

void sal::DelayFilter::Read ( const Int  num_samples,
Sample output_data 
) const
noexcept

Read the next num_samples samples.

Parameters
[in]num_samplesthe number of samples to be read.
[out]output_datathe array where to write these samples.
const Sample& sal::DelayFilter::ReadAt ( const Int  delay_tap) const
inlinenoexcept

This allows to read at a different location from the read pointer.

void sal::DelayFilter::Reset ( )
virtualnoexcept

Resets the state of the filter

void sal::DelayFilter::SetLatency ( const Int  latency)
noexcept

Resets the latency of the filter. This can introduce artifacts if the latency is updated too fast.

bool sal::DelayFilter::Test ( )
static
void sal::DelayFilter::Tick ( )
inlinenoexcept

This causes time to tick by one sample.

void sal::DelayFilter::Tick ( const Int  num_samples)
noexcept

This causes time to tick by more than one sample (use only if you understand what you are doing!).

void sal::DelayFilter::Write ( const Sample  sample)
inlinenoexcept

This writes the next sample into the filter. If this method is called 2 times before the Tick() operation, the former value will be overwritten.

void sal::DelayFilter::Write ( const Sample samples,
const Int  num_samples 
)
noexcept

Member Data Documentation

Sample* sal::DelayFilter::end_
protected
sal::Int sal::DelayFilter::latency_
protected
sal::Int sal::DelayFilter::max_latency_
protected
Sample* sal::DelayFilter::read_index_
protected
Sample* sal::DelayFilter::start_
protected
Sample* sal::DelayFilter::write_index_
protected

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