Jump to content

Peak detector VI Analization with code


Crtomir

Recommended Posts

Hello,

 

I have created code to filter a signal and calculate its peaks. The code is doing perfectly good until..... the signal frequency gets lower (about 10 Hz).

 

The problem is as shown in Peak detector VI. My code needs to execute under 100 ms. Because Peak detector VI takes to much time at low frequency, my program fails.

My thinking: Peak detector does a quadratic fit on the points (maybe here hides the time problem ?). I already did FIR filtering, so quadratic fit is not needed?

 

I have added the code for you all to test and use it if you want (try changing frequency at the top of graph and look at how calculation takes more time).

 

Please comment on what i created and if there are some FASTER peak calculation alternatives... for us all to use.

 

PS: you are looking at a test. This is not my program arhitecture (queued state machine)

 

Thank you

forum question peak finder.vi

Link to comment

One note: you will want to move your location back to where it should be if you're decimating (multiply by the decimation factor).  There're a couple other logic things which are also redundant.  The biggest time sink would probably be polling your controlls.  Try this version (it's in 2013).


And of course I didn't test my code properly, and it seems to run more slowly than yours... I'll have to dig more deeply into why...

Peak Finder 2013.zip

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.