Question: Write a Matlab function that draws an essentially continuous sine wave, y(t)=sin(omega.t), for omega=pi and t on the interval [0,5] (draw this as a smooth
Write a Matlab function that draws an essentially continuous sine wave, y(t)=sin(omega.t), for omega=pi and t on the interval [0,5] (draw this as a smooth solid line, taking a very small delta t=0.001 for the purpose of making the plot)). Then, compute the samples of this sine wave at timesteps t_k=h.k for some microcontroller sample period h (draw the samples y_k as x symbols), taking h=0.1, 0.2, and 0.4. Then draw the "stair-step" like function y_zoh that results from applying a zero-order-hold (zoh) DAC to these samples. 3b. Then, modify your Matlab function to redraw the same smooth sine wave, and take the same samples (taking h=0.1, 0.2, and 0.4) but now draw the result of a first-order-hold (foh) DAC applied to these samples. In class, I called the foh a "hack"; looking at the plot you created, what do you like about the foh response, and what do you not like about the foh response? Discuss. [Hint: take y_foh(t)=y_k+(t-t_k).(y_k-y_{k-1})/h for t in [t_k,t_{k+1}]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
