Hello MLambe ,
I am using the code provided from https://github.com/analogdevicesinc/ad5940-examples to program the EVAL-AD5940ELCZ for electrochemical impedance spectroscopy.
I need to sweep frequencies from 0.1Hz to 10kHz. With default parameters, there was noise in the impedance measurement at low frequencies. After engaging the SINC2 filter, there was a reduction in noise in the impedance measurement at low frequencies; however, the quality of the impedance measurement at high frequencies decreased ( RE: EIS 2-wire measurements using EVAL-AD5940ELCZ ).
I would like to engage the SINC2 filter at low frequencies and disengage the SINC2 filter at high frequencies; note that I would like to do this at time-of-flight. For example, engage the SINC2 filter until the sweep frequency is 100Hz, then disengage the SINC2 filter.
In a previous discussion, it was mentioned that the AppIMPRegModify() function is a good place to update the AFE during time-of-flight ( AD5940 ELCZ - using SINC2 data for the DFT not working ).
Following this discussion, I attempted to disengage the SINC2 filter in the AppIMPRegModify() function by adding the following to it:
float freq = AppIMPGetCurrFreq();
if(SWITCHING_FREQ < freq) {
AppIMPCfg_Type *pImpedanceCfg;
AppIMPGetCfg(&pImpedanceCfg);
pImpedanceCfg->DftSrc = DFTSRC_SINC3; // Reset DftSrc to SINC3, disengaging SINC2 and increasing the oversampling rate
}
However, I did not observe an increase in the oversampling rate. I am left with the following questions:
1. What do I need to write in the AppIMPRegModify() function? Is the above code sufficient?
2. Do I need to call a function to reinitialize the AFE?
Thank you for your assistance.