C9 · Lesson 1 · Signals in continuous and discrete time
Functions of time, and lists of numbers
A microphone puts out a voltage that changes smoothly with time: a function x(t), defined at every instant. Once a converter samples it, the same sound becomes a list of numbers, one every 1/48,000 of a second: a sequence x[n], defined only at whole numbers n. Most of electrical engineering moves signals back and forth between these two worlds, and the tools of this course work in both. They behave alike in most ways, but not in all. A sampled cosine, for one, may never repeat, and two different frequencies can give exactly the same samples.
- The dots are the samples , and the dashed curve is the cosine they were taken from. is in radians per sample.
- Start at (π/4): the pattern repeats every 8 samples. Now try 1.0: the samples never repeat exactly, because 2π/1 isn't a whole number or a ratio of whole numbers.
- Set to 5.498 (2π − π/4). The dashed curve wiggles fast, but the dots are the same as at 0.785. In discrete time, frequencies 2π apart are the same signal.
Predict
Is , a sampled cosine with = 1 radian per sample, periodic?
No. A period N must be a whole number of samples with a multiple of 2π, so N = 2πk for some whole k, and 2π is irrational. The values come close to repeating every 44 samples or so, but never exactly. A continuous cosine always repeats; its samples repeat only when is a ratio of whole numbers.
Name it
Two kinds of signal
A continuous-time signal x(t) is defined for every real t. A discrete-time signal x[n] is defined only for whole numbers n; it often comes from sampling, with sampling period T. Sampling a cosine of f hertz at samples a second gives
Periodicity
x(t) is periodic with period T if for all t. A discrete signal needs a whole-number period N. For that means for whole numbers m and N: periodic only when is rational, and in lowest terms N is the period. And because for every whole n, discrete-time frequencies only matter over a range of 2π, usually taken as −π to π. The highest frequency a sequence can have is π radians per sample: alternating signs.
Energy and power
and the power is the average of over all time. An energy signal has finite E (so zero average power), like a decaying pulse; a power signal has finite, nonzero power (so infinite energy), like a sinusoid, whose power is . (These are "energies" as if x were a voltage across 1 Ω.)
| Signal | Energy | Power |
|---|---|---|
| 0 | ||
| infinite | ||
| , | 0 |
Worked example
Find the energy and power of .
Show the solution
- Energy.
- Power. Finite energy means the average power over all time is 0: it's an energy signal.
- Check with the table. With , the table's gives the same 2.25.
Answer the energy is 2.25 and the average power is 0, so it's an energy signal.
Worked example
Is periodic, and with what period?
Show the solution
- Frequency as a fraction of a cycle.
- Period. That's a ratio of whole numbers in lowest terms, so the period is 16 samples.
- Cycles per period. In those 16 samples the underlying cosine goes through 3 cycles.
Answer yes, it's periodic, with a period of 16 samples.
Worked example
Find the average power and the RMS value of .
Show the solution
- Drop the cross term. Over a period the cross term averages to zero.
- Average power. The DC part and the sinusoid contribute power separately because they're orthogonal:
- RMS value.
- Power signal. The energy is infinite, so this is a power signal.
Answer the average power is 3 and the RMS value is ; it's a power signal.
Check
What is the energy of ?
Check
What is the average power of ?
Check
What is the period, in samples, of ?
Check
What is the energy of ?
Check
A 440 Hz cosine is sampled at 8000 samples a second. What is , in radians per sample?
Write units the way you normally would: 1.5 rad and 1500 mrad are the same answer.
Check
Which of these is a power signal (finite, nonzero average power)?
Check
Find the energy of with A = 3 and a = 0.5 (seconds).
(a)
What is its total energy?
(b)
By what time has half the energy arrived?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
Check
.
Step 1
What is its total energy?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
How much of it arrives between 0 and T?
Explain why
Why do and give exactly the same samples, while their continuous versions are different?
At a whole number n, adding 2π to the frequency adds to the angle, a whole number of full turns, which leaves the cosine unchanged. So every sample is the same. In continuous time, t takes values between the whole numbers too, and there the extra isn't a whole number of turns, so the two curves differ. Sampling only looks at the whole numbers and can't tell them apart. That's the root of aliasing, and it's why discrete-time frequency only needs a 2π range.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.