Filter Design Toolbox | ![]() ![]() |
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:
; ; 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, ....
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 | ![]() |