cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
phifred
Participant
Participant
1,066 Views
Registered: ‎11-20-2017

FIR COE File with floats

In FIR compiler (7.2) I can set the FIR filter using float values.

How do I write a COE file with float values?

I can only find examples using integer with base 10.

 

4 Replies
nathanx
Moderator
Moderator
1,022 Views
Registered: ‎08-01-2007

The coe file can only accept three format, which does not include floating point value, so make sure to quantatize the coefs before the put them into the coe file.

0 Kudos
bruce_karaffa
Scholar
Scholar
1,016 Views
Registered: ‎06-21-2017

The RADIX=10 format will accept fractional coefficients.  SOmething like this:

 

RADIX = 10;
COEFDATA =  

-0.000059659082087166009,
-0.000066866907286874759,
 0.0001937416967986231,
 0.00062986632850025107,
 0.00061518833272256783,
-0.00019546251023739046,
-0.00089589769459859966,
-0.00021517614146749535,

 

but I agree that quantizing (and normalizing) the coefficient set before using filter generator is a good idea.

diverger
Adventurer
Adventurer
227 Views
Registered: ‎06-22-2018

Hi, it's a good news to know the COE can contain floating point numbers. May you give some official sources or docs about this?

Thanks.

0 Kudos
nathanx
Moderator
Moderator
172 Views
Registered: ‎08-01-2007

@diverger , it's not recommended to have floating point numbers in the COE file, because the FIR Compiler GUI will do quantization based on your bit width and fractional width settings, the frequency response may be a little different because quantization is done by the GUI and coef values might change after quantization, that said, it's recommended for the user to quantize the coefs firstly, then user can use set this quantization in the GUI, so the frequency response does not change.

0 Kudos