1、CIC滤波器学习笔记学习笔记: CIC filter及其matlab实现References:1 Understanding cascaded integrator-comb filters By Richard Lyons, Courtesy of Embedded Systems Programming URL: .com/articles/article10028.html 2 Example of Cascaded Integrator Comb filter in Matlab 3 Digital Signal Processing Principles, Algorithms an
2、d Applications , John G. Proakis, Dimitris G. ManolakisCIC数字滤波器是窄带低通滤波器的高计算效率的实现形式,常常被嵌入到现代通信系统的抽取和插值模块的硬件实现中。CIC filter 应用 CIC滤波器非常适合用作抽取之前的抗混迭滤波和插值之后的抗镜像滤波。这两种应用都跟very high-data-rate滤波有关,例如现代无线系统中硬件正交调制和解调,以及delta-sigma A/D 和 D/A 转换器。Figure 1: CIC filter applications 因为CIC滤波器的幅频响应包络象sin(x)/x,通常在CI
3、C滤波器之前或者之后都有一个high-performance linear-phase lowpass tapped-delay-line FIR filters, 用于补偿CIC滤波器不够平坦的通带。CIC滤波器不需要乘法运算,易于硬件实现。抽取CIC滤波器只不过是滑动平均滤波器的一个非常高效的迭代实现,有NR taps, 其输出再进行 R 抽取 . 同样,插值CIC滤波器在每两个输入采样之间插入R -1个0,然后通过一个NR -tap的工作在输出采样率?s ,out 的滑动平均滤波器。对于高采样率转换率的抽取和插值来说,Figure 1所示的级联形式的计算量大大低于单一FIR滤波器的计算量
4、。Recursive running-sum filter Figure 2: D-point averaging filters Figure 2a是标准的D-point moving-average 处理,需要D-1次加法运算和1次乘法运算。时域表达式:Equation 1 z域表达式:Equation 2 z域传递函数:Equation 3 Figure 2b: 迭代running-sum filter,等价于figure 2a.y(n) = 1/D * x(n) + x(n-1) + + x(n-D+1)y(n-1) = 1/D * x(n-1) + x(n-2) + x(n-D+1)
5、 + x(n-D)y(n) y(n-1) = 1/D * x(n) x(n-D)Equation 4 z域传递函数:Equation 5 Equation 3 和 Equation 5 本质是一样的。Equation 3 是非递归表达式,equation 5是递归表达式。不考虑delay length D的话,递归形式只需要一个加法和一个减法运算。例子:figure 1a的matlab实现,滑动平均滤波器,忽略scale factor% Moving Average filter N = 10; %延时 xn = sin(2*pi*0:.1:10); %n=0:1:100; sin(2*pi*
6、f*t)=sin(2*pi*f*T*n)=f=1Hz, fs=10Hz. hn = ones(1,N); %脉冲响应 y1n = conv(xn,hn); % transfer function of Moving Average filter hF = fft(hn,1024); plot(-512:511/1024, abs(fftshift(hF); xlabel(Normalized frequency) ylabel(Amplitude) title(frequency response of Moving average filter) Figure 1c的matlab实现% Im
7、plementing Cascaded Integrator Comb filter with the % comb section following the integrator stage N = 10; delayBuffer = zeros(1,N); intOut = 0; xn = sin(2*pi*0:.1:10); for ii = 1:length(xn) % comb section combOut = xn(ii) delayBuffer(end); delayBuffer(2:end) = delayBuffer(1:end-1); delayBuffer(1) =
8、xn(ii); % integrator intOut = intOut + combOut; y2n(ii) = intOut; end err12 = y1n(1:length(xn) y2n; err12dB = 10*log10(err12*err12/length(err12) % identical outputs close all 先integrator后comb的实现% Implementing Cascaded Integrator Comb filter with the % integrator section following the comb stage N =
9、10; delayBuffer = zeros(1,N); intOut = 0; xn = sin(2*pi*0:.1:10); for ii = 1:length(xn) % integrator intOut = intOut + xn(ii); % comb section combOut = intOut delayBuffer(end); delayBuffer(2:end) = delayBuffer(1:end-1); delayBuffer(1) = intOut; y3n(ii) = combOut; end err13 = y1n(1:length(xn) y3n; er
10、r13dB = 10*log10(err13*err13/length(err13) % identical outputsCIC filter structures Figure 2c: the classic form of 1st-order CIC filter, 忽略figure 2b中的1/D因子。其中前馈部分称为comb section, 其differential delay 是D;反馈部分称为积分器。差分方程:Equation 6Equation 7Figure 3: Single-stage CIC filter time-domain responses when D =
11、 5 Figure 2c这个1阶CIC滤波器看做是2部分的级联。Figure 3a是comb stage的脉冲响应,figure 3b是积分器的脉冲响应,figure 3c是整个系统的脉冲响应。系统的脉冲响应是一个矩形序列,等价于moving-average filter和recursive running-sum filter的单位脉冲响应,仅仅相差一个常数的scale factor。Figure 4: Characteristics of a single-stage CIC filter when D = 51阶CIC滤波器的频率响应,Equation 7在单位圆上的z变换:Equati
12、on 8Equation 9 If we ignore the phase factor in Equation 9, that ratio of sin() terms can be approximated by a sin(x )/x function. This means the CIC filters frequency magnitude response is approximately equal to a sin(x )/x function centered at 0Hz as we see in Figure 4a. (This is why CIC filters a
13、re sometimes called sinc filters.)虽然在单位圆上有极点,但是CIC滤波器的系数都是1,滤波器系数没有量化误差,因此CIC滤波器并不存在通常滤波器因在单位圆上有极点而导致的风险。虽然有递归,但是CIC滤波器是稳定的,线性相位的,有有限长度的脉冲响应。在0Hz处(DC),CIC滤波器增益等于comb滤波器delay D.CIC 滤波器在抽取和插值中的应用 Figure 5: Single-stage CIC filters used in decimation and interpolation 大多数的CIC滤波器的rate change R等于comb的差分延时D.Figure 6: Magnitude response of a 1st-order, D = 8, decimating CIC filter: before decimation; aliasiing after R = 8 decimation
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1