Filter Design Toolbox    
coewrite

Write a Xilinx CORE GeneratorTM coefficient (.COE) file

Syntax

Description

coewrite(hq) 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 quantized filter object hq. Your quantized filter must be a direct-form FIR structure with one section. You cannot export nonquantized filters as .coe files, nor multiple-section filters. To enable you to provide a name for the file, coewrite displays a dialog where you fill in the file name. If you do not specify the name of the output file, the default file name is untitled.coe.

coewrite(hq,radix) indicates the radix (number base) used to specify the FIR filter coefficients. Valid radix values are 2 for binary, 10 for decimal, and 16 for hexadecimal (default).

coewrite(...,filename) writes a XILINX.COE file to filename. If you omit the file extension, coewrite adds the .coe extension to the name of the file.

Examples

coewrite generates an ASCII text file that contains the filter coefficents in a format the XILINX CORE Generator can read and load. In this example, you create a 30th-order quantized filter and generate the .coe file that include the filter coefficients as well as associated information about the filter.

when you look at mycoefile.coe, you see the following:

coewrite puts the filter coefficients in column-major order and reports the radix, the coefficient width, and the coefficients. These represent the minimum set of data needed in a .coe file.

See Also
coeread


  coeread convergent