LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Natural sampling of a generated signal

I am generating a sine wave using simulate signal. The sine wave is 100Hz. I am supposed to show natural sampling at 1KHz. So, basically 10 samples per period of sine wave. the object of the exercise is to sample the signal followed by putting it through a low pass filter (cut off frequency @ 500Hz) to show the original signal can be retrieved.

 

i tried using a relay as a natural sampler but i dont know how to generate a 1KHz clock. At max I can generate a 500Hz clock in a while loop using the wait function (min 1 ms delay between iterations) by inverting a boolean value every iteration using a shift register. but i can never use this value outside of the loop for some reason. the only possible way is to bring in the simulated signal and the relay inside the loop but then the frequency of the signal has to be changed and it gets way more complicated.

 

any ideas how i can solve this problem?

how can i do the same using sample and hold?

Download All
0 Kudos
Message 1 of 4
(2,441 Views)

Hi Whaque,

 

as you simulate the signal all you need to do is to simulate a sine wave with 1000 samples of 100 periods:

check.png

Best regards,
GerdW


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

Please take a look at the attached files. That's natural sampling. However its with a clock frequency of 500Hz. I need to sample the sine signal AFTER generating it to show the waveform in waveform chart 2. Filtering that with a low pass filter would give me the original signal back.

0 Kudos
Message 3 of 4
(2,410 Views)

Hi Whaque,

 

simulate a sine wave, then use a Decimate function. No need for all those ExpressVIs...

check.png

Best regards,
GerdW


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