キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Moving Average From Data File

解決済み
解決策を見る

Hi,

 

I'm trying to do a subvi that counts any jumps in the data points.

The algorithm:

--construct an array of samples (of the size round(FPS/2))

--Take the mean

--subtract the data points of the array from the mean: difference=absolute(data point-mean).

--compare the difference to the threshold: if difference>=thershold then add 1 to the counter.

 

The subvi (jump detect) is going to be used in a larger vi, and I need to make sure that it's working. But it's not working now....

While the vi is running and everything is calculated, it doesn't count the jumps which are clearly seen on the plot.

Any ideas what am I doing worng?

 

Thank you,

 

 

すべてをダウンロード
0 件の賞賛
メッセージ1/5
3,837件の閲覧回数

A couple more attachements....

すべてをダウンロード
0 件の賞賛
メッセージ2/5
3,836件の閲覧回数

Anyone?

0 件の賞賛
メッセージ3/5
3,808件の閲覧回数
解決策
トピック作成者simply_meが受理

The problem exsist in your for loop in your subVI. At this point you are iterating through FPS/2 size of array, and you are only outputing the last value of all of your calculations. Unless the very last value is flagged as a jump, it won't be logged. You can easily fix this by putting shift registers on your for loop, the only issue is doing something with your boolean flag. You could index the boolean values and then do an Or Array function, but that part is up to you.

 

Changes.png

National Instruments
Applications Engineer
メッセージ4/5
3,774件の閲覧回数

Hi Scott,

 

Thank you for the corrections, I really appreciate it.

 

0 件の賞賛
メッセージ5/5
3,760件の閲覧回数