How can I measure percentage of pulse signal
2 views (last 30 days)
Show older comments
Dogukan Arat
on 24 Jul 2018
Commented: Ryan Takatsuka
on 25 Jul 2018
I am working on a project. I need get pwm signal on raspberry pi then find the open interval which means percentage of the signal. I design a system but it does not work properly.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192504/image.png)
I can reach the correct value without delay but when I decrease the percentage it keeps max value.
0 Comments
Accepted Answer
Ryan Takatsuka
on 24 Jul 2018
You are probably better off filtering the PWM signal to find the interval percentage. See the attached example.
2 Comments
Ryan Takatsuka
on 25 Jul 2018
If you have the Signal Processing Toolbox, you can use the filterDesigner app to design a lowpass IIR filter. Otherwise, there are some online tools such as this one: Online Filter Designer
I've attached an example of a filter using a 0.020 s period with an arbitrary sampling rate.
More Answers (0)
See Also
Categories
Find more on Digital and Analog Filters in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!