Hi, I am trying to implement a digital filter for measuring (samplling and filtering) the voltage of a circuit. The RLC circuit is defined by an ODE. I’ve come up with a simulation using a callback for sampling, but the filter is continuous (modeled by a ODE again). I am using the ModelingToolkit approach (last version for Julia and the ModelingToolkit itself).
But for a discrete version, I have tried to mix different ideas without result. Is my idea possible? Is any example of something similar?
You’re likely to find a broader pool of answers with a minimal working example and reframing the question to be more general, such as “Callback sampling of discrete data possible?” That should draw people who may not be EEs but could have useful ideas.
You mention both measuring the voltage and then filtering it. I have implemented a Julia version of measuring a voltage using the Raspberry PI with the MCC172. This unit allows you to set the sampling rate and it has built-in anti-alias filters typical for instruments made for measuring vibration. This will allow you to set a fast enough sampling rate and use your own digital filter. It works well for what it was designed to do. There is a start in this package for the more cost effective MCC128. This unit does not have the anti-alias filters. This Julia package is available here.
If your question is more related to how to do the filtering, I don’t have experience with that.