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: 

a median filter that is not working as expected

RSE on a USB DAQ in a noisy Environment at 50hz?  Let me just guess (Oh magic 8-Ball ~~~ is the OP using a Laptop on Batteries Too?~~~ "It is Certain")

 

OK time to get back to hardware a signal specs


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 16
(698 Views)

The scales are different because all the high frequency noises are filtered out by the median filter. If I understand you guys correctly...then there is really no point in adding the extra white space to the picture. Like the two pictures I posted in the update post, the Y scale of the 2nd picture ranges from 0.55 to 0.9 because there is nothing bigger than 0.9 after the median filter while the Y scale of the 1st picture ranges from 0.5 to 1.2 because of the high frequency noise...I don't quite understand why the Y scales have to be the same when the range of data is different. If you are talking about the x scale...then yes it is different, but all the pitures show same number of data points.

 

Thank you for the responses about the grounding, express vi and high sampling rate though.

0 Kudos
Message 12 of 16
(691 Views)

"then there is really no point in adding the extra white space to the picture. "

 

Wrong. When i want to compare two signals "by eye", i exactly do that so i have the same y-axis (vertical) interval shown, in a way that both signal sequences are at the middle. Otherwise there is a good chance that you trick your eyes...

 

edit: also, I would compare the two signals at a somewhat lower range (but still, using the same range interval size!), even if it "cuts off" the noise spikes. In this way you might also see the noise "content" better in the two signals. Anyway, I would just oversample the signal with proper wiring and grounding (also using differential pin config) at 50 kHz, I am sure it would improve it a lot!

0 Kudos
Message 13 of 16
(686 Views)

The scales need to be the same to have the same turning algorithm when displayed.  There are more points than pixels!  which points are not showing?

 

Think of a digital oscope and the vertical display style options like Ave, peek detect normal etc... you have no control or visibility over that compression algorithm on the graph display.  Worse you are using Matlab to demonstrate how LabVIEW is manipulating your data and simply adding additional questions that are likely hiding the basic flaw.  

So, let's do go backwards and find out what the hardware is.  I'll bet you have more than an antenna, DAQ device and Windows PC.  If that is really all there is you have faulty hardware.  Then, please tell us what INFORMATION you are trying to observe about the data.  That would help us help you a whole lot!  

 

Right now we know only

1. You have data.

2. The noise in the acquired data is preventing you from making an assessment of fact.  What assessment and what parameters of the data are unknowns

3. You attempted to use a median filter and weren't able to resolve number 2.

 

So, could you please tell us more?


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 16
(672 Views)

I'm only going to address the Topic, "A median filter that is not working as expected".  I can think of three possibilities:

  • You don't understand Median Filters, and your expectations are wrong.
  • You understand Median Filters, but you programmed it wrong.
  • LabVIEW's Median Filter routine doesn't work correctly.

Here is a demonstration (an example of "Proof by Intimidation") that it is probably Door #2.

 

You posted a very large text file, Original.txt, with >600,000 points.  I took a subset of these points, namely the first 50000, converted them to Floats, ran them through the Median Filter, and plotted them, along with the original from which I had subtracted 0.2 to "move it down" on the plot.  I'm going to post a picture of the Front Panel, a Snippet of the Block Diagram, and attach the VI.  Note that the Median Filter appears to work, giving what appears to be a Low-Pass-filtered version of the original (certainly the big spike, consisting of a single point, is gone, and the rest of the signal has lower amplitude, less "noise").

Median Test FP.png

Median Test BD.png

Bob Schor

 

Message 15 of 16
(657 Views)

I Concur Bob

 

I see nothing wrong with the median filter

 

Digging through the two uses cases in the OP original the ptxpt is going to decimate the data by 50:1 while the median filter is going to glitch once per second.  Nice example


"Should be" isn't "Is" -Jay
0 Kudos
Message 16 of 16
(650 Views)