11-07-2013 10:28 PM
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?
11-08-2013 02:32 AM
11-08-2013 02:48 AM
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.
11-08-2013 02:52 AM - edited 11-08-2013 03:16 AM