AudibleT 0.0.1
A real-time A/B/X audio testing tool for subjective assessment of various audio parameters, compatible for general purpose computer as well as embedded systems.
Loading...
Searching...
No Matches
ShelfFilter.h
Go to the documentation of this file.
1//=======================================================================
29//=======================================================================
30
31
32#ifndef SHELFFILTER_H
33#define SHELFFILTER_H
34
35#include "BaseFilter.h"
36
37#include <iostream>
38#include <array>
39#include <vector>
40#include <cmath>
41#include <complex>
42
43#include "FilterType.h"
44
52class ShelfFilter: public BaseFilter {
53public:
64 ShelfFilter(double sample_rate, double cutoff_frequency, double gain_db, FilterType type);
65
80 std::vector<float> process_buffer(std::vector<float>& inputBuffer) override;
81
94 float process_sample(float sample) override;
95
103 const std::vector<double>& get_A() const;
104
112 const std::vector<double>& get_B() const;
113
114private:
115 std::array<double, 3> x = {0, 0, 0};
116 std::array<double, 3> y = {0, 0, 0};
117 std::vector<double> A;
118 std::vector<double> B;
119 FilterType filterType;
120
130 void updateCoefficients(double sample_rate, double cutoff_frequency, double gain_db);
131};
132
133#endif // SHELFFILTER_H
An abstract class that defines a basic audio filter.
Definition: BaseFilter.h:39
High-shelf and low-shelf filter for audio processing.
Definition: ShelfFilter.h:52
const std::vector< double > & get_A() const
Get the A coefficients.
Definition: ShelfFilter.cpp:121
float process_sample(float sample) override
Override of process_sample for ShelfFilter class.
Definition: ShelfFilter.cpp:75
const std::vector< double > & get_B() const
Get the B coefficients.
Definition: ShelfFilter.cpp:126
std::vector< float > process_buffer(std::vector< float > &inputBuffer) override
Processes a buffer of input samples through the filter. This is experimental and not used.
Definition: ShelfFilter.cpp:91
FilterType
An enumeration of filter types.
Definition: FilterType.h:43