ROOTCASTLE / 엔지니어링 랩
필터 설계
Biquad 필터, Bode 플롯 및 C 코드.
LOCAL CALCULATION · RUNS IN THE BROWSER
✓ Stable: all poles inside the unit circle
- |H(2kHz)|
- -12.37 dB
- ∠H(2kHz)
- -136.9°
- Section
- 1
- max |pole|
- 0.911594
| Section | b0 | b1 | b2 | a1 | a2 |
|---|---|---|---|---|---|
| 1 | 0.0039161235 | 0.007832247 | 0.0039161235 | -1.8153396 | 0.83100411 |
| 1 · Q14 | 64 | 128 | 64 | -29743 | 13615 |
/* Low-pass Q 0.7071, f0 1kHz, fs = 48000 Hz. Generated by Rootcastle LAB; verify against your own requirements. */
typedef struct { float b0, b1, b2, a1, a2; float z1, z2; } biquad_t;
static biquad_t stages[1] = {
{ 0.003916123487f, 0.007832246974f, 0.003916123487f, -1.815339612f, 0.8310041056f },
};
float filter_step(float x) {
for (int i = 0; i < 1; i++) {
biquad_t *s = &stages[i];
float y = s->b0 * x + s->z1;
s->z1 = s->b1 * x - s->a1 * y + s->z2;
s->z2 = s->b2 * x - s->a2 * y;
x = y;
}
return x;
}Model and assumptions
Second-order IIR (biquad) sections are designed with the bilinear transform using R. Bristow-Johnson’s “Audio EQ Cookbook” formulas. As the corner approaches fs/2, frequency warping increases the deviation from the analog prototype. 4th- and 6th-order low/high-pass filters are cascaded with Butterworth Q values (the Q input is then unused). Fixed-point results show coefficient quantization only; accumulator overflow, rounding noise and limit cycles must be tested separately.
ω0 = 2π·f0/fs; α = sin ω0 / 2Q; H(z) = (b0 + b1·z⁻¹ + b2·z⁻²) / (1 + a1·z⁻¹ + a2·z⁻²)
용도
이득 조절기는 센서 신호에서 mains hum(50/60 Hz 노이즈)을 제거하거나, 진동 밴드를 분리하거나, 제어 루프에서 노이즈를 억제하는 가장 일반적인 빌딩 블록입니다. 여기서 설계를 시도해 보세요, 크기와 위상을 함께 확인한 후, 자체 하드웨어에서 계수와 C 코드를 검증해 보세요.
제한 사항
제어 루프의 안정성 마진을 저하시키는 위상 지연; 루프 내 필터를 적용하기 전에 위상 마진을 재계산하십시오. 고정 소수점에서 계수 양자화는 low f0/fs 비율에서 폴을 단위 원으로 밀어넣습니다; 적분 폭 및 오버플로우 동작은 별도로 테스트해야 합니다. 아날로그 반음성 필터를 대체하지 않습니다: aliasing은 ADC 전에 방지되어야 합니다.
참고문헌
R. Bristow-Johnson, “Cookbook formulae for audio EQ biquad filter coefficients” (W3C Audio EQ Cookbook) · A. V. Oppenheim, R. W. Schafer, Discrete-Time Signal Processing, 3rd ed., ch. 6–7 · S. Butterworth, “On the Theory of Filter Amplifiers”, 1930
교육용 모델. 기계를 진단하거나 안전한 운영 한계를 확정하기에 결과가 충분하지 않습니다.