LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cut off waveform noise

Solved!
Go to solution

Hello all,

 

I am reading some TDMS files I have created during data acquisition. The thing is that when there is no inputs, I pick up a low amplitude noise ( low in comparison to what I am probing) which of course has been recorded in my files.

 

I would like to set an amplitude threshold to cut off that signal. So, when the amplitude falls below that limit, the waveform elements will be all zeros and when it is equal or greater of that threshold I will be processing my original waveform normally.

 

I tried to do that with a case structure ( TRUE: output is a waveform constant of elements of zeros and the original dt step \ FALSE: get the original waveform without any editing) decision but the VI crashes.

 

Could anyone suggest an efficient way of doing this? If not with decision making but noise filters? My analyzing VI already performs plenty of calculations so I would like to do something very simple and straightforward without undermining processor resources.

 

Thank you very much

Panos

0 Kudos
Message 1 of 6
(4,502 Views)

Panos,

 

Typically the case structure is a very efficient way of doing such things.  Since it crashes your VI, you probably have something wired incorrectly. Please post your VI so we can see what you have tried.

 

Lynn

0 Kudos
Message 2 of 6
(4,479 Views)
Solution
Accepted by topic author Saloutios

In order for us to reproduce and fix the crash, it'll be great if you could post an example VI along with some example data.

 

As for the threshold, it seems you might be looking for something like this:

 

17751iCAAF89A4B9489380

 

Herbert

Message 3 of 6
(4,468 Views)

Thank both of you  for the replies!

 

Herbert, that  was so simple and so great the same time! Works fine!

Just for the record, what I tried to do was using a case structure where if the waveform was above the threshold, the waveform was passed through unedited and when it was below I created a waveform constant where I only changed the dt attribute to 0.0001sec ( which is the step of my waveform). The VI lagged and finally crashed. 

 

Can I make an additional question here without needing to start a new thread? As you can see I am adding up 5 waveforms. Is there a more efficient way of doing this? I know I can use the In Place Element Structure but I am not quite sure how it works and especially how to connect 5 waveform instead of two as presented at the NI Examples. Cheers Smiley Wink

 

17909iDF430DA2BA7C06A1

Message 4 of 6
(4,449 Views)

To the best of my knowledge, the waveform functions would internally do the same thing. The inplace structure helps you mostly if you replace portions of an existing array. If you're looking to improve performance, you might want to try replacing Express VIs with lower level functions, after that it might be helpful to replace waveforms with numeric arrays. Another aspect is that waveforms by default contain DBL arrays, whereas a lot of times, SGL precision would be enough to capture the accuracy you need. You can even go as far as using unscaled integers instead. That will reduce the amount of data you're processing by factor 2-4 and speed things up accordingly.

 

Herbert

0 Kudos
Message 5 of 6
(4,430 Views)

Thanks Herbert,

 

In my acquisition VI I am using low level I/O functions and a state machine architecture for saving but used Express VI's for post processing. It would be a good idea converting to TDMS file functions there too. As for data type, yeah, I am trying to retain as much as possible the waveform data type because I am kinda reluctant to convert to numerical as I might lose timestamps and other attributes. I am sure it can be done that way but I am afraid I will enter again a maze of debugging Smiley Sad

 

 

0 Kudos
Message 6 of 6
(4,409 Views)