Generate the three signals below with a suitable sampling frequency and a total
ID: 2247910 • Letter: G
Question
Generate the three signals below with a suitable sampling frequency and a total duration of T_tot = 0.1 s. If the signal is shorter than the total duration, add zeros to match T_tot (this is called zero-padding - check the total number of samples you get in the end). Write separate functions for each signal (e.g., generate square (): generate ramp (), zero pad ()): A normalized square-wave signal (sometimes called 'boxcar-function') with T_0 = 10 ms rect_T0 (t) = {1/T_0 if 0 lessthanorequalto t lessthanorequalto T_0 0 if t > T_0 MATLAB: ones (N, M), zeros (N, M) A linear ramp of duration T_0 = 10 ms lin_T_0 (t) = {t if 0 lessthanorequalto t lessthanorequalto T_0 0 if t > T_0 Think about which sampling rate to choose-it. would be good to end up with integer numbers of samples...Explanation / Answer
Square wave
collapse all in page
Syntax
x = square(t)
x = square(t,duty)
Description
x = square(t) generates a square wave with period 2 for the elements of time vector t. square(t) is similar to sin(t), but creates a square wave with peaks of ±1 instead of a sine wave.
Ramp
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.