cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
akshay_iyngr95
Participant
Participant
1,579 Views
Registered: ‎02-19-2018

Coefficient file for fir compiler

Jump to solution

Hi,

I have generated coefficient file for a filter in FDATool in MATLAB which gives me the coefficient file with extension .fcf .

I have to use this coefficient file in FIR compiler in Vivado HLS which is expecting file of extension .coe .

How can I get .coe file from FDA tool in MATLAb or how can i convert .fcf to .coe

 

 

 

Thanks and regards,

Akshay M

0 Kudos
1 Solution

Accepted Solutions
bruce_karaffa
Scholar
Scholar
1,717 Views
Registered: ‎06-21-2017

An fcf file looks like this:

 

% Generated by MATLAB(R) 9.2 and the Signal Processing Toolbox 7.4.
% Generated on: 09-Mar-2018 09:20:21

% Coefficient Format: Decimal

% Discrete-Time FIR Filter (real)    
% -------------------------------    
% Filter Structure  : Direct-Form FIR
% Filter Length     : 45             
% Stable            : Yes            
% Linear Phase      : Yes (Type 1)   

                                    
Numerator:                           
 0.000097547980806971738             
 0.00031118118575867499              
 0.00070657071413631443              
 0.0012740818962985352               
 0.0019029775546380559

...

 0.0019029775546380559               
 0.0012740818962985352               
 0.00070657071413631443              
 0.00031118118575867499              
 0.000097547980806971738  

 

The coe file looks like this:

RADIX = 10;
COEFDATA =   0.000097547980806971738,
 0.00031118118575867499,
 0.00070657071413631443,
 0.0012740818962985352,
 0.0019029775546380559,

...

 0.0019029775546380559,
 0.0012740818962985352,
 0.00070657071413631443,
 0.00031118118575867499,
 0.000097547980806971738;

 

All you need to do is replace the Matlab header with

RADIX = 10;
COEFDATA =  

 

then put a comma at the end of every coefficient except the past one.  Put a semicolon at the end of that one.  I wouldn't be surprised of somebody out there doesn't have a script to do this.

 

View solution in original post

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

An fcf file looks like this:

 

% Generated by MATLAB(R) 9.2 and the Signal Processing Toolbox 7.4.
% Generated on: 09-Mar-2018 09:20:21

% Coefficient Format: Decimal

% Discrete-Time FIR Filter (real)    
% -------------------------------    
% Filter Structure  : Direct-Form FIR
% Filter Length     : 45             
% Stable            : Yes            
% Linear Phase      : Yes (Type 1)   

                                    
Numerator:                           
 0.000097547980806971738             
 0.00031118118575867499              
 0.00070657071413631443              
 0.0012740818962985352               
 0.0019029775546380559

...

 0.0019029775546380559               
 0.0012740818962985352               
 0.00070657071413631443              
 0.00031118118575867499              
 0.000097547980806971738  

 

The coe file looks like this:

RADIX = 10;
COEFDATA =   0.000097547980806971738,
 0.00031118118575867499,
 0.00070657071413631443,
 0.0012740818962985352,
 0.0019029775546380559,

...

 0.0019029775546380559,
 0.0012740818962985352,
 0.00070657071413631443,
 0.00031118118575867499,
 0.000097547980806971738;

 

All you need to do is replace the Matlab header with

RADIX = 10;
COEFDATA =  

 

then put a comma at the end of every coefficient except the past one.  Put a semicolon at the end of that one.  I wouldn't be surprised of somebody out there doesn't have a script to do this.

 

View solution in original post

0 Kudos