HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
ImpulseResponse< SampleType > Class Template Reference

Container for representing an impulse response (IR) More...

#include <hart_impulse_response.hpp>

Public Member Functions

 ImpulseResponse (AudioBuffer< SampleType > input, AudioBuffer< SampleType > output)
 Create an IR instance from a pait of time-domain signals.
 
size_t getNumChannels () const
 Get number of channels.
 
size_t getNumFrames () const
 Get number of frames (samples)
 
double getSampleRateHz () const
 Get a sample rate metadata.
 
void represent (std::ostream &stream) const
 Prints readable representation of the IR.
 
const SampleType * operator[] (size_t channel) const
 Get a raw pointer to a specific channel's read-only audio data.
 

Related Symbols

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &stream, const ImpulseResponse &ir)
 Prints readable text representation of the ImpulseResponse object into the I/O stream.
 

Detailed Description

template<typename SampleType>
class hart::ImpulseResponse< SampleType >

Container for representing an impulse response (IR)

It is guaranteed to have a specific sample rate associated with it

Definition at line 21 of file hart_impulse_response.hpp.

Constructor & Destructor Documentation

◆ ImpulseResponse()

template<typename SampleType >
ImpulseResponse ( AudioBuffer< SampleType >  input,
AudioBuffer< SampleType >  output 
)
inline

Create an IR instance from a pait of time-domain signals.

Parameters
inputSignal at the input of the system
outputSignal at the output of the system
Exceptions
hart::SampleRateErrorif provided audio buffers either don't have sample rate, or it has invalid value
hart::SizeErrorif the lengths of provided buffers (in frames) don't match
hart::ChannelLayoutErrorif numbers of channels of the provided buffers don't match

Definition at line 35 of file hart_impulse_response.hpp.

Member Function Documentation

◆ getNumChannels()

template<typename SampleType >
size_t getNumChannels ( ) const
inline

Get number of channels.

Returns
Number of allocated channels

Definition at line 90 of file hart_impulse_response.hpp.

◆ getNumFrames()

template<typename SampleType >
size_t getNumFrames ( ) const
inline

Get number of frames (samples)

Returns
Number of allocated frames (samples) in every channel

Definition at line 94 of file hart_impulse_response.hpp.

◆ getSampleRateHz()

template<typename SampleType >
double getSampleRateHz ( ) const
inline

Get a sample rate metadata.

Returns
IR's sample rate in Hz

Definition at line 98 of file hart_impulse_response.hpp.

◆ represent()

template<typename SampleType >
void represent ( std::ostream &  stream) const
inline

Prints readable representation of the IR.

Parameters
streamString stream to append the representation to

Definition at line 110 of file hart_impulse_response.hpp.

◆ operator[]()

template<typename SampleType >
const SampleType * operator[] ( size_t  channel) const
inline

Get a raw pointer to a specific channel's read-only audio data.

Note
The data is guaranteed to have at least getNumFrames() items and to be a contiguous non-interleaved block of memory.
Returns
Pointer to the IR data of requested channel

Definition at line 118 of file hart_impulse_response.hpp.

Friends And Related Symbol Documentation

◆ operator<<

template<typename SampleType >
std::ostream & operator<< ( std::ostream &  stream,
const ImpulseResponse< SampleType > &  ir 
)
friend

Prints readable text representation of the ImpulseResponse object into the I/O stream.

Definition at line 125 of file hart_impulse_response.hpp.


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