Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulse Width Measurement of single pulse #946

Open
blutack opened this issue Dec 10, 2024 · 0 comments
Open

Pulse Width Measurement of single pulse #946

blutack opened this issue Dec 10, 2024 · 0 comments

Comments

@blutack
Copy link

blutack commented Dec 10, 2024

Hi, I ported the pulse measurement filter to the scalar approach as I needed it. I ending up gutting out all the amplitude measurement stuff so it's probably not suitable to incorporate as is but I can share if it's useful.

While doing this, I noticed that the filter does not work for a single pulse. The code that iterates over edges looks like this:

size_t elen = edges.size();

for(size_t i=0; i < (elen - 2); i+= 2)
{

So in the case of a single pulse with 2 edges, i < (2 - 2) on the first iteration and the loop never runs at all.

Changing the case to:

size_t elen = edges.size();

for(size_t i=0; i < (elen - 1); i+= 2)
{

it now correctly handles the single pulse case.

Thanks for this excellent project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant