FIR filter coefficient (with COE file)

hey,

I'm using the Xilinx CoreGenerator for the first time because i need a FIR filter and saw the DA FIR in the IPCore library and found it really usefull in this design. The only problem is dat i don't find how to generate a COE file? So i don't know how to turn a floating point coefficients (which i found through firdes or matlab) into a COE file?

thanx in advance,

kind regards,

Yttrium

Reply to
Yttrium
Loading thread data ...

formatting link

If you can't use coewrite from Matlab, then use this format...

; ; XILINX CORE Generator(tm) Distributed Arithmetic FIR filter ; coefficient (.COE) File ; Generated by MATLAB(tm) and the Filter Design Toolbox. ; ; Generated on: 15-Mar-2002 13:47:15 ; Radix = 10; Coefficient_Width = 16; CoefData = -41, -851, -366, 308, 651, 22, -873, -658, 749, 1504, 21,

-2367,

-2012, 3014, 9900, ....

Reply to
Ben Howe

The Active-HDL simulator has the similar built-in FIR core generator which accepts the floating point coefficients.

Regards, A.Ser.

Reply to
Vladislav Vasilenko

scale your numbers to integer, the coef width depends on the resolution(decimal points)you wish.

Reply to
ccon

=_NextPart_000_0027_01C3F3EF.5DB915D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

wo when i have 0.002100205514 as a coefficient i enter it in the COE = file as 2100205514 with the radix=3D10 and the width as i want it to be = (with changing the coefficient to the size that it can fit the width!)?

greetings,

Yttrium =20

Reply to
Yttrium

yup, it's something like that, and it also depends on max/min range of your coefficients. For the number in your example you will need 32 bit coe, and if your coef is signed you will need 1 more bit. In practical you may reduce your resolution to fit in smaller device. Generally speaking, you may ask yourself what kind of device you can afford? what is your data width? howmany taps? and what kind of FIR?...

Reply to
Marlboro

thanx, have made a script (thanx to a post by R Andraka where he mentioned some interesting matlab functions) in matlab and i found my coefficient and the FIR is up and running ;-)

thanx

yttrium

Reply to
Yttrium

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.