How to Generate a clock pulse in Matlab ?

How can I generate a clock pulse with the function of time so that it sample my input signal at certain sampling rate let say at 1Khz. I mean on every rising egde of clock it must sample the input signal. could anyone can help how to write code for that clock ? The clock must be with respect to time. Thanks

2 Comments

Look at a pulse generator block, you can change f.
Thnak you. There is no f in the properties as I attached snap. Also how can I use rising edge of clock in my next block ? Thanks

Sign in to comment.

Answers (1)

See there is a period(s), its a time period, f=1/time period, to calculate the frequency. So Adjust the T in such a way that f equal 1 KHz, so t should be equal to 0.001 sec

5 Comments

With this configuration its not giving pulse output. please have alook into attached file. I set period 0.1 here for now.
Change pulse width 50% and confirm, is the problem solved?
No, still same. Actually I need standard clock which should have sampling time, width. I have to use that rising edge of clock for next block. and then I have to add some delay in that cock. I do not know this will work or not. Also it should be with the function of t.
@Sarfaraz your question seems very easy, I am guessing, look at Pulse type options, also for testing you can reduce the frequency so that more visibility in a cycle.
If there is no rise time and fall time delay, it should look like a square, otherwise its triangular depends on rising and fall time value
Pulse Width (PW) is the elapsed time between the rising and falling edges of a single pulse. To make this measurement repeatable and accurate, we use the 50% power level as the reference points.
Hope it helps you
Thank you. I require pulse wave where I can introduce some delay as well. could you help how can I do this ? Also I need to sample data on rising edge of clock. let say the attached snap is using simulation time. I dont want to use simulation time. wave should be function of time where I can adjust some delay. do you get my point sir ?

Sign in to comment.

Categories

Find more on Simulink in Help Center and File Exchange

Asked:

on 5 Oct 2018

Edited:

on 5 Oct 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!