Bug 1340 - PWM to analog conversion
Summary: PWM to analog conversion
Status: CONFIRMED
Alias: None
Product: libsigrokdecode
Classification: Unclassified
Component: Other (show other bugs)
Version: 0.5.1
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-12 20:57 CET by Sven
Modified: 2018-12-14 13:53 CET (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?