From : http://www.earlevel.com/main/2003/02/28/biquads/

    One of the most-used filter forms is the biquad. A biquad is a second order (two poles and two zeros) IIR filter. It is high enough order to be useful on its own, and—because of coefficient sensitivities in higher order filters—the biquad is often used as the basic building block for more complex filters. For instance, a biquad lowpass filter has a cutoff slope of 12 dB/octave, useful for tone controls; if you need a 24 dB/octave slope, you can cascade two biquads, and it will have less coefficient-sensitivity problems than a single fourth-order design.

Biquads come in several forms. The most obvious, a direct implementation of the second order difference equation (y[n] = a0*x[n] + a1*x[n-1] + a2*x[n-2] – b1*y[n-1] – b2*y[n-2]), called direct form I:

     Direct form I

Direct form I is the best choice for implementation in a fixed point processor because it has a single summation point (fixed point DSPs usually have an extended accumulator that allows for intermediate overflows).

We can take direct form I and split it at the summation point like this:

 

We then take the two halves and swap them, so that the feedback half (the poles) comes first:

 

Now, notice that one pair of the z delays is redundant, storing the same information as the other. So, we can merge the two pairs, yielding the direct form II configuration:

  Direct form II

 

In floating point, direct form II is better because it saves two memory locations, and floating point is not sensitive to overflow in the way fixed point math is. We can improve this a little by transposing the filter. To transpose a filter, reverse the signal flow direction—output becomes input, distribution nodes become summers, and summers become nodes. The characteristics of the filter are unchanged, but in this case it happens that the floating point characteristics are a little better. Floating point has better accuracy when intermediate sums are with closer values (adding small numbers to large number in floating point is less precise than with similar values). Here is the transposed direct form II:

     Transposed direct form II

 
Notes and recommendations

Again, direct form I is usually the best choice for fixed point, and transposed direct form II for floating point.

At low frequency settings, biquads are more susceptible to quantization error, mainly from the feedback coefficients (b1 and b2) and the delay memory. Lack of resolution in the coefficients makes precise positioning of the poles difficult, which is particularly a problem when the poles are positioned near the unit circle. The second problem, delay memory, is because multiplication generates more bits, and the bits are truncated when stored to memory. This quantization error is fed back in the filter, causing instability. 32-bit floating point is usually good enough for audio filters, but you may need to use double precision, especially at very low frequencies (for control filtering) and at high sample rates.

For fixed point filters, 24-bit coefficients and memory work well for most filters, but start to become unstable below about 300 Hz at 48 kHz sample rate (or twice that at 96 kHz). Double precision is always costly on a fixed point processor, but fortunately there is a simple technique for improving stability. Looking at the direct form I drawing, the quantization occurs when the higher precision accumulator is stored in the lower precision delay memory on the right side. By taking the quantization error (the difference between the full accumulated value and its value after storing it to memory) and adding it back in for the next sample calculation, the filter performs nearly as well as using full double precision calculations, but at a much lower computational cost. This technique is called first order noise shaping. There are higher order noise shapers, but this one works well enough to handle almost all audio needs, even at high sample rates.

Direct form I with first-order noise shaping

 

In general, 16-bit fixed point processing is not suitable for audio without double precision coefficients and computation.

Finally, biquads are just one of a DSP programmers tools—they aren’t always the best filter form. There are other filters that don’t share the biquad’s low-frequency sensitivities (in general, biquad coefficient precision is very good at high frequencies, and poor at low ones; there are other filter forms that spread the precision out more evenly, or trade off reduced high frequency performance for better low frequency performance). However, biquads are well known and design tools are plentiful, so they are usually the first choice for an IIR filter unless you find a reason to use another.

There are too many filter forms to cover, but one other filter form that is popular for synthesizers is the state variable filter. It has very excellent low frequency performance, and limitations in the high frequencies that have to be worked around, but most importantly frequency and Q coefficients are separate and easy to change for dynamic filtering. It also make a great low frequency sine wave generator.

Biquads的更多相关文章

  1. Libfilth(一个滤波器C库)使用

    Libfilth使用说明 winshton 2009年2月 (*本文大部分翻译自libfilth,还有一部分是个人使用实践 *时间水平均有限,翻译的不完整,尤其第二章可以忽略) 版本历史修改记录 版本 ...

  2. Digital biquad filter

    Direct Form 1 The most straightforward implementation is the Direct Form 1, which has the following ...

随机推荐

  1. joomla安装

    最开始我以为是我电脑反映慢.傻傻的等了很久.因为我在sae上面初始化成功了.只是差两张表而已.等了很久很久.也试了好几次.反正就是卡在创建数据表那里.突然我想到在sae初始化数据库的时候有两种模式In ...

  2. python - json/pickle

    # import json #将数据类型转换成字符串 # data = {"a":"123"} # a = json.dumps(data) # print(a ...

  3. Android NetworkInterface 的 name

    user@android:/$ ls /sys/class/net/ dummy0 lo p2p0 rev_rmnet0 rev_rmnet1 rev_rmnet2 rev_rmnet3 rmnet0 ...

  4. WGAN源码解读

    WassersteinGAN源码 作者的代码包括两部分:models包下包含dcgan.py和mlp.py, 这两个py文件是两种不同的网络结构,在dcgan.py中判别器和生成器都含有卷积网络,而m ...

  5. freeRTOS中文实用教程4--资源管理互斥

    1.前言 访问一个被多任务共享,或是被任务与中断共享的资源时,需要采用”互斥”技术以保证数据在任何时候都保持一致性.这样做的目的是要确保任务从开始访问资源就具有排它性,直至这个资源又恢复到完整状态 F ...

  6. 现代C++之理解decltype

     现代C++之理解decltype decltype用于生成变量名或者表达式的类型,其生成的结果有的是显而易见的,可以预测的,容易理解,有些则不容易理解.大多数情况下,与使用模板和auto时进行的类型 ...

  7. 通达OA系统优化-对mysql数据库减肥

    OA系统冗余数据过多,访问效率受到影响,现需要对历史数据进行一次清理,以提高OA访问速度 大的数据主要体现在流程上,流程数据主要放在flow_run,flow_run_data,flow_run_pr ...

  8. js学习、备忘

    字符串使用单引号’abc’.(双引号也行.推荐:html→双引号,js→单引号)===严格等于.!==严格不等于if(x)  当x为undefined.null和0的时候都为false:需注意当x为0 ...

  9. typeof引发的思考

    今天在群里看到一位网友提问:var status=1; typeof status 结果输出什么 我会心一笑  ,这尼玛这么简单,一看就是‘number’,结果网友说不是number,而是string ...

  10. OCM_第十五天课程:Section6 —》数据库性能调优 _SQL 访问建议 /SQL 性能分析器/配置基线模板/SQL 执行计划管理/实例限制

    注:本文为原著(其内容来自 腾科教育培训课堂).阅读本文注意事项如下: 1:所有文章的转载请标注本文出处. 2:本文非本人不得用于商业用途.违者将承当相应法律责任. 3:该系列文章目录列表: 一:&l ...