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: 

Filter Express VI sampling frequency

Solved!
Go to solution

I am a novice in LV. I want to know that is it really necessary to know sampling frequency if we want to use filter for our data? what is sampling frequency in Filter express VI? As it do not asks for a sampling frequency when we use it.

0 Kudos
Message 1 of 7
(3,589 Views)

Do you know the difference between the Analog World and the Digital World?  If I play middle on a properly-tuned Piano, the string will vibrate at 256 Hz (with overtones), and it would be in continuous motion (that is, it wouldn't matter how small a time interval I used, the string position would take on "smoothly-different" positions in that interval.  This is Analog.  If I play a DVD of someone playing middle C on the piano, 44,000 times a second a changing voltage is being sent to a loud-speaker (or headphone) and you hear a very good approximation of a 256Hz waveform.  This is Digital -- time isn't continuous (44K times/second) and neither is the voltage (it can only take on discrete values).

 

If you want to build an Analog Filter, you take a resistor and a capacitor (and possibly some analog amplifiers) and build a circuit.  If you want to build a Digital Filter, you first sample your waveform (at what is curiously called the "sampling frequency") and then perform some mathematical operation on the digital (meaning "finite precision", often 16-bit) Sample values.  The sampling frequency determines the "granularity" of your filter and its subsequent output representation.

 

Bob Schor

 

0 Kudos
Message 2 of 7
(3,549 Views)

Thank you @ BOB, your reply is quite good to understand. But what about Lab view? Is it same to use express VI filter to the other filters available in functions pallet? What i understand is that express VI filter is for signal in form of waveform (TDMS format for example) and other simple filter VI is for signal in form of values (some array). So if we have timing information already in our data, we can use express VI. Is it fine to use express VIs?

0 Kudos
Message 3 of 7
(3,546 Views)
Solution
Accepted by topic author irsa

The Filter Express VI takes Dynamic Data Type (DDT) or Waveform Data Type (WDT) signal(s) as input. The following screenshot shows how it works when using a WDT. As you can see there are three components needed to build a WDT, these are:

 

  •  timestamp: the time of your first data sample. Optional but critical if you are running your filter in a loop (multiple consecutive WDTs)
  • dt: The sample interval that is the time difference between two consecutive samples. This is also the inverse of your sample rate and how you tell the Express VI about your sample rate. If you don't specify this value your Express VI will assume you were sampling at 1 S/s.
  • Y: The actual data array assumed sampled with dt interval

image.png

 

Check out the help for WDT or DDT for more information on how to correctly manipulate your signals.

Message 4 of 7
(3,539 Views)

Thanks for your reply. Hence, i can use Express VI for filter as both normal VIs in LV and express VI are equally reliable. 

0 Kudos
Message 5 of 7
(3,500 Views)
Solution
Accepted by topic author irsa

From your perspective, the differences between a "real filter" (for example, Butterworth, from the Filter sub-Palette) and the Express VI Filter are the following:

  • The Butterworth filter has a unique icon (and Label), making it easier to tell from the Block Diagram what filter you are using.
  • The Butterworth filter has specific inputs for the data points (Y) and the sampling frequency (fs), whereas the Express VI requires that you create a Waveform (or, much worse, a Dynamic Data Type) from these values, making more work for the Developer.

My recommendation would be to not employ the "Express VI" shortcut.

 

Bob Schor

Message 6 of 7
(3,488 Views)

Actually i have data from human subjects and the data is saved in TDMS file format. Would it be safe to use an express VI Butterworth bandpass filter to filter my data? 

0 Kudos
Message 7 of 7
(3,475 Views)