Trying to write a script to recreate an oscilloscope-style display using raw data, matplotlib really isn't the most appropriate tool for this task, I needed a lot of hacks just to add graticules inside the grid... #electronics
With the help of the script, I finally can stop worrying about whether the horizontal and vertical offsets are aligned to the graticule lines before taking a screenshot, everything can be changed and recreated from raw data for better presentation. #electronics
Now I need to calculate the waveform parameters from raw data (instead of using the oscilloscope to do it), such as 10%-90% rise time. It's harder than it looks since real-life data has noise and may not be monotonically increasing. Differentiation to find dv/dt and di/dt on noisy data also gives you a lot of garbage. It seems the standard method is running a spline curve fitting to smooth the waveform first... 🤔 #electronics
The voltage across 15 Ω looks like this, so the peak di/dt seems to be over 400 A/µs! 📈 This is pretty concerning, 800% of the component rating 💥... #electronics
@maddiefuzz @puniko My oscilloscope's 320x240 resolution is low, but not too bad. I did this mainly to make data <del>manipulation</del> post-processing easier. Whenever I take a screenshot, I always end up finding some settings are bad, e.g. accidentally selecting the "system" menu when you want to show the "measure" menu... Even in this image, the vertical offset of channel 1 is not aligned to graticule.
@puniko @maddiefuzz It's just a quick and dirty script in 200 lines. Everything is tied to both the internal data format of both this particular oscilloscope, and my ad-hoc JSON format to represent a dump of that data. There is no any kind of control to adjust anything on the plot either. So it's not useful to anyone else. Perhaps I'll post that someday when I have the motivation to clean it up. CC @brethil
That's super cool. Are you planning to open source it? I would see this to be super useful for teacher of electronics courses
@niconiconi yer a wizard! A matplotlib wizard. This looks great! I recently got a hantek 6022be USB oscilloscope which can also export data. I might give something like this a try.