The filter coefficients are supplied to the FIR Compiler using a coefficient file with a .coe extension. This is an ASCII text file with a single-line header that defines the radix of the number representation used for the coefficient data, followed by the coefficient values themselves. This is shown in the following code example for an N-tap filter.
Complex coefficients use an interleaved representation where real and imaginary
parts alternate: , and so on. The a(0)_real, a(0)_imag, a(1)_real,
a(1)_imag_real/_imag labels are for
illustration; only numerical values need to be provided.
radix=coefficient_radix;
coefdata=
a(0),
a(1),
a(2),
…,
a(N-1);
The filter coefficients can be supplied as integers in either base-10, base-16, or base-2 representation. This corresponds to coefficient_radix=10, coefficient_radix=16, and coefficient_radix=2 respectively. Alternatively, the coefficients can be entered as real numbers (specified to a minimum of one decimal place) in base-10 only. If you enter signed negative symmetric hexadecimal coefficients, each value needs to be sign-extended to the boundary of the most significant nibble or hex character. This ensures that coefficient structure inference can be performed correctly (this includes Hilbert transform filter types, which are also negative symmetric). Complex coefficients use an interleaved representation where real and imaginary parts alternate: a(0)_real, a(0)_imag, a(1)_real, a(1)_imag, and so on (the _real/_imag labels are for illustration; only numerical values need to be provided).
The follow code example shows how the coefficient values can also be placed on a single line.
radix=coefficient_radix;
coefdata=a(0),a(1),a(2),…,a(N-1);