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.

AFE4403: AFEF4403's sample rate question

Part Number: AFE4403
Other Parts Discussed in Thread: CC3220SF-LAUNCHXL, , CC3220SF,

Hello, I use CC3220SF-LAUNCHXL and a custom AFE4403 module which uses an SPH7050.

In my previous question, I receive the answer that I can apply FFT to obtain the heart rate.

I wish to ask in detail. Suppose I sample 256 samples of LED data from AFE4403's registers.

1. Regardless of the LED color (Green/Red), I can apply FFT of the "LED2-ALED2VAL" samples to calculate the heart rate, right?

2. As mentioned in this post, (Fs = sample rate, N = FFT size, which is 256 in this case)

frequency = nth bin(which has the absolute maximum FFT value) * Fs / N

// Ref. AFE4403EVM FW SRCv2.3
#define PRF 500 /* Typical ADC sample rate = 4 * PRF, Max ADC conversion time = PRF / 4 */ #define DUTYCYCLE 25 #define ADCRESET_DELAY 5 #define PRP ((AFECLK/PRF)-1) #define DELTA (((PRP+1)*DUTYCYCLE)/100) #define CONV_DELTA ((PRP+1)/4) #define LED2STC_VAL ((((PRP+1)*3)/4)+80) #define LED2ENDC_VAL (LED2STC_VAL-80+DELTA-2) #define LED2LEDSTC_VAL (LED2STC_VAL-80) #define LED2LEDENDC_VAL (LED2ENDC_VAL+1) #define ALED2STC_VAL 80 #define ALED2ENDC_VAL (DELTA-2) #define LED1STC_VAL (((PRP+1)/4)+80) #define LED1ENDC_VAL (LED1STC_VAL-80+DELTA-2)

// CONTROL1 register-NUMAV[7:0] is configured as 7. // ...

Since CC3220SF is based on Cortex-M4F, I chose

arm_cfft_q31 or

arm_cfft_radix4_q31

to calculate the FFT amplitude.

As expected, the ADC data ready pin signal shows the 500Hz frequency.

Is the PRF (Pulse repetition frequency) value identical to the sampling frequency (Fs) when calculating the frequency of "LED2-ALED2VAL" samples?

Or, as described in the datasheet, is Fs == 4 x PRF or Fs = NUMAV[7:0] x PRF? I wish to double check.

3. Lastly, if

Fs == 4 x PRF

why is 4 multiplied?

  • Hi David,

    Here are the answers.
    1) Irrespective of LED's wavelength , you can calculate the FFT.
    2) PRF is the sampling frequency.
    3) Since in one PRF cycle, ADC converts the output of 4 phases ( LED2, ALED2, LED1, ALED1). The rate of ADC conversion is 4*PRF.
    But as long as you are looking at only one phase at a time, the sampling frequency (Fs) = PRF, as that phase is converted only once in a PRF cycle.

    Regards,
    Prabin
  • As always, thanks for your time Prabin.

    Prabin Yadav said:
    But as long as you are looking at only one phase at a time, the sampling frequency (Fs) = PRF, as that phase is converted only once in a PRF cycle.

    I haven't understood your term "looking at only one phase at a time".

    - I read all 6 data registers of AFE4403 (LED2VAL, ALED2VAL, LED1VAL, ALED1VAL, LED2-ALED2VAL, LED1-ALED1VAL) when the data ready pin is triggered.

    - I buffer those 6 data in an integer array. I store total 1,536 (256 reading * 6 data).

    - The timing values (LED2STC, LED2ENDC, and more) are the same from the AFE4403EVM FW SRCv2.3 code.

    - The PRF is set to 500 Hz

    If I read all 6 data after the data ready pin is triggered, am I looking all the phases (LED2 sample phase, Ambient sample phase, LED1 sample phase, Ambient sample phase, LED2 convert phase, Ambient convert phases, LED1 convert phase)?

    I don't see the relations between the sampling frequency and the ADC output phase in the datasheet.

    Can you help me and elaborate on this "phase / sampling frequency"?

  • Hi David,

    In a given PRF sample there are 4 active phases . They are LED2, ALED2, LED1 and ALED1. For each of those 4 phases there are individual sampling window and ADC conversion window ( i.e. 4 sampling pulses and 4 ADC conversion pulses).
    Since ADC ( single ADC is inside the chip ) is used 4 times in a PRF, the output of ADC = 4 * PRF. But sampling/ conversion of a phases ( either LED2 or ALED2 or LED2 or ALED1) happens only once in a PRF, the sampling frequency is same as PRF.

    So while taking the FFT the sampling frequency will be PRF.

    Hope this helps.

    Regards,
    Prabin