数字音频重采样

  • A+
所属分类:音频杂谈

1. 什么是有限带宽插值(Bandlimited Interpolation)

        在数字信号处理中,作用于离散时间信号的有限带宽插值是一个得到广泛应用的基本工具。一般而言,我们所面临的问题是,给定一系列离散时间信号幅度样本,如何利用它们正确地计算出任意连续时间的样本幅度值。换句话说,我们必须能够在这些离散信号之间进行插值。由于原始信号总是被假定为有限带宽的——采样率的二分之一(否则在采样的过程中会发生折叠失真(aliasing distortion)),因此根据香农采样定理,利用有限带宽插值对采样点进行处理将可以正确和唯一地还原到原始的信号。
        有很多方法都可以对离散点进行插值。例如,拉格朗日插值定理(Lagrange interpolation)就是一种经典的插值方法,它可以从N+1个点中构造出一个N次多项式。
        还有一些其它的插值方法,如三次样条曲线(cubic spline)插值法和贝塞尔曲线(Bezier splines)插值法等等。
        上面这些提到的方法适用于图形和其它问题的处理,但是对于数字音频处理来说它们不是理想的。在数字音频中,最要紧的是可听样本之间的采样误差(audibility of interpolation error between samples)。香农定理告诉我们,从离散的采样点恢复原始信号是完全可能的,因此最佳的数字音频插值方法应当尽可能地依据香农定理的理论,这样的“理想”插值方法被称为有限带宽插值。

2. 工作原理(Theory of Operation)

2.1 摘要

        这篇指南讲述了一种对离散时间信号进行有限带宽插值的技术,该技术支持对任意时刻信号求值,并且对于平稳变化采样率表现良好。该方法是基于在一个滤波器系数表中进行内插查找,以使得滤波器冲击响应在连续时间形式上有效。一个已经预先计算好的滤波器表将被用于处理所有的插值时间和采样率转换比率。下面也会给出一些公式来确定查找表的大小,以满足给定的精度要求。
        This tutorial describes a technique for bandlimited interpolation of discrete-time signals which supports signal evaluation at an "arbitrary" time, and which performs well for smmothly changing sampling rates, such as needed for digital audio "scrubbing." The method is based on interpolated look-up in a table of filter coefficients, so as to make the filter impulse response available effectively in continuous-time form. A single pre-computed filter table handles all interpolation times and sampling-rate conversion ratios. Formulas are given for determinning the look-up table size needed for a given precision requirement.

2.2 理想有限带宽插值理论(Theory of Ideal Bandlimited Interpolation)

        我们来简单回顾一下采样速率转换中的“模拟插值法”,这也是现有方法实现的根基。假设我们拥有连续可积信号x(t)的一组采样值x(nTs),其中t代表时间(按秒计),n取值为整数,Ts为采样周期。假设x(t)被带宽限制在±Fs/2,其中Fs=1/Ts是采样频率。如果X(ω)代表x(t)的傅里叶变换,那么,
假设对于|ω| ≥ πFsX(ω) = 0。那么,香农的采样理论告诉我们,通过这些采样信号值,连续信号x(t)将可以被唯一地重新构建:
其中,
为了将x(t)重采样到一个新的频率F′s = 1 / T′s,我们只需要选取时间为T's的整数倍的取值点重新计算公式(1)即可。
        当新的采样率F's比原来的采样率Fs小时,低通截止必须低于新的更低的采样率的一半(the lowpass cutoff must be placed below half the new lower sampling rate)。因此,在理想低通的情形下,hs(t) = min{1, F's/Fs}sinc(min{Fs, F's}t),其中比例因子在通带内将会保持单位增益。
        sinc函数sinc(t) ≈ sin(πt) / (πt)的图形如图1所示。注意该函数的峰值为幅度1,并且对于所有的非0整数t,sinc(t) = 0。
        如果“※”代表数字信号的卷积操作,那么等式(1)所代表的加法可以被重新书写为(x ※ hs)(t)
        公式(1)可以被理解为移位缩放后的一系列sinc函数hs的叠加和。一个sinc函数的实例被转换到每一个信号采样点并且被该采样点缩放,然后所有的这些实例将会加到一起。注意sinc(z)的所有过零点发生在除了z=0以外的所有整数点上,这意味着在时刻t = nTs,只有x(nTs)对于加权和有唯一贡献。因此,正是通过现有的这些采样点使得内插可行。
        Equation Eq.(1) can be interpreted as a superposition of shifted and scaled sinc functions hs. A sinc function instance is translated to each signal sample and scaled by that sample, and the instances are all added together. Note that zero-crossings of sinc(z) occur at all integers except z = 0. That means at time t = nTs, (i.e., on a sample instant), the only contribution to the sum is the single sample x(nTs). All other samples contribute sinc functions which have a zero-crossing at time t = nTs. Thus, the interpolation goes precisely through the existing samples, as it should.
        一幅图说明sinc函数是如何相互叠加以获得原始有限带宽信号的,如图2。图中展示了五个sinc函数的相互叠加,每个函数都具有单位幅度,并且以一个采样点为间隔。这些sinc函数可以被用于重构离散时间信号x = [..., 0, 1, 1, 1, 1, 1, 0,...].的有限带宽插值点。注意在时刻t = nTs,实线将正好穿过对应于该时刻的采样点:
        A plot indicating how sinc functions sum together to reconstruct bandlimited signals is shown in Fig.2. The figure shows a superposition of ifve sinc functions, each at unit amplitude, and displaced by one-sample intervals. These sinc functions would be used to reconstruct the bandlimited interpolation of the discrete-time signal x = [..., 0, 1, 1, 1, 1, 1, 0,...]. Note that at each sampling instant t = nTs, the solid line passes exactly through the tip of the sinc function for that sample.
        第二种公式(1)的解释如下:(实在不知道该如何翻译了,原文如下)
        A second interpretation of Eq.(1) is as follows: to obtain the interpolation at time t, shift the signal samples under one sinc function so that time t in the signal is translated under the peak of the sinc function, then create the output as a linear combination of signal samples where the coefficient of each signal sample is given by the value of the sinc function at the location of each sample. That this interpretation is equivalent to the first can be seen as a aresult of the fact that convolution is commutative; in the first interpretation, all signal samples are used to form a linear combination of shifted sinc functions, while in the second interpretation, samples from one sinc function are used to form a linear combination of samples of the shifted input signal. The practical bandlimited interpolation algorithm presented below is based on the second interpretation.

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: