Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Community Forums
- :
- Forums
- :
- Hardware Development
- :
- AI Engine, DSP IP and Tools
- :
- Re: Problem generating .coe (coefficients) file fo...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

vizzie

Visitor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-06-2009 01:42 PM

9,845 Views

Registered:
10-02-2008

Problem generating .coe (coefficients) file for a Polyphase FIR Decimator in MATLAB

Hi everyone

I have been trying to generate a .coe file in MATLAB for the Polyphase Decimator Filter Structure for an FIR Compiler design as follows:

Hlpf = mfilt.firdecim(...);

hq = dfilt.dffir(hlpf.Numerator);

set(hq, 'Arithmetic', 'fixed');

coewrite(hq, 10, 'coefile');

Though I could get a .coe file after this, I am unsure if what I did was correct. The mfilt.firdecim is a Direct Form FIR Polyphase Decimator structure while dfilt.dffir is Direct Form FIR structure. So, how do I generate coefficients for the Polyphase decimator structure for the FIR compiler?

Any help would be greatly appreciated.

Regards,

Kumar Vijay Mishra.

0
Kudos

Reply

3 Replies

criley

Xilinx Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-06-2009 02:08 PM

9,844 Views

Registered:
08-16-2007

Open the .coe file created and verify that it follows the COE File Syntax defined in the Xilinx ISE Help Guide. Open the Help Guide and search for "COE File Syntax".

-Chris

0
Kudos

Reply

vizzie

Visitor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-06-2009 03:22 PM

9,839 Views

Registered:
10-02-2008

Thanks Chris for your reply.

Well, I can certainly write the coefile manually if that is the only option left. But is my method of generating the coe file for a polyphase decimator correct?

Regards,

vizziee.

0
Kudos

Reply

sjulius2007

Visitor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-20-2010 10:00 AM

8,822 Views

Registered:
01-16-2009

Hello vizzie

You can do the following :

1)Design your filter in Matlab using FDA tool

2)Click on " Set quantization parameters" on the left side of GUI

3)Change "filter arithmetic" to Fixed point

4)Click on the Coefficients tab to check the number of bits ( Numerator word length = 16 etc.).

5)Change "filter arithmetic" back to Full precision

6)Export the filter coefficients "Num" into Matlab workspace by clicking File->Export

7)Go to Matlab command prompt and type the following:

coef_set= round(Num * (2^(bits-1))); Note : [ bits = 16]

dlmwrite('mycoefile.coe',coef_set);

8)Now you will have a .coe file which contains the coefficients as a,b.............. a

9) Now you need to modify it so that it is suitable for Xilinx CORE.

A) Add the following lines at the beginning:

;

Radix = 10;

Coefficient_Width = 16;

CoefData =

B) Change all the ' , ' to ' ; '

C) Add a ' ; ' in the end

Now your file looks like :

;

Radix = 10;

Coefficient_Width = 16;

CoefData = a; b; ........... a;

D)Save the file

Now it should be okay for the Xilinx core.

Good luck

Mona

0
Kudos

Reply