| Mu Analysis and Synthesis Toolbox | ![]() |
Generate a VARYING matrix containing a cosine, sine, or step signal at an evenly spaced time interval
Syntax
out = cos_tr(freq,mag,tinc,lastt) out = sin_tr(freq,mag,tinc,lastt) out = step_tr(timedata,stepdata,tinc,lastt)
Description
cos_tr, sin_tr, and step_tr generate time signals for use with the trsp (time response) command. The following are the input variables provided to cos_tr and sin_tr:
freq |
frequency of the cosine (sine) signal (radians/second) |
mag |
magnitude of signal |
tinc |
time step (increment) |
lastt |
final time (the signal starts at time t=0) |
out |
time varying matrix of the cosine (sine) signal |
timedata |
time at which step occurs (vector) |
stepdata |
magnitude of step (vector) |
tinc |
time step (increment) |
lastt |
final time (the signal starts at time t=0) |
out |
time varying matrix of steps |
Examples
Synthesize a cosine signal with a 1 Hz frequency and of magnitude 1.5, 5 seconds in length. The time increment is .05 seconds.
out=cos_tr(2*pi,1.5,.05,5); vplt('iv,d',out) grid title('Generate a cosine signal via cos_tr') xlabel('time (seconds)') ylabel('Magnitude')
Algorithm
cos_tr and sin_tr call the MATLAB commands cos and sin, respectively.
See Also
minfo, siggen, trsp, vpck
![]() | cmmusyn | crand, crandn, sysrand, varyrand | ![]() |