我从ti例程上下载的28035的例子C:\tidcs\c28\DSP2803x\v121\DSP2803x_examples\cla_adc,其中有cla.asm里边有个数字滤波器,我想问下,这个滤波器是什么滤波器,表达式如何写。
有哪位大侠来给解答一下啊
user3900194:
怎么没有大侠出来帮助一下呢
我从ti例程上下载的28035的例子C:\tidcs\c28\DSP2803x\v121\DSP2803x_examples\cla_adc,其中有cla.asm里边有个数字滤波器,我想问下,这个滤波器是什么滤波器,表达式如何写。
有哪位大侠来给解答一下啊
user3900194:
回复 user3900194:
大侠们来支持一下,例程如下:
_X4 .set _X+8_X3 .set _X+6_X2 .set _X+4_X1 .set _X+2_X0 .set _X+0
_A4 .set _A+8_A3 .set _A+6_A2 .set _A+4_A1 .set _A+2_A0 .set _A+0
; CLA 5-tap FIR Filter;; Coefficients A[0, 1, 2, 3, 4]; Data X[0, 1, 2, 3, 4] (Delay Line – X[0] is newest value);; Equations;; Y = A4 * X4 First Calculation of sum of products.; X4 = X3 X4 can now be updated, because it has been used.; Y = Y + A3 * X3 Second product, 1st add.; X3 = X2 X3 update; Y = Y + A2 * X2 Third product, 2nd add.; X2 = X1; Y = Y + A1 * X1 Fourth product, 3rd add.; X1 = X0; Y = Y = A0 * X0; MMOV32 MR0,@_X4 ;1 Load MR0 with X4 MMOV32 MR1,@_A4 ;2 Load MR1 with A4 MNOP ;3 Wait till I8 to read result MNOP ;4 Wait till I8 to read result MNOP ;5 Wait till I8 to read result MNOP ;6 Wait till I8 to read result MNOP ;7 Wait till I8 to read result MUI16TOF32 MR2, @_AdcResult.ADCRESULT1 ;8 Read ADCRESULT1 and convert to float
MMPYF32 MR2, MR1, MR0 ; MR2 (Y) = MR1 (A4) * MR0 (X4) || MMOV32 @_X0, MR2
MMOVD32 MR0,@_X3 ; Load MR0 with X3, Load X4 with X3 MMOV32 MR1,@_A3 ; Load MR1 with A3
MMPYF32 MR3, MR1, MR0 ; MR3 (Y) = MR1 (A3) * MR0 (X3) || MMOV32 MR1,@_A2 ; Load MR1 with A2 MMOVD32 MR0,@_X2 ; Load MR0 with X2, Load X3 with X2
MMACF32 MR3, MR2, MR2, MR1, MR0 ; MR3 = A3*X3 + A4*X4 || MMOV32 MR1,@_A1 ; MR2 = MR1 (A2) * MR0 (X2) MMOVD32 MR0,@_X1 ; Load MR0 with X1, Load X2 with X1
MMACF32 MR3, MR2, MR2, MR1, MR0 ; MR3 = A2*X2 + (A3*X3 + A4*X4) || MMOV32 MR1,@_A0 ; MR2 = MR1 (A1) * MR0 (X1) MMOVD32 MR0,@_X0 ; Load MR0 with X0, Load X1 with X0
MMACF32 MR3, MR2, MR2, MR1, MR0 ; MR3 = A1*X1 + (A2*X2 +A3*X3 + A4*X4) || MMOV32 MR1,@_A0 ; MR2 = MR1 (A0) * MR0 (X0)
MADDF32 MR3, MR3, MR2 ; MR3 = A0*X0 + (A1*X1 + A2*X2 +A3*X3 + A4*X4)
MF32TOUI16 MR2, MR3 ; Get back to Uint16 valueMMOV16 @_VoltFilt, MR2 ; Output MSTOP ; End task MNOP MNOP MNOP_Cla1T7End: