AuxPort 0.2
Modules for Audio Software Development
Loading...
Searching...
No Matches
AuxPort::Audio::FIR Class Referenceabstract

Parent class for all FIR Design SubClasses. More...

#include <AuxFIR.h>

Inheritance diagram for AuxPort::Audio::FIR:
AuxPort::ILog AuxPort::Audio::RectangleFIR AuxPort::Audio::BartlettFIR AuxPort::Audio::BartlettHannFIR AuxPort::Audio::BlackmanFIR AuxPort::Audio::BlackmanHarrisFIR AuxPort::Audio::FlatFIR AuxPort::Audio::HammingFIR AuxPort::Audio::HannFIR AuxPort::Audio::NuttallFIR

Public Types

enum  Type { LowPass , HighPass , BandPass , BandReject }
 Represents the type of FIR Filter. More...
 

Public Member Functions

 FIR (const FIR &response)=default
 
virtual void filterAlgo ()=0
 Implement this function with your FIR Algorithm in your Derived Class [Overridable].
 
void setSampleRate (uint32_t sampleRate)
 Sets the Sample Rate.
 
void compute (float passband, float stopband, uint32_t order, Type filterType=Type::LowPass)
 Function designs an FIR by taking in Passband and stopband frequencies for a particular provided Order.
 
void compute (float cutoffFrequency, uint32_t order, Type filterType=Type::LowPass)
 Function designs an FIR by taking a cutoff frequency for a particular provided Order.
 
void replace (const std::vector< float > &impulseResponse)
 Method to load an impulse response into an FIR object...can be used with the FIR Engine.
 
void replace (float *impulseResponse, uint32_t size)
 Method to load an impulse response into an FIR object...can be used with the FIR Engine.
 
void Log () override
 Logs the Impulse Response onto the Console.
 
std::vector< float > * getImpulseResponse ()
 Returns a pointer to the internal std::vector containing the IR.
 

Protected Member Functions

void normalize ()
 Normalize the Impulse Response (In Development)
 
void spectralReversal ()
 Performs spectral reversal of Impulse Response.
 
virtual void applyWindow ()
 Applyies a window on the Impulse Response.
 
- Protected Member Functions inherited from AuxPort::ILog
void setColour (const ColourType &colourType)
 This function allows you to set text colour for the text to be printed onto the console.
 

Protected Attributes

Type filterType
 
std::vector< float > impulseResponse
 
float passband = 0
 
float stopband = 0
 
float cutoff = 0
 
float normFreq = 0
 
uint32_t order = 0
 
uint32_t sampleRate = 0
 

Detailed Description

Parent class for all FIR Design SubClasses.

Definition at line 18 of file AuxFIR.h.

Member Enumeration Documentation

◆ Type

Represents the type of FIR Filter.

Definition at line 24 of file AuxFIR.h.

Member Function Documentation

◆ applyWindow()

void AuxPort::Audio::FIR::applyWindow ( )
protectedvirtual

◆ compute() [1/2]

void AuxPort::Audio::FIR::compute ( float cutoffFrequency,
uint32_t order,
Type filterType = Type::LowPass )

Function designs an FIR by taking a cutoff frequency for a particular provided Order.

Definition at line 80 of file AuxFIR.cpp.

◆ compute() [2/2]

void AuxPort::Audio::FIR::compute ( float passband,
float stopband,
uint32_t order,
Type filterType = Type::LowPass )

Function designs an FIR by taking in Passband and stopband frequencies for a particular provided Order.

Definition at line 60 of file AuxFIR.cpp.

◆ filterAlgo()

virtual void AuxPort::Audio::FIR::filterAlgo ( )
pure virtual

Implement this function with your FIR Algorithm in your Derived Class [Overridable].

Implemented in AuxPort::Audio::RectangleFIR.

◆ getImpulseResponse()

std::vector< float > * AuxPort::Audio::FIR::getImpulseResponse ( )

Returns a pointer to the internal std::vector containing the IR.

Definition at line 55 of file AuxFIR.cpp.

◆ Log()

void AuxPort::Audio::FIR::Log ( )
overridevirtual

Logs the Impulse Response onto the Console.

Reimplemented from AuxPort::ILog.

Definition at line 45 of file AuxFIR.cpp.

◆ normalize()

void AuxPort::Audio::FIR::normalize ( )
protected

Normalize the Impulse Response (In Development)

Definition at line 23 of file AuxFIR.cpp.

◆ replace() [1/2]

void AuxPort::Audio::FIR::replace ( const std::vector< float > & impulseResponse)

Method to load an impulse response into an FIR object...can be used with the FIR Engine.

Definition at line 9 of file AuxFIR.cpp.

◆ replace() [2/2]

void AuxPort::Audio::FIR::replace ( float * impulseResponse,
uint32_t size )

Method to load an impulse response into an FIR object...can be used with the FIR Engine.

Definition at line 14 of file AuxFIR.cpp.

◆ setSampleRate()

void AuxPort::Audio::FIR::setSampleRate ( uint32_t sampleRate)

Sets the Sample Rate.

Definition at line 4 of file AuxFIR.cpp.

◆ spectralReversal()

void AuxPort::Audio::FIR::spectralReversal ( )
protected

Performs spectral reversal of Impulse Response.

Definition at line 31 of file AuxFIR.cpp.

Member Data Documentation

◆ cutoff

float AuxPort::Audio::FIR::cutoff = 0
protected

Definition at line 92 of file AuxFIR.h.

◆ filterType

Type AuxPort::Audio::FIR::filterType
protected

Definition at line 88 of file AuxFIR.h.

◆ impulseResponse

std::vector<float> AuxPort::Audio::FIR::impulseResponse
protected

Definition at line 89 of file AuxFIR.h.

◆ normFreq

float AuxPort::Audio::FIR::normFreq = 0
protected

Definition at line 93 of file AuxFIR.h.

◆ order

uint32_t AuxPort::Audio::FIR::order = 0
protected

Definition at line 94 of file AuxFIR.h.

◆ passband

float AuxPort::Audio::FIR::passband = 0
protected

Definition at line 90 of file AuxFIR.h.

◆ sampleRate

uint32_t AuxPort::Audio::FIR::sampleRate = 0
protected

Definition at line 95 of file AuxFIR.h.

◆ stopband

float AuxPort::Audio::FIR::stopband = 0
protected

Definition at line 91 of file AuxFIR.h.


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