forked from chipaudette/OpenAudio_ArduinoLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioFilterBiquad_F32.cpp
More file actions
41 lines (32 loc) · 817 Bytes
/
AudioFilterBiquad_F32.cpp
File metadata and controls
41 lines (32 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* AudioFilterBiquad_F32.cpp
*
* Chip Audette, OpenAudio, Apr 2017
*
* MIT License, Use at your own risk.
*
*/
#include "AudioFilterBiquad_F32.h"
void AudioFilterBiquad_F32::update(void)
{
audio_block_f32_t *block;
block = AudioStream_F32::receiveWritable_f32();
if (!block) return;
// If there's no coefficient table, give up.
if (coeff_p == NULL) {
AudioStream_F32::release(block);
return;
}
// do passthru
if (coeff_p == IIR_F32_PASSTHRU) {
// Just passthrough
AudioStream_F32::transmit(block);
AudioStream_F32::release(block);
return;
}
// do IIR
arm_biquad_cascade_df1_f32(&iir_inst, block->data, block->data, block->length);
//transmit the data
AudioStream_F32::transmit(block); // send the IIR output
AudioStream_F32::release(block);
}