Difference between revisions of "Fourier Series"

From PrattWiki
Jump to navigation Jump to search
(Singularity Function Shortcuts)
(Singularity Function Shortcuts)
Line 370: Line 370:
 
\hat{x}(t) & \mathbb{X}[k] & \hat{x}(t) & \mathbb{X}[k] \\
 
\hat{x}(t) & \mathbb{X}[k] & \hat{x}(t) & \mathbb{X}[k] \\
 
\delta(t) & \frac{1}{T} & \delta{t-t_0) & \frac{e^{-jk\omega_0t_0}{T}\\
 
\delta(t) & \frac{1}{T} & \delta{t-t_0) & \frac{e^{-jk\omega_0t_0}{T}\\
\end{array}\end{align*}<\math><\center>
+
\end{array}\end{align*}</math></center>
  
  

Revision as of 17:59, 28 February 2024

Introduction

This document takes a look at different ways of representing real periodic signals using the Fourier series. It will provide translation tables among the different representations as well as (eventually) example problems using Fourier series to solve a mechanical system and an electrical system, respectively.

Notation

The notation used on this page is a combination of notations from:

  • Signals and Systems, 2nd ed. Simon Haykin and Barry Van Veen. John Wiley & Sons, Hoboken, NJ, 2005. pp. 774, 777.
  • Signals and Systems, 2nd ed. Alan V. Oppenheim and Alan S. Willsky with S. Hamid Nawab. Prentice Hall, Upper Saddle River, NJ, 1997. p. 206.
  • Signals & Systems: Theory and Applications, Fawwaz Ulaby and Andrew Yagle. Available for free at https://ss2.eecs.umich.edu/

Signal Requirements

For a signal $$x(t)$$ to have a Fourier series representation, it must satisfy the following:

  • $$x(t)$$ must be periodic
  • $$x(t)$$ must be absolutely integrable over a period; that is:
    \(\int_T|x(t)|\,dt<\infty\)
  • $$x(t)$$ must have a finite number of local maxima and minima per period
  • $$x(t)$$ must have a finite number of discontinuities per period

Synthesis Equations

There are three primary Fourier series representations of a periodic signal \(f(t)\) with period \(T\) and fundamental frequency \(\omega_0=\frac{2\pi}{T}\); note that different sources may use different symbols for the series coefficients!

\( \begin{align} \mbox{Trigonometric Series}&~ & f(t)&=a_0+ \sum_{n=1}^{\infty}\left(a_n\,\cos(n\omega_0 t) + b_n\,\sin(n\omega_0 t)\right)\\ \mbox{Cosine Series} &~ & f(t)&= c_0 + \sum_{n=1}^{\infty}c_n\,\cos(n\omega_0 t+\theta_n)\\ \mbox{Exponential Series} &~ & f(t)&= \sum_{k=-\infty}^{\infty}\mathbb{X}[k]\,e^{jk\omega_0 t} \end{align} \)

In the series above, \(a_0\), \(a_n\), \(b_n\), \(c_0\), \(c_n\), and \(\theta_n\) are real numbers while \(\mathbb{X}[k]\) may be complex.

Analysis Equations

The formulas for obtaining the Fourier series coefficients are:

\( \begin{align} a_n&=\frac{2}{T}\int_{T}f(t)\,\cos(n\omega_0t)~dt & b_n&=\frac{2}{T}\int_{T}f(t)\,\sin(n\omega_0t)~dt \\ a_0=c_0&=\frac{1}{T}\int_{T}f(t)~dt & c_n&= \sqrt{a_n^2+b_n^2} \\ \theta_n&= \begin{cases} -\tan^{-1}\left(\frac{b_n}{a_n}\right) & a_n>0\\ 180^{\circ}-\tan^{-1}\left(\frac{b_n}{a_n}\right) & a_n<0 \end{cases}\\ \mathbb{X}[k]&=\frac{1}{T}\int_Tf(t)\,e^{-jk\omega_0t}~dt & \end{align} \)

Translation Table

The table below summarizes how to get one set of Fourier Series coefficients from any other representation. Note that it is assumed the function being represented is real - meaning \(a_n=a_{-n}^*\). Also, \(n>0\) in the table. The core equations at use in the translation table are:

\( \begin{align} e^{j\theta}&=\cos(\theta)+j\sin(\theta)\\ \cos(\theta+\phi)&=\cos(\theta)\cos(\phi)-\sin(\theta)\sin(\phi)\\ \mbox{atan2}(b_n,a_n)&= \begin{cases} \tan^{-1}\left(\frac{b_n}{a_n}\right) & a_n>0\\ \tan^{-1}\left(\frac{b_n}{a_n}\right)-180^{\circ} & a_n<0 \end{cases}\\ \end{align} \)
\( \begin{align} \begin{array}{|c|c|c|c|} \hline \mbox{Find:} & \mbox{From trig} & \mbox{From cosine} & \mbox{From exponential} \\ \hline a_n & a_n & c_n\cos(\theta_n) & \mathbb{X}[n]+\mathbb{X}[-n]=2\Re\{\mathbb{X}[n]\}\\ \hline b_n & b_n & -c_n\sin(\theta_n) & j\left(\mathbb{X}[n]-\mathbb{X}[-n]\right)=-2\Im\{\mathbb{X}[-n]\}\\ \hline a_0=c_0 & a_0 & c_0 & \mathbb{X}[0] \\ \hline c_n & \sqrt{a_n^2+b_n^2} & c_n & |\mathbb{X}[n]|+|\mathbb{X}[-n]|=2|\mathbb{X}[n]|\\ \hline \theta_n & -\mbox{atan2}(b_n,a_n) & \theta_n & \angle \mathbb{X}[n]\\ \hline \mathbb{X}[0] & a_0 & c_0 & \mathbb{X}[0] \\ \hline \mathbb{X}[n] & \frac{a_n}{2}+\frac{b_n}{2j}= \frac{a_n}{2}-j\frac{b_n}{2} & \frac{c_n}{2}\angle \theta_n & \mathbb{X}[n]\\ \hline \mathbb{X}[-n] & \frac{a_n}{2}-\frac{b_n}{2j}= \frac{a_n}{2}+j\frac{b_n}{2} & \frac{c_n}{2}\angle -\theta_n &\mathbb{X}[-n] \\ \hline \end{array} \end{align} \)

Common Fourier Series Pairs and Properties

The next two subsections present tables of common Fourier series pairs and Fourier series properties. The information in these tables has been adapted from:

  • Signals and Systems, 2nd ed. Simon Haykin and Barry Van Veen. John Wiley & Sons, Hoboken, NJ, 2005. pp. 774, 777.
  • Signals and Systems, 2nd ed. Alan V. Oppenheim and Alan S. Willsky with S. Hamid Nawab. Prentice Hall, Upper Saddle River, NJ, 1997. p. 206.

Common Exponential Fourier Series Pairs

Note in the table below, the discrete form of the Dirac delta function $$\delta[k]$$ is used. The definition of this function is: $$\begin{align*} \delta[k]&= \left\{ \begin{array}{cl} k=0 & 1\\ k\neq 0 & 0 \end{array} \right. \end{align*}$$

$$ \renewcommand{\arraystretch}{2.1} \begin{align*} \begin{array}{l l l} \mbox{Name} & \mbox{Signal} & \mbox{Fourier Series} \renewcommand{\arraystretch}{2.1} \\ \hline % \mbox{Basic Signal} & x(t)\mbox{, Period $T$} & \mathbb{X}[k]\mbox{, $\omega_0=\frac{2\pi}{T}$}\\ \hline % \mbox{Complex Exponential}& {\displaystyle x(t)=e^{jp\omega_0t}}& \mathbb{X}[k]=\delta[k-p]\\ \hline % \mbox{Cosine}& {\displaystyle x(t)=\cos(p\omega_0t)}& {\displaystyle \mathbb{X}[k]=\frac{1}{2}\left(\delta[k-p]+\delta[k+p]\right) }\\ \hline % \mbox{Sine}& {\displaystyle x(t)=\sin(p\omega_0t)}& {\displaystyle \mathbb{X}[k]=\frac{1}{j2}\left(\delta[k-p]-\delta[k+p]\right) }\\ \hline % \mbox{Constant}& {\displaystyle x(t)=c}& \mathbb{X}[k]=c\delta[k]\\ \hline % \mbox{Periodic Square Wave}& {\displaystyle \begin{array}{l} x(t)=\left\{ \renewcommand{\arraystretch}{1.2} \begin{array}{ll} 1, & |t|<T_1\\ 0, & T_1<|t|\leq\frac{T}{2} \end{array}\right.\\ \mbox{and }x(t+T)=x(t) \end{array}}& {\displaystyle \mathbb{X}[k]=\frac{\sin(k\omega_0T_1)}{k\pi}}\\ \hline % \mbox{Impulse Train}& {\displaystyle x(t)=\sum_{n=-\infty}^{\infty}\delta(t-nT)}& {\displaystyle \mathbb{X}[k]=\frac{1}{T}}\\ \hline \end{array} \end{align*} $$

Common Exponential Fourier Series Properties

$$ \renewcommand{\arraystretch}{2.0} \newcommand{\cc}{\circlearrowleft\!\!\!\!\!\!\!\!\!\!\;*~} \begin{align*} \begin{array}{l l l} \mbox{Property} & \mbox{Periodic Signal} & \mbox{Fourier Series}\\ \hline % \mbox{Basic Signals} & x(t), y(t), z(t);~T_x=T_y=T & \mathbb{X}[k], \mathbb{Y}[k], \mathbb{Z}[k];~\omega_0=\frac{2\pi}{T}\\ \hline % \mbox{Linearity} & z(t)=Ax(t)+By(t) & \mathbb{Z}[k]=A\mathbb{X}[k]+B\mathbb{Y}[k]\\ \hline % \mbox{Time Shifting} & z(t)=x\left(t-t_0\right) & \mathbb{Z}[k]=\mathbb{X}[k]e^{-jk\omega_0t_0}\\ \hline % \mbox{Frequency Shifting} & z(t)=e^{jk_0\omega_0t}x(t) & \mathbb{Z}[k]=\mathbb{X}[k-k_0]\\ \hline % \mbox{Conjugation} & z(t)=x^*(t) & \mathbb{Z}[k]=\mathbb{X}^*[-k]\\ \hline % \mbox{Time Reversal} & z(t)=x(-t) & \mathbb{Z}[k]=\mathbb{X}[-k]\\ \hline % \mbox{Time Scaling} & z(t)=x(\alpha t), \alpha>0 & \mathbb{Z}[k]=\mathbb{X}[k], T_z=\frac{T_x}{\alpha}\\ \hline % \mbox{Periodic Convolution} & z(t)={\displaystyle \int_{T}x(\tau)y(t-\tau)d\tau} & \mathbb{Z}[k]=T\mathbb{X}[k]\mathbb{Y}[k]\\ \hline % \mbox{Multiplication} & z(t)=x(t)y(t) & {\displaystyle \mathbb{Z}[k]=\sum_{l=-\infty}^{\infty}\mathbb{X}[l]\mathbb{Y}[k-l]}\\ \hline % \mbox{Differentiation} & z(t)=\frac{dx(t)}{dt} & \mathbb{Z}[k]=jk\omega_x\mathbb{X}[k]\\ \hline % \mbox{Integration} & {\displaystyle z(t)=\int_{-\infty}^{t}x(\tau)~d\tau}, \mathbb{X}[0]=0& \mathbb{Z}[k]=\left(\frac{1}{jk\omega_x}\right)\mathbb{X}[k]\\ \hline % \mbox{Properties of Real Signals} & z(t)\mbox{ real} & \left\{ \renewcommand{\arraystretch}{1.0} \begin{array}{l} \mathbb{Z}[k]=\mathbb{Z}^*[-k]\\ \Re\{\mathbb{Z}[k]\}=\Re\{\mathbb{Z}[-k]\}\\ \Im\{\mathbb{Z}[k]\}=-\Im\{\mathbb{Z}[-k]\}\\ |\mathbb{Z}[k]|=|\mathbb{Z}[-k]|\\ \measuredangle \mathbb{Z}[k]=-\measuredangle \mathbb{Z}[-k] \end{array} \renewcommand{\arraystretch}{2.0} \right.\\ \hline % \mbox{Properties of Real, Even Signals} & z(t)\mbox{ real and even}&\mathbb{Z}[k]\mbox{ real and even}\\ \hline % \mbox{Properties of Real, Odd Signals} & z(t)\mbox{ real and odd}&\mathbb{Z}[k]\mbox{ imaginary and odd}\\ \hline % \mbox{Isolation of Even Part} & z(t)=x_e(t)\mbox{ with x(t) real}& \mathbb{Z}[k]=\Re\{\mathbb{X}[k]\} \\ \hline % \mbox{Isolation of Odd Part} & z(t)=x_o(t)\mbox{ with x(t) real}& \mathbb{Z}[k]=j\Im\{\mathbb{X}[k]\} \\ \hline % \mbox{Parseval's Relation (Power)} & {\displaystyle P_{ave}=\frac{1}{T}\int_{T}|z(t)|^2~dt}& {\displaystyle P_{ave}=\sum_{k=-\infty}^{\infty}|\mathbb{Z}[k]|^2} \end{array} \end{align*} $$

Examples

Single-Frequency Sinusoid

The core concept for finding the Fourier Series coefficients for a single-frequency sinusoid is the Euler representation of a sinusoid. Imagine there is a component $$\hat{x}(t)$$ in your signal $$x(t)$$ that is a single frequency sinusoid oscillating at $$m$$ times the fundamental frequency of your signal (where $$m$$ is an integer). That component could be broken up into cosine and sine terms:

$$\begin{align*} \hat{x}(t)&=A\cos\left(m\omega_0t\right)+B\sin\left(m\omega_0t\right)\\ \hat{x}&=A\left( \frac{e^{jm\omega_0t}+e^{-jm\omega_0t}}{2} \right) + B\left( \frac{e^{jm\omega_0t}-e^{-jm\omega_0t}}{2} \right)\\ \hat{x}&=\left(\frac{A}{2}+\frac{B}{j2}\right)e^{jm\omega_0t} + \left(\frac{A}{2}-\frac{B}{j2}\right)e^{-jm\omega_0t} \end{align*}$$

From this you can see that the contributions to the Fourier series coefficients will be:

$$\begin{align*} \mathbb{X}[k]&=\begin{cases}\frac{A}{2}+\frac{B}{j2},&k=m\\\frac{A}{2}-\frac{B}{j2},&k=-m\end{cases}\end{align*}$$

Alternately, if you define your sinusoid using cosine with a phase angle:

$$\begin{align*} \hat{x}(t)&=C\cos\left(m\omega_0t+\phi\right)\\ \hat{x}(t)&=C\left(\frac{e^{j(m\omega_0t+\phi)}+e^{-j(m\omega_0t+\phi)}}{2}\right)\\ \hat{x}(t)&=\left(\frac{Ce^{j\phi}}{2}\right)e^{jm\omega_0t}+\left(\frac{Ce^{-j\phi}}{2}\right)e^{-jm\omega_0t}\end{align*}$$

you can see that the contributions to the Fourier series coefficients will be:

$$\begin{align*} \mathbb{X}[k]&=\begin{cases}\frac{Ce^{j\phi}}{2},&k=m\\\frac{Ce^{-j\phi}}{2},&k=-m\end{cases}\end{align*}$$

Multiple Single-Frequency Sinusoids

If the signal $$x(t)$$ is composed of cosines and sines at integer multiples of the fundamental frequency, the non-zero components will be at indices equal to that multiple and the value of those components will be based on the magnitude and phase of the sinusoid. As an example, if

$$\begin{align*} x(t)&=\alpha\cos(6t)+\beta\sin(10t)+\gamma\cos(16t+30^{\circ}) \end{align*}$$

you can start by finding the fundamental frequency of the signal. The component frequencies are 6, 10, and 16 rad/s and the GCF of those values is 2. You therefore have components oscillating at 3, 5, and 8 times the fundamental frequency; we could re-write $$x(t)$$ as:

$$\begin{align*} x(t)&=\alpha\cos(3\omega_0t)+\beta\sin(5\omega_0t)+\gamma\cos(8\omega_0t+30^{\circ}) \end{align*}$$

If we look at each component individually, we get the following:

$$\begin{align*} \alpha\cos(3\omega_0t)&\rightarrow\begin{cases}\frac{\alpha}{2},&k=3\\\frac{\alpha}{2},&k=-3\end{cases}\\ \beta\sin(5\omega_0t)&\rightarrow\begin{cases}\frac{\beta}{j2},&k=5\\-\frac{\beta}{j2},&k=-5\end{cases}\\ \gamma\cos(8\omega_0t+30^{\circ})&\rightarrow\begin{cases}\frac{\gamma}{2}e^{j30^{\circ}},&k=8\\\frac{\gamma}{2}e^{j30^{\circ}},&k=-8\end{cases}\end{align*}$$

and since $$e^{j30^{\circ}}=\frac{\sqrt{3}}{2}+j\frac{1}{2}$$ and $$e^{-j30^{\circ}}=\frac{\sqrt{3}}{2}-j\frac{1}{2}$$, that last one could be written as:

$$\begin{align*} \gamma\cos(8\omega_0t+30^{\circ})\rightarrow\begin{cases}\frac{\gamma\sqrt{3}}{4}+j\frac{\gamma}{4},&k=8\\\frac{\gamma\sqrt{3}}{4}-j\frac{\gamma}{4},&k=-8\end{cases}\end{align*}$$

meaning the full set of non-zero values would be:

$$\begin{align*} X[k]&=\begin{cases} \frac{\gamma\sqrt{3}}{4}+j\frac{\gamma}{4}, &k=8\\ \frac{\beta}{j2}, &k=5\\ \frac{\alpha}{2}, &k=3\\ \frac{\alpha}{2}, &k=-3\\ -\frac{\beta}{j2}, &k=-5\\ \frac{\gamma\sqrt{3}}{4}-j\frac{\gamma}{4}, &k=-8 \end{cases} \end{align*}$$

Products of Trig Functions

For products of trig functions, you have two options:

  • Use trig identities
  • Use Euler notation

Trig Identities

For the trig identities, you have:

$$\begin{align*} \cos\left(\theta\right)\cdot\cos\left(\phi\right)&=\frac{1}{2}\left(\cos\left(\theta+\phi\right)+\cos\left(\theta-\phi\right)\right)\\ \sin\left(\theta\right)\cdot\sin\left(\phi\right)&=\frac{1}{2}\left(\cos\left(\theta-\phi\right)-\cos\left(\theta+\phi\right)\right)\\ \cos\left(\theta\right)\cdot\sin\left(\phi\right)&=\frac{1}{2}\left(\sin\left(\theta+\phi\right)-\sin\left(\theta-\phi\right)\right)\\ \sin\left(\theta\right)\cdot\cos\left(\phi\right)&=\frac{1}{2}\left(\sin\left(\theta+\phi\right)+\sin\left(\theta-\phi\right)\right)\\ \end{align*}$$

so for $$A\,\cos(\omega_xt)\cdot\sin(4\omega_xt)$$ you could re-write it as $$\frac{A}{2}\left(\sin(5\omega_xt)-\sin(-3\omega_xt)\right)=\frac{A}{2}\left(\sin(5\omega_xt)+\sin(3\omega_xt)\right)$$ and then you can see that the fundamental frequency is $$\omega_x$$ in this case, there are signal components at 3 and 5 times that fundamental frequency, and you would end up with non-zero Fourier Series coefficients of:

$$\begin{align*} \mathbb{X}[k]&=\begin{cases}k=5,&\frac{A}{j4}\\k=3,&\frac{A}{j4}\\k=-3&-\frac{A}{j4}\\k=-5&-\frac{A}{j4}\end{cases} \end{align*}$$

Euler

To use Euler:

$$\large\begin{align*} x(t)&=A\,\cos(\omega_xt)\cdot\sin(4\omega_xt)\\ ~&=A\left(\frac{e^{j\omega_xt}+e^{-j\omega_xt}}{2}\right)\cdot\left(\frac{e^{j4\omega_xt}-e^{-j4\omega_xt}}{j2}\right)\\ ~&=\frac{A}{j4}\left(e^{j5\omega_xt}-e^{-j3\omega_xt}+e^{j3\omega_xt}-e^{-j5\omega_xt}\right) \end{align*}$$

Once again, the fundamental frequency is $$\omega_x$$ and now you can directly see terms that look like $$X[k]e^{jk\omega_0t}$$. You can thus determine the non-zero $$\mathbb{X}[k]$$ by inspection.

Building a Signal from Sinusoids

If your non-zero Fourier series coefficients are at a few indices, you can use the reverse process to build a signal. For a real signal, $$\mathbb{X}[k]=\mathbb{X}^*[-k]$$, so you only need to look at the non-negative indices. Since $$A\cos(m\omega_0t)$$ produces $$A/2$$ in the Fourier series, a real value $$C$$ at $$\mathbb{X}[m]$$ will result in $$2C\cos(m\omega_0t)$$ in the signal. Similarly, since $$B\sin(m\omega_0t)$$ produces $$B/(j2)$$ in the Fourier series, an imaginary value $$jD$$ at $$\mathbb{X}[m]$$ will result in $$-2D\sin(m\omega_0t)$$ in the signal (be careful with signs for sines).

Imagine you have a periodic signal $$x(t)$$ with a fundamental frequency $$\omega_0=3$$ and non-zero Fourier series coefficients given by:

$$\begin{align*} \mathbb{X}[k]&=\begin{cases} 3, & k=5\\ j2, & k=4\\ 4-j5, & k=2\\ 4+j5, & k=-2\\ -j2, & k=-4\\ 3, & k=-5\end{cases}[\end{align*}$$

We can translate this as follows:

$$\begin{align*} X[5]&=3 & ~&~6\cos(15t)\\ X[4]&=j2 & ~&~-4\sin(12t)\\ X[2]&=4-j5 & ~&~8\cos(6t)+10\sin(6t)\\ ~&~ & x(t)=&~8\cos(6t)+10\sin(6t)-4\sin(12t)+6\cos(15t) \end{align*}$$

For the $$k=2$$ case, $$4-j5=6.403\angle -51.34^{\circ}$$, meaning the $$k=2$$ terms could also be written as $$8\cos(6t)+10\sin(6t)=12.806\cos(6t-51.34^{\circ})$$ (note that the amplitude is again twice what is seen in the Fourier series coefficient).


Singularity Function Shortcuts

If you can write the equation $$\hat{x}(t)$$ for a single period of $$x(t)$$ such that $$\hat{x}(t)=0$$ for all values outside of that period, and if that function is comprised of a series of impulses and its integrals, you can use the integral property to find the contributions of each element within the series to the whole. The contributions are as follows:

\(\begin{align*}\begin{array}{cccc} \hat{x}(t) & \mathbb{X}[k] & \hat{x}(t) & \mathbb{X}[k] \\ \delta(t) & \frac{1}{T} & \delta{t-t_0) & \frac{e^{-jk\omega_0t_0}{T}\\ \end{array}\end{align*}\)


External Links