CIC滤波器学习笔记.docx

上传人:b****6 文档编号:4061360 上传时间:2022-11-27 格式:DOCX 页数:16 大小:372.96KB
下载 相关 举报
CIC滤波器学习笔记.docx_第1页
第1页 / 共16页
CIC滤波器学习笔记.docx_第2页
第2页 / 共16页
CIC滤波器学习笔记.docx_第3页
第3页 / 共16页
CIC滤波器学习笔记.docx_第4页
第4页 / 共16页
CIC滤波器学习笔记.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

CIC滤波器学习笔记.docx

《CIC滤波器学习笔记.docx》由会员分享,可在线阅读,更多相关《CIC滤波器学习笔记.docx(16页珍藏版)》请在冰豆网上搜索。

CIC滤波器学习笔记.docx

CIC滤波器学习笔记

学习笔记:

CICfilter及其matlab实现

References:

[1]Understandingcascadedintegrator-combfilters–ByRichardLyons,CourtesyofEmbeddedSystemsProgrammingURL:

http:

//www.us.design-

[2]ExampleofCascadedIntegratorCombfilterinMatlab

[3]DigitalSignalProcessing–Principles,AlgorithmsandApplications,JohnG.Proakis,DimitrisG.Manolakis

CIC数字滤波器是窄带低通滤波器的高计算效率的实现形式,常常被嵌入到现代通信系统的抽取和插值模块的硬件实现中。

CICfilter应用

CIC滤波器非常适合用作抽取之前的抗混迭滤波和插值之后的抗镜像滤波。

这两种应用都跟veryhigh-data-rate滤波有关,例如现代无线系统中硬件正交调制和解调,以及delta-sigmaA/D和D/A转换器。

Figure1:

CICfilterapplications

因为CIC滤波器的幅频响应包络象sin(x)/x,通常在CIC滤波器之前或者之后都有一个high-performancelinear-phaselowpasstapped-delay-lineFIRfilters,用于补偿CIC滤波器不够平坦的通带。

CIC滤波器不需要乘法运算,易于硬件实现。

抽取CIC滤波器只不过是滑动平均滤波器的一个非常高效的迭代实现,有NRtaps,其输出再进行R抽取.同样,插值CIC滤波器在每两个输入采样之间插入R-1个0,然后通过一个NR-tap的工作在输出采样率ƒs,out的滑动平均滤波器。

对于高采样率转换率的抽取和插值来说,Figure1所示的级联形式的计算量大大低于单一FIR滤波器的计算量。

Recursiverunning-sumfilter

Figure2:

D-pointaveragingfilters

Figure2a是标准的D-pointmoving-average处理,需要D-1次加法运算和1次乘法运算。

时域表达式:

Equation1

z域表达式:

Equation2

z域传递函数:

Equation3

Figure2b:

迭代running-sumfilter,等价于figure2a.

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)+x(n-D)]

y(n)–y(n-1)=1/D*[x(n)–x(n-D)]

Equation4

z域传递函数:

Equation5

Equation3和Equation5本质是一样的。

Equation3是非递归表达式,equation5是递归表达式。

不考虑delaylengthD的话,递归形式只需要一个加法和一个减法运算。

例子:

figure1a的matlab实现,滑动平均滤波器,忽略scalefactor

%MovingAveragefilter

N=10;%延时

xn=sin(2*pi*[0:

.1:

10]);%n=[0:

1:

100];sin(2*pi*f*t)=sin(2*pi*f*T*n)=>f=1Hz,fs=10Hz.

hn=ones(1,N);%脉冲响应

y1n=conv(xn,hn);

%transferfunctionofMovingAveragefilter

hF=fft(hn,1024);

plot([-512:

511]/1024,abs(fftshift(hF)));

xlabel(’Normalizedfrequency’)

ylabel(’Amplitude’)

title(’frequencyresponseofMovingaveragefilter’)

Figure1c的matlab实现

%ImplementingCascadedIntegratorCombfilterwiththe

%combsectionfollowingtheintegratorstage

N=10;

delayBuffer=zeros(1,N);

intOut=0;

xn=sin(2*pi*[0:

.1:

10]);

forii=1:

length(xn)

%combsection

combOut=xn(ii)–delayBuffer(end);

delayBuffer(2:

end)=delayBuffer(1:

end-1);

delayBuffer

(1)=xn(ii);

%integrator

intOut=intOut+combOut;

y2n(ii)=intOut;

end

err12=y1n(1:

length(xn))–y2n;

err12dB=10*log10(err12*err12′/length(err12))%identicaloutputs

closeall

先integrator后comb的实现

%ImplementingCascadedIntegratorCombfilterwiththe

%integratorsectionfollowingthecombstage

N=10;

delayBuffer=zeros(1,N);

intOut=0;

xn=sin(2*pi*[0:

.1:

10]);

forii=1:

length(xn)

%integrator

intOut=intOut+xn(ii);

%combsection

combOut=intOut–delayBuffer(end);

delayBuffer(2:

end)=delayBuffer(1:

end-1);

delayBuffer

(1)=intOut;

y3n(ii)=combOut;

end

err13=y1n(1:

length(xn))–y3n;

err13dB=10*log10(err13*err13′/length(err13))%identicaloutputs

CICfilterstructures

Figure2c:

theclassicformof1st-orderCICfilter,忽略figure2b中的1/D因子。

其中前馈部分称为combsection,其differentialdelay是D;反馈部分称为积分器。

差分方程:

Equation6

Equation7

Figure3:

Single-stageCICfiltertime-domainresponseswhenD=5

Figure2c这个1阶CIC滤波器看做是2部分的级联。

Figure3a是combstage的脉冲响应,figure3b是积分器的脉冲响应,figure3c是整个系统的脉冲响应。

系统的脉冲响应是一个矩形序列,等价于moving-averagefilter和recursiverunning-sumfilter的单位脉冲响应,仅仅相差一个常数的scalefactor。

Figure4:

Characteristicsofasingle-stageCICfilterwhenD=5

1阶CIC滤波器的频率响应,Equation7在单位圆上的z变换:

Equation8

Equation9

IfweignorethephasefactorinEquation9,thatratioofsin()termscanbeapproximatedbyasin(x)/xfunction.ThismeanstheCICfilter'sfrequencymagnituderesponseisapproximatelyequaltoasin(x)/xfunctioncenteredat0HzasweseeinFigure4a.(ThisiswhyCICfiltersaresometimescalledsincfilters.)

虽然在单位圆上有极点,但是CIC滤波器的系数都是1,滤波器系数没有量化误差,因此CIC滤波器并不存在通常滤波器因在单位圆上有极点而导致的风险。

虽然有递归,但是CIC滤波器是稳定的,线性相位的,有有限长度的脉冲响应。

在0Hz处(DC),CIC滤波器增益等于comb滤波器delayD.

CIC滤波器在抽取和插值中的应用

Figure5:

Single-stageCICfiltersusedindecimationandinterpolation

大多数的CIC滤波器的ratechangeR等于comb的差分延时D.

Figure6:

Magnituderesponseofa1st-order,D=8,decimatingCICfilter:

beforedecimation;aliasiingafterR=8decimation

ƒs,out=ƒs,in/R

Thespectralband,ofwidthB,centeredat0Hzisthedesiredpassbandofthefilter.

AkeyaspectofCICfiltersisthespectralfoldingthattakesplaceduetodecimation.

假设CIC的输入信号的频谱是在[-ƒs,in/2,ƒs,in/2]上的方波,那么经过CIC滤波器以后的输出信号的频谱如figure6a绿色的包络所示。

我们知道,在8分之一下采用的情况下,ƒs,out/2是下采用后信号的频域边界,即ƒs,in/16。

下采样后信号频域范围是[-ƒs,out/2,ƒs,out/2],即是[-ƒs,in/16,ƒs,in/16],带宽为ƒs,in/8。

采样前信号在ƒs,in/8的整数倍为中心频率,宽度为ƒs,in/8的频谱都会混迭到下采样后的信号频带内。

虽然下采样后信号的ƒs,in/8频带都被混迭了,由于我们真正关心的是以0hz为中心,带宽为B的一段频带,在这个频带外的频谱不需要考虑。

Figure6a中用阴影表示了将要被混迭且影响目标频带的频谱。

Figure6b是对混迭后(下采样后)目标频带的频谱混迭情况。

Figure7:

1st-order,D=R=8,interpolatingCICfilterspectra:

inputspectrum;outputspectralimages

Figure7a是一个任意的基带频谱和它的由于8倍插值而产生的在ƒs,in整数倍上的频谱复制。

Figure7b是滤波器的输出频谱,反映了不完美的滤波引入的不需要的频谱镜像。

在CIC滤波器后连接一个传统的lowpasstapped-delay-lineFIR滤波器,如果这个滤波器的阻带包含第一个频谱镜像,那么可以很好的滤除这些频谱镜像。

ImprovingCICattenuation

Figure8:

3rd-orderCICdecimationfilterstructure,andmagnituderesponsebeforedecimationwhenD=R=8

Equation10

提高抗混迭衰减的代价是增加了硬件加法器的使用,同时还增加了通带的弯曲下垂。

另外,增加滤波器阶数会影响到滤波器增益,滤波器增益跟阶数成指数关系。

因为为保持稳定,CIC分不清通常需要全精度,加法器的bit数为Mlog2(D),这意味着高滤波器阶数需要大的数据位宽。

即使如此,多级实现形式在商用集成电路中是很常用的,M阶的CIC滤波器常称为sincM滤波器。

BuildingaCICfilter

Figure9:

Single-stageCICfilterimplementations:

fordecimation;forinterpolation

通常将CIC滤波器的comb部分放在低采样率区域来减少用于存储delay的存储器的size.

Figure10:

CICdecimationfilterresponses:

forvariousvaluesofdifferentialdelayN,whenR=8;fortwodecimationfactorswhenN=2

那些采样率比高的采样率转换,其comb部分的差分延时的设计参数N的典型值是1或2。

N有效的决定了抽取滤波器频率响应中零点的个数。

如Figure10a所示。

CIC抽取滤波器的一个重要特征是:

在N一定的情况下,对于不同的抽取率R,滤波器响应的形状变化很小,如图figure10b所示。

当R大于16时,变化可以忽略不计。

因此不同抽取率的系统可以用同样的补偿FIR滤波器。

CIC滤波器在每个积分部分有unityfeedback,因此它遭受寄存器溢出之扰。

不过只有满足下面2个条件,溢出没有影响。

·therangeofthenumbersystemisgreaterthanorequaltothemaximumvalueexpectedattheoutput,and

·thefilterisimplementedwithtwo'scomplement(nonsaturating)arithmetic.

因为一阶CIC滤波器在0Hz(DC)的增益D=NR,McascadedCICdecimationfiltershaveanetgainof(NR)M.每一级积分器必须增加NRbitswidth.插值CIC滤波器在每2个采样值之间插入零,这降低了增益,因子为1/R,因此插值CIC滤波器的整体增益为(NR)M/R.因为必须用整数运算,每一级字宽必须要能够容纳这一级的最大信号(full-scale输入乘以增益)。

虽然Mth-orderCICdecimationfilter得增益是(NR)M,individualintegratorscanexperienceoverflow.(TheirgainisinfiniteatDC.)Assuch,theuseoftwo'scomplementarithmeticresolvesthisoverflowsituationjustsolongastheintegratorwordwidthaccommodatesthemaximumdifferencebetweenanytwosuccessivesamples(inotherwords,thedifferencecausesnomorethanasingleoverflow).Usingthetwo'scomplementbinaryformat,withitsmodularwrap-aroundproperty,thefollow-oncombfilterwillproperlycomputethecorrectdifferencebetweentwosuccessiveintegratoroutputsamples.

对于插值器,字宽在每一级comb滤波器会增加一个bit,因为积分器具有的累积特性,必须避免溢出。

因此,必须在每一级comb滤波器增加一个bit的字宽给插值用。

也可以不增加字宽而是丢弃每一级comb滤波器的LSB,这样会增加滤波器输出的noise.

Compensationfilters

在典型的抽取/插值滤波器应用中,我们需要滤波器具有合理的平坦的通带和窄的过渡带。

CIC滤波器自身不能够满足这样的需求,因为它的弯曲的通带增益和宽的过渡带。

例如在抽取器中,在CIC滤波器之后级联一个补偿非递归FIR滤波器可以缓解这个问题,如figure1a所示。

Figure11:

CompensationFIRfilterresponses;witha1st-orderdecimationCICfilter;witha3rd-orderdecimation

Figure11a:

简单的3-tapFIR滤波器[-1/16,9/8,-1/16].来补偿1st-orderR=8CICfilter。

Figure11b:

15-tapcompensationFIRfilterhavingthecoefficients[-1,4,-16,32,-64,136,-352,1312,-352,136,-64,32,-16,4,-1]来补偿3rd-orderR=8CICfilter.

ThosedashedcurvesinFigure11representthefrequencymagnituderesponsesofcompensatingFIRfilterswithinwhichnosample-ratechangetakesplace.(TheFIRfilters'inputandoutputsampleratesareequaltotheƒs,outoutputrateofthedecimatingCICfilter.)IfacompensatingFIRfilterweredesignedtoprovideanadditionaldecimationbytwo,itsfrequencymagnituderesponsewouldlooksimilartothatinFigure12,where>s,inisthecompensationfilter'sinputsamplerate.

Figure12:

Frequencymagnituderesponseofadecimate-by-2compensationFIRfilter

Advancedtechniques

抽取CIC滤波器只不过是滑动平均滤波器的一个非常高效的迭代实现,有NRtaps,其输出再进行R抽取.同样,插值CIC滤波器在每两个输入采样之间插入R-1个0,然后通过一个NR-tap的工作在输出采样率ƒs,out的滑动平均滤波器。

对于高采样率转换率的抽取和插值来说,Figure1所示的级联形式的计算量大大低于单一FIR滤波器的计算量。

下图与figure9a相同,下面是下图中两种方式的matlab实现

%Fordecimation,havingtheCICfilteringbeforetakingeveryothersample

D=2;%decimationfactor

N=10;%delaybufferdepth

delayBuffer=zeros(1,N);%init

intOut=0;

xn=sin(2*pi*[0:

.1:

10]);

y6n=[];

forii=1:

length(xn)

%combsection

combOut=xn(ii)–delayBuffer(end);

delayBuffer(2:

end)=delayBuffer(1:

end-1);

delayBuffer

(1)=xn(ii);

%integrator

intOut=intOut+combOut;

y6n=[y6nintOut];

end

y6n=y6n(1:

D:

end);%takingeveryothersample–decimation

%ForefficienthardwareimplementationoftheCICfilter,havingthe

%integratorsectionfirst,decimate,thenthecombstage

%Gain:

ReducedthedelaybufferdepthofcombsectionfromNtoN/D

D=2;%decimationfactor

N=10;%delaybufferdepth

delayBuffer=zeros(1,N/D);

intOut=0;

xn=sin(2*pi*[0:

.1:

10]);%input

y7n=[];%output

forii=1:

length(xn)

%integrator

intOut=intOut+xn(ii);

ifmod(ii,2)==1

%combsection

combOut=intOut–delayBuffer(end);

delayBuffer(2:

end)=delayBuffer(1:

end-1);

delayBuffer

(1)=intOut;

y7n=[y7ncombOut];

end

end

err67=y6n–y7n;

err67dB=10*log10(err67*err67′/length(err67))

下图跟figure9b相同,下面是下图2中形式的matlab实现

%Forinterpolation,insertthezerosfollowe

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育 > 政史地

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1