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::MicrophoneArray Class Reference

#include <microphonearray.h>

Inheritance diagram for sal::MicrophoneArray:
sal::Microphone sal::UniformArray< T > sal::CircularArray< T > sal::StereoMic< T >

Public Member Functions

 MicrophoneArray (const mcl::Point &position, const mcl::Quaternion &orientation, const std::vector< Microphone * > &microphones)
 
virtual void SetPosition (const mcl::Point &position) noexcept
 
void SetOrientation (const mcl::Quaternion &orientation) noexcept
 
bool IsCoincident () const noexcept
 
Int num_channels () const noexcept
 
const MicrophoneGetConstMicrophonePointer (const Int microphone_id) const noexcept
 
MicrophoneGetMicrophonePointer (const Int microphone_id) noexcept
 
std::vector< Microphone * > GetMicrophonePointers () const noexcept
 
std::vector< const Microphone * > GetConstMicrophonePointers () const noexcept
 
Int num_microphones () const noexcept
 
virtual ~MicrophoneArray ()
 
virtual void AddPlaneWave (const Sample *input_data, const Int num_samples, const mcl::Point &point, const Int wave_id, Buffer &output_buffer) noexcept
 
virtual void AddPlaneWaveRelative (const Sample *input_data, const Int num_samples, const mcl::Point &point, const Int wave_id, Buffer &output_buffer) noexcept
 
- Public Member Functions inherited from sal::Microphone
 Microphone (mcl::Point position, mcl::Quaternion orientation=mcl::Quaternion::Identity())
 
mcl::Point position () const noexcept
 
mcl::Quaternion orientation () const noexcept
 
void SetHandedness (const mcl::Handedness handedness) noexcept
 
void AddPlaneWave (const MonoBuffer &signal, const mcl::Point &point, Buffer &output_buffer) noexcept
 
void AddPlaneWave (const Sample *input_data, const Int num_samples, const mcl::Point &point, Buffer &output_buffer) noexcept
 
void AddPlaneWave (const Sample input_sample, const mcl::Point &point, Buffer &output_buffer) noexcept
 
void AddPlaneWave (const MonoBuffer &input_buffer, const mcl::Point &point, const Int wave_id, Buffer &output_buffer) noexcept
 
void AddPlaneWave (const Sample input_sample, const mcl::Point &point, const Int wave_id, Buffer &output_buffer) noexcept
 
virtual bool IsOmni () const noexcept
 
mcl::Point GetRelativePoint (const mcl::Point &point) const noexcept
 
virtual void Reset () noexcept
 
virtual ~Microphone ()
 
virtual void AddPlaneWaveRelative (const MonoBuffer &signal, const mcl::Point &point, const Int wave_id, Buffer &output_buffer) noexcept
 

Static Public Member Functions

static bool Test ()
 
- Static Public Member Functions inherited from sal::Microphone
static bool Test ()
 

Protected Attributes

std::vector< Microphone * > microphones_
 
- Protected Attributes inherited from sal::Microphone
mcl::Handedness handedness_
 

Detailed Description

This is a microhone array, containing pointers to other microphones. A call to AddPlaneWave will call the AddPlaneWave of each microphone. You can then access the streams of each microphone by first extracting pointers to the microphone with the microphones() method and then accessing each one's stream. Alternatively, the object also has a multichannel stream object, which contains pointers to the individual streams.

Constructor & Destructor Documentation

sal::MicrophoneArray::MicrophoneArray ( const mcl::Point &  position,
const mcl::Quaternion &  orientation,
const std::vector< Microphone * > &  microphones 
)
inline
virtual sal::MicrophoneArray::~MicrophoneArray ( )
inlinevirtual

Member Function Documentation

virtual void sal::MicrophoneArray::AddPlaneWave ( const Sample input_data,
const Int  num_samples,
const mcl::Point &  point,
const Int  wave_id,
Buffer output_buffer 
)
inlinevirtualnoexcept

Simulates the output of the microphone array to a source in the direction of source.position() and with input signal source.signal(). This does not include attenuation nor delay due to propagation. If you wish to use this method, the buffer has to be a multichannel buffer, and all the underlying microphones need to be monophonic. If that is not the case, then you need to use the AddPlaneWave of the underlying microphone objects directly.

Reimplemented from sal::Microphone.

virtual void sal::MicrophoneArray::AddPlaneWaveRelative ( const Sample input_data,
const Int  num_samples,
const mcl::Point &  point,
const Int  wave_id,
Buffer output_buffer 
)
inlinevirtualnoexcept

This is implemented by the specific type of microphones. mcl::Point in this case is relative to the microphone reference system. This is the most important function of this object. This filters the sample sample as a function of the position from where the sound is incoming point. Info for developer: the directivity should preferably have a maximum in the direction of the x-axis For anthropomorphic directivities, the facing direction is the x-axis. An arrow going from the jaw trough the skull and up should preferrably be in the direction of plus-z-axis. Other choices could be made, as long as the conventions are kept at higher levels.

Implements sal::Microphone.

const Microphone* sal::MicrophoneArray::GetConstMicrophonePointer ( const Int  microphone_id) const
inlinenoexcept
std::vector<const Microphone*> sal::MicrophoneArray::GetConstMicrophonePointers ( ) const
inlinenoexcept
Microphone* sal::MicrophoneArray::GetMicrophonePointer ( const Int  microphone_id)
inlinenoexcept
std::vector<Microphone*> sal::MicrophoneArray::GetMicrophonePointers ( ) const
inlinenoexcept
bool sal::MicrophoneArray::IsCoincident ( ) const
inlinevirtualnoexcept

Returns true if the array is coincident. If there are 0 or 1 microphones the array is considered coincident.

Implements sal::Microphone.

Int sal::MicrophoneArray::num_channels ( ) const
inlinevirtualnoexcept

Implements sal::Microphone.

Int sal::MicrophoneArray::num_microphones ( ) const
inlinenoexcept
void sal::MicrophoneArray::SetOrientation ( const mcl::Quaternion &  orientation)
inlinevirtualnoexcept

Set microphone orientation

Reimplemented from sal::Microphone.

Reimplemented in sal::CircularArray< T >.

virtual void sal::MicrophoneArray::SetPosition ( const mcl::Point &  position)
inlinevirtualnoexcept

This method will move all the internal microphones to a new position. The relative positions of the different microphones will stay unchanged.

Reimplemented from sal::Microphone.

static bool sal::MicrophoneArray::Test ( )
static

Member Data Documentation

std::vector<Microphone*> sal::MicrophoneArray::microphones_
protected

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