06-27-2014 07:20 AM
Hello,
How to convert an analog signal into digital signal such that every sample of analog signal corresponding to 1.2V will be represented as '1' in digital signal and other samples of analog signal(that are not 1.2v) will be represented(converted) as '0' in digital signal.
And how to display both wavefroms or signals in graph indicators.
Thanks.
Solved! Go to Solution.
06-27-2014 07:34 AM
You need to choose a threshold to what is considered a 1 and 0. Sounds like you chose 1.2V. So just take your array and use the Greater Or Equal? function to compare all of your elements to 1.2. You can then use the Boolean to 0,1 function to change to a 0 or 1.
06-27-2014 07:36 AM
Use the "In Range and Coerce" primitive and feed the Value and for max and min set 1.2V +/- 0.2 or something to have a threshold. So if it is around 1.2 you will get "High" else you will get "low" boolean values. If you still want 0 or 1 out of it, then wire the boolean to "Boolean to (0,1)" primitive.
Edit: Tim, you are way to fast. 🙂
06-27-2014 09:09 AM
As posted by the cheat previously a better solution for a noise signal is to use a two level threshold.
http://forums.ni.com/t5/LabVIEW/Two-Threshold-Analog-to-Digital/td-p/2738762
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-27-2014 09:27 AM
@Hooovahh wrote:
As posted by the cheat previously a better solution for a noise signal is to use a two level threshold.
http://forums.ni.com/t5/LabVIEW/Two-Threshold-Analog-to-Digital/td-p/2738762
I forgot about that thread. That was a fun little thing to get working.
06-27-2014 09:29 AM
Hi,
With your suggestions I tried like this but I don’t know how to get a continuous digital sqaure signal (waveform) plot of the converted analog waveform.
Can anyone help me to the required?
06-27-2014 09:33 AM
You are reducing 1000 samples to a single scalar. You probably should operate on all 1000 elements at each iterations of the loop.
06-27-2014 09:33 AM - edited 06-27-2014 09:35 AM
I tried with a "collector" by taking 1000 samples but was unable to get the digital(sqaure pulses) waveform.
06-27-2014 09:34 AM
06-27-2014 09:34 AM
If you have 1000 samples, and you want to convert to digital, you are going to get 1000 digital values. Attached is what I mean.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord