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: 

How can I convert a continuous waveform to a discrete waveform in Labview?

Please see the attached picture for reference, since I am not sure if I expressed myself correctly in English. My current waveform looks like the gray waveform, and I would like to convert it to the red waveform. Can anyone tell me how to do this in Labview? Thank you for your help!

0 Kudos
Message 1 of 5
(2,364 Views)

Hi Laura,

 

next time you should attach real pictures like PNG...

 

You could use a combination of Quotient&Remainder with Multiply to get your desired "discrete" waveform!

check.png

Best regards,
GerdW


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

@GerdW wrote:

Hi Laura,

 

next time you should attach real pictures like PNG...

 

You could use a combination of Quotient&Remainder with Multiply to get your desired "discrete" waveform!

check.png


Dividing and multiplying will reduce the data to the nearest multiple of 5, but the red line shows that the data is not discretised in the y domain but instead in the x domain, ie the time domain has been chopped.

To achieve this it seems you need to be selecting every nth data point, which is similar to downsampling your data. You can achieve this with the Align & Resample Express VI

http://zone.ni.com/reference/en-XX/help/371361J-01/lvexpress/align_and_resample/

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 5
(2,345 Views)

You can also use Decimate Array from the array pallete.  Set it up for, lets say 5 outputs, and it splits a 1D array into 5 separate 1D arrays.  Simply throw away 4 of them and you now have a 1D array with every 5th datapoint from your original array.

 

This restricts you to a set data point spacing so you'll need to decide if that's ok.

0 Kudos
Message 4 of 5
(2,339 Views)

I would use the Decimate Array.  Can you share some code so we can see where you are at?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(2,338 Views)