LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to average and subtract waveforms

Untitled.jpgI have 6 mics, and I have to calculate average sound pressure from mics 1-3 and 4-6. Then I have to subtract these average values. I did it like you see in that screenshot, but probe data says that after that subtract block there comes sound pressure mic 1. And in graph I can see also that it is same than mic 1.

0 Kudos
Message 1 of 13
(7,065 Views)

You were very careful to pluck the waveform out of the Dreaded Dynamic Wire (I assume that's what you have) when you added the signals, but not when you subtracted them.  Is there a reason that subtraction is being handled differently?

 

Bob Schor

0 Kudos
Message 2 of 13
(7,051 Views)

The names are coming from the names stored in the attributes of the waveforms.  In the case of the subtraction, it uses the attributes from the first input.  You could always just change the plot name in your graph.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 13
(7,042 Views)

You can also rename the resulting waveform using Set Waveform Attribute.vi. The new name will be the one displayed in the graph.

 

SetWaveformNameAttribute.png

 

Ben64

Message 4 of 13
(7,017 Views)

This doesn't help with your question but is rather a tip. The index array function will automatically start indexing at 0 if the index values are left empty. 

 

If you want to index rows 5, 6 & 7....you only need to explicitly index row 5 and Labview with auto-increment the following indexes. 

 

Capture.JPG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 5 of 13
(6,999 Views)

I mean that the plot in graph is same than mic 1 plot. 

0 Kudos
Message 6 of 13
(6,944 Views)

There is not much more we can do with just a picture of part of your code. We have no idea what the content of your array of waveform looks like. Maybe the first 3 are identical to mic1 and the last 3 are 0. Then the result would be similar to mic1.

 

Ben64

0 Kudos
Message 7 of 13
(6,856 Views)

Here you can see my problem.I am trying to subtract mic 2 from mic 1 because I want to see the difference between mic 1 and mic 2. Why the plot in graph 2 is still same as mic 1 in the first graph.

111.jpg

333.jpg

222.jpg

0 Kudos
Message 8 of 13
(6,765 Views)

Hi Tugez, at the two red circles, could you right click >> create indicator. Then run your VI once with both indicators there. Then right click >> change to constant on each indicator. Then upload your VI (LV 2014 or less for me!). Thanks,

 

temp.png

0 Kudos
Message 9 of 13
(6,743 Views)

Okay, here it is. Subtract 1 vi is with numeric indicator and subtract 2 with graph indicator. 

Download All
0 Kudos
Message 10 of 13
(6,705 Views)