LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous signal to discrete

Solved!
Go to solution
Hi everyone,
I'm supposed to do a discrete time fourier transform (DTFT) for my input signal.
I got the input signal from "Basic Function Generator.vi" which is suppose to be a continuous and periodic signal. With respect to DTFT function, the signal has to be discrete and non periodic.
Now the question is, how to I convert the continuous signal to be discrete, and how can I make the signal non-periodic?
Thanks a lot in advance.
0 Kudos
Message 1 of 5
(5,350 Views)

Hi,

 

When you generate the waveform with the vi, it is already a discrete and non-periodic signal. 

 

It is a discrete signal because the function is not defined for all time, but only at the multiple of your sampling period, i.e. you only have data point at the sampling period intervals.  If you have a sampling rate of 0.1ms with initial time =0, you would have a point at 0, at 0.1ms, at 0.2ms, at 0.3ms, etc, and you will not have any data point at 0.05ms, 0.25ms, etc. 

 

It is a non-periodic signal, because at any given time, you would only have a waveform from a particular time instance to another particular time instance, and you will never have a waveform form from -inf to +inf, which is part of the definition of being periodic.  Let me know if this is clear or not.

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 2 of 5
(5,326 Views)

Hi Yik,

 

Thanks for your prompt reply. I understand your explanation. However, if i were to apply select a waveform from the vi, whether it's sine wave, sawtooth wave etc, what I would see is still a  continuous signal. I had linked the output of the vi directly to the graph, do I need to apply something else so that what I see are discrete values as what you had described earlier? 

 

As for the non-periodic signal I got my queries again. By default the waveform will start at 0 and ends at +inf unless i select true for reset signal for the vi, or change the x-axis scale to display the range which I want. Is there any other methods? 

 

Will adding another vi help me with this, because I only want to see the impulses for a given time range.  

 

-Gareth 

0 Kudos
Message 3 of 5
(5,319 Views)
Solution
Accepted by gareth1983

Hi Gareth,

 

The output of that VI is a waveform, which is a cluster with initial time (to), sampling period (dt), and a 1d array for the y-values.  To extract the 1d array of values, you can go to waveform -> get wfm comp and use that function. 

 

You can use waveform -> build wfm to change the to, dt, and 1d array.  For the 1d array, you just need to do some array manipilation to get your range correctly and feed the new array into the build wfm function.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
Message 4 of 5
(5,292 Views)

Hi Yik,

 

thanks a lot. It works as what I wanted.  

0 Kudos
Message 5 of 5
(5,279 Views)