LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter out noisy data?

I have spent ages recently trying to get a VI working and i have finally managed it and now taken loads of data. When it now comes to analysing the numbers, there is far too much noise and so im going to need to add a filter. The sensors were used to pick up motion but (obviously!!) have also picked up vibrations from the vehicle. It is now very difficult to see the actual data under all the rubbish. I have had a go at trying to solve the problem by importing the data from the .lvm file back into a VI and adding a low-pass filter, but the graph output has loads of '0' values and so makes the graph even worse! Im sure this must be a really easy task but i just dont have the knowledge!
I have attached one of the sets of data in question.

many thanks
andrew
0 Kudos
Message 1 of 10
(7,655 Views)
You didn't attach the data.
Randall Pursley
0 Kudos
Message 2 of 10
(7,643 Views)
I really should have checked that!

It wouldn't let me attach a .lvm so ive made it an .xls instead

Message Edited by adlamb on 05-12-2005 10:06 AM

0 Kudos
Message 3 of 10
(7,641 Views)
Assuming that your signal of interest is the slowly changing stuff, I did the following.

1. Converted the xls file into a tab-delimited txt file so I wouldn't have to try to process the xls file.
2. Read the txt file in as a spreadsheet string and then convert that string into a 2-D string array
3. Truncate the first 22 rows so that the remaining array contains only the data of interest.
4. Convert the 2-D string array into a 2-D double array.
5. Since there are 6 pairs of lines, I process them identically with a for-next loop.
6. I filter the y data line by first subtracting out the DC component, passing through the filter, adding in the DC component. This allows the filter to settle faster, but the first few points are still affected by the filter initializing.
7. I display the results.

I have attached the file as Labview 7.1.1.

This is a simple filtering process, but if I have filtered out something that you needed to keep you will have to change the cutoff and the order. You will also not be able to use the loop if the channels cannot be filtered the same way.
Randall Pursley
Message 4 of 10
(7,630 Views)
Im not sure I understand what you have done but it sure does work! Fantastic! Having now had a better look at the outputs, i perhaps didnt give you the best file as an example. I just chose the smallest but this only has about 2.5seconds of data. Ive run the filter on the other larger sets of data i have and it seems to work pretty well. Im trying to take out vibrations from an aircraft engine in flight. The values i need to keep are the motion of the aircraft. These vary from turbulance at a fairly high frequency to the pilot inducing a slow attitude change. Up until now, ive been using LabVIEW 7.1 and the express VI so im not used to the layout of the one you sent. I was trying to double click things to get properties and looking for a frequency value (in Hz) for the filter! I was expecting to find the filter set to somewhere between 50 and 100Hz low-pass but came across the 0.01 value near the butterworth filter. Reducing this value seems to lower the pass band so i think ive figured it out.? Can I split the 6 sets of data and create them each on a separate graph?

Thanks very much for your help!

Andrew
0 Kudos
Message 5 of 10
(7,611 Views)
I didn't know your sampling rate so I left it blank, so the .01 is relative to a sampling frequency of 1 Hz, so if your sampling rate is 100 Hz then the filter is set at 1 Hz, 1 kHz would mean the filter is set at 10 Hz, etc.

Take a look at the Butterworth Filter. One of the inputs is fs. Put your sampling frequency in there and then change the Fl input to a proportional value.
Randall Pursley
Message 6 of 10
(7,605 Views)
Ah it all makes sense now! Thanks for that. I added 100 constant for the fs value and then 1 in fl and it seems to work fine.
I just have one final question. I would like to be able to produce a graph for each of the 6 signals. All at once on the same VI or one at a time will be fine cos i will be saving each one anyway. Ive had a play with the numbers for the loop and can make it produce just one graph but cant seem to figure out how to tell it which graph i want! Or all six on a different set of axes for that matter.??

In the long run, i would like to be able to add this filter directly onto my data recording VI but i have no idea how to do that at all so that can be a future development!

Thanks for all your help

Andrew
0 Kudos
Message 7 of 10
(7,591 Views)
Each signal is in a cluster and all of the signals are present in an array of clusters. If you index the array, each cluster element can be directed to a separate X-Y graph using a for-next loop with a case statement inside. Each case statement will have a different X-Y Graph as the indicator and you use the counter in the for-next loop to drive the case statement (Element 0 will route to case 0, Element 1 to case 1 etc).
Randall Pursley
Message 8 of 10
(7,583 Views)
Thants EXACTLY what I was looking for!
Thanks so very much.

Best regards

Andrew
0 Kudos
Message 9 of 10
(7,574 Views)
Hello, I`m Sebastián from Argentina. I`m trying to filter a signal. The signal is in txt file, in where I only have the voltage data. The sampling frec. is 10KHz. The problem is de format of the data, because I can´t convert it to wave or signal format. I attach de vi and the txt
Download All
0 Kudos
Message 10 of 10
(7,019 Views)