The recommended way is to use a sinc-filter on the incoming bitstream (I think there is an app note for the AD7403 detailing that). What you also can do is e.g. collecting e.g. 64k pulses and count how many of these are 1s. I did this as a test project and can confirm that it works. Disadvantage is that you get a slower response than using a digital filter.
thanks for the replay!
A counter sounds pretty straightforward indeed.
I suppose I can trade accuracy for bandwidth (and vise versa) when I adjust how many pulses I count.
one way of averaging 1-bit input is to use a custom LPFilter component, which is simple first-order exponential filter. See example project here:
Instead of using internal ADCs, just set Filter input bus width to a single bit, and attach it to the AD7403 output. The Filter output is an exponentially-averaged bitstream at lower rate. You can further average it by using PSoC digital Filter. For example, starting with ADC rate of 20MHz, and Filter dumping length 256, the decimated output will be 4-bit at rate of ~80kHz, which can easily be filtered further by the PSoC Digital Filter.
It is possible to cascade several LPFilter components to make a higher-order filter, depending on strobe frequency and other PSoC resources. Simplest way to transfer data to DFB is to read LPFilter output directly using API (for lower speed); to use DMA attach a Status Register and use StatusReg-DMA-DFB transfer.
Attached is an example of the bitstream integration using LPFilter component. To simulate ADC bitstream it uses a PriSM component, which pulse density is being varied using rotary encoder. The bitsream first aggregated using LPFilter and decimated to lower data rate, acceptable to the digital Filter component. The data is displayed using the Multichart plotting SW. Project uses approx 30% of PSoC5 resources, indicating that sampling of two bitstreams simultaneously is feasible at about 20MHz rate.
Project files are attached.
Other libraries needed to operate the project:
thank you for the answer.
The LPFilter seems to be a very usefull component - not just for single-bit bitstreams!
Why are such usefull things not included in PSoC Creator?
The date on the datasheet says "Revised August 21, 2016".
Thanks for your support.
The LPFilter is so-called "Community component". You can find some of those on this (old) page
I had no time to "release" the component - other things took a priority. Its main goal was to compliment ADC_SAR_ex digital bus output (8-12-bits). It can be used for a single bitstream averaging as well, but there are also several other tools available for that. As mentioned above, a standard Counter can be used as a simple FIR-filter. Thee are also other community components by Chris Keeser (KEES) for that, namely Bitstream Integrator and Sinc^2 filter. I will try to check those and/or post a links to those examples.
P.S. The DMA settings (StatusReg-DMA-Fillter) in your project are incorrect, please find correct DMA settings in the DMA.c file above.