# 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!

Message 1 of 5
(2,478 Views)

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

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!

Best regards,
GerdW

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

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

@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!

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)

Message 3 of 5
(2,459 Views)

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

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.

Message 4 of 5
(2,453 Views)

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

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

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
Message 5 of 5
(2,452 Views)