mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-09 15:12:35 -04:00
Rebased code from new eried repo commits. Changed to to reflect strijar implementation. Fixed previous issue with old ssb-am-tx ui_mictx code.
This commit is contained in:
parent
603b7fb1ab
commit
f65852ff05
20 changed files with 1545 additions and 16 deletions
|
@ -55,3 +55,29 @@ void IIRBiquadFilter::execute(const buffer_f32_t& buffer_in, const buffer_f32_t&
|
|||
void IIRBiquadFilter::execute_in_place(const buffer_f32_t& buffer) {
|
||||
execute(buffer, buffer);
|
||||
}
|
||||
|
||||
void IIRBiquadDF2Filter::configure(const iir_biquad_df2_config_t& config) {
|
||||
b0 = config[0] / config[3];
|
||||
b1 = config[1] / config[3];
|
||||
b2 = config[2] / config[3];
|
||||
a1 = config[4] / config[3];
|
||||
a2 = config[5] / config[3];
|
||||
}
|
||||
|
||||
// scipy.signal.sosfilt
|
||||
//
|
||||
// x_n = x[i, n] # make a temporary copy
|
||||
// # Use direct II transposed structure:
|
||||
// x[i, n] = b[s, 0] * x_n + zi[i, s, 0]
|
||||
// zi[i, s, 0] = (b[s, 1] * x_n - a[s, 0] * x[i, n] + zi[i, s, 1])
|
||||
// zi[i, s, 1] = (b[s, 2] * x_n - a[s, 1] * x[i, n])
|
||||
|
||||
float IIRBiquadDF2Filter::execute(float x) {
|
||||
float y;
|
||||
|
||||
y = b0 * x + z0;
|
||||
z0 = b1 * x - a1 * y + z1;
|
||||
z1 = b2 * x - a2 * y;
|
||||
|
||||
return y;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue