取消
显示结果 
搜索替代 
您的意思是: 

Sampling a sine wave

已解决!
转到解答

Hi everyone

 

I am looking to sample a signal using labview.

 

I have produced a signal using the "simulate signal" block with controls for amplitude, frequency etc, and have varified that it works.

 

I want to sample this signal at regular intervals and store the data. Can anyone explain how to sample a signal in labview?

 

 

I have looked at the following white paper but it dealt more with the concept of sampling, rather than a tutorial of how to implement it:

 

http://www.ni.com/white-paper/3016/en/ 

 

 

I also looked at the following, which again didn't actually provide a tutorial:

 

http://www.ni.com/tutorial/3116/en/ 

 

 

I couldn't find anything else in my search. If anyone can point me in the direction of a tutorial for sampling it would be much appreciated

0 项奖励
1 条消息(共 14 条)
10,743 次查看

Hi David,

 

when you create a sine wave using "Simulate signal" you already have your samples!

So it is unclear, where/why/how you want to "sample your signal" again…

 

Can you please explain, what you really want to achieve?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
2 条消息(共 14 条)
10,737 次查看

I understand that, but it is for me to learn how sampling works, so I can utilise it for other applications in future. It is just for learning purposes

0 项奖励
3 条消息(共 14 条)
10,732 次查看

Hi David,

 

sampling means to get the value of a signal at a regular time interval.

 

A waveform in LabVIEW stores values of a signal at regular time intervals (aka dt), so when you create a waveform (even by SimulateSignal) you already get a "sampled signal"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
4 条消息(共 14 条)
10,727 次查看

I know what sampling means.

 

Obviously the purpose of the simulated signal is just to provide me with a signal to sample. 

 

Those sampling techniques will then be utilised for sampling real signals on an NI DAQ device. The simulated signal is just to provide me with a learning tool to learn sampling techniques, i.e. acquiring amplitudes at regular intervals

0 项奖励
5 条消息(共 14 条)
10,723 次查看

Hi David,

 

Obviously the purpose of the simulated signal is just to provide me with a signal to sample. 

No, the simulated signal is already sampled. There is no need to sample it again…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
6 条消息(共 14 条)
10,711 次查看

I feel that you are being quite pedantic and unhelpful here. Its a learning tool. Its not supposed to be a useful program, but a program to illustrate how to sample, I just need any sample as an input to test the sampling mechanism. I could go out and buy hardware worth a few thousand pounds, buy a signal generator, some cables, a module, connect it all together and then sample it with a DAQ block connected to some sampling code. Or I could just use a signal simulator. The end result of the experiment will not be a solution for nuclear fusion, or a hover car, but the end result will simply be that I understand how to sample a signal. That is the sole objective of this experiment. 

0 项奖励
7 条消息(共 14 条)
10,696 次查看

Hi David,

 

I feel that you are…

I feel we are talking about different things!

 

You want to "learn about sampling", but you start to learn that with a waveform already containing a sampled signal.

When you want to "sample" a sine wave you should start with scalar values. Get those values at regular time intervals and create a waveform from them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
8 条消息(共 14 条)
10,626 次查看

but sampling a simulated sine wave and sampling a continuous signal sine wave is going to work in exactly the same manner

0 项奖励
9 条消息(共 14 条)
10,620 次查看

Those sampling techniques will then be utilised for sampling real signals on an NI DAQ device. The simulated signal is just to provide me with a learning tool to learn sampling techniques, i.e. acquiring amplitudes at regular intervals



I just need any sample as an input to test the sampling mechanism

 

Using an NI DAQ device there are no other 'sampling techniques'. If you look at the vi snippet below, you see that the DAQ vi outputs a sampled signal just like the generate waveform vi. You don't get to do any sampling yourself or use a 'sampling mechanism', just change the input parameters to the vi to tell it sample rate, etc.

Therefore, I'm not quite sure what you are looking for (and obviously neither is GerdW who was actually trying to be helpful).

 

sampling.pngsamplesfp.png

 

If you are looking to observe what happens when you change the sample frequency for a given waveform (in order to experiment with aliasing, etc.) then you can take the given samples and 'downsample' using the Resample Waveform vi.

 

 

10 条消息(共 14 条)
10,575 次查看