# Digital Signal Processing in Radio Astronomy

An NSF Research Experience for Teachers Program

### Linux Cheat Sheet

View the Project on GitHub

# 1. Fourier Analysis

Fourier Analysis is a very powerful tool that comes into play when we discuss periodic signals. Colloquially, a periodic signal repeats.

## 3.1. Introduction

Mathematically a signal $x(t)$ is periodic if there exists a positive constant $T$ such that: $x(t) = x(t + T)$ for all values of $t$. The smallest value of $T$ for which this is true is called the fundamental period and is denoted $T_o$. The corresponding fundamental frequency is $f_o = \frac{1}{T_o}$. If $T_o$ is in seconds, then $f_o$ is in Hertz (Hz). The fundamental angular frequency is $\omega_o = 2\pi f_o$ and is measured in rad/sec.

↑ Go to the Top of the Page

## 3.2. Fourier Series

A Fourier series is an expansion of a periodic function f(x) in terms of an infinite sum of sines and cosines. The computation and study of Fourier series is known as harmonic analysis and is extremely useful as a way to break up an arbitrary periodic function into a set of simple terms that can be plugged in, solved individually, and then recombined to obtain the solution to the original problem or an approximation to it to whatever accuracy is desired or practical. 1

Mathematically in a simple sense an arbitrary function $f(t)$ can be decomposed as:

We shall explore this concept by making two waveforms using sinosoids:

### 3.2.1. A Sqaure Wave

From Lab 1, we have the function generator. We use that to make a square wave of amplitude = 1.

Mathematically it can be written as:

Which has a period of $2\pi$. For an arbitrary period P:

The corresponding Fourier series of the square wave with period $2\pi$

and for arbirary period P:

Use more and more sources to add additional sinusoids and see what waveform you get after each added term. How many terms until you’re square wave looks good? 5? 10?

It should look similar to this:

This type of analysis is important for digital design in the sense that most digital signals are square waves, representing either a 1 or a zero. So if your signal is at 10MHz, how fast should the electronics and design work?

↑ Go to the Top of the Page

### 3.2.2. A Triangle Wave

The triangular wave is defined as: $f(x)=|x|\ for\ -1\lt x \leq 1\ and\ f(x+2)=f(x)\ for\ all\ x$

Its corresponding fourier series is:

Make a flowgraph out of the expanded terms above and check the output after each operation. Do you need more or fewer components to begin looking like a triangle wave as compared to a square wave? Why do you think that is?

It should give an output like this:

### 3.2.3. A Sawtooth wave.

Now mathematically define a sawtooth wave and find it’s Fourier series expansion. Then create its flow-graph, again with more and more Fourier components. Again, do you need more/less Fourier components as compared to a square or triangle wave?

## 3.3. Fourier Series and Fourier Transforms

We segue into the concept of Fourier transforms directly by seeing how they relate to fourier series. First some mathematics to associate familiarity, the Fourier transform of $x(t)$ is given by:

When x(t) is periodic and has a Fourier series expansion, this integral is pulling out those sines and cosines in the expansion.

In more detail: For the complex representation of a Fourier series of a periodic function $x(t)$ :

The co-effecients, $c_n$ of $x(t)$ (which has the period $T$ is given by the relation:

where $X(\omega)$ is the Fourier transform and $\omega_o = \frac{2\pi}{T}$

In summary, the Fourier series of a signal is a sum of sines and cosines. And, the Fourier transform decomposes the signal into it’s its frequency components with their relative strength. This can be visually seen in a neat animation as shown below ( credit: wikipedia ) and in the next section

↑ Go to the Top of the Page

### 3.3.1. Fourier Transform

Use the Square Wave and the Triangle Wave flowgraphs from the previous exercise.

First use a signal source block to make a square wave and feed the signal into a QT frequency sink

The Frequency Sink takes the Fourier Transform of the incoming signal and plots the output of the fourier transform

Place another QT Frequency Sink and change the number of inputs to the number of Fourier series sinusoids you have in your flowgraph and feed all the sinusoids (vis-a-vis the individual Fourier series terms) into the frequency sink

The output looks like this:

The colored peaks are the Fourier transforms of the individual sinusoids. Do they align with the Fourier Transform of the pure square wave? If you add more terms of the Fourier series to the sink, how do they compare?

Repeat this exercise for the triangle wave.

We’ve been taking Fourier transform of the signal every time we see a plot with frequency in the time axes.

We shall visit Fourier transforms in detail again that in Lab 5.

### 3.3.2. Example

We can also think of this to use gnuradio-companion to graphically get the Fourier components of a signal using a Fourier transform. Create a flow-graph with a signal source->FFT(Fourier transform)-> complex to real/imag -> vector sinks. The output of the real-part contains the cosine components of the transform. The imaginary part contains the sine components of the Fourier expansion.

It is also helpful to plot the time series to see what your input is and the frequency sink to make it easier to just read off the frequency of the components.

An example flowgraph looks like:

The FFT block is a special block which does the Fourier transform really fast. Play around with the FFT block and your general waveform generator from Lab 1 to take their Fourier transform. Use this to read off the Fourier series coefficients. This can still be used with a periodic signal with much less obvious structure.

1. http://mathworld.wolfram.com/FourierSeries.html