14 0.000088228877315364f, 0.000487010018128278f, 0.000852264975437944f, -0.001283563593466774f,
15 -0.010130591831925894f, -0.025688727779244691f, -0.036346596505004387f, -0.024088355516718698f,
16 0.012246773417129486f, 0.040021434054637831f, 0.017771298164062477f, -0.046866403416502632f,
17 -0.075597513455990611f, 0.013331126342402619f, 0.202889888191404910f, 0.362615173769444080f,
18 0.362615173769444080f, 0.202889888191404910f, 0.013331126342402619f, -0.075597513455990611f,
19 -0.046866403416502632f, 0.017771298164062477f, 0.040021434054637831f, 0.012246773417129486f,
20 -0.024088355516718698f, -0.036346596505004387f, -0.025688727779244691f, -0.010130591831925894f,
21 -0.001283563593466774f, 0.000852264975437944f, 0.000487010018128278f, 0.000088228877315364f,
25 for (
int i = 0; i <
kNumTaps / 2; ++i)
26 taps_[i] =
poly_float(coefficients[2 * i], coefficients[2 * i + 1]);
39 int input_buffer_size = 2 * num_samples;
43 int start_audio_index = input_buffer_size -
kNumTaps + 2;
44 for (
int i = 0; i <
kNumTaps / 2 - 1; ++i) {
45 int audio_index = start_audio_index + 2 * i;
60 int output_buffer_size = num_samples;
69 for (
int memory_start = 0; memory_start <
kNumTaps / 2 - 1; ++memory_start) {
74 int num_memory =
kNumTaps / 2 - memory_start - 1;
75 for (; tap_index < num_memory; ++tap_index) {
76 sum =
utils::mulAdd(sum, memory_[tap_index + memory_start], taps_[tap_index]);
81 for (; tap_index <
kNumTaps / 2; ++tap_index) {
95 for (; out_index < output_buffer_size; ++out_index) {
97 int audio_index = audio_start;
100 for (
int tap_index = 0; tap_index <
kNumTaps / 2; ++tap_index) {
120 void FirHalfbandDecimator::reset(
poly_mask reset_mask) {
121 for (
int i = 0; i <
kNumTaps / 2 - 1; ++i)
FirHalfbandDecimator()
Constructs a FirHalfbandDecimator and initializes taps.
Definition fir_halfband_decimator.cpp:12
@ kAudio
The main audio input.
Definition fir_halfband_decimator.h:27
virtual void process(int num_samples) override
Processes the input audio by decimating it, producing half the number of output samples.
Definition fir_halfband_decimator.cpp:58
static constexpr int kNumTaps
Number of FIR taps in the filter.
Definition fir_halfband_decimator.h:20
void saveMemory(int num_samples)
Saves the last few samples of audio to memory, preparing for the next processing block.
Definition fir_halfband_decimator.cpp:38
Base class for all signal-processing units in Vital.
Definition processor.h:212
force_inline Input * input(unsigned int index=0) const
Retrieves the Input pointer at a given index.
Definition processor.h:587
force_inline Output * output(unsigned int index=0) const
Retrieves the Output pointer at a given index.
Definition processor.h:616
#define VITAL_ASSERT(x)
Definition common.h:11
const poly_mask kFullMask
A mask covering all lanes of a poly_float vector.
Definition synth_constants.h:257
force_inline poly_float consolidateAudio(poly_float one, poly_float two)
Interleaves two stereo poly_floats into a single vector with left channels first, then right channels...
Definition poly_utils.h:491
force_inline poly_float mulAdd(poly_float a, poly_float b, poly_float c)
Performs a fused multiply-add on SIMD data: (a * b) + c.
Definition poly_utils.h:61
force_inline poly_float sumSplitAudio(poly_float sum)
Adds two stereo lanes for each voice, returning a combined mono result in each lane.
Definition poly_utils.h:517
Contains classes and functions used within the Vital synthesizer framework.
float mono_float
Definition common.h:33
poly_float * buffer
Pointer to the output buffer.
Definition processor.h:110
Represents a vector of floating-point values using SIMD instructions.
Definition poly_values.h:600
Represents a vector of integer values using SIMD instructions.
Definition poly_values.h:56