LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring a particular 'deep' in a graph by filtering out the noise

Hello to all LabVIEW experts.

I got an issue related to measurement of depth of the below marked region. 

Graph Image.PNG

As you can seen from the image above I have one peak and one deep point in my real time measured graph. I actually have to measure the depth of the marked region continuously in order to go for some mathematical calculations. But unfortunatelly due to the calculation is based on a very sensitive measurement (hence the graph must be as stable and having no noise as possible) and I am not able to get a clear result I can't do the calculations as expected. So the points I need help of you guys are;

1- How can I clear out the noise in the red line and the blue line in the graph?

2- How can I minimize the oscillation of the graph? (Because as long as it oscillates the measured point is varying and hance calculated result keeps changing)

 

P.S 1- I previously tried filtering out the noise with a median filter, but due to the oscillation of the graph is too high and the base line keeps changing in almost every measurement process, this filter did not work.

P.S 2- Please find below attached VI that is written in LabVIEW 2016 but saved for 2013 version and above LabVIEW users.

Add 273 on whatever Celcius said.
-Kelvin
0 Kudos
Message 1 of 18
(3,254 Views)

Well, do you have the acquaintance of anyone with experience in recording signals, understanding shielding and grounding, knowing about analog filters, etc., i.e. someone with experience or a degree in electrical engineering?  The first place to try to eliminate noise is in the incoming signal.  What about the data acquistion system?  Are you introducing noise there, perhaps by using a ±10v A/D converter with a signal that is only 1v?  You don't say much about the sampling rate, so it is hard to recommend filters.  However, you want some form of low pass filter that will remove the noise but preserve the "peak" without too much distortion (where's that EE when you need her?).

 

Bob Schor

0 Kudos
Message 2 of 18
(3,203 Views)

Hello Bob_Schor,

Thanks for your reply. Above shown graph is received directly from an optical instrument. Noise occured is caused by the Thermal Noise within the instrument it self. The only external tool we have is the Ethernet Cable that is used to establish connection between the instrument device and the PCB. Shown graph is made of combination of 16000 data points and corresponding instrument is having 2Hz of sampling rate. What kind of filter do you suggest me to design?

Regards

Add 273 on whatever Celcius said.
-Kelvin
0 Kudos
Message 3 of 18
(3,193 Views)

16000 data points at 2 points/sec = 8000 seconds of data, just over 2 hours.  Does that sound right?  In your Figure, do the Graphs show all 16000 data points (I'm guessing "not")?

 

It might be helpful to attach a data file and explain what channel corresponds to the red trace and what to the blue.  What do you know about "data exploration", about how to look at data, how to understand sampling rates, how it relates to frequency content, how (particularly low-pass) filters work, etc.?  If you are an engineering student, have you taken "Signals" yet?

 

I'm curious about having an Ethernet Cable between the "instrument device" and the "PCB".  Please elaborate.  I would not expect TCP/IP to introduce what looks like analog noise.  [Oh, never mind -- you said "Noise = thermal noise within the instrument itself", so presumably the instrument is acquiring the (noisy) data, doing the Analog-to-digital conversion, and is sending the data via TCP/IP to the PCB (whatever that is -- just what is that?).

 

Bob Schor

0 Kudos
Message 4 of 18
(3,177 Views)

@TITAN-x wrote:

 

1- How can I clear out the noise in the red line and the blue line in the graph?

2- How can I minimize the oscillation of the graph? (Because as long as it oscillates the measured point is varying and hance calculated result keeps changing)

 

P.S 1- I previously tried filtering out the noise with a median filter, but due to the oscillation of the graph is too high and the base line keeps changing in almost every measurement process, this filter did not work.

 


How about the Savitzky Golay Filter?

savitzky.png

 

savitzky.png

Regards,
Alex

0 Kudos
Message 5 of 18
(3,162 Views)

 

Hello Alex,

I am so thankful for your reply. But unfortunatelly "drag & run" doesn't work for the snap you share. If you dont mind can you save it as VI and let me check the modifications you made over the actual VI.

Regards

Add 273 on whatever Celcius said.
-Kelvin
0 Kudos
Message 6 of 18
(3,147 Views)

there exist up to three savitzky golay related vis, if you have installed  the " Full Development System"

savitzky.PNG

 

I used this one:

Savitzky-Golay-Filter (VI)

http://zone.ni.com/reference/de-XX/help/371361L-0113/lvanls/sgfil/

 

there's also an example:

..\LabVIEW 2017\examples\Signal Processing\Filters\Savitzky-Golay Filtering.vi

 

0 Kudos
Message 7 of 18
(3,128 Views)

Hello Alex,

I will consider this one. Thanks again for your effort.

Add 273 on whatever Celcius said.
-Kelvin
0 Kudos
Message 8 of 18
(3,108 Views)

@TITAN-x wrote:

 

 

As you can seen from the image above I have one peak and one deep point in my real time measured graph. I actually have to measure the depth of the marked region continuously in order to go for some mathematical calculations.

 


So, what exactly do you want to "measure" and what is known about the peak? Does the width and position change or are these invariant? Do you have a mathematical model for the peak shape? If you have shape information, fitting the peak will immediately involve many points and smoothing (which can distort the shape!) will not be necessary at all. You can limit the fitting to a relatively narrow region (eg. 10x peak width). Involving far points makes no sense.

0 Kudos
Message 9 of 18
(3,104 Views)

Hello altenbach,

Let me clarify a confusion point. I am not interested in finding peaks. Instead, I would like to measure the "depth" in terms of dB that is shown in the very first image above. The issue I am facing is that; noise level of the signal shown red in color is quite high and I am not able to precisely measure and calculate the depth of the falling part in the signal. Another problem related to the measuring the depth is that; signal keeps swinging up and down. Hence the magnitude keeps changing. What do you suggest me to go with these two issues?

Regards

Add 273 on whatever Celcius said.
-Kelvin
0 Kudos
Message 10 of 18
(3,100 Views)