10-26-2022 05:16 AM
As shown in the figure below, I bundled the two arrays collected together to form a waveform, and then wanted to make a Fourier transform on this waveform, but I found that there was no way to convert it into a time-domain waveform to connect. 😥
10-26-2022 06:39 AM
Hi XHLL,
@XHLL wrote:
I bundled the two arrays collected together to form a waveform,
Wrong!
You don't create a waveform by bundling two arrays into a cluster. You create a XY plot - which is completely different to a waveform…
Is your X array (aka timestamp array) using evenly spaced values? Then you just need the start time and dt to build a waveform using the functions in the waveform functions palette!
10-26-2022 07:05 AM
Hi GerdW,
I didn't exactly create a XY graph.
In fact, these two arrays were generated by using instructions to query the waveforms on the oscilloscope.
So your method may not apply to me.Thank you for your reply!
Best regards,
XHLL
10-26-2022 07:20 AM
Then we need to see the user manual of the device you're using.
Also, please upload your VI and use Save to Previous to, at least, LabVIEW 2018. They are better than uploading only images of partial code.
10-26-2022 08:27 AM
Hi XHLL,
@XHLL wrote:
I didn't exactly create a XY graph.
In fact, these two arrays were generated by using instructions to query the waveforms on the oscilloscope.
When you bundle two 1D array into a cluster and show that cluster on a graph then you are using a XY graph…
It doesn't help to call that cluster a "waveform" as waveforms are another distinct datatype in LabVIEW!
As has been said: describe your problem with more details, provide code and links to related manuals!
10-26-2022 12:46 PM - edited 10-26-2022 12:50 PM
@XHLL wrote:
As shown in the figure below, I bundled the two arrays collected together to form a waveform, and then wanted to make a Fourier transform on this waveform, but I found that there was no way to convert it into a time-domain waveform to connect. 😥
First, you have a glaring race condition because that property node will probably get read way before the indicator receives new data, so you either get nothing or process the result from a previous run in the same session..
In the image, you do an FFT of the Y array (NOT a cluster!), which has no timing information, but if you know the time spacing between the equally spaced points, you can calculate df from dt from first principles. You can use "build waveform" to add the timing information or you can just use the plain FFTs and handle the timing out of band.
No matter what, your code should give you an fft in shape, but it assumes a dt=1. If you don't get anything, something else is wrong (maybe the race condition?).
Attach your VI and some data and we will point you in the right direction. Also please never hide (or delete?) the label of terminals.
10-26-2022 08:48 PM
Here is my VI , the purpose of this code is to query the waveform information of the oscilloscope with commands to build XY plots and I want to Fourier transform it, as you said, I can probably add "create waveform" to achieve this! I'll give it a try!
10-26-2022 09:16 PM
I uploaded my VI to the conversation above and the zip is the manual for the instrument, thanks for your reply.