mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Add IIR execute_in_place()
This commit is contained in:
parent
71990b380a
commit
876a591a66
@ -39,12 +39,17 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void execute(buffer_s16_t buffer) {
|
||||
for(size_t i=0; i<buffer.count; i++) {
|
||||
buffer.p[i] = execute_sample(buffer.p[i]);
|
||||
void execute(buffer_s16_t buffer_in, buffer_s16_t buffer_out) {
|
||||
// TODO: Assert that buffer_out.count == buffer_in.count.
|
||||
for(size_t i=0; i<buffer_out.count; i++) {
|
||||
buffer_out.p[i] = execute_sample(buffer_in.p[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void execute_in_place(buffer_s16_t buffer) {
|
||||
execute(buffer, buffer);
|
||||
}
|
||||
|
||||
private:
|
||||
const std::array<float, 3> b;
|
||||
const std::array<float, 3> a;
|
||||
|
@ -453,7 +453,7 @@ public:
|
||||
* -> 48kHz int16_t[32] */
|
||||
auto audio = demod.execute(channel, work_audio_buffer);
|
||||
|
||||
audio_hpf.execute(audio);
|
||||
audio_hpf.execute_in_place(audio);
|
||||
feed_audio_stats(audio);
|
||||
fill_audio_buffer(audio);
|
||||
}
|
||||
@ -502,7 +502,7 @@ public:
|
||||
* -> 48kHz int16_t[32] */
|
||||
auto audio = demod.execute(channel, work_audio_buffer);
|
||||
|
||||
audio_hpf.execute(audio);
|
||||
audio_hpf.execute_in_place(audio);
|
||||
feed_audio_stats(audio);
|
||||
fill_audio_buffer(audio);
|
||||
}
|
||||
@ -565,7 +565,7 @@ public:
|
||||
auto audio = audio_filter.execute(audio_2fs, work_audio_buffer);
|
||||
|
||||
/* -> 48kHz int16_t[32] */
|
||||
audio_hpf.execute(audio);
|
||||
audio_hpf.execute_in_place(audio);
|
||||
feed_audio_stats(audio);
|
||||
fill_audio_buffer(audio);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user