How to convert filter coefficients to DFB code

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello members

I set the coefficients of the filter component (channel: A, Filter class: FIR, taps: 5) as follows.

-0.151365399360657

-0.25751805305481

0.700000047683716

-0.25751805305481

-0.151365399360657

On the other hand, the DFB code inside the filter component was described as follows.

area data_b

ChA_FIRST:dw 15507471

dw 14616998

dw 5872026

dw 14616998

ChA_LAST: dw 15507471

[Question]

How is the coefficient set in the filter component converted to the numerical value described in the DFB code?

For example, why "-0.151365399360657" is converted to "15507471"?

Best Regards

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Hello Shimizu-san,

DFB uses Q23 format i.e. 23 bits for decimal points and one for sign.

First coefficient is a negative number. Hence the hexadecimal representation is two's complement of the number in Q23.

coefficient1 => (2^24) –  (2^23 * 0.151365399360657)=15507471= 0xECA00E

Third one is a positive decimal number.  Just multiply the number by 2^23 to convert to Q23.

coefficient2 => (2^23 * 0.700000047683716)=5872026= 0x59999A

Best Regards,

Geona Mary

View solution in original post

0 Likes
2 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

This thread may be useful-

Digital Filter Block

0 Likes
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Hello Shimizu-san,

DFB uses Q23 format i.e. 23 bits for decimal points and one for sign.

First coefficient is a negative number. Hence the hexadecimal representation is two's complement of the number in Q23.

coefficient1 => (2^24) –  (2^23 * 0.151365399360657)=15507471= 0xECA00E

Third one is a positive decimal number.  Just multiply the number by 2^23 to convert to Q23.

coefficient2 => (2^23 * 0.700000047683716)=5872026= 0x59999A

Best Regards,

Geona Mary

0 Likes