librespeaker
Public Member Functions | Static Public Member Functions | List of all members
respeaker::VepAecBeamformingNode Class Referenceabstract

#include <vep_aec_beamforming_node.h>

Inheritance diagram for respeaker::VepAecBeamformingNode:
respeaker::BaseNode

Public Member Functions

virtual bool OnStartThread ()=0
 
virtual std::string ProcessBlock (std::string block, bool &exit)=0
 
virtual bool OnJoinThread ()=0
 
virtual void SetAngleForMic0 (int angle)=0
 
- Public Member Functions inherited from respeaker::BaseNode
BaseNodeGetId ()
 
void Uplink (BaseNode *uplink_node)
 
void RegisterDownlinkNode (BaseNode *downlink_node)
 
NodeParameterGetNodeOutputParameter ()
 
bool RecursivelyStartThread (ChainSharedData *shared_data)
 
bool RecursivelyJoinThread ()
 
virtual std::string FetchBlock (bool &exit)
 
virtual void StoreBlock (std::string block, bool &exit)
 
virtual void Pause ()
 
virtual void Resume ()
 
std::mutex * GetDownlinkDataQueueMutex (BaseNode *downlink_node_id=nullptr)
 
std::condition_variable * GetDownlinkDataQueueConditionVar (BaseNode *downlink_node_id=nullptr)
 
std::queue< std::string > & GetDownlinkDataQueue (BaseNode *downlink_node_id=nullptr)
 
int GetQueueDeepth ()
 
bool BindToCore (int core_index)
 
bool SetThreadPriority (int priority)
 

Static Public Member Functions

static VepAecBeamformingNodeCreate (MicType mic_type, bool is_single_beam_output, int ref_channel_index)
 
static VepAecBeamformingNodeCreate (MicType mic_type, bool is_single_beam_output, int ref_channel_index, bool enable_wav_log)
 

Additional Inherited Members

- Protected Member Functions inherited from respeaker::BaseNode
void EnableQueueFlush (bool enable)
 
void _Interleave (const int16_t *const *deinterleaved, size_t num_frames, size_t num_channels, int16_t *interleaved)
 
void _Deinterleave (const int16_t *interleaved, size_t num_frames, size_t num_channels, int16_t *const *deinterleaved)
 
void _Deinterleave (const float *interleaved, size_t num_frames, size_t num_channels, float *const *deinterleaved)
 
- Protected Attributes inherited from respeaker::BaseNode
BaseNode_uplink_node = nullptr
 
std::list< BaseNode * > _list_downlink_nodes
 
NodeParameter _input_parameter
 
NodeParameter _output_parameter
 
int _system_check = 0
 
ChainSharedData_chain_shared_data = nullptr
 
bool _is_head = false
 
bool _is_tail = false
 
bool _is_interleaved_after_process = false
 
int _num_frames_for_store_block
 
int _channels_for_store_block
 
int16_t * _buffer_for_store_block
 
std::unique_ptr< int16_t *[]> _channels_ptr
 

Detailed Description

This VepAecBeamformingNode provides beamforming, AEC, NR and DOA algorithms from Alango.

Member Function Documentation

◆ Create() [1/2]

static VepAecBeamformingNode* respeaker::VepAecBeamformingNode::Create ( MicType  mic_type,
bool  is_single_beam_output,
int  ref_channel_index 
)
static

Create a VepAecBeamformingNode instance. Do beamforming, AEC(acoustic echo cancellation), NR(noise reduction) and a part of DOA(direction of arrival) on the input audio stream, output the most proper beam(single-beam) or all the beams(multi-beam).

Parameters
mic_type- Specify the microphone type.
is_single_beam_output- Specify output single-beam(the most proper beam) or multi-beam(all the beams). When set to output single-beam, this node actually outputs 3 channels data, the first channel is the most proper beam channel, the second channel is reference channel, and the third channel is some vep scores. When set to output multi-beam, this node outputs all the beams and a reference channel and a vep-score channel.
ref_channel_index- Please note that the channel index starts from 0. For ReSpeaker v2, it's better to specify 6 here.
Returns
VepAecBeamformingNode*

◆ Create() [2/2]

static VepAecBeamformingNode* respeaker::VepAecBeamformingNode::Create ( MicType  mic_type,
bool  is_single_beam_output,
int  ref_channel_index,
bool  enable_wav_log 
)
static
Parameters
mic_type- Specify the microphone type.
is_single_beam_output- Specify output single-beam(the most proper beam) or multi-beam(all the beams).
ref_channel_index- Please note that the channel index starts from 0. For ReSpeaker v2, it's better to specify 6 here.
enable_wav_log- Set it true to save all the input channels and output beams into wav files(for debug), default to false.
Returns
VepAecBeamformingNode*

◆ OnJoinThread()

virtual bool respeaker::VepAecBeamformingNode::OnJoinThread ( )
pure virtual

Do per node cleanup in this method.

Implements respeaker::BaseNode.

◆ OnStartThread()

virtual bool respeaker::VepAecBeamformingNode::OnStartThread ( )
pure virtual

The derived node must configure the output parameter in this method

Implements respeaker::BaseNode.

◆ ProcessBlock()

virtual std::string respeaker::VepAecBeamformingNode::ProcessBlock ( std::string  block,
bool &  exit 
)
pure virtual

Every node must implement this method.

Parameters
block[in]
exit[out] - The exit flag of the ChainSharedData is set, the thread should join now.
Returns
std::string

Implements respeaker::BaseNode.

◆ SetAngleForMic0()

virtual void respeaker::VepAecBeamformingNode::SetAngleForMic0 ( int  angle)
pure virtual

Set the angle for microphone 0, if it's not 0 for the board. Only works for circular microphone array.

Parameters
angle- degree

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