Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ImpulseResponse Class Reference

This class represents an impulse response that can be used in convolution. More...

#include <ImpulseResponse.h>

Public Member Functions

 ImpulseResponse (std::shared_ptr< StreamBuffer > impulseResponse, std::shared_ptr< FFTPlan > plan)
 Creates a new ImpulseResponse object.
 
 ImpulseResponse (std::shared_ptr< StreamBuffer > impulseResponse)
 Creates a new ImpulseResponse object.
 
Specs getSpecs ()
 Returns the specification of the impulse response.
 
int getLength ()
 Retrieves the length of the impulse response.
 
std::shared_ptr< std::vector< std::shared_ptr< std::vector< std::complex< sample_t > > > > > getChannel (int n)
 Retrieves one channel of the impulse response.
 

Detailed Description

This class represents an impulse response that can be used in convolution.

When this class is instanced, the impulse response is divided in channels and those channels are divided in parts of N/2 samples (N being the size of the FFT plan used). The main objetive of this class is to allow the reutilization of an impulse response in various sounds without having to process it more than one time.

Warning
The size of the FFTPlan used to process the impulse response must be the same as the one used in the convolver classes.

Constructor & Destructor Documentation

◆ ImpulseResponse() [1/2]

ImpulseResponse::ImpulseResponse ( std::shared_ptr< StreamBuffer > impulseResponse,
std::shared_ptr< FFTPlan > plan )

Creates a new ImpulseResponse object.

The impulse response will be split and transformed to the frequency domain.

Parameters
impulseResponseThe impulse response sound.
planA shared pointer to a FFT plan used to transform the impulse response.

◆ ImpulseResponse() [2/2]

ImpulseResponse::ImpulseResponse ( std::shared_ptr< StreamBuffer > impulseResponse)

Creates a new ImpulseResponse object.

This overload instances its own FFTPlan with default size. The impulse response will be split and transformed to the frequency domain.

Parameters
impulseResponseThe impulse response sound.

Member Function Documentation

◆ getChannel()

std::shared_ptr< std::vector< std::shared_ptr< std::vector< std::complex< sample_t > > > > > ImpulseResponse::getChannel ( int n)

Retrieves one channel of the impulse response.

Parameters
nThe desired channel number (from 0 to channels-1).
Returns
The desired channel of the impulse response.

◆ getLength()

int ImpulseResponse::getLength ( )

Retrieves the length of the impulse response.

Returns
The length of the impulse response.

◆ getSpecs()

Specs ImpulseResponse::getSpecs ( )

Returns the specification of the impulse response.

Returns
The specification of the impulse response.

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