26 lines
552 B
C
Raw Normal View History

2022-09-16 03:16:58 +02:00
#pragma once
#include <cstdint>
2023-05-12 03:50:26 +02:00
#include <vector>
2022-09-16 03:16:58 +02:00
class FIR {
public:
FIR();
2022-09-19 04:30:42 +02:00
void FilterSamples(float *samples, uint32_t size);
2022-09-19 04:30:07 +02:00
void FilterSamplesInterleaved(float *samples, uint32_t size, uint32_t channels);
2022-09-21 03:06:50 +02:00
uint32_t GetBlockLength();
int LoadCoefficients(const float *coeffs, uint32_t coeffsSize, uint32_t blockLength);
2022-09-16 03:16:58 +02:00
void Reset();
private:
2023-05-12 03:50:26 +02:00
std::vector<float> offsetBlock;
std::vector<float> coeffs;
std::vector<float> block;
2022-09-21 03:06:50 +02:00
uint32_t coeffsSize;
uint32_t blockLength;
bool hasCoefficients;
2022-09-16 03:16:58 +02:00
};