Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab FDA tool to coefficient ?

Status
Not open for further replies.

elsalvador

Member level 4
Joined
Apr 25, 2003
Messages
75
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
474
fda tool

How I generate coe file ?

plz help me.
 

elcielo

Full Member level 6
Joined
Jun 13, 2002
Messages
383
Helped
15
Reputation
30
Reaction score
8
Trophy points
1,298
Activity points
3,250
fdatool

https://www.mathworks.com/access/he...electronix.ru/forum/index.php?showtopic=65694

coewrite -
Write Xilinx COE file
Syntax
coewrite(hd)
coewrite(hd,radix)
coewrite(...,filename)


Description
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 dfilt object hd. Your fixed-point filter must be a direct form FIR structure dfilt object with one section and whose Arithmetic property is set to fixed. You cannot export single-precision, double-precision, or floating-point filters as .coe files, nor multiple-section filters. To enable you to provide a name for the file, 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 untitled.coe.

coewrite(hd,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 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 include the filter coefficients as well as associated information about the filter.

b = firceqrip(30,0.4,[0.05 0.03]); hq = dfilt.dffir(b);
set(hq,'arithmetic','fixed'); coewrite(hq,10,'mycoefile');When you look at mycoefile.coe, you see the following:

;
; XILINX CORE Generator(tm) Distributed Arithmetic
; FIR filter coefficient (.COE) File
; Generated by MATLAB(R) 7.8 and the Filter Design Toolbox 4.5.
;
Radix = 10;
Coefficient_Width = 16;
CoefData = -83,
-1702,
-732,
615,
1302,
45,
-1746,
-1316,
1498,
3008,...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.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top