Archive for the 'fourier' Category

MATLAB, fourier

MATLAB - FFT and Zero Padding

This is the fourth post in the blinkdagger signal processing series.

Introduction

Matlab Logo In the previous tutorial, we showed you how correctly scale your x-axis so that your FFT results were meaningful. In this post, we will be discussing zero-padding, a method that can help you better visualize/interpret your fft results. Zero-padding means that you append an array of zeros to the end of your input signal before you fft it. Luckily, the fft command within Matlab makes it very easy to zero-pad.

Why Zero Pad?

Two reasons that you might want to zero pad is to increase the number of data points to a power of 2. Traditionally, the FFT algorithm is more efficient when it is dealing with signals that contain 2^N data points. Nowadays, this isn't as important with the modern algorithms. Another reason for zero-padding is for a "better" resolution in the frequency spectrum. We'll discuss why quotes are used around better in a bit. In general, zero-padding can prove quite useful and should be used when using the fft command. In practice, it is helpful to zero pad a signal to 4 times it's original length, giving you a 4-fold increase in the frequency resolution.
Continue Reading »

MATLAB, fourier

Matlab - Introductory FFT Tutorial

This is the third post in the blinkdagger signal processing series. Click here to view the earlier posts.

Introduction

Matlab Logo In this tutorial, we will discuss how to use the fft (Fast Fourier Transform) command within Matlab. The fft command is in itself pretty simple, but takes a little bit of getting used to in order to be used effectively.

When we represent a signal within matlab, we usually use two vectors, one for the x data, and one for the y data. The fft command only operates on the y-data (converting the y-data from the time domain into the frequency domain), so it's up to the user to determine what the x-data in the frequency domain will be! This tutorial will show you how to define your x-axis so that your fft results are meaningful. In addition, it will show you how to obtain a two-sided spectrum as well as a positive frequency spectrum for a given signal.

Continue Reading »

MATLAB, fourier

A Super Simple Introduction to Fourier Analysis

This is the second post in the blinkdagger signal processing series. Click here to view the first post.

blackboard with lots of equations
Photo from Shonk

What IS Fourier Analysis??

This is an introductory post that tries to answer that question in a simple manner.

Fourier Analysis is based on the premise that any arbitrary signal can be constructed using a bunch of sine and cosine waves. See this crazy signal? It looks more like a conglomeration of random points.

Seemingly Random Signal

Believe it or not, we can recreate that signal using a lot of sine and cosine waves (more specfically, we would need an infinite number of waves to make this happen)! There's a bunch of theory that goes behind this statement, but we're not going to be discussing that here. But, you can go sunlightd.com or complextoreal.com for a great explanation.

Why would we want to recreate an arbitrary signal using sinusoids?

Why not recreate the signal using square waves? Or triangle waves? There are several reasons why sinusoids are used. Sine and Cosine waves have particular characteristics that make them special. Most notably, their amplitude, frequency, and phase. Sinusoids have the special property wherein any sinusoidal input to a linear time-invariant system results in a sinusoidal output that differs only in amplitude and phase shift, while retaining the frequency and wave shape.

Sinusoidal Fidelity

Sinusoids are the ONLY waveform to have this useful property, which makes Fourier analysis possible. But what exactly is a linear time-invariant system? (if you aren't familiar with LTI systems, click here to get the blinkdagger explanation).

So why is this useful?

All signals inherently have characteristics such as frequency, phase, and amplitude. In applications such as signal processing, image processing, communications, these characteristics are vital and offer invaluable insight. In the time domain, it is difficult to ascertain these qualities. But in the frequency domain, it is much easier.

How do we go from the time domain to the frequency domain?

dimension
Photo from Spacemonkey

The process by which this is done is called the Fourier transform. By representing a signal as the sum of sinusoids, we are effectively representing that same signal in the frequency domain. The details on this process can take an entire chapter within a textbook, so we won't dig too much into this. But you can go to Fourier Analysis for Beginners for more information. Once we transform the signal to the frequency domain, it is much easier to extract the pertinent information.

Okay, so it sounds somewhat useful, but can you give us a practical example?

Let's take another look at the crazy signal I showed you earlier:

Seemingly Random Signal

This is a signal of a building's response during an earthquake. Now, looking at that curve, there isn't very much useful information there. But lets take the fourier transform of that and see what we get (see graph below). Once we do this, we will begin to get a better idea on why fourier analysis is so valuable.

Frequency Spectrum for Crazy Signall

Okay, so I took the fourier transform of the signal, now what?

earthquake damage
Photo from heypaul

If you notice, there are large spikes at specific frequencies. What does this mean? Those are the resonant frequencies of the building. At those frequencies, the building will sustain the most damage. This is useful information to know, because builders can modify the building so that these resonant frequencies are mitigated. Using this kind of analysis, we can build structures that are able to withstand earthquakes. In areas where earthquakes are a real concern, this is of utmost importance.

What's Next?

This post was more theoretical and is meant to provide a foundation to build upon. We would like to stress that these posts, while informative and helpful, are not meant to be a substitute. , but the next couple of posts will involve the use of Matlab.

Next post: How to use FFT

fourier

Linear Time Invariant Systems: The Backbone of Fourier Theory

Introduction to Linear Time Invariant Systems

This is the first post in the blinkdagger signal processing series.

Fourier theory is predicated upon LTI (Linear Time Invariant) systems. Thus, before we even discuss signal processing, it is important to first understand what makes a particular system LTI. In this post, you will learn what classifies a system as LTI and why it plays a fundamental role in Fourier analysis.

There are three requirements for an LTI system which will be discussed in the following sections:

  1. Scalability
  2. Additivity
  3. Time Invariant

We will see how each property affects the following block diagram:

block diagram

Continue Reading »