Change baseband audio processing pipeline to all floats.

This commit is contained in:
Jared Boone
2016-01-11 16:15:42 -08:00
parent b9f124850b
commit 55e3a70fde
12 changed files with 90 additions and 56 deletions
+3 -5
View File
@@ -27,7 +27,7 @@ void IIRBiquadFilter::configure(const iir_biquad_config_t& new_config) {
config = new_config;
}
void IIRBiquadFilter::execute(const buffer_s16_t& buffer_in, const buffer_s16_t& buffer_out) {
void IIRBiquadFilter::execute(const buffer_f32_t& buffer_in, const buffer_f32_t& buffer_out) {
const auto a_ = config.a;
const auto b_ = config.b;
@@ -45,15 +45,13 @@ void IIRBiquadFilter::execute(const buffer_s16_t& buffer_in, const buffer_s16_t&
y_[2] = b_[0] * x_[2] + b_[1] * x_[1] + b_[2] * x_[0]
- a_[1] * y_[1] - a_[2] * y_[0];
const int32_t output_sample = y_[2];
const int32_t output_sample_saturated = __SSAT(output_sample, 16);
buffer_out.p[i] = output_sample_saturated;
buffer_out.p[i] = y_[2];
}
x = x_;
y = y_;
}
void IIRBiquadFilter::execute_in_place(const buffer_s16_t& buffer) {
void IIRBiquadFilter::execute_in_place(const buffer_f32_t& buffer) {
execute(buffer, buffer);
}