# Frequency Shifting and Modulation

Learn how a shift in frequency is implemented in discrete-time processing.

## We'll cover the following

Given a signal, a shift in time results in a product between the original signal spectrum and a frequency-domain complex sinusoid. This has a counterpart in the frequency domain, as follows.

## Complex signals

If we multiply a signal $x[n]$ with a complex sinusoid in the time domain, we get a shift in the signal spectrum. Let’s call this new signal $y[n]$.

$y[n]=x[n]\cdot e^{j2\pi\frac{k_0}{N}n}$

From the DFT definition, we have:

$\begin{align*} Y[k]=&\sum_{n=0}^{N-1}\left(x[n]e^{j2\pi\frac{k_0}{N}n}\right)e^{-j2\pi\frac{k}{N}n}\\ =&\sum_{n=0}^{N-1}x[n]e^{-j2\pi\frac{k-k_0}{N}n}\\ =&X[k-k_0] \end{align*}$

## Real signals

What happens when, instead of a complex sinusoid, we multiply that signal with a real sinusoid? Euler’s identity is of help here.

$\cos( \omega n) = \frac{e^{j\omega n}+e^{-j\omega n}}{2}$

Clearly, $x[n]\cos (\omega n)$ would now result in *two shifts*, one at $+\omega$ (the positive part of the spectrum) and the other at $-\omega$ (the negative part of the spectrum). Let’s verify this by executing the following code:

Get hands-on with 1200+ tech skills courses.