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: 

shift register didn't add

Solved!
Go to solution

Dear all,

 

I am trying to use shift register adding all the detected waveform together. The added result will be divided the present number of waveform to get the average result. However, it looks like the shift register doesn't function at all. Refer to the image below, if the number waveform is 1000, the intensity of the averaged signal is just 1/1000 of the detected signal. Theoreically, if no noise present and the shift register did add each detection together, the average signal should be identical to the detected signal. Anyone can help me resolve this problem?

 

Thank you very much

2.png

0 Kudos
Message 1 of 7
(2,745 Views)
Solution
Accepted by topic author KevinLilian

First you should be dividing by the N of the inner loop, not i+1 of the outer loop.

 

If you want to average over the outer loop as well, you need a shift register in that loop.

 

Lynn

0 Kudos
Message 2 of 7
(2,740 Views)

Hi, Lynn,

 

Thank you very much for your reply. I've changed the connection. However, It looks like the average signal just follow the detected signal. Still no averaging happening.... 😞

 

Thanks

Chuan

0 Kudos
Message 3 of 7
(2,733 Views)

Can you post your VI with some data saved as default? That we we can look at what is happening.

 

Is your data acquisition triggered in such a way that each waveform is in phase?

 

Lynn

0 Kudos
Message 4 of 7
(2,725 Views)

I just got it fixed. 🙂

 

The reason is once the inside "for" loop finished, the shift register will get refreshed again. That's why I keep seeing the averaged signal just following the input signal.

 

A solution would be deleting the inside "for" loop and adding the shift register directly on the outside loop.

 

Thank you very much, Lynn

 

All the best,

Chuan 

0 Kudos
Message 5 of 7
(2,720 Views)

Then you should mark Lynn's message 2 as the solution to your problem rather than your own thank you message.  First you will have to go to the options menu to the upper right of your message to unmark it as the solution.

0 Kudos
Message 6 of 7
(2,700 Views)

I don't mean to make any offense. I just thought that I should post a more straightforward and clear explanation. Anyway 

0 Kudos
Message 7 of 7
(2,669 Views)