A Unit Impulse Signal
Explore how a unit impulse signal forms the fundamental unit of discrete-time signals.
We'll cover the following...
No computer can plot a continuous-time sine wave. When we see such a figure on our screen, it’s in fact an interpolated version of a discrete-time sine wave in which the samples are joined together with straight lines.
A discrete-time sinusoid
To understand this idea, let’s generate another sinusoid but with a low sample rate. Here, we don’t join the individual samples to display the discrete-time signals, as shown below:
Press + to interact
Let’s run some code and observe the effect on this discrete-time signal.
Press + to interact
import numpy as npimport matplotlib.pyplot as plfigWidth = 20figHeight = 10# Generating a cosinefs = 10 # sample rateTs = 1/fs # sample timef = 1T = 1/fA = 1phi = 0t = np.arange(0, 2*T, Ts)s = A*np.cos(2*np.pi*f*t + phi)# Plotting the signalfig, ax = pl.subplots(figsize=(figWidth, figHeight))ax.vlines(t, ymin=s, ymax=0, color='g', linewidth=2, zorder=10, clip_on=False)ax.plot(t, s, 'o', color='orange', markersize=10, zorder=10, clip_on=False)# Axes linesax.axhline(y=0, color='k', linewidth=2)ax.axvline(x=0, color='k', linewidth=2)ax.set_xlim(-Ts, 2*T+Ts)ax.set_xticks(np.linspace(0, 2*T-2*Ts, 7))ax.set_xticklabels(np.arange(0, 21, 3))ax.set_ylim(-1.1, 1.1)ax.set_yticks(np.linspace(-1, 1, 5))ax.tick_params(labelsize=18)# Hide the right and top spinesax.spines['right'].set_visible(False)ax.spines['top'].set_visible(False)ax.set_title("A Discrete-Time Sinusoid", fontsize=18)ax.set_xlabel("$n$", fontsize=18)ax.set_ylabel("$x[n]$", fontsize=18)ax.grid()# saving figurepl.savefig('output/cosine-discrete.png')
As we can see, all discrete-time signals are constructed from individual samples.
A time-domain impulse
For this reason, a unit impulse ...