Signal Type Explorer
Copy this iframe to your website:
1 | |
Description
This MicroSim plots one of four basic signals (a sinusoid, a square wave, a decaying exponential or a unit step) as a continuous-time signal \(x(t)\), as a discrete-time signal \(x[n]\), or as both at once. The discrete-time view samples the plotted curve every \(T_s = 0.05\) s, so \(x[n] = x(nT_s)\) and the 4-second window holds samples \(n = -40\) to \(n = 40\).
Amplitude, frequency and phase set the signal. The time-shift and time-scale controls plot \(y(t) = x\big(a(t - t_0)\big)\): a positive \(t_0\) delays the signal, \(a > 1\) compresses it, \(0 < a < 1\) expands it, and Reverse makes \(a\) negative, which flips the signal about \(t = t_0\). A table under the plot reports the energy, average power and RMS amplitude and classifies each view as an energy signal or a power signal.
The simulation supports the section on signal classifications, parameters and operations in Chapter 2: Introduction to Signals and Systems.
| Signal | Definition | Classification |
|---|---|---|
| Sinusoid | \(x(t) = A\cos(2\pi f t + \phi)\) | Periodic, power signal |
| Square wave | \(x(t) = A\,\text{sgn}[\cos(2\pi f t + \phi)]\) | Periodic, power signal |
| Exponential | \(x(t) = A e^{-\alpha t}u(t)\) | Aperiodic, energy signal |
| Step function | \(x(t) = A\,u(t)\) | Aperiodic, power signal |
Energy, Power and RMS
The table reports closed-form results for the ideal, infinitely long signal, not estimates taken from the 4-second window:
| Signal | Energy \(E\) | Average power \(P\) | RMS \(=\sqrt{P}\) |
|---|---|---|---|
| Sinusoid | \(\infty\) | \(A^2/2\) | \(A/\sqrt{2}\) |
| Square wave | \(\infty\) | \(A^2\) | \(A\) |
| Exponential | \(A^2/(2\alpha\lvert a\rvert)\) | \(0\) | \(0\) |
| Step function | \(\infty\) | \(A^2/2\) | \(A/\sqrt{2}\) |
For the discrete-time view the integrals become sums, \(E = \sum_n |x[n]|^2\) and \(P = \lim_{N\to\infty}\frac{1}{2N+1}\sum_{n=-N}^{N}|x[n]|^2\). The sampled power equals the continuous-time power with one exception: when \(f\,|a|\) is a multiple of 10 Hz, the samples \(x[n] = A\cos(\Omega n + \theta)\) have \(\Omega\) equal to a multiple of \(\pi\), so they form a constant or alternating sequence \(\pm A\cos\theta\) and the sampled power is \(A^2\cos^2\theta\). The energy of the sampled exponential is a geometric series, \(E = A^2 / (1 - e^{-2\alpha |a| T_s})\) when a sample lands on the start of the exponential, which is roughly \(1/T_s = 20\) times the continuous-time energy.
Controls
- Signal and View choose the waveform and whether \(x(t)\), \(x[n]\) or both are drawn.
- Amplitude, Frequency and Phase set \(A\), \(f\) and \(\phi\). They are greyed out for signals that do not use them. For the exponential the frequency slider sets the decay rate \(\alpha\).
- Time shift and Time scale, and the Reverse checkbox, apply the signal operations.
- Pin keeps the current signal on the plot in a second color so you can compare. Up to three signals can be pinned (four traces in total). Clear removes the pinned signals.
A red note appears in the discrete-time views when the sinusoid or square wave has fewer than two samples per cycle (\(f\,|a| > 10\) Hz). The samples then no longer follow the continuous curve, an effect called aliasing that is covered in Chapter 5: Sampling and Quantization.
Lesson Plan
Learning Objectives
After using this MicroSim, students will be able to:
- Distinguish continuous-time and discrete-time representations of the same signal.
- Predict how amplitude, frequency and phase change a sinusoid.
- Classify a signal as an energy signal or a power signal from its energy and average power.
- Analyze how time shifting, time scaling and time reversal change a waveform and its energy or power.
- Explain why the samples of a sinusoid stop following the curve when \(f\,|a|\) exceeds 10 Hz.
Target Audience
Undergraduate students in an introductory signals and systems course. Plan 15-20 minutes.
Prerequisites
- Sine and cosine functions, radians and degrees
- The exponential function
- The idea of an integral as an area
Activities
Activity 1: Amplitude and power (5 min). Select the sinusoid, keep \(f = 1\) Hz and switch among the three views. Note the power and RMS for \(A = 2\) (2.00 and 1.41), then set \(A = 4\). The power becomes 8.00 and the RMS 2.83: power grows with the square of the amplitude, RMS grows linearly.
Activity 2: Phase versus time shift (5 min). With the sinusoid at \(A = 2\) and \(f = 1\) Hz, press Pin and set the phase to 180 degrees. The new curve is the pinned curve flipped about the time axis and the power is still 2.00. Return the phase to 0 and set the time shift to \(t_0 = 0.5\) s. The curve is flipped again, because a delay of half the 1 s period is the same as a phase of 180 degrees.
Activity 3: Scaling an energy signal (5 min). Select the exponential with \(A = 2\) and \(\alpha = 1\). The continuous-time energy is 2.00. Set the time scale to \(a = 2\) and the energy becomes 1.00; set \(a = 0.5\) and it becomes 4.00. Move the time shift or tick Reverse and the energy stays at 2.00. Then select the step function, tick Reverse and confirm that its power stays at 2.00.
Activity 4: Samples that do not follow the curve (5 min). Select the sinusoid in the Both view with \(A = 2\) and set \(f = 10\) Hz. Every sample sits at \(\pm 2\) and the discrete-time power reads 4.00 while the continuous-time power reads 2.00. Set the phase to 90 degrees and every sample is zero (the discrete-time class reads "Zero signal"). Then return the phase to 0 and set the time scale to \(a = 1.5\): the red note appears, and the dots trace a slow sinusoid with a period of 4 samples (5 Hz) although the continuous curve is a 15 Hz sinusoid.
Assessment
- By what factor do the average power and the RMS amplitude of a sinusoid change when the amplitude doubles? Power grows by a factor of 4 and RMS by a factor of 2, because \(P = A^2/2\) and RMS \(= A/\sqrt{2}\).
- Give the energy, power and class of \(x(t) = 3e^{-2t}u(t)\). \(E = 3^2/(2\cdot 2) = 2.25\), \(P = 0\), so it is an energy signal (select the exponential, \(A = 3\), \(\alpha = 2\) to check).
- Give the energy, power and RMS value of \(x(t) = 3\cos(2\pi \cdot 5t)\). \(E = \infty\), \(P = 3^2/2 = 4.5\), RMS \(= 2.12\), so it is a power signal (select the sinusoid, \(A = 3\), \(f = 5\) Hz to check).
- Which of the operations time shift, time scale and phase change the energy of an energy signal? Only time scaling does: a scale of \(a\) divides the energy by \(|a|\). A shift or a reversal leaves it unchanged.
- A 10 Hz sinusoid with phase 90 degrees is viewed in discrete time with \(T_s = 0.05\) s. Why is every sample zero? \(x[n] = 2\cos(2\pi \cdot 10 \cdot 0.05\,n + \pi/2) = 2\cos(\pi n + \pi/2) = -2\sin(\pi n) = 0\) for every integer \(n\).
Common Misconceptions
- "Shifting or scaling a signal changes its power." Pin a sinusoid and move the time shift: the power readout never changes. Scaling by \(a\) changes the energy of an energy signal (the exponential), but it leaves the power of a power signal (the sinusoid, square wave or step) the same.
- "A discrete-time signal is the same as the continuous curve with the gaps left out." \(x[n]\) exists only at integer \(n\), and its readouts can differ from the continuous-time ones. At \(f = 10\) Hz the sampled power is 4.00 rather than 2.00, and the sampled exponential energy (42.03 for \(A = 2\), \(\alpha = 1\)) is about 20 times the continuous-time energy (2.00).
References
- Energy (signal processing) - Wikipedia - definitions of signal energy and power for continuous and discrete time
- Discrete time and continuous time - Wikipedia - the two representations compared in the plot
- Heaviside step function - Wikipedia - the unit step \(u(t)\) used by the exponential and step signals
- Root mean square - Wikipedia - RMS amplitude and its relation to average power
- Aliasing - Wikipedia - why samples stop following the curve above 10 Hz in this MicroSim
- The Scientist and Engineer's Guide to Digital Signal Processing - Steven W. Smith - free online textbook covering signals, sampling and the basic waveforms
- Oppenheim, A. V., Willsky, A. S., & Nawab, S. H. (1997). Signals and Systems (2nd ed.). Prentice Hall. Chapter 1 covers signal energy and power, transformations of the independent variable, and the basic continuous-time and discrete-time signals.
- Lathi, B. P., & Green, R. A. (2018). Linear Systems and Signals (3rd ed.). Oxford University Press.