LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help creating a logical filter for an anlog signal

Solved!
Go to solution

 

Dear all, 
I need to create a logical filter for an analog signal from 1f lock-in amplifier in a '.vi' file. The signal is recorded using DAQmx in the LabVIEW. The data of the amplifier is written in one column. I need to write another column based on a logical number (0 or 1) along the signal. 1 stands for the true and 0 stands for the false condition. Please see the image ('example_signal.png') in the attachment. The upper panel represents the analog signal of one channel. This signal has three distinct features i.e. maximum positive, maximum negative, and the zero crossing. Based on the information, a logical column in the data for the true and false conditions (as shown in the lower panel) is required for specific sample number/Time. How can this be done in LabVIEW data acquisition '.vi' file? Your help in this regard much appreciated. Thank you

Download All
0 Kudos
Message 1 of 4
(2,075 Views)
Solution
Accepted by topic author umja

Hi umja,

 

some simple pseudocode:

IF (current sample - previous sample) < 0 THEN
   output := 0
ELSE
  output := 1
ENDIF

(Well, the subtraction is a simple numeric derivation…)

 

Where exactly do you have problems? Where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,066 Views)

Thank you for the answer. I am fairly new to the labVIEW software. I wrote the program for data acquisition based on examples provided on the webpage of the national instruments. I do not know how this (logical filter) can be achieved and applied to the signal (dynamic data) in the '.vi' file (position mentioned in the red square in the 'vi.png'). So that it is written in the data set among other signals and later used as a reference for extracting the right signal.

0 Kudos
Message 3 of 4
(2,045 Views)

Would you start writing the program in C++ (or Java, or JavaScript) without learning the language first, just from some examples that do some of the things you need?

 

On the first page of this Forum, there are links to sites where you can spend some time and learn something about LabVIEW and code development.  Once you do, you should be able to go beyond the examples where somebody else wrote the code for you, and actually write the code that does what you need for yourself.

 

If you get stuck, we are here to help.  If you want someone to do your work for you, check out the Forum for LabVIEW Developers for Hire.

 

Bob Schor

0 Kudos
Message 4 of 4
(2,025 Views)