From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring peaks per unit time

Solved!
Go to solution

Hello,

 

I am trying to measure peaks per unit time of a real time signal.

As I am a beginner, I tried to do the same via the simulate signal, to find no. of peaks per unit time of a sine wave.

While surfing the internet, I found a VI , which I tried to modify, but few of the wires were giving error.

Secondly, I did not have any idea on how I could get the elapsed time.

 

Any clue/hint on the VI or the time problem would be of use.

 

Thanks very much.

 

Anupam

0 Kudos
Message 1 of 13
(3,614 Views)

Hello anupam2016,

i have done some modifications. Not every possibility was checked and tested, but it can be a good starting point for you.

asdf.png

best regards
Alexander
Message 2 of 13
(3,579 Views)

Thanks Alexander.

 

I was not able to open the VI as I am using Labview 2013. Is possible for you to save it in that version.It would be great,if you can do that.

 

I am trying to understand the logic, what you have constructed.

 

Thanks Again

 

Anupam

0 Kudos
Message 3 of 13
(3,554 Views)

Hello,

I am in process of  making a VI. My aim is to" indicate(through bool) when I have recieved  more than 'n' (say 5) peaks".

I am using shift register and case structure for this. I have labelled my VI.

Problem which I am facing is that when I come to case 0 of the case structure, the final output it over incremented. I feel I am messing up somewhere with the shift registers.

 

Can someone please have a look at my VI and suggest me something.

 

Thanks.

 

Regard,

Anupam.

 

P.S: I use LABVIEW 2013. Thanks

 

0 Kudos
Message 4 of 13
(3,605 Views)

Hello anupam2016,

saved to 2013

best regards
Alexander
Message 5 of 13
(3,548 Views)

Hello Alexander,

 

I have tried to make my own program for just counting peaks. I am able to count the peaks succesfully.As my aim is to find the no. of peaks per unit time, I need to detect  "N peaks"(say N = 5) and then divide 5/(total time taken for those peaks to arrive).

For detecting these 5 peaks, I have used the divisiblity logic, i.e: every time total no. of peaks detected is divisible by 5 means , 5 peaks have passed. But my final value gets over incremented always.

 

I am uploading my VI. I have labelled it for further clarity.

 

Thanks.

Anupam

 

(Labview 2013, Thanks)

0 Kudos
Message 6 of 13
(3,539 Views)

Hello anupam2016,

 

the problem came form the true and false, which makes the wrong behaviour. Attached a fixed example.

best regards
Alexander
Message 7 of 13
(3,514 Views)

Hi Alexander,

 

Thanks for that correction in the previous VI. I am almost done with my final VI. Only thing left is the stopwatch. I had downloaded a stopWatch VI from one of the questions. I turned the block diagram into a sub VI and trie to use it in my final VI.

But the stopclock doesnt seem to work with a slight modification, changing a boolean control to a boolean constant.

 

I have labeled the VI for clarity. I am also attaching the stopclock VI.

 

Thanks a lot.

Anupam

(labview 2013, Thanks)

Download All
0 Kudos
Message 8 of 13
(3,483 Views)

Hello anupam2016,

from the simulation you get an array back and you know the delta t, the time between the samples, now it is better to caluclate the time between the rising edges with this instead of measuring the time with functions. The Loop rate is also 100ms so the reuslt can not be more finer then 100ms.

 

Attached your version with timing measurement.

My version with the index was posted with the VI Snippet on ‎03-18-2017 09:37 PM.

best regards
Alexander
0 Kudos
Message 9 of 13
(3,477 Views)

Hi Alexander,

Actually I think I was not able to communicate properly what I am upto.

My objective is to calculate number of peaks per minute. In order to do this I am approximating it in the following way.

1. Detect when 5 peaks arrive through boolean (n = 5).

2. Find the time taken for these 5 peaks to arrive. (say time = t seconds).

3. No. of peaks/second = n/t;

4. For finding no. of peaks per minute , I multiply (n/t)*60 = Result.

I think , we seemed to have messed up the calculations.

 

Any suggestions/corrections would be of use.

 

Thanks a lot.

Sorry for the lack in clarity.

 

Anupam

(Labview 2013, Thanks)

0 Kudos
Message 10 of 13
(3,473 Views)