Bug 1340

Summary: PWM to analog conversion
Product: libsigrokdecode Reporter: Sven <sven.koehler>
Component: OtherAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: 0.5.1   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Sven 2018-12-12 20:57:36 CET
When using PulseView, and depending on the zoom level, a PWM signal rather quickly becomes a solid gray bar. There is no way to tell what the duty cycle of the signal is anymore.

Given a PWM signal, one could easily convert it into an analog signal with a sample frequency that matches the PWM frequency. To do that, simply generate one analog sample for each rising (or falling) edge. The value of the analog signal should depend on the duty cycle of the last PWM period.

However, this might create a lot of jitter in the signal. So one might want to consider multiple PWM perriods, i.e. generate an analog sample based on the duty cycle of the last 3 PWM periods. In fact, that would be equivalent to an averaging filter.
Comment 1 Sven 2018-12-14 13:53:32 CET
I wrote a PWM decoder that outputs annotations that have a length proportional to the duty cycle. Furthermore, the decoder averaged several PWM duty cycles into one annotation.

The intensity of the PWM signal was still not very visible. It depended on the zoom level and the right number of averaged duty cycles.

Where would I even start to add support for analog output in protocol decoders?
Is the whole framework written in Python? Is PulseView written in Python?