Write Xilinx COE file
coewrite(hd) writes a
XILINX Distributed Arithmetic FIR filter coefficient .COE file which
can be loaded into the XILINX CORE Generator. The coefficients are
extracted from the fixed-point
Your fixed-point filter must be a direct form FIR structure
with one section and whose
is set to
fixed. You cannot export single-precision,
double-precision, or floating-point filters as
nor multiple-section filters. To enable you to provide a name for
coewrite displays a dialog box where
you fill in the file name. If you do not specify the name of the output
file, the default file name is
the radix (number base) used to specify the FIR filter coefficients.
radix values are
10 for decimal, and
a XILINX.COE file to
filename. If you omit the
coewrite adds the .
to the name of the file.
coewrite function always generates the
XILINX.COE file in your current folder. To use this function, you
must have write permission in your current folder.
coewrite generates an ASCII text file that
contains the filter coefficients in a format the XILINX CORE Generator
can read and load. In this example, you create a 30th-order fixed-point
filter and generate the .
coe file that includes
the filter coefficients as well as associated information about the
b = firceqrip(30,0.4,[0.05 0.03]); hq = dfilt.dffir(b); set(hq,'arithmetic','fixed'); coewrite(hq,10,'mycoefile');
coewrite function generates the output
mycoefile.coe, in your current folder. The
coe file contains the radix, coefficient width,
and filter coefficients. The file reports the filter coefficients
in column-major order. The radix, coefficient width, and filter coefficients
are the minimum set of data needed in a .