Digital Signal Processing Reference
In-Depth Information
1. Create a signal x 1 , where x 1 = 2 cos(215t).
Make t a range large enough to show 2 repetitions of x 1 .
Plot x 1 .
What are the minimum and maximum values of x 1 from the graph?
Make the increment of t small enough that the plot of x 1 looks smooth (if it
already looks smooth, make it even smoother), then replot x 1 .
Answer:
One common problem with this is that a straight line appears instead of a
sinusoid. The problem stems from the argument to the cos function, namely,
making t go from 0 to some limit with a command like t=0:100. Since the
count is by 1, t is always an integer, and the argument to the cos function
is always an integer multiple of 2. Since the cos function repeats every 2,
the answer is always the same. To x this, let the range of t increment by a
fraction, such as t=0:0.001:1.
A 15 Hz sinusoid repeats 15 times per second. So one full repetition is 1/15.
Here is a nonsmooth plot:
t = 0:0.01:(2*1/15); x1 = 2*cos(2*pi*15*t); plot(x1)
Here is a smooth plot:
t = 0:0.001:(2*1/15); x1 = 2*cos(2*pi*15*t); plot(x1)
The minimum and maximum values are -2 and +2, respectively.
2. Let x 2 = x 1 + 2:5 cos(230t), and adjust t as needed.
Plot x 2 .
Again, from the plot, what are the minimum and maximum values?
Answer:
t = 0:0.001:(2*1/15);
x2 = 2*cos(2*pi*15*t) + 2.5 * cos(2*pi*30*t);
plot(x2)
The minimum and maximum values are approximately -2.7 and +4.5, respec-
tively.
Search WWH ::




Custom Search