# Objective 2.1 — The Frequency Domain

| LO# | Description |
|----------|----------|
| 2.1 | I can graph a given sinusoidal signal, including DC components, in both the time and frequency domains and determine its bandwidth. |

By the end of this reading you should be able to:

1. Draw a signal in both the **time domain** and the **frequency domain**.
2. Place a **DC component** correctly in a spectrum.
3. Determine a signal's **bandwidth**.
4. Write a signal back in the time domain from its spectrum.

## Motivation

So far, we've only looked at very simple AC signals -- sinusoids.
However, real signals are inherently complex. Consider your favorite
song - at any one point in time you will hear several instruments, which
produce a range of frequencies. Can you imagine how difficult it would
be to analyze the signal in the time domain? This is why, for highly
complex signals, we typically analyze the signal with respect to
frequency instead of time. Frequency domain representations allow us to
view and manipulate signals in a more intuitive way. For example, if you
wanted to add more bass and less treble to your song, you would use an
equalizer. In essence, an equalizer is a simple filter -- one that
lets us select which frequencies to keep and which to remove. (A real
equalizer can also boost a band; the ideal filters in this course only
pass or remove.) If you wanted
more bass, then you could reduce the volume of the high frequencies
while keeping the volume of the low frequencies the same. In this
lesson, we will look at signals in the frequency domain.

### Frequency Domain

In Block I, we explained how the frequency of a sinusoid tells us the number of times the signal repeated
(or "cycled") in a second. To graph the signal as a function of time (or
in the *time domain*), we translated the frequency into a period using
the following equation:

$$T = \frac{1}{f}$$

When we start looking at moving information around, we will see that
understanding how fast a signal changes is often more important than
being able to trace it as it changes. Fast changing signals (with high
frequencies) require us to collect more data to fully capture them.

The technique we will use to represent the frequency content of a
message is known as an *amplitude spectrum*, or a plot or graph that
describes a signal's amplitude as a function of frequency. It is
important to realize a signal does not exist exclusively in the time or
frequency domain -- those are simply different ways we choose to
represent the signal. We can represent any signal as an equation, or as
a combination of sines and cosines, which can then be viewed as a time
domain waveform, or as a frequency spectrum plot. As we proceed
further, it will become clearer there is a definite relationship between
the two domains and each has its own usefulness. It is similar to
looking at an object through regular binoculars or through night vision
goggles -- we see the same object, but it appears differently.

Let's look at a sinusoid first. Electrical engineers like sinusoids
because they are mathematically straightforward and very easy to
analyze. In fact, in frequency domain there's only one value on the
x-axis instead of the infinite number of values for time we needed when
we graphed sinusoids in time. So, for an amplitude spectrum, instead of
plotting the function's value on the y-axis and time on the x-axis, we
will plot amplitude on the y-axis and frequency on the x-axis. To
translate a signal from the time domain to the frequency domain, we only
need to gather two pieces of information from the equation (or plot):
amplitude and frequency. For example, if we wanted to graph the
amplitude spectrum of the monotone signal:

$$v(t) = \mathbf{100}\cos\left( 2\pi \cdot \mathbf{440}t \right)\ \text{mV}$$

we simply draw a vertical line at 440 Hz (the frequency of the cosine
term), with an amplitude of 100 mV, as shown below. What this means is
that the signal, v(t), oscillates at a single frequency (440 Hz) and we
assume it never changes.

![](./ECE215_B2_Obj01_Reading_media/media/image1.png)

Figure 1: Frequency domain graph of a sinusoid with a frequency of 440
Hz

If we don't worry about any phase shifts (and we won't for the sake of
this lesson), then we can say the graph above contains exactly the same
information as the original equation. This is an important point. We now
have three distinct and useful ways of representing an electrical
signal:

-   An equation

-   A waveform (graphing voltage/current/power with respect to time)

-   An amplitude spectrum (graphing voltage/current/power with respect
    to frequency).

Now we can complicate things a little bit. True monotone (one single
frequency) sinusoids don't happen very often in the physical world. Even
just a single note on an instrument contains some additional tones,
which are slightly above and below the primary frequency. Also, if we
were to play the same note on a piano, it contains more than one
harmonic (higher frequency). These harmonics give each instrument its
unique sound. This is the reason why a piano sounds like a piano.

So, when we play an A above middle C on the piano, we get a signal with
a fundamental frequency of 440 Hz, plus a series of harmonic
frequencies, each one at a multiple of 440 Hz. Each successive harmonic
exists at a lower amplitude than the one before it.

It is easy to imagine how graphing this signal in the time domain would
become very complicated very quickly. But just to drive the point home,
the figures on the next page show the first five harmonics of the 440Hz
note in both the time domain (left) and frequency domain (right):

![time
domain_spectrum](./ECE215_B2_Obj01_Reading_media/media/image2.png)
![frequency
domain_spectrum](./ECE215_B2_Obj01_Reading_media/media/image3.png)

Figure 2: The first five harmonics of the 440 Hz note, in the time domain
(left) and the frequency domain (right)

In theory, these harmonics continue out to infinity, each one located at
a multiple of 440 Hz, but as we add more notes from more instruments,
the signal becomes even more complex. If we really wanted, we could
write the signal above as an equation:

$$v_{music}(t) = \mathbf{100}\cos{(2\pi \cdot \mathbf{440}t)} + \mathbf{91}\cos{(2\pi \cdot \mathbf{880}t)} + \mathbf{86}\cos{(2\pi \cdot \mathbf{1320}t)} + \mathbf{71}\cos{(2\pi \cdot \mathbf{1760}t)} + \mathbf{68}\cos{(2\pi \cdot \mathbf{2200}t)}\  + \ldots\ \ \text{mV}$$

Hopefully, you can see three things from this equation:

-   First, the time domain plot doesn't give much useful information

-   Second, the equation is fairly tedious and not that easy to digest

-   Third, each vertical line in the graph corresponds to a single
    cosine term in the equation

### DC Signals in the Frequency Domain

DC signals in the
frequency domain are important because sometimes we will want
to add a bias to a signal. For example, let's say that we want to add a
DC bias of 50 mV to the 440 Hz signal. The resulting formula for the
voltage would be:

$$v(t) = \mathbf{50}\ \text{mV} + \mathbf{100}\cos\left( 2\pi \cdot \mathbf{440}t \right)\ \text{mV}$$

At first glance, this does not appear helpful, as the bias term has no
cosine, and thus, no frequency. However, if we think of the DC voltage
as not fluctuating with time, hence having a frequency of 'zero' hertz
(0 Hz), and we keep in mind that cos(0) equals "1", we could
rewrite the above equation like this:

$$v(t) = \mathbf{50}\cos\left( 2\pi \cdot \mathbf{0}t \right)\ \text{mV} + \mathbf{100}\cos\left( 2\pi \cdot \mathbf{440}t \right)\ \text{mV}$$

Now we see that we can simply draw a spike at 'zero' to represent the DC
voltage.

![](./ECE215_B2_Obj01_Reading_media/media/image4.png)

Figure 3: Frequency domain graph of signal with DC bias and 440 Hz
sinusoid

:::{admonition} Key Concept
:class: key-concept

One sinusoid in time is **one spike** in frequency. A DC term is a spike at $f = 0$ — and if it is present, $f_{low} = 0$ when you compute bandwidth. Forgetting that is the classic error on this objective.
:::

### Bandwidth

*Bandwidth* is a very important term in ECE, and it refers to the range
of frequencies that a signal or system contains. Many people like to use
bandwidth to refer to cell phone or internet data rates, but for this
class, we will keep these notions separate. A range of frequencies will
be the bandwidth, and the speed at which you can transfer information on
a computer or cell phone will be the data rate.

We can calculate the bandwidth of a signal or system by subtracting the
lowest frequency from the highest frequency, as shown in the following
equation.

$$BW = f_{high} - f_{low}$$

For example, the bandwidth of the signal in Figure 3 is 440 Hz because
$f_{high} = 440\ Hz$ and $f_{low} = 0\ Hz.$ For the signal in Figure 2,
$f_{high} = 2.2\ kHz$ and $f_{low} = 440\ Hz$, so the bandwidth is 1.76
kHz. This brings us to two points. First, frequency domain graphs are
very helpful for calculating the bandwidth of a signal. Second, the
lowest frequency of a signal, $f_{low}$, will only be 0 Hz if the signal
has a DC bias.

::::{admonition} Type-along
:class: type-along

A signal is $v(t) = 2 + 4\cos(2\pi\cdot 100t) + 7\cos(2\pi\cdot 1200t) + 3\cos(2\pi\cdot 6000t)$.

1. Sketch the spectrum, labeling the position and height of every spike.
2. State the bandwidth.

:::{admonition} Solution
:class: dropdown

**1.** Four spikes: $f = 0$ at height 2 (the DC term), 100 Hz at 4, 1200 Hz at 7, and 6000 Hz at 3.

**2.** $f_{low} = 0$ because DC is present, and $f_{high} = 6000$ Hz, so $BW = 6000 - 0 = 6$ kHz.
:::

::::

## Wrap-Up

The time and frequency domains are two views of one signal: each sinusoid is a spike whose position is its frequency and whose height is its amplitude, and **DC sits at $f = 0$**. Bandwidth is $f_{high} - f_{low}$, remembering that a DC component pins $f_{low}$ to zero.

Objective 2.2 uses this directly — a filter is simply a rule about which of those spikes survive.
