This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE4300: Where can I find the algorithm to process data for BCM?

Part Number: AFE4300

Hey, Marry Xmas and Happy New Year!

I set my AFE4300 for communicating with raspberry pi similar dev board.

So, I logged several data of my AFE4300, something like that

It show amplitudes and phases of the signal with different frequencies (8 to 128 kHz), so how can I use this data to calculate BCM? I found this project 

those guys save the same data into csv file and use them in AFE software.

Thanks in advance

  • Hi Ivan ,

    Following are the few links for the application note that talks about calculating the impedance from the raw data.
    www.ti.com/.../sbaa202.pdf

    Also, following post might be useful.
    e2e.ti.com/.../353345

    Regards,
    Prabin
  • Hi Prabin, thanks for your reply!

    Your first link shows that I have to know the refs resistance values to calibrate the device before using, does it mean that these resistors need once and the are not used in the future (if CALIBRATION = FALSE), I ask because my schematic referred to TI's Biometric Steering Wheel design. And it hasn't R56,57 (schematic). I attached my schematic 6011.3835.AFE4300_BCM.pdf

    Seems I forgot to link RP1 to RN0 and RP0 to RN1 with 10Mohms, is it important? And this note means to use some offsets to import them into AFE4300 software, but it doesn't show how TBW, FFM, etc has been calculated, I mean there is no algorithm for this one.

    Your 2nd link uses only one measured parameter is R (full impedance) and calculation is based on prediction, does it mean that coefficients depends on some external factors (age, ...), I mean they are not similar for everybody. BIS method is more accurate, is not it?

  • Hi Ivan ,

    In your schematic you already have two calibration resistors (i.e. R15 and R16). You need to know the exact value of these resistors for the calibration routine. Ideally you should have same circuit in IOUTs and other calibration paths ( RN0, RP, ..).
    From the calibration routine you have to find the slope (i.e. current) and the offset. Using the slope, offset and output with body , you can estimate the body impedance.
    The formula for TBW, FFM are given in the 2nd link.
    Yes, the coefficient depends on biological factors ( such as gender, weight, age, etc) and are different for everyone.

    Regards,
    Prabin.
  • Hi Prabin,

    My nominal value of R15 is 100 Ohms and R16 is 1kOhms, so full impedance is equal Z = R + jX, so we have capacity reactance, then the formula looks like Z = R - X. I need to put the values of reference's resistors to get impedance according to your first link. Also there is written that we need to get values of 8, 16, 32, 64 kHz, it's needed to get offset for calibration only, is not it?

    Next I read the value on 50 kHz frequency to calculate TBW, am I right?

    The formula for FFM has Z5, is it mistake? Or I have to get the value on 5kHz???

    And How to choose the references resistor, because my have this values, another schematics have other values. What does it depend on?

    And I wrote below, that I had forgotten to link RP1 to RN0 and RP0 to RN1 with 10Mohms, like in other schematics in my previous message, is it important to link them?

    Using IQ modulation we are getting magnitude and phase of the signal, how does it influence calculations, for what we calculate this? I know, that Mag = sqrt(R^2 + X^2) and Phase = atan(X/R), where is X = 1/(2*pi*f*C), f is a frequency (8,16,32,64 kHz), what is C (i know it is a capacitor's value). I ask because for our calculation we use R and X, which AFE4300 returns.

    For examples, part of my code

    write_register(ADC_CONTROL_REGISTER2, 0x63);
    wait_for_stability(0.002, quiet);
    double result_I = read_register(ADC_DATA_RESULT);             // Is it Resistance?
    result_I = (result_I >= 32768) ? result_I - 65536 : result_I;
    
    write_register(ADC_CONTROL_REGISTER2, 0x65);
    wait_for_stability(0.002, quiet);
    double result_Q = read_register(ADC_DATA_RESULT);              // Is it reactance?
    result_Q = (result_Q >= 32768) ? result_Q - 65536 : result_Q;
    
    double mag = sqrt(pow((float)result_I, 2)+pow((float)result_Q, 2))*(1.7/32768);
    double phase = atan((float)result_Q/result_I);

  • Hi Ivan,

    The excitation current flowing through the body might vary form device to device. For a given device the exact current can be found using the calibration routine with two known calibration resistors (R15 and R16). For the accuracy of the calibration routine, you need to know the exact value of the calibration resistors. Calibration routine also removes the effect of the channel offset.

    You can refer to section 2.2 "BIS Implementation using AFE4300 IQ Mode" of the first link for the steps involved in body impedance measurement.
    Your formula for the magnitude and the phase is wrong. It should be Mag = sqrt(I^2 + Q^2) and Phase = atan(Q/I), where I = ADC data when I channel is connected to the ADC and Q is ADC data when Q channel is connected to the ADC.

    You should choose the calibration resistors so that it covers the extremes of the expected body impedance.

    Formula for the FFM in the 2nd link is FFM = TBW/K where K = 0.732


    Regards,
    Prabin
  • Thanks for your explanation!

    And how does the impedance depend on magnitude and phase? How to calculate impadance, knowing Mag and Phase?

    Because according to this formulas I have to get impedance on frequency 50 kHz and 5 kHz.

    And the formula for ECW is correct? I mean, Z of 5kHz freq?

  • Hi Ivan,

    Following post talks about simple calibration routine to estimate the impedance using Mag and Phase.
    e2e.ti.com/.../2168676

    Yes, formula for ECW is correct in FWR mode. As in FWR mode we can get 5KHz excitation frequency.

    Regards,
    Prabin
  • Thanks Prabin.

    As I understood, following your link, I have to do next steps:

    1. Calibrate device knowing 2 resistor's values for 8, 16, 32, 64, 128 kHz. Do I need to use electrodes for this (do i need to put them on body?)
    2. Substract this values every time when I measure impedance (in other words make them as predefined variables)
    3. To calculate TBW in IQ mode I need to get the body impedance and use Deurenberg's formula. To calculate this one I need to use this formula:
      1.  Pass the same excitation current through two known impedance (just to measure the voltage across resistor?) and measure the voltage developed across it.
        1. i.e. Y1 = MX1 + C and  Y2 = MX2 + C , where X1, X2 are the two known impedance (known resistors?) and Y1, Y2 are voltages across them respectively (do I need to get them with multimeter?). M = Excitation current (How to get it? Because to measure the current I need to build multimeter in my circuit), C = Offset (From step 1? But I have 5 different offset, which one I need to use?).
      2. Find the Current and offset by using values from Step 1. For each one? I know Y1, Y2, X1, X2
      3. Measure the voltage across the unknown impedance (across the body? Y(body)-?).
      4. Calculate the unknown impedance by subtracting offset from voltage ( from step c-b, C is general for Y1 and Y2?) and finally divide by current (M is also general for Y1, Y2?). (Ohms law?) I have 2 values from steps above

    You have also mentioned, that formula for ECW is correct in FWR mode, does it mean that IQ mode doesn't support the measuring ECW?

  • Hi Ivan,

    If you want to use the above mentioned formula for the ECW, then it can't be done in IQ mode.
    However if you have any other formal based on some studies then you can use the IQ mode ( if the given excitation frequency is allowed).

    Regards,
    Prabin
  • Thanks Prabin!

    And what about my algorithm of actions? There are a few questions, that I didn't understand. Could you please provide more information?