In the datasheet are two different formulas for the conversion of the FFT raw values to mg.
Q1: Is the following formula the right one?:
Q2: How should zero X_buf values be handled? Are they really converted to a non-zero mg value?
Q1: Yes, the logarithmic relation is the correct one (i.e. the one you copied above), there is a typo on page 35 of the DS.
Q2: Very good question. I will check with the designer and circle back to you.
Is there any update?!
The short answer to your second question is yes. Internally, for FFT records, the log values are stored, as implied by this formula. And log(0) is handled as 0.