Digital Signal Processing Reference
In-Depth Information
signal, x[n] will be used. The variable n is related to t with the equation t = nT s ,
where T s is the sampling time. If you measure the outdoor temperature every hour,
then your sampling time T s = 1 hour, and you would take a measurement at n = 0
(0 hours, the start time), then again at n = 1 (1 hour), then at n = 2 (2 hours),
then at n = 3 (3 hours), etc. In this way, the signal is quantized in time, meaning
that we have values for the signal only at specic times.
The sampling time does not need to be a whole value, in fact it is quite common
to have signals measured in milliseconds, such as T s = 0:001 seconds. With this
sampling time, the signal will be measured every nT s seconds: 0 seconds, 0.001
seconds, 0.002 seconds, 0.003 seconds, etc. Notice that n, our index, is still an
integer, having values of 0, 1, 2, 3, and so forth. A signal measured at T s = 0:001
seconds is still quantized in time. Even though we have measurements at 0.001
seconds and 0.002 seconds, we do not have a measurement at 0.0011 seconds.
Figure 1.4 shows an example of sampling. Here we have a (simulated) continuous
curve shown in time, top plot. Next we have the sampling operation, which is like
multiplying the curve by a set of impulses which are one at intervals of every 0.02
seconds, shown in the middle plot. The bottom plot shows our resulting digital
signal, in terms of sample number. Of course, the sample number directly relates
to time (in this example), but we have to remember the time between intervals for
this to have meaning. In this text, we will start the sample number at zero, just
like we would index an array in C/C++. However, we will add one to the index in
MATLAB code, since MATLAB indexes arrays starting at 1.
Suppose the digital signal x has values x[1] = 2, and x[2] = 4. Can we conclude
that x[1:5] = 3? This is a problem, because there is no value for x[n] when n = 1:5.
Any interpolation done on this signal must be done very carefully! While x[1:5] = 3
may be a good guess, we cannot conclude that it is correct (at the very least, we
need more information). We simply do not have a measurement taken at that time.
Digital signals are quantized in amplitude as well. When a signal is sampled, we
store the values in memory. Each memory location has a nite amount of precision.
If the number to be stored is too big, or too small, to t in the memory location,
then a truncated value will be stored instead. As an analogy, consider a gas pump.
It may display a total of 5 digits for the cost of the gasoline; 3 digits for the dollar
amount and 2 digits for the cents. If you had a huge truck, and pumped in $999.99
worth of gas, then pumped in a little bit more (say 2 cents worth), the gas pump will
likely read $000.01 since the cost is too large a number for it to display. Similarly,
if you went to a gas station and pumped in a fraction of a cent's worth of gas, the
cost would be too small a number to display on the pump, and it would likely read
$000.00. Like the display of a gas pump, the memory of a digital device has a nite
amount of precision. When a value is stored in memory, it must not be too large
Search WWH ::




Custom Search