The Fourier Transform is one of deepest insights ever made. Unfortunately, the meaning is buried within dense equations:

Yikes. Rather than jumping into the symbols, let's experience the key idea firsthand. Here's a plain-English metaphor:

**What does the Fourier Transform do?**Given a smoothie, it finds the recipe.**How?**Run the smoothie through filters to extract each ingredient.**Why?**Recipes are easier to analyze, compare, and modify than the smoothie itself.**How do we get the smoothie back?**Blend the ingredients.

Here's the "math English" version of the above:

- The Fourier Transform takes a time-based pattern, measures every possible cycle, and returns the overall "cycle recipe" (the amplitude, offset, & rotation speed for every cycle that was found).

Time for the equations? No! Let's get our hands dirty and *experience* how any pattern can be built with cycles, with live simulations.

If all goes well, we'll have an aha! moment and intuitively realize why the Fourier Transform is possible. We'll save the detailed math analysis for the follow-up.

This isn't a force-march through the equations, it's the casual stroll I wish I had. Onward!

## From Smoothie to Recipe

A math transformation is a change of perspective. We change our notion of quantity from "single items" (lines in the sand, tally system) to "groups of 10" (decimal) depending on what we're counting. Scoring a game? Tally it up. Multiplying? Decimals, please.

The Fourier Transform changes our perspective from consumer to producer, turning *What do I have?* into *How was it made?*

In other words: given a smoothie, let's find the recipe.

Why? Well, recipes are great descriptions of drinks. You wouldn't share a drop-by-drop analysis, you'd say "I had an orange/banana smoothie". A recipe is more easily categorized, compared, and modified than the object itself.

So... given a smoothie, how do we find the recipe?

Well, imagine you had a few filters lying around:

- Pour through the "banana" filter. 1 oz of bananas are extracted.
- Pour through the "orange" filter. 2 oz of oranges.
- Pour through the "milk" filter. 3 oz of milk.
- Pour through the "water" filter. 3 oz of water.

We can reverse-engineer the recipe by filtering each ingredient. The catch?

**Filters must be independent**. The banana filter needs to capture bananas, and nothing else. Adding more oranges should never affect the banana reading.**Filters must be complete**. We won't get the real recipe if we leave out a filter ("There were mangoes too!"). Our collection of filters must catch every possible ingredient.**Ingredients must be combine-able**. Smoothies can be separated and re-combined without issue (A cookie? Not so much. Who wants crumbs?). The ingredients, when separated and combined in any order, must make the same result.

## See The World As Cycles

The Fourier Transform takes a specific viewpoint: **What if any signal could be filtered into a bunch of circular paths?**

Whoa. This concept is mind-blowing, and poor Joseph Fourier had his idea rejected at first. (*Really Joe, even a staircase pattern can be made from circles?*)

And despite decades of debate in the math community, we expect students to internalize the idea without issue. Ugh. Let's walk through the intuition.

The Fourier Transform finds the recipe for a signal, like our smoothie process:

- Start with a time-based signal
- Apply filters to measure each possible "circular ingredient"
- Collect the full recipe, listing the amount of each "circular ingredient"

Stop. Here's where most tutorials excitedly throw engineering applications at your face. Don't get scared; think of the examples as "Wow, we're finally seeing the source code (DNA) behind previously confusing ideas".

If earthquake vibrations can be separated into "ingredients" (vibrations of different speeds & amplitudes), buildings can be designed to avoid interacting with the strongest ones.

If sound waves can be separated into ingredients (bass and treble frequencies), we can boost the parts we care about, and hide the ones we don't. The crackle of random noise can be removed. Maybe similar "sound recipes" can be compared (music recognition services compare recipes, not the raw audio clips).

If computer data can be represented with oscillating patterns, perhaps the least-important ones can be ignored. This "lossy compression" can drastically shrink file sizes (and why JPEG and MP3 files are much smaller than raw .bmp or .wav files).

If a radio wave is our signal, we can use filters to listen to a particular channel. In the smoothie world, imagine each person paid attention to a different ingredient: Adam looks for apples, Bob looks for bananas, and Charlie gets cauliflower (sorry bud).

The Fourier Transform is useful in engineering, sure, but it's a metaphor about finding the root causes behind an observed effect.

## Think With Circles, Not Just Sinusoids

One of my giant confusions was separating the definitions of "sinusoid" and "circle".

- A "sinusoid" is a specific back-and-forth pattern (a sine or cosine wave), and 99% of the time, it refers to motion in one dimension.
- A "circle" is a round, 2d pattern you probably know. If you enjoy using 10-dollar words to describe 10-cent ideas, you might call a circular path a "complex sinusoid".

Labeling a circular path as a "complex sinusoid" is like describing a word as a "multi-letter". You zoomed into the wrong level of detail. Words are about concepts, not the letters they can be split into!

The Fourier Transform is about circular paths (not 1-d sinusoids) and Euler's formula is a clever way to generate one:

Must we use imaginary exponents to move in a circle? Nope. But it's convenient and compact. And sure, we can describe our path as coordinated motion in two dimensions (real and imaginary), but don't forget the big picture: we're just moving in a circle.

## Following Circular Paths

Let's say we're chatting on the phone and, like usual, I want us to draw the same circle simultaneously. (*You promised!*) What should I say?

- How big is the circle? (Amplitude, i.e. size of radius)
- How fast do we draw it? (Frequency. 1 circle/second is a frequency of 1 Hertz (Hz) or 2*pi radians/sec)
- Where do we start? (Phase angle, where 0 degrees is the x-axis)

I could say "2-inch radius, start at 45 degrees, 1 circle per second, go!". After half a second, we should each be pointing to: starting point + amount traveled = 45 + 180 = 225 degrees (on a 2-inch circle).

Every circular path needs a size, speed, and starting angle (amplitude/frequency/phase). We can even combine paths: imagine tiny motorcars, driving in circles at different speeds.

The combined position of *all the cycles* is our signal, just like the combined flavor of *all the ingredients* is our smoothie.

Here's a simulation of a basic circular path:

(Based on this animation, here's the source code. Modern browser required. Click the graph to pause/unpause.)

The magnitude of each cycle is listed in order, starting at 0Hz. Cycles `[0 1]`

means

- 0 amplitude for the 0Hz cycle (0Hz = a constant cycle, stuck on the x-axis at zero degrees)
- 1 amplitude for the 1Hz cycle (completes 1 cycle per time interval)

Now the tricky part:

**The blue graph measures the**. Another lovely math confusion: the real axis of the circle, which is usually horizontal, has its magnitude shown on the vertical axis. You can mentally rotate the circle 90 degrees if you like.*real part*of the cycle**The time points are spaced at the fastest frequency**. A 1Hz signal needs 2 time points for a start and stop (a single data point doesn't have a frequency). The time values`[1 -1]`

shows the amplitude at these equally-spaced intervals.

With me? `[0 1]`

is a pure 1Hz cycle.

Now let's add a 2Hz cycle to the mix. `[0 1 1]`

means "Nothing at 0Hz, 1Hz of amplitude 1, 2Hz of amplitude 1":

Whoa. The little motorcars are getting wild: the green lines are the 1Hz and 2Hz cycles, and the blue line is the combined result. Try toggling the green checkbox to see the final result clearly. The combined "flavor" is a sway that starts at the max and dips low for the rest of the interval.

The yellow dots are when we actually measure the signal. With 3 cycles defined (0Hz, 1Hz, 2Hz), each dot is 1/3 of the way through the signal. In this case, cycles `[0 1 1]`

generate the time values `[2 -1 -1]`

, which starts at the max (2) and dips low (-1).

Oh! We can't forget phase, the starting angle! Use `magnitude:angle`

to set the phase. So `[0 1:45]`

is a 1Hz cycle that starts at 45 degrees:

This is a shifted version of `[0 1]`

. On the time side we get `[.7 -.7]`

instead of `[1 -1]`

, because our cycle isn't exactly lined up with our measuring intervals, which are still at the halfway point (this could be desired!).

**The Fourier Transform finds the set of cycle speeds, amplitudes and phases to match any time signal.**

Our signal becomes an abstract notion that we consider as "observations in the time domain" or "ingredients in the frequency domain".

Enough talk: try it out! In the simulator, type any time or cycle pattern you'd like to see. If it's time points, you'll get a collection of cycles (that combine into a "wave") that matches your desired points.

But… doesn't the combined wave have strange values between the yellow time intervals? Sure. But who's to say whether a signal travels in straight lines, or curves, or zips into other dimensions when we aren't measuring it? It behaves exactly as we need at the equally-spaced moments we asked for.

## Making A Spike In Time

Can we make a spike in time, like `(4 0 0 0)`

, using cycles? I'll use parentheses `()`

for a sequence of time points, and brackets `[]`

for a sequence of cycles.

Although the spike seems boring to us time-dwellers (*one data point, that's it?*), think about the complexity in the cycle world. Our cycle ingredients must start aligned (at the max value, 4) and then "explode outwards", each cycle with partners that cancel it in the future. Every remaining point is zero, which is a tricky balance with multiple cycles running around (we can't just "turn them off").

Let's walk through each time point:

At time 0, the first instant, every cycle ingredient is at its max. Ignoring the other time points,

`(4 ? ? ?)`

can be made from 4 cycles (0Hz 1Hz 2Hz 3Hz), each with a magnitude of 1 and phase of 0 (i.e., 1 + 1 + 1 + 1 = 4).At every future point (t = 1, 2, 3), the sum of all cycles must cancel.

Here's the trick: when two cycles are on opposites sides of the circle (North & South, East & West, etc.) their combined position is zero (3 cycles can cancel if they're spread evenly at 0, 120, and 240 degrees).

Imagine a constellation of points moving around the circle. Here's the position of each cycle at every instant:

Time 0 1 2 3 ------------ 0Hz: 0 0 0 0 1Hz: 0 1 2 3 2Hz: 0 2 0 2 3Hz: 0 3 2 1

Notice how the the 3Hz cycle starts at 0, gets to position 3, then position "6" (with only 4 positions, 6 modulo 4 = 2), then position "9" (9 modulo 4 = 1).

When our cycle is 4 units long, cycle speeds a half-cycle apart (2 units) will either be lined up (difference of 0, 4, 8…) or on opposite sides (difference of 2, 6, 10…).

OK. Let's drill into each time point:

- Time 0: All cycles at their max (total of 4)
- Time 1: 1Hz and 3Hz cancel (positions 1 & 3 are opposites), 0Hz and 2Hz cancel as well. The net is 0.
- Time 2: 0Hz and 2Hz line up at position 0, while 1Hz and 3Hz line up at position 2 (the opposite side). The total is still 0.
- Time 3: 0Hz and 2Hz cancel. 1Hz and 3Hz cancel.
- Time 4 (repeat of t=0): All cycles line up.

The trick is having individual speeds cancel (0Hz vs 2Hz, 1Hz vs 3Hz), or having the lined-up pairs cancel (0Hz + 2Hz vs 1Hz + 3Hz).

When every cycle has equal power and 0 phase, we start aligned and cancel afterwards. (I don't have a nice proof yet -- any takers? -- but you can see it yourself. Try `[1 1]`

, `[1 1 1]`

, `[1 1 1 1]`

and notice the signals we generate: `(2 0)`

, `(3 0 0)`

, `(4 0 0 0)`

).

In my head, I label these signals as "time spikes": they have a value for a single instant, and are zero otherwise (the fancy name is a delta function.)

Here's how I visualize the initial alignment, followed by a net cancellation:

## Moving The Time Spike

Not everything happens at t=0. Can we change our spike to `(0 4 0 0)`

?

It seems the cycle ingredients should be similar to `(4 0 0 0)`

, but the cycles must align at t=1 (one second in the future). Here's where phase comes in.

Imagine a race with 4 runners. Normal races have everyone lined up at the starting line, the `(4 0 0 0)`

time pattern. Boring.

What if we want everyone to *finish* at the same time? Easy. Just move people forward or backwards by the appropriate distance. Maybe granny can start 2 feet in front of the finish line, Usain Bolt can start 100m back, and they can cross the tape holding hands.

Phase shifts, the starting angle, are delays in the cycle universe. Here's how we adjust the starting position to delay every cycle 1 second:

- A 0Hz cycle doesn't move, so it's already aligned
- A 1Hz cycle goes 1 revolution in the entire 4 seconds, so a 1-second delay is a quarter-turn. Phase shift it 90 degrees backwards (-90) and it gets to phase=0, the max value, at t=1.
- A 2Hz cycle is twice as fast, so give it twice the angle to cover (-180 or 180 phase shift -- it's across the circle, either way).
- A 3Hz cycle is 3x as fast, so give it 3x the distance to move (-270 or +90 phase shift)

If time points `(4 0 0 0)`

are made from cycles `[1 1 1 1]`

, then time points `(0 4 0 0)`

are made from `[1 1:-90 1:180 1:90]`

. (Note: I'm using "1Hz", but I mean "1 cycle over the entire time period").

Whoa -- we're working out the cycles in our head!

The interference visualization is similar, except the alignment is at t=1.

Test your intuition: Can you make `(0 0 4 0)`

, i.e. a 2-second delay? 0Hz has no phase. 1Hz has 180 degrees, 2Hz has 360 (aka 0), and 3Hz has 540 (aka 180), so it's `[1 1:180 1 1:180]`

.

## Discovering The Full Transform

The big insight: our signal is just a bunch of time spikes! If we merge the recipes for each time spike, we should get the recipe for the full signal.

The Fourier Transform builds the recipe frequency-by-frequency:

- Separate the full signal (a b c d) into "time spikes": (a 0 0 0) (0 b 0 0) (0 0 c 0) (0 0 0 d)
- For any frequency (like 2Hz), the
*tentative*recipe is "a/4 + b/4 + c/4 + d/4" (the amplitude of each spike is split among all frequencies) - Wait! We need to offset each spike with a phase delay (the angle for a "1 second delay" depends on the frequency).
- Actual recipe for a frequency = a/4 (no offset) + b/4 (1 second offset) + c/4 (2 second offset) + d/4 (3 second offset).

We can then loop through every frequency to get the full transform.

Here's the conversion from "math English" to full math:

A few notes:

- N = number of time samples we have
- n = current sample we're considering (0 .. N-1)
- x
_{n}= value of the signal at time n - k = current frequency we're considering (0 Hertz up to N-1 Hertz)
- X
_{k}= amount of frequency k in the signal (amplitude and phase, a complex number) - The 1/N factor is usually moved to the
*reverse transform*(going from frequencies back to time). This is allowed, though I prefer 1/N in the forward transform since it gives the*actual*sizes for the time spikes. You can get wild and even use $1/\sqrt{N}$ on both transforms (going forward and back creates the 1/N factor). - n/N is the percent of the time we've gone through. 2 * pi * k is our speed in radians / sec. e^-ix is our backwards-moving circular path. The combination is how far we've moved, for this speed and time.
- The raw equations for the Fourier Transform just say "add the complex numbers". Many programming languages cannot handle complex numbers directly, so you convert everything to rectangular coordinates and add those.

## Onward

This was my most challenging article yet. The Fourier Transform has several flavors (discrete/continuous/finite/infinite), covers deep math (Dirac delta functions), and it's easy to get lost in details. I was constantly bumping into the edge of my knowledge.

But there's always simple analogies out there -- I refuse to think otherwise. Whether it's a smoothie or Usain Bolt & Granny crossing the finish line, take a simple understanding and refine it. The analogy is flawed, and that's ok: it's a raft to use, and leave behind once we cross the river.

I realized how feeble my own understanding was when I couldn't work out the transform of `(1 0 0 0)`

in my head. For me, it was like saying I knew addition but, gee whiz, I'm not sure what "1 + 1 + 1 + 1" would be. Why not? Shouldn't we have an intuition for the simplest of operations?

That discomfort led me around the web to build my intuition. In addition to the references in the article, I'd like to thank:

- Scott Young, for the initial impetus for this post
- Shaheen Gandhi, Roger Cheng, and Brit Cruise for kicking around ideas & refining the analogy
- Steve Lehar for great examples of the Fourier Transform on images
- Charan Langton for her detailed walkthrough
- Julius Smith for a fantastic walkthrough of the Discrete Fourier Transform (what we covered today)
- Bret Victor for his techniques on visualizing learning

Today's goal was to *experience* the Fourier Transform. We'll save the advanced analysis for next time.

Happy math.

## Appendix: Projecting Onto Cycles

Stuart Riffle has a great interpretation of the Fourier Transform:

Imagine spinning your signal in a centrifuge and checking for a bias. I have a correction: we must spin *backwards* (the exponent in the equation above should be $e^{-i 2 \pi...}$). You already know why: we need a phase *delay* so spikes appear in the *future*.

## Appendix: Another Awesome Visualization

Lucas Vieira, author of excellent Wikipedia animations, was inspired to make this interactive animation:

Fourier Toy - Click to download, requires flash

(Detailed list of control options)

The Fourier Transform is about cycles added to cycles added to cycles. Try making a "time spike" by setting a amplitude of 1 for every component (press Enter after inputting each number). Fun fact: with enough terms, you can draw any shape, even Homer Simpson.

Check out http://www.jezzamon.com/fourier/ for a great tool to draw any shape using epicycles.

## Appendix: Article with R code samples

João Neto made a great writeup, with technical (R) code samples here:

http://www.di.fc.ul.pt/~jpn/r/fourier/fourier.html

## Appendix: Using the code

All the code and examples are open source (MIT licensed, do what you like).

- Interactive example (view source)
- Github gist
- Reddit discussion on details of the computation, I'm pb_zeppelin

## Other Posts In This Series

- A Visual, Intuitive Guide to Imaginary Numbers
- Intuitive Arithmetic With Complex Numbers
- Understanding Why Complex Multiplication Works
- Intuitive Guide to Angles, Degrees and Radians
- Intuitive Understanding Of Euler's Formula
- An Interactive Guide To The Fourier Transform
- Intuitive Understanding of Sine Waves
- An Intuitive Guide to Linear Algebra
- A Programmer's Intuition for Matrix Multiplication
- Imaginary Multiplication vs. Imaginary Exponents

gordDecember 20, 2012 at 8:12 amHey, great use of animations to explain and edify..

and I much appreciate your crediting and linking to my HTML5 sine animation.. Kudos!

Nice article!

gord.

seanDecember 20, 2012 at 8:24 amawesome! if the world does come to an end today, i can at least die having understood the basics of DFT :)

An Interactive Guide To The Fourier TransformDecember 20, 2012 at 9:04 am[…] betterexplained.com/articles/an-interact… […]

MikeDecember 20, 2012 at 11:14 amThis is really, really awesome. Thank you for sharing!

mattDecember 20, 2012 at 11:19 amAbsolutely fantastic article, thanks for this!

BoDecember 20, 2012 at 1:04 pmSpectacular article – I’ve always wanted to see it explained in an intuitive way and you’ve finally done it. Congrats on all the hard work.

josh AgDecember 20, 2012 at 2:03 pmI think you should make a similar post for explaining fourier transforms as a change of basis from time to frequency.

kalidDecember 20, 2012 at 2:13 pm@gord: Thanks for the note — the pleasure was all mine, your original sine animation was incredible! So concise and effective.

@sean: Hah, I feel the same!

@Mike, @matt, @Bo: Thanks, I appreciate it :)

@josh: Great point. I’d like to do a follow-up going into some of the more advanced math & interpretations. There’s some good overlaps with linear algebra here too.

SteveDecember 20, 2012 at 3:16 pmGreat explanation! Thanks.

Is there somewhere that explains convolution this well?

kalidDecember 20, 2012 at 6:05 pm@Steve: Glad you enjoyed it! I don’t have an article on convolution yet, but it’d be a great follow-up.

@Marnee: Looks like it didn’t work for you! The key is realizing whether you’re looking at “ingredients” (inputs) or the “cooked meal” (output). The transform lets you switch between the two. Smoothies are nice because there’s just blending/separating, no “cooking” that is difficult to undo.

Amr AbughazalaApril 5, 2017 at 1:42 ambut how this analogy works to explain loop through every frequency to get full transform.

In the beginning, he started that all frequencies are there 1 Hz 2 Hz 3 Hz … xHz and we are going take take care of their amplitudes (each / x) and their delays to end at the same time (phase shift based on each frequency) and then the sum already is the cooked meal.

But there were an extra step of loop through every frequency (recipe) to get full transformation, I thought that all are handled already.

Bookmarks for December 20th | Chris’s Digital DetritusDecember 20, 2012 at 7:58 pm[…] An Interactive Guide To The Fourier Transform | BetterExplained – This entry was posted in Web Bookmarks and tagged fft, math, tutorial by chris. Bookmark the permalink. […]

JamesDecember 20, 2012 at 8:16 pmI really like your presentation!

I recently wrote a tutorial on the DFT as well, though I came at it from a different point of view. My understanding of it is based on correlation between the time domain signal and a series of sinusoids of increasing frequency: http://practicalcryptography.com/miscellaneous/machine-learning/intuitive-guide-discrete-fourier-transform/

FranciscoDecember 20, 2012 at 8:55 pmHey, man, this is really great. I like to use DFTs for stochastic processes and look at their underlying trend (this is similar to harmonic regression, which is kinda’ cool). Thanks for this!

ReneDecember 20, 2012 at 11:42 pmNicely done!

Yves DaoustDecember 21, 2012 at 1:01 amRarely seen such a complicated and confusing presentation of the Fourier transform. Sorry, I didn’t like it.

pawan yadavApril 3, 2017 at 2:10 amit was the best presentation for fourier transformation i ever seen….did you understand mr. yveeees daust….

An Interactive Guide To The Fourier Transform | My BlogDecember 21, 2012 at 3:40 am[…] An Interactive Guide To The Fourier Transform (betterexplained.com) […]

pawan yadavApril 3, 2017 at 2:03 amit was the best presentation for fourier transformation i ever seen….did you understand mr. yveeees daust….

An Interactive Guide To The Fourier Transform - Márcio Francisco Dutra e CamposDecember 21, 2012 at 3:45 am[…] http://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/ Diversos none […]

KwazaiDecember 21, 2012 at 4:02 amI learned it as a way to approximate the solution to conductive heat transfer integral math. The length of the series that substitutes for the equation has diminishing changes after only a few members of the series are calculated. when the material constants are only measureable to within 10%, the answer would be good. the integral math would normally be very hard to solve- the series is easy comparatively speaking (accurate to how many places….).

It was at that time taught for computerized solutions as finite difference method (rather than finite element method). letting the computer grind out the solution to ‘complicated’ math. Not quite Rayleigh’s ‘shooting’ method (superposition methods solved with a first guess on computer-ie natural frequencies of rotating shafts) but at least as effective. Bessel functions ultimately similar- just more obtuse (3rd order nonlinear partial diff eq….) approximations.

NeilPostDecember 21, 2012 at 6:20 amSorry, Fourier transform’s rotted my brain an University, and I accepted a career in Computing and not Electrical and Electronic Engineering :-)

I know my place.

Dan SuttonDecember 21, 2012 at 8:55 amWhat a great article – I’ve been playing on and off with Fourier transforms for years… I don’t think I’ve ever seen anyone elucidate on the subject quite as well as this…

PeterDecember 21, 2012 at 10:07 amI got stuck at the first formula, where there is an x missing in the exponent.

zaine_ridlingDecember 21, 2012 at 10:36 amLoved this! I’m going to reread it about four more times until I’ve memorized it.

kalidDecember 21, 2012 at 10:58 am@James: Glad you liked it! Thanks for the link, I’ll check it out (I’m planning on doing a more math-focused follow-up, so that’ll come in handy).

@Francisco: More than welcome, glad you enjoyed it.

@Rene: Thanks!

@Yves: No problem :). Beauty (a clear explanation?) is in the eye of the beholder.

@Kwazai: Neat stuff! I believe heat transfer was the original use case for the transform. I’m a physics newbie but would like to get into more applications.

@NeilPost: The Fourier Transform was a brutal mistress for most of us ;).

@Dan: Thanks, really glad it’s helping!

@Peter: D’oh! Of course there’d be a typo in the first line. Fixed now.

@Zaine: Awesome. If there are any parts that are confusing after the 2nd reading, I probably need to reword them :).

RachelJuly 6, 2017 at 8:05 amI know this was years ago, but I’d still love a mathier follow up post. This explanation is awesome and it would be great to have it expanded upon!

KwazaiDecember 21, 2012 at 1:11 pm@Glukk-

the only way I know to ‘abort’ the system as we know it (prostitutes like bankers…) is to give it away. Best things in life are not free-they just make you happy to think they are.

Engineering is the art(science?) of fudge factors…

Mother Earth News solved the global energy crisis in the 70’s- nobody listened….

Garth McKayDecember 21, 2012 at 2:44 pmKalid, your article appeared in my mailbox and I had no intention of reading it at that moment, but read the first bit and I was totally, totally hooked! I was flat out excellent and we all certainly appreciate the seriously hard work and thought that you obviously put into this. It was riveting, and helped me understand in a much different and wholly more satisfying way, than my college math days, The Fourier Transform. Full marks, Kalid! Full marks!

gary knottDecember 21, 2012 at 2:52 pmA nice description! You might enjoy the “full”

mathematical story at

http://www.civilized.com/files/newfourier.pdf

kalidDecember 21, 2012 at 4:19 pm@Glukk: The Fourier Transform cannot stay in the hands of the math elite!

@Garth: Awesome, I love it when math gets addictive! Thanks for the kind words :)

@Gary: Thanks! I’ll have to check that out. I’m looking to do a more math-focused follow-up.

Lars Wu-TangDecember 21, 2012 at 5:46 pmYou ask how to easily prove “When every cycle has equal power and 0 phase, we start aligned and cancel afterwards.”

This is because the roots of x^n = 1 sum to 0 (Vieta’s formulas):

x^n – 1 = (x-r1)(x-r2)…(x-rn) = x^n – (r1 + r2 + … + rn)x^(n-1) + …

so r1 + r2 + … + rn = 0.

DanielDecember 22, 2012 at 1:03 amI think the best way to intuit why a spike can be built in the way you describe is by going back to the circle. I am going to speak extremely loosely in the spirit of your blog.

Instead of thinking of a sum of sines, let’s go back to your circle analogy. Imagine N evenly spaced “slots” around the circle, in which we can place some number of “dots” which represent the presence of a frequency. As you said, at time 1, the dots will be all evently spaced out throughout the circle, spaced by 1 unit representing each frequency increment. Then at time 2 they will be spaced out by 2, at time 3, 3, etc. However, very often the dots will “wrap around”. In fact, this will always happen unless the dots are placed with a one unit spacing (N slots, N dots, so either you go in steps of one or you have to loop around). What I want to convince you of now is that whether or not there is looping, the resulting occupied slots form a regular polygon on the unit circle, and further, every occupied slot is occupied equally with dots. If the “step size” is not “divisible” into N, then you will hit every slot exactly once. This is an N-sided regular polygon, each slot gets hit the same number of times. (Good!) When there is “divisibility”, this means that you will eventually hit a space you already occupied, and therefore will begin repeating. We are left with a regular polygon, and it also must have each vertex occupied evenly, since repetition happens after a number of times divisible into N. So the result is always expressible as the sum of the vertices of a regular polygon (times some integer to account for some integer number of layers). But it is visually obvious that the sum of vertices of a regular polygon sum to the center of the polygon (zero).

There is one exception to this rule: a “one-gon” is the only shape with a “bias”. This is what will be responsible for our “spike”. Actually, it’s not surprising that there is a weird exception somewhere, after all, if there were destructive interference everythere, then we woud have found a nontrivial sum of sines that add to zero, proving they are not linearly independent!

Everything I’ve said above is very loose, but I think the purpose of this blog is not to prove things rigorously, but to get a really good intuition for them. And I hope this is what I have done.

Frank AbbingDecember 22, 2012 at 4:08 amI love the smoothie metaphor!

VijayDecember 22, 2012 at 9:32 amKeep it coming! Thanks!

It must have been hard work. And fun in putting in a lot of imagination to get this done. Great work.

SteveDecember 22, 2012 at 12:06 pmWorth the wait – only 22 years for me!

PeteDecember 22, 2012 at 7:42 pmGreat explanation for something that is so seemingly complicated!

Michael Tsai - Blog - An Interactive Guide to the Fourier TransformDecember 24, 2012 at 11:59 am[…] Kalid Azad: The Fourier Transform changes our perspective from consumer to producer, turning “What did I see” into “How was it made?”. […]

MaartenDecember 25, 2012 at 5:18 pm“One of my giant confusions was separating circles from sinusoids.”

This was one of my most notable Aha!-moments during the Analysis class as well. Glad to see it explained clearly here. You might find the website below very interesting, especially ‘phasor phactory’ (in case you haven’t encountered it yet).

http://www.jhu.edu/signals/index.html

Keep up this useful work,

M.

Stephen R. BeschDecember 26, 2012 at 6:25 amThis is all very interesting and I do rather like the use of the unit circle definition of the sine wave as an illustrative tool. However, the exposition still lacks something that has always bothered me about discussions of Fourier’s ideas: Specifically, it doesn’t actually explain why the transform works at all. A few years back, when working on a software algorithm for synchronous signal detection, I once again became intrigued by the FFT and why it actually works. At that time, I set upon the task of figuring it out. The result of this effort was an essay, with graphs and mathematics, which I originally called “Fourier for Dummies” – apeing the interminable string of “XXXYouNameIt for Dummies” books.While I left this original title in the link on my web page, I actually named the piece more descriptively as “A look at Fourier from a High School Math Perspective: Fourier and AC Signal Processing”. You can read the essay and/or download a PDF from my web server at:

http://linuxbio.med.buffalo.edu/Fourier/AC_Signal_Processing.html

You may hate it or you may love it but it may be worth a look.

G. DiehlJanuary 1, 2013 at 9:42 amA couple examples of using the Fourier integrals and series on a known signal (e.g. a simple one like 1+sin(t)) and showing how the ‘parts’ are extracted would be helpful.

I tried and failed to get what I expected (e.g. 1 for the DC component for this litle signal above at w=0) when I attempted to evaluate the integral form, which probably just means I forgot how to integrate properly (but Maxima blew up on it too).

Kalid – As always, thanks *so much* for your efforts! I look forward to you tackling the Laplace transform one of these days:)

StepJanuary 2, 2013 at 8:04 am1+sin(t) can be evaluated very easily at w=0 if you remember that e raised to the zero power is always exactly equal to 1. On the otherhand, if you write the integral in expanded form (i.e. as integral of x(t)Cos(wt)-jx(t)Sin(wt)) and integrate piecewise.Then you are only ingtegrating Cos(wt), iSin(wt), Sin(t)Cos(wt) and iSin(t)Sin(wt) and combining the results. Since you have no phase shift and only a single frequency, the integrals of iSin(wt) and Sin(t)Cos(wt) evaluate to exactly zero. The integral of Cos(wt) also evaluates to exactly zero everywhere except at w=0. This is easily seen since Cos(0)=1, so at w=0, you are taking the integral of 1. The integral of iSin(t)Sin(wt) is non-zero when w=1 and zero everywhere else.

When you actually do the integral, at least for the value of the integral of Cos(0) dt, there is this irritating problem that the integral actually evaluates to “t”, not “1” and this is probably why Maxima blew up calculating the definite integral: t would have been replaced by infinity in the calculations! This is exactly the problem that Lipot Fejer resolved by proving that the series converged only when cast in terms of the means. So whenever you are attempting to recover amplitudes, you need to take the mean, which essentially means dividing by “t”. When you do this, you get the expected result. You may still need to massage the equations in Maxima to prevent the possibility of dividing Infinity by infinity. Intuitively you (a human) may think that this should be equal to 1, however, in reality it is mathematically undefined This is because infinity+x is still infinity so the ratio of 2 infinities must be indeterminate since, by definition, you can never say that 2 infinities have the same value and there is no way to find out if they do.

More complex periodic functions can be analyzed in a similar fashion by first applying trigonometric transforms to the functions and then integrating the components. Not always easy, but it works.

Stephen R. BeschJanuary 2, 2013 at 8:11 amSomehow my attribution got bombed from the last post

Graeme McDonaldJanuary 2, 2013 at 2:56 pmThanks, Great article

Glenn DiehlJanuary 2, 2013 at 8:35 pmStephen,

Thanks for replying. I actually did recognize that e^0 is one. The integral becomes integral(1+sin(t)dt), which evaluates to t-cos(t). But, evaluating that from -inf to +inf blows up, which is no big surprise.

Dividing by ‘t’, as you mentioned, doesn’t quite get me there either.

The formula in the first bullet of section 2.4 in http://www.civilized.com/files/newfourier.pdf (see Gary Knott’s post above – thanks Gary) does work (divide by 1/p (the fundmental frequency) and adjust the limits of integration to be one cycle), but I don’t follow (yet, anyway, but I’m not giving up) how we can just replace the +/-infinities in the formal definition of the integral.

At least I finally got the answer I was looking for, but needless to say I would have failed the exam (which is why I like this blog in the first place :) ).

Glenn

DanielJanuary 3, 2013 at 2:33 amThe reason the Fourier transform of 1+sin(t) seems to be blowing up is because it does… The Fourier transform of a pure Fourier mode will always just be a delta function centered around the appropriate frequency. In the case of the zero frequency component, we expect zero anywhere away from zero, but an infinitely thin spike around zero.

Stephen R. BeschJanuary 3, 2013 at 7:59 amGlenn,

I should have mentioned the 1 cycle issue. Here’s the explanation you are looking for (I hope). Since Sin and Cos are periodic, the integral over one cycle is exactly the same as the integral over an infinite number of cycles. Also, since the integral 1+sin(t)dt evaluates to t-cos(t), then divide by t to get 1-cos(t)/t. In the limit of infinity, this clearly becomes exactly equal to 1 – not to mention that cos(t) can never exceed one anyway, so this integral can never blow up – at least not with real valued t. If t is complex, I’m not sure what may happen. Why Maxima can’t cope with this probably has something to do with how it deals with the definition of infinity. Also, if I remember the deatils, the 1/p issue has to do with changing the limits of the integration to cover exactly one cycle. It is essentially the same as integrating from -2Pi to +2Pi. You might also consider forgetting about the negative frequency part of the spectrum. For all real valued data (that is, all real data!) it is exacly the mirror image of the positive spectrum anyway,

Stephen R. BeschJanuary 3, 2013 at 8:07 amDaniel,

Are you sure about this? I’ve done a lot of fourier analysis on single frequency sine waves with and without a DC offset and indeed, the result is always a spike at the fundamental frequency of the sine wave and if there is a DC offset, another at the origin.However, these are not of infinite amplitude – quite the contrary, the heights are always exactly equal to the amplitude of the sine wave and it’s DC component. If this were not to be the case, the Fourier transform would not really be very useful for AC signal analysis. I suspect that you are thinking about some other interesting property of the transform and I would like to have you clarify what you are thinking about – perhaps the transform of the delta function?

DanielJanuary 3, 2013 at 11:48 amI’d be happy to explain myself. I say the Fourier Transform of has three spikes, one at and one at both and respectively. Namely, for

If you don’t buy this, well, let’s just check it. According to the definition given at the beginning of the post of the Inverse Fourier Transform, we have

Then when we perform the integration, the delta functions yield the integrand evaluated at the value of s that makes the argument of that delta function zero. This gives

as desired.

Stephen R. BeschJanuary 3, 2013 at 12:50 pmDaniel,

Don’t get me wrong. It is not at all that I disagreed with your assertions, especially since they are formally correct in every way. They are also really cool and insightful and your clarification is very adequate,.The confusion centers arount the traditional use of the delta function in the time domain as an infinitely high pulse of zero duration whose integral =1. Also, invoking this interpretation involves understanding a lot of really difficult math involving distributions. etc. I am also a little preplexed by the use of “s”, usually reserved for the complex variable of integration of the LaPlace transform. My only intent is to help clarify the workings of the Fourier concept using simple, approachable math.

DanielJanuary 4, 2013 at 12:15 amI think I can answer that question also. When the frequency domain is discrete, it makes sense to talk about non-infinite amounts of each component, as you describe. The trouble is, when the frequency domain is continuous, it makes less sense to talk about the amount at each frequency, and a “amount density” is more applicable. After all, in the real world there is not really such thing as a pure sine tone; everything has some width in frequency space. But if a finite width has noninfinitesimal “amounts” at every frequency, then the total amount is infinite, which makes no sense. This is the same principle why discussing the mass of an object in detail requires a notion of a local mass density, because if every POINT in the object had its own noninfinitesimal mass, the whole thing would have infinite mass. The Dirac delta is a formal way to revive the concept of a pure sine frequency even after we have evolved to the notion of densities. The Dirac delta is the representation of a “point mass” in the “density” way of thinking about things.

I think what you said about the height of the transform being equal to the amplitude is correct in the discrete frequency interpretation, because there densities DON’T make sense, while “amounts” do.

Stephen R. BeschJanuary 4, 2013 at 8:44 am“But if a finite width has noninfinitesimal “amounts” at every frequency, then the total amount is infinite, which makes no sense”. The problem with this statement is that the width is finite and therefore there are only a finite number of finite amounts and the sum is therefore finite! If I recall my history,this is precisely the polemic that raged for years regarging whether in the limit, the differential becomes vanishingly small on the one hand or 0 on the other.. The point was that as the slice becomes smaller and smaller it’s contribution also becomes smaller, and in the limit, the sum converges on the integral. The argument is whether an infinite number of infintely small pieces totals up to a finite value. Certainly we know that when we integrate a simple function that the answer almost always gives us the area bounded by the curve, not an infinite value, and in this regard, for all practical considerations it does not seem to matter if we consider that the differential truly reaches 0 in the limit or not.I suppose that we could argue about this for years, just as mathematicians did in the 19th century, However, it appears that Paul Dirac must have finally resolved this debate with the invention of the Delta Function. In the interest of all the other readers of this posting, I think we should put the whole matter to rest. At least that’s what I am going to do!

DanielJanuary 4, 2013 at 11:14 amYes, what you are saying is correct, but the “amounts” have to tend toward zero as the “pieces” become smaller to give a finite result. I am just explaining why setting the amount at each piece to a constant (non infinitesimal) would give trouble.

Steve BithellJanuary 5, 2013 at 3:34 pmGoodness me, what a splendid article!

Mahesh SJanuary 7, 2013 at 10:49 pm@Yves: It would be great if you could post a link which explains better (no sarcastic tone in this line). It would genuinely benefit the many other people who also feel this explanation is not so good. Kalid may include few points from that link to make this article better.

Resolution, Fourier Analysis, and the Heisenberg Uncertainty PrincipleThe Physics MillJanuary 13, 2013 at 4:10 am[…] Explained has a page on the Fourier […]

AnonymousJanuary 14, 2013 at 3:00 pmSeriously, can we have you education minister, for the whole world? okthnx

a) I love you.

b) I basically hate practically all my math teachers, for the destruction they have spread in mine, and everybody else’s mind.

Rethinking “Learn it Once” « Scott H YoungJanuary 22, 2013 at 10:58 am[…] felt this way with learning many mathematical concepts. The depth of insight in something like Fourier analysis is so large it’s impossible to fully grasp it with a first pass. New exposures, particularly […]

AnonymousFebruary 4, 2013 at 7:25 amMath is as easy as pie! but needs someone to bake it as good as you did!

Great!!

Congra!

ClaudeFebruary 11, 2013 at 9:53 amI had asked Kalid about the Fourier Transform a while back and he had emailed a great brief explanation. I just returned to this site to see whether there were any updates and I’m happy to see that the Fourier Transform is on here. This is a fantastic website!

kalidFebruary 11, 2013 at 11:23 amThanks Claude! :)

satheeshFebruary 13, 2013 at 9:56 pmHi Genius,

Thanks for the article ,It was awesome like always but i have a doubt.What does negative values in time mean like -1 the graph is always positive in x and y value is just projection of point in x so i can’t get negative meaning of time

kalidFebruary 14, 2013 at 6:45 pmHah, just a curious learner here. Negative values in time, for the signal you mean? In this case, if it’s an infinitely-repeating signal (that’s what the Fourier Transform assumes), then -1 means “1 second before the current cycle started, i.e. near the end of of the previous cycle”. Sort of like “-1AM” might mean 11PM of the night before.

Jose OrtizFebruary 14, 2013 at 3:26 amI just figured out how the transform works on my own. I think its “better explained” by showing how multiplying f(t) by e^iwt is really rotating in the complex plane with frequency w/2pi, and the larger the value you get integrating this over all time, the better f(t) “matched the rythm of w”. Further more, depending on where in e^iwt’s phase f(t) keeps getting bigger at periodically, that will be contributing the most to the fourier transform’s complex value. So the final value, the sum over all time of f(t)’s complex position when rotated by multiplication with e^iwt, tells you about the phase and magnitude of the match-up between w, the rotation speed, and f(t), the function being rotated. Its wierd, its very much a sort of circular integral, where depending on w, you get really far from where the value of the integral starts, or depending on how f(t) matches up with the phase of e^iwt, gives the integral’s angle in the complex plane. Its a little mathematical machine, and it is an extremely intuitive one. For instance, why divide by 2*pi? Because that is how much further a rotation in the complex plane moves a value of f(t), it moves it more by a factor of 2*pi.

kalidFebruary 14, 2013 at 6:48 pmHi Jose, thanks — that’s a really neat interpretation. Yep, it’s almost like a “dot product” where you are seeing how big and overlap you can get (and different phases will have different overlaps).

RR RaskolnikovFebruary 14, 2013 at 8:45 pmWonderful!

SatheeshFebruary 15, 2013 at 12:53 amThanks for the explanation.

may be this be silly but can you just brief out the terms in the formula like n,N,k sorry to ask this.

kalidFebruary 15, 2013 at 4:40 pm@RR: Thanks

@Satheesh: No problem, just updated the post (the Discovering the Full Transform section)

satheeshFebruary 15, 2013 at 11:57 pmHi,

Thanks a lot.Best wishes to reach heights.

AngelFebruary 17, 2013 at 2:57 amThe old Yamaha DX synthesizers series used frequency modulation to create, from 4 to 6 sine waveforms, quite complex sounds.

kalidFebruary 17, 2013 at 9:40 pm@Angel: Cool background — it seems to only take a few components before the shapes get really intricate.

AnonymousFebruary 19, 2013 at 8:35 amIs there anyway to visualize orthogonal signals?Or understand it intuitively instead of just saying that their dot product is zero. I’m studying trigonometric fourier series and having a hard time grasping how each multiple of fundamental frequency component acts the same way like orthogonal vectors that when adding them together they doesn’t interfere and you can add frequency components with right amplitudes to the sum and you don’t need to correct already calculated amplitudes when adding a new term.

HamppiFebruary 19, 2013 at 8:36 amIs there anyway to visualize orthogonal signals?Or understand it intuitively instead of just saying that their dot product is zero. I’m studying trigonometric fourier series and having a hard time grasping how each multiple of fundamental frequency component acts the same way like orthogonal vectors that when adding them together they doesn’t interfere and you can add frequency components with right amplitudes to the sum and you don’t need to correct already calculated amplitudes when adding a new term.

HamppiFebruary 21, 2013 at 6:45 amI just wanted to learn digital signal processing… After a couple of chapters in my dsp book i noticed that i have to study signals and systems first in order to understand fully dsp. It became clear very soon that i need to learn more math especially fourier analysis to make sense of everything in my signals and systems book. I’m on chapter three now in my signals and systems book (fourier series) and it will probably take my whole life to get to a fourth.

Akshar GuptaFebruary 25, 2013 at 2:50 amThis could not get better. I have been trying to understand this concept on my own and it has been a long difficult task. But with this post of yours, my life is easy now. Keep up the good work man!

Ben DehartMarch 2, 2013 at 1:38 pmThe part I missed on the first 2 animations– the values listed beside “time” are amplitude values, while the timing is implied as divisions of the 1hz cycle.

Further down I was able to use context clues. overall, EXTREMELY HELPFUL

BenMarch 2, 2013 at 2:07 pmAlso: The amplitude of the waveform corresponds to the X value on the circle, as opposed to the Y value like every other example i’ve seen.

I realized it doesn’t matter which you choose, it is just a 90 degree phase shift. Because its a damn circle and X and Y are perpendicular.

This is probably really

AnonymousMarch 2, 2013 at 2:09 pmobvious to you, but it gave me some trouble. Now i have a broader understanding.

Sorry for the 3 separate comments

VicMarch 2, 2013 at 4:07 pmWhere were you when I got my BSEE!! Great explanation.

kalidMarch 2, 2013 at 8:16 pm@Hamppi: I see orthogonal signals as ones whose net “overlap” or contribution to the other is entirely wiped out when you multiply them piece-by-piece.

Imagine two signals driving a car. One controls the speed, the other controls the direction. When the speed is at max, the direction might be null (no direction, the brakes). And when the direction is north, the speed might be null (no speed, the brakes). Sometimes they are both on (North at 10mph, or South at 10mph). Over all time though, the car does not move, because the sum of all contributions cancels.

@Akshar: Thank you!

@Ben: Great feedback, I really like knowing which parts can be clarified. I’ll update the article to make your feedback more clear. Thanks!

@Vic: Glad you enjoyed it

Degmlidet BekeleMarch 11, 2013 at 5:28 amthank you very much for your help!. I want some solved problems

Alex Scarlat MDMarch 24, 2013 at 1:47 pmI was struggling with Fourier for quite some time.

Wikipedia and other web based explanations are way too complicated for my rudimentary knowledge – and thus, useless.

Thanks for explaining a difficult concept so elegantly.

The metaphors /analogies were excellent while the animations are superb !

Would you please be kind enough and consider doing the same magic and explain the concept of (Claude) Shannon Entropy ? That’s another painful concept to grasp.

Thanks

A. Scarlat MD

kalidMarch 26, 2013 at 12:10 pm@A. Scarlat MD: Really glad it clicked, thanks for the note! Yes, often times people jump into extremely technical discussions of math without laying an intuitive foundation. I’d like to do more signal processing posts later on :).

AnonymousMarch 27, 2013 at 11:56 pmVery complicated explanation.

AnonymousMarch 28, 2013 at 12:36 amIs this presentation targeted for persons already familiar with Fourier Series?

Think With Circles, Not Just Sinusoids:

What is a circle? Just a circle itself? A sinusoid?, a Complex exponential? or vice versa. Why not considering a circle the son of a cone? Or maybe a circle is just a straight line for bug living in an infinite radius circle.

AnonymousMarch 31, 2013 at 4:36 amThank you very much for this work sharing your insights, there has been very practice for my math career, keep going!

kalidApril 3, 2013 at 3:05 pm@Anon: Glad it was helpful

AnonymousApril 2, 2013 at 7:03 pmI wonder why most books about periodic phenomena most of the time instead of using circles, use a trigonometric description or even more , a complex exponential description?

How we multiply a circle (representing AC electrical current) by another circle (representing a AC alternating “voltage”) for finding for example the instantaneus AC power. So in other words what is the geometric picture of this two circles multiplied together?

I wonder what the circle based description would be for a two dimensional Fourier transform?

AnonymousApril 2, 2013 at 7:14 pmIf we have sinusoidal AC voltages and currents, how do we multiply the corresponding two circles for finding the instantaneus AC power? What is the geometric picture?,

I wonder why most books use a trigonometric description or even more a complex exponential for playing with the associated math for both theoretical and practical use?

What would be the “circle” for a two or more dimensionsonal Fourier Transform?

kalidApril 3, 2013 at 3:41 pm@Anonymous: Not sure why most books jump to the most technical definition first :). Intuitively, I imagine a circular path, and on that circular path, another circle is traveling [a bit like how the Earth moves around the sun, and the moon moves around the Earth]. The combined effect of the two positions is the net power seen.

dfsdfApril 7, 2013 at 1:41 pmFINALLY THIS MAKES SENSE

AnonymousApril 16, 2013 at 1:45 pmWhat is the practical use of this circle view approach in solving practical problems?

For example what is the “circle” output of a linear system for any periodic “circle” input? How we represent the “circle” amplitude response and the “circle” phase response?

What is the “circle” transfer function of a linear system?

DavidApril 20, 2013 at 6:37 pm:) Thanks! Really good!

WaldirApril 23, 2013 at 9:43 pm“Click graph the graph to pause/unpause.” –> “Click the graph to pause/unpause.”

kalidApril 24, 2013 at 8:55 amThanks Waldir, just fixed.

Purushottam LateyApril 27, 2013 at 10:28 amAfter years of trawling the net..;this is one place where I truly understood fourier transform

kalidApril 27, 2013 at 2:50 pm@Purushottam: Awesome, glad it helped!

Murugesh PrabhuMay 4, 2013 at 3:42 amKudos! This is the best ever intuitive presentation of Fourier! And the animations…gr8 work…Thanks for the effort…Similar insights on Wavelets might be of gr8 help too…pls consider it….Thanks again…keep it going!!!

RomanMay 9, 2013 at 12:06 pmThis is a work of a an extremely talented and gifted person!!!

Question – i am trying to understand what probability density functions have to do with “cyclicality”?? Because characteristic function of a probability density is Fourier Transform, so it needs to be time and cycle driven, but I just not sure what does cyclicality have to do with probability..

Thank you!!!!!!!!!!!!!!!

kalidMay 16, 2013 at 10:42 am@Murugesh: Thanks for the note! Wavelets would be a good follow-up. I need to learn more about them.

@Roman: Really appreciate the kind words. Interesting, I don’t know much about probability distribution functions and their relationship to the Fourier Transform, but something to study!

JASMay 25, 2013 at 10:31 pmHello Khalid,

All I have to say is that you have put together a wonderful article. Your style of writing immensely helps in removing the apprehension in the mind of the reader of having to deal with a complex topic.

I am an Image Processing/Computer Vision enthusiast. I plan to write articles in this domain the help students and professionals maneuver complex topics in these subjects by presenting them in a easy to grasp manner

My article on Fourier Transforms @ http://jasexplains.blogspot.in/ is the first write-up. Would be very thankful if you can provide your feedback.

JAS

Hugo GonçalvesMay 28, 2013 at 6:13 pmHi Kalid,

I am myself writing my own website with math/signal processing/electronics content and, although I am probably not doing it as well as you are, I do believe these complex subjects can be explained in a simple way. This explanation of the Fourier Transform is an excellent example of it. Thanks.

zenbowmanMay 30, 2013 at 11:20 pmThis is golden. Thank you.

BurkeJune 3, 2013 at 5:57 pmI can’t comment on the rigor or accuracy, but in my view this article is absolutely brilliant.

Please write some textbooks.

tim buckleyJune 4, 2013 at 5:05 pmWonderful and revelatory stuff – you make learning it a delightful experience with all the visual metaphors and animations gradually building to the abstract formulas. what a rarity – maths taught in a human way! I’ve been trying to grok the fourier transform for months with little success outside of the basic concept that it decomposes a signal into frequencies. The formulas themselves just confused me. Now i really feel I have a handle on it.

andewwJune 5, 2013 at 3:20 amThank you for the effort in making this .

Hope everybody who gets swamped in this domain comes here.

Erti-Chris EelmaaJune 6, 2013 at 11:11 amI like your site. This is the way teaching math should be done, in order for anybody to “get” it.

Simple thanks.

kalidJune 13, 2013 at 1:28 pm@JAS: Glad you’re enjoying it! Yep, part of writing is getting in the head of the reader and gently going down the path, vs. blasting people with all the details up front :). I’ll check out your article later today.

@Hugo: Thanks for the note! I love hearing about other people doing their explanations. Everyone has a different style, so looking forward to checking out yours.

@zenbowman: More than welcome.

@Burke: Thanks! Hoping to do some more material on Calculus, Trig, etc. organized into a book. Stay tuned…

@Tim: Thanks so much — exactly, why can’t we be *human beings* when talking about math? Sure, math can be written down in a way that can be used by machines, but it doesn’t mean we have to think and talk like them. Let’s use metaphors/visualizations to make the rigorous proofs more palatable.

@andeww, Erti-Chris: Thanks!

E. L. PetersenJune 23, 2013 at 3:48 pmThis is awesome! Nicely intuitive.

shwethaJune 23, 2013 at 11:51 pmBetter explained is great service to all “scratch heads” who badly wanno feel the concepts behind these great scientific discoveries but unfortunately are somewhere caught tangled.. ………….. It takes gr8 effort and flair to be consistent and maintain this network of better explained!! Thank you…. I have a question to this article…the first cosine wave we simulate from a circular motion and the sine wave in the referral link provided, vary in explaining the amplitude….the link has an extra perpendicular line dropping from the revolving “radius head” taken to be the amplitude…i clearly understand the amplitude concept there…. but the cos signal in this article gives a different explanation for the amplitude…( u had mentioned to turn the circle by 90 degree mentally which i fail to comprehend…) i am probably not in the right perspective…

shwethaJune 23, 2013 at 11:54 pmsthyusr

Bobbum_ManJune 24, 2013 at 8:12 amI didn’t enjoy this article as much as the others. This is because the recipe analogy didn’t feel intuitive. If anyone is having difficulties processing this, I highly recommend reading James’ http://practicalcryptography.com/miscellaneous/machine-learning/intuitive-guide-discrete-fourier-transform/. It’s way more verbose and more intuitive (if you understand simple statistic concepts like correlation and variance).

AmitJune 26, 2013 at 6:55 amThe analogy is rather out-of-place, confusing and seems like an unnecessary detour. Most important of all, the author seems to lack primary insight on the subject himself. Smoothie is a whole and its ingredients are parts. It is not the same with signals at all. They are all whole in their own domain. The analogy is totally misplaced and the information provided only partly correct. The key idea of FT – change of variable – is not emphasized at all. Only well informed people should be allowed to author such articles.

That said, there are a couple of good insights for new learners – 1. decomposition of a signal into other signals, though that hardly warrants such a confusing and misplaced analogy and 2. representation of complex numbers on the z-plane, though this may not be the best place for such a long discussion on that.

DanielJune 26, 2013 at 5:15 pm@Amit,

What a shame that some feel the need to squelch the brilliance of others, presumably to bolster their own inadequacies.

The ability to recognize an analogy like this does not demonstrate a lack of insight, it proves the author’s ability to understand the concept at an intuitive level– a task which is much more challenging and profound than merely memorizing equations.

To this end, I am confounded by your own statement that the smoothie is not an apt analogy. We can both agree that a smoothie is a ‘whole’ while the ingredients are ‘parts’. But that does not preclude the ingredients themselves from being whole on their own. Before berries are thrown in the blender, they are just that: berries, which are themselves a whole. Regardless, this distinction is primarily one of taste– the important observation is that a signal can be represented as a sum of Fourier modes in the same way that smoothies can be represented as a union of ingredients. The features of this analogy carry through quite naturally, and the aspects that do not are clearly addressed by the author.

My next concern is that you object that the author does not address the concept of ‘change of variable’: “The key idea of FT – change of variable – is not emphasized at all.” However, the author very clearly mentions this in the very first section after the introduction “From Smoothie to Recipe”:

“A math transformation is a change of perspective. We change our notion of quantity from single items”

In the very next sentence of your comment you mention that “Only well informed people should be allowed to author such articles.” Judging by the fact that you clearly didn’t read (or worse, didn’t understand) the author’s mention of change of variables, I think I will modify your assertion: “Only people who read (and are capable of understanding) the article should be allowed to post incindiary remarks regarding the article’s validity”.

I applaud the author’s work in compiling this article, as I think it does a very good job at laying down the key ideas to newcomers of Fourier Analysis, and manages to motivate the equations intuitively instead of simply asserting them.

On that note, I am saddened that this article did not meet its mark for you.

Simon PerryJuly 3, 2013 at 6:35 pmKalid, I love this, it’s brilliant. I’ve forwarded it to my nephew who is a non-verbal autistic 10-year-old with an IQ of 138, the ability to give you the day of the week for any date, and the ability to read a page of text if you just wave it at him. I feel we might hear more of him in the future.

I love this: “Wow, we’re finally seeing the source code (DNA) behind previously confusing ideas”. I’m applying your clear nuts-and-bolts approach to the atheist morality problem. I hope you will hear more of me in the future. I will keep this article as an example of how intellectual work should be done.

kalidJuly 5, 2013 at 9:49 amHi Simon, thanks for the note — hope your nephew enjoys it :). Really appreciate the kind words, I hope the strategy of finding specific examples to illuminate abstract concepts gets more traction. It’s a spiral of theory, practice, theory, practice…

NikoJuly 6, 2013 at 10:30 pmThose animations are AMAZING. Mad mad props. But I don’t really get how the time points are spaced…

“The time points are spaced at the fastest frequency. A 1Hz signal needs 2 time points for a start and stop (a single data point doesn’t have a frequency). The time values [1 -1] shows the amplitude at these equally-spaced intervals.”

Like for a 1 Hz signal why are you measuring at 2 points, for a 2 Hz signal at 3 points, for a 3 Hz signal at 4 points and so on? Does this have something to do with the Nyquist-Shannon sampling theorem?

kalidJuly 7, 2013 at 7:26 pmHi Niko, great question. Each animation is over the course of 1 second. If you are specifying a 0Hz (constant) component, then a single value is fine, since it’ll be the same throughout.

If you are analyzing a 1Hz signal inside that interval, you just need a measurement at the beginning and halfway (at 0.0 and 0.5 seconds) to make a determination of its strength. If you only had the measurement at the beginning (0.0 seconds) you wouldn’t know how strong the 1Hz signal was halfway, when it was completing its cycle.

If you are trying to measure a 2Hz cycle (which goes up and down twice during the period), then you need at least 2 measurements beyond the starting one (so at 0.0, 0.333, and 0.666 seconds) to specify its behavior. Yep, this is related to the sampling theorems, I’ll need a follow-up on that and build up my own deeper intuition :).

Understanding Fourier Transform | cikaJuly 7, 2013 at 2:08 am[…] out this Interactive Guide to the Fourier Transform, which is essential for digital modulation onto radio […]

PiJuly 8, 2013 at 6:27 amKalid, could you possibly tell us what software you use to create these animations? How do you accomplish these?

kalidJuly 8, 2013 at 10:51 am@Pi: Sure thing. I’m using Javascript and the HTML5 Canvas tag to make the animations. You can open http://betterexplained.com/examples/fourier/?cycles=0,1 and do View Source to see the code. The details of how to do web programming will probably need a few more articles though! :)

kalidJuly 9, 2013 at 6:31 pmQuestion from a reader:

I was looking through your material on fourier transform and its by far the best explanation I have found anywhere. I spent a few days reading this and I understand everything except for one hiccup. Could u explain why there is the 1/N factor in the second equation? If you take a simple example, at t = 0, the formula should spit out the sum of strengths, but instead it spits out the average. Can you please lead me on the right track?

Thanks!

Abhi

—–

Awesome, glad you enjoyed it! Great question about the 1/N term. There are several versions of the Fourier Transform, they key is realizing you need to average the strengths somewhere along the way when you apply the forward transform and then the reverse. If f(x) is the forward transform and F(x) is the reverse, then you can have:

f(x) = find the components

F(x) = average them, and recombine

or

f(x) = find the components, and average them

F(x) = recombine

or

f(x) = find the components, and apply a 1/sqrt(N) factor

F(x) = recombine, and apply a 1/sqrt(N) factor

Either way, after doing f(F(x)) or F(f(x)), i.e. apply the forward and reverse transforms, you need a 1/N term. Lots of books don’t explain this part!

Ah, reading again, your question is *why* is the average needed? Good question. If you have a single instant (a spike in time like (1 0 0 0 0 0 …)), then its magnitude should be shared among every possible frequency (which can claim it?). In other words, the frequency strengths would be (1/n 1/n 1/n 1/n 1/n…). A complete signal is just a series of instants, and its strength is averaged among every possbile frequency (however, each frequency has a phase shift, which increases for each instant, and may result in no “net” strength at a given frequency; still, having 0 because you had 1 and -1 constructively interfere is intuitively different from having 0 because there was no activity at all!).

MatijaJuly 18, 2013 at 6:00 amHey Kalid great work on this one. I started learning about EEG signal analysis and the Fourier tranformation comes up constantly. I never heard of it before and for such a beginner this is a great, very helpful, article.

However to better understand everything about what you said I have a couple questions which I hope you can answer:

1) Why is the strenght (amplitude) in every example 1? In reality, is the signal not comprised of waves of varying amplitude?

2) In the interactive graphs, why does the time slot change its value when the amplitude (strenght) of the wave is changed from 1 to a bigger number? As I can tell the values “time” slot is giving us are saying at which point in time we do the measurement, but why does it change?

3)Does the Fourier transformation get the number of frequencies that is equal to the number of samples taken in a given time period that is being analyised?

4)Can we get a frequency from a Fourier Transformation that is a decimal number for example a frequency of 4.5 Hz?

Thanks, and I hope you keep making these!! :)

kalidJuly 19, 2013 at 12:17 pmHi Matija, glad it helped

1) Actually, the amplitudes don’t need to be 1.0 (for example: http://imgur.com/11VKmdJ)

2) The time slot values is the strength of the signal. For example, seeing [1 2 3 4] on the time side means “The signal starts with strength 1. At the next intervals it has strength 2, then 3, then 4”. So if you double the amplitude of all the components, you’ll double the amplitudes of all the time slots.

3) Yep :). Think of it like this: N frequencies and N time samples convey the same information about the signal (it’s like changing coordinates from the time-domain to the frequency-domain… but either way, you need the same amount of data to represent the signal).

4) If you want fractional frequencies (4.5Hz) and therefore fractional time measurements (1.5 intervals), you need the continuous version of the Fourier transform [not the discrete one]. In math class, when working with analytic functions, you’ll learn the continuous one. But for engineering applications (with quantized time measurements) you’ll use the discrete one, since computers are storing individual data points, not an analytic function.

AmitJuly 25, 2013 at 7:02 am@Daniel

“What a shame” that the internet allows mediocre people to post any garbage as knowledge and pull it off! I repeat, this article is basically flawed because the analogy does not capture the true essence of the Fourier transform. I understand this article will provide some starting thought for beginners, but that’s pretty much all it should be used for. No doubt, the animations are nice and the article is well-written, but I have problem with the content, and anyone who understands Fourier transform well would have the same problem. It is unfortunate that some people are unable to accept healthy criticism without descending to provocative language.

KalidJuly 25, 2013 at 8:25 pmAmit, your feedback would carry more weight if 1) I claimed this were a math-first encyclopedic article (re-read the intro) and 2) you didn’t purport to be the arbiter of what could or could not be written on the matter.

I don’t know of any factual errors, but am happy to correct them. Stylistically, it’s your opinion that the ideal introduction to the transform lies in the mechanics (changing variables) not the “ingredient-first” viewpoint it enables. Let’s agree to differ here.

RickAugust 4, 2013 at 7:02 amWell explanation is very good but i m stuck at some points. I don’t understand how the Yellow points are placed and what is meant by 0 Hz at strength 0/1? plz reply asap. Thank u!

kalidAugust 7, 2013 at 2:00 amHi Rick, for the yellow intervals, see my reply to Niko on July 7 2013.

0Hz is the speed of the cycle ingredient we’re considering, and the strength is how large it is. A strength of 0 means that cycle ingredient is not present in the signal.

ashAugust 22, 2013 at 5:59 amWow, Thanks a lot, that was very informative and entertaining as well.

Robert StokesAugust 24, 2013 at 9:39 amI am a retired mathematics teacher and I have to say that one of the most inspired pieces of teaching that I have seen.

WhippyAugust 30, 2013 at 6:55 amFantastic article. I have a basic maths understanding but am not a mathematician, and have found most descriptions of Fourier transform to be utterly impenetrable. However this article presented exactly what I needed, for my purposes, and the interactive animations helped greatly too. A huge thanks!

I’ve just been finding some other great articles on this site too. Great work!

WhippyAugust 30, 2013 at 8:53 am@Matija: re Q4, I’m not sure if this helps, but the above examples/annotations are all based on an overall time interval of 1 second, and 1Hz, 2Hz, etc. Probably in a real application the overall time interval would not be 1 second, and therefore the frequencies would change accordingly. For example (as I understand it), if the time interval was 1/10th second then the waves would have frequencies of 0Hz, 10Hz, 20Hz, etc, for as many samples as you have in that interval. If the time interval were 2 seconds then you would actually have 0Hz, 0.5Hz, 1Hz, 1.5Hz, etc, which might be of some use in your case. Also bear in mind the article uses the unit “Hz” (and “seconds”) a little loosely in places, which it explains. Hope this helps.

kalidSeptember 3, 2013 at 4:34 pm@Whippy: Thanks for the comments! Glad you’re enjoying the site :).

Thomas Dybdahl AhleSeptember 16, 2013 at 11:06 amI think there is a mistake where you introduce the formulas in the end. The formula for timepoint and frequency are swapped. The frequency one should contain the 1/N factor, like in the appendix.

Anyhow, thank you so much for this!

Thomas Dybdahl AhleSeptember 16, 2013 at 11:20 amSorry, I didn’t read the part where you said you preferred to move the factor to the inverse. I was just trying to produce the same results as in the article

kalidSeptember 16, 2013 at 12:18 pmHi Thomas, no problem! I should probably clarify that point. In the article, correct, I do the averaging (1/N) in the forward step.

sofyanhayajnehSeptember 20, 2013 at 2:14 pmSimply, Brilliant

Lazy Sunday Links - 9/22/2013 - HackalizerSeptember 22, 2013 at 1:43 pm[…] it, you think you see valuable information. But what exactly is a Fourier Transform? Check out the interactive guide to Fourier Transform so you can learn […]

Stephen KennedyOctober 31, 2013 at 7:33 amThe section where you introduce the animations needs to be clarified. The way it is written confuses me. I don’t understand what is happening to the animation when you change the values in the Cycles and Time box. When you change one it automatically changes the other, why? Why is there always a 0? What does a sentence like “Nothing at 0Hz, 1Hz of strength 1, 2Hz of strength 1” even mean?

Confused.

Nyquist, Shannon & Friends | Audio SketchesNovember 4, 2013 at 12:07 pm[…] Understanding the Fourier Transform [video] Fourier Transform is “a unitary transformation between two different Hilbert spaces” [stack exchange] Fourier Transform [Better Explained] […]

Jamal KakaNovember 5, 2013 at 4:46 pmNot good at all. I was confused and you added spices into it.

The animation controller are the worst. I didn’t get what the those number were.

sorry.

WillNovember 6, 2013 at 12:17 amGreat article Kalid. Thanks!

However, while it explains how the signal components are put together, it doesn’t really seem to explain how they can be extracted. I don’t understand the process of isolating the individual frequencies from the mix.

I’m amazed at the number of bored and boring people who think it’s ok to criticise your explanation. They clearly all think they’re very clever, but none of them mention where we can find their superior explanation. This is the internet people, if you don’t like what you see, move on – don’t bore the rest of us with your smug whining!

kalidNovember 6, 2013 at 4:16 pmThanks Will! Isolating the individual frequencies is tricky. Let me expand on the analogy in the post.

Imagine you have a bunch of toy cars, racing around a circular track. Some are going fast, some are going slow, and our “function” is the total position of all these cars. (Just add up the coordinates for all the cars — that’s our function. We could have an East-West position and North-South position over time.)

Now, how can we find out how many cars are going at, say, 10mph exactly?

We can put a conveyer belt around the track, and run it like a treadmill (against the car’s direction). If this treadmill is going 10mph, then cars going exactly that speed will stay still. The other cars are going either faster or slower, and will continue to circle around the track (over time, their average contribution will be nothing).

Only cars matching the speed of 10mph will stick around, and can be measured. Maybe we see 3 cars going that speed. We might write “The strength of the 10mph speed is 3 cars”.

The Fourier Transform takes the notion that any signal really has a bunch of spinning circular paths inside. If we can take our signal and “run it on a treadmill”, then we can extract the contribution, if any, at every speed (frequency).

The fancy equation e^{i*2*pi*x} is a way to create a circular path of frequency “x”, and we put in a negative sign because it is running backwards, getting e^{-i*2*pi*x}. That is just the treadmill: we multiply in our signal, and the overall result (if anything) is how many cars were at that speed, so to speak.

Hope that helps!

(Btw, appreciate the support. Writing online, you quickly realize you’ll get feedback from all types. I feel no strong obligation to help people who can’t enjoy a freely-provided resource, especially with feedback is as inactionable as “I didn’t get it”).

kalidNovember 6, 2013 at 4:24 pm@Stephen: I’d like to do a video to help walk through the animations. Basically, we have two ways to describe a signal: as a series of points (here’s where the signal was at time 0, 1, 2, 3, 4…) or as a series of ingredients (the signal is made from a 0Hz cycle, a 1Hz cycle, a 2 Hz cycle, etc.).

The cycles have various strengths (how much of each ingredient to use). When you change either side, the widget converts the new values to the other. So, if you add a different set of time points (from 1 1 1 1 to 2 2 2 2, for example) then the corresponding cycle ingredients are adjusted. If you change the cycle ingredients, the time points they lead to are similarly adjusted.

It’s a little tricky, but the upcoming video will help clarify.

Will KempNovember 6, 2013 at 4:31 pmThanks Kalid!

So any circuit / algorithm that wanted to do a Fourier transform effectively has to generate its own set of frequencies and test the signal against those? Or do something equivalent, but probably a bit more efficient maybe.

Perhaps you should offer the whining bores their money back! ;-)

kalidNovember 6, 2013 at 4:54 pmHeh — can’t please everyone, and you’ll go crazy trying.

You got it: if you’re trying to compute the Fourier Transform for *every* frequency (i.e., to get the strength of every ingredient) then you need to generate every possible candidate and loop through (if on a computer, for example).

In the real world, there are tricks to avoid this manual iteration. For example:

—–

From http://www.math.hmc.edu/funfacts/ffiles/20003.3.shtml

In fact, your ears do Fourier series automatically! There are little hairs (cilia) in you ears which vibrate at specific (and different) frequencies. When a wave enters your ear, the cilia will vibrate if the wavefunction “contains” any component of the correponding frequency! Because of this, you can distinguish sounds of various pitches!

—-

So, our ear is setup in a way that each hair is tuned to react at different frequencies. As sound comes in, different hairs vibrate (extracting the strength of the pitch it’s detecting). Nature usually has ways to do everything in parallel, while our computers manually crunch through.

Will KempNovember 6, 2013 at 6:16 pmCool! Thanks!

Christian Patrick GallesNovember 6, 2013 at 6:27 pmI’m nodding a paragraph in, this is already very exciting and well written.

Quick notes (sticky post) | synthtechNovember 7, 2013 at 6:42 pm[…] Interactive guide to the Fourier Transform. Fourier toy. Mathematica: Sound and […]

Fouriet Transforms, X-ray Diffraction, Quasicrystals | T.A. AbinandananNovember 9, 2013 at 9:32 am[…] at Better Explained, Kalid also has a wonderful intro, with his own animated […]

PradipNovember 12, 2013 at 11:10 amI have read almost all ur posts and love it!

I dint know what Fourier transform is, one hour ago so this may be stupid question..

Fourier transform has all positive values then how can it give back a signal with negative values?? Similar question shateesh had asked about but ur answer dint satisfy me :(

Can you add at least one graph of sample Fourier transform for people like me :p

Also do you know about best algorithms to compare Fourier transform in order to compare two sound signal??

Your answer will really be appreciated.

stmagDecember 8, 2013 at 8:23 amHi

Great article, especially for somebody like me with no previous Fourier experience.

I have one question that is still confusing for me and it would be great if you could help:

on your animation for basic [0, 1] circles I get time points [1, -1]

When i calculate DFT(1,-1) (using the formula above or use calculator like this:http://calculator-fx.com/calculator/fast-fourier-transform-calculator-fft/1d-discrete-fourier-transform) I get amplitude of 2 for the 1Hz circle. I am expecting this value to be 1 (and not 2). What am I missing?

Thanks for your help!

kalidDecember 8, 2013 at 4:58 pm@Pradip: Great question. The Fourier Transform is based on circular paths, which start at an angle of 0 [neutral], go positive [90 degrees], back to zero [180 degrees], negative [270 degrees], and back to neutral [360].

By aligning and delaying various circular paths, you can reach the negative numbers. In general, you can modify a positive signal by starting each cycle at the opposite side to make it negative. So, if a cycle would have started at 45 degrees, start it at 180 + 45 = 225 degrees instead.

Down the road I’d like to do a follow-up with more sample transforms and graphs, thanks for the suggestion.

@stmag: Great question. There are several variations of the FT and DFT equations, and one decision is where the “1/N” scaling factor is applied.

In the calculator linked, try entering [1 0 0 0 ]. The result is [1 1 1 1], which appears to have magnitude 4, even though the input signal had magnitude 1. It’s fine to list the frequency magnitudes as [1 1 1 1], if you remember you need to apply the 1/4 scaling factor when going back from frequency to time.

In my examples, I apply the scaling factor immediately, so [1 0 0 0] becomes [1/4 1/4 1/4 1/4]. For me, this makes it easier to see that the max magnitude of the [1/4 1/4 1/4 1/4] pattern will be 1, which is the time spike we have. Since the two sequences are shown side by side in the simulation, I think it’d be confusing to have the time segment [1 0 0 0] transform into the cycles [1 1 1 1].

Thanks for the question, it’s something to clarify in the post.

Joe P.December 16, 2013 at 10:22 amThanks Kalid. In a case like below where a DTFT pair exists for p_N[n] but you also have another term (constant a raised to power n) included, is there a simple method for finding the DTFT without doing crazy convolution integrals?

h[n] = a^n * p_N[n] where p_N[n] = u[n] – u[n-N] and 0 < a < 1

eta the earthbenderDecember 23, 2013 at 3:51 pmI am a junior in DFT, actually i just heard of fourier transformation for the first time (shame on me, i know), and tried the wikipedia explanation. and i was like ‘holy cow, am i dumb or is this thing too much for anyone’. Then i found your site… I <3ed it. I cant say i understand everything just yet, ill need to work a lot harder for that. But i did have a very clear theoretical and practical idea of what im about to study now.

Dnx a million, you make science sound like less science.

Nice job with the graphs, and good idea the challenge to try (0, 0, 4, 0). That was the point when i finally really understood

kalidDecember 30, 2013 at 7:16 pm@eta: Awesome, glad it clicked for you. Wikipedia is a good reference to *remember* something you’ve forgotten, but it’s tough going to learn something new (in Math, anyway). I have to make sure I’m not fooling myself by trying simple examples and checking the intuitive result meets the actual one. Thanks for letting me know the examples helped.

PradipDecember 23, 2013 at 7:42 pmOhh Thanks for your enlightening. Got the insight and felt happy. Love u man !

kalidDecember 30, 2013 at 7:13 pmThanks Pradip, glad it helped!

Deepak MishraDecember 25, 2013 at 5:06 amVery helpful.. Thank you.

gparleyJanuary 14, 2014 at 10:05 amHi, thanks for this, it helps a lot. But there is a peculiarity:

“A 1Hz cycle goes 1 revolution in the entire 4 seconds, so a 1-second delay is a quarter-turn. Phase shift it 90 degrees backwards (-90) and it gets to phase=0, the max value, at t=1”

Surely a 0.25Hz cycle goes one revolution in 4 seconds?

Audio Grains » Music Technology one post at a time! » The Fourier (Blog) Series Part 1 – Introducing The DFTJanuary 16, 2014 at 9:49 am[…] images are captured from the interactive tool created by Lucas Vieira posted at the bottom of the betterexplained.com article on the Fourier Transform which you can also play around with the recreate the images […]

kalidJanuary 17, 2014 at 9:55 am@gparley: Thanks, you are correct. I was very loose with my terminology, to avoid the need for decimals.

If a signal had 4 data points (a b c d), I wanted to imagine scaling it up so it took 4 seconds of time to complete. A cycle that would have complete 1/4 of the entire signal each step (.25Hz) could be seen as a “1Hz” signal that went through a data point per second (a, b, c, d).

Similarly, something which completed half the cycle each step (.50) would be a “2Hz” signal which ran through 2 positions per second (a, c, a, c). This is a mental conversion I was running in my head, and I need to clarify this part, thanks!

New mathematical techniques might allow for X-ray nanocrystallography | National Academy of SciencesJanuary 20, 2014 at 3:35 am[…] The scientists next determine crystal size by carrying out a Fourier analysis of the intensity of the signals around spots. A Fourier analysis essentially involves breaking down complex signals into a combination of simple waves to better understand the signals — kind of like taking a meal and figuring out its ingredients. […]

AnonymousJanuary 20, 2014 at 11:45 pmyou misspelled “intution”

kalidJanuary 20, 2014 at 11:52 pmThanks, just fixed up.

Quick notes 2013, September to November | synthtechJanuary 22, 2014 at 12:50 pm[…] Interactive guide to the Fourier Transform. Fourier toy. Mathematica: Sound and […]

Derajat Konsolidasi (1) – Sekilas Deret Fourier – Civil engineering as viewed by meFebruary 9, 2014 at 12:14 pm[…] Cat: Untuk lebih mudah memahani secara visual yang dimaksud dengan bidang imajiner dan real dari gelombang periodik, bisa lihat beberapa animasi gelombang periodik di tautan ini!! […]

aristogeitFebruary 9, 2014 at 10:28 pmSuddenly I discovered the meaning of your site

to make money isnt it?

there you go

you do give some insights Im’ not saying the opposite

but alot of it is hogwash you can find it in many other books

but for pure robots as you say its useful it dazzles

maybe you are the Conway of explanations

kalidFebruary 12, 2014 at 7:03 pm@aristogeit: I guarantee you, there’s more effective ways to make money online than through a math blog :). My goal is to help people grok the ideas I struggled with.

PradipFebruary 12, 2014 at 8:14 pm@aristogeit: go read those books why to visit this blog and help him make more money if you think that way. Don’t waste your precious time in commenting here. Next time we would take permission from you whether to write blog or not.

Dave WattsFebruary 27, 2014 at 9:41 amHi,

I just made a 2D fft filtering tool on my website, you can mask off regions of the spectrum as a filter and see the effects by performing an iFFT on the spectrum

http://www.ejectamenta.com/Imaging-Experiments/fourierimagefiltering.html

SaifMarch 15, 2014 at 1:32 pmThank You.

From what i have seen so far(not too much) this is the best possible way to explain “Fourier transform”. And i must say you did the best.

Thank you again to explain it so clearly.

kalidMarch 16, 2014 at 11:52 pm@Dave: Cool demo, thanks!

@Saif: glad it helped!

AsifMarch 18, 2014 at 1:48 pmHi

Trying to understand your animation – the first one (http://treeblurb.com/dev_math/sin_canv00.html)

On r.h.s. you have a cosine wave which is 1 period long and goes from 1 to -1. And I assume on the l.h.s. you are plotting the values from it on the circle. But how do you get the circle. If you just have a cosine wave, you will oscillate along the x-axis. Don’t you need the sum of cosine+sine to go into a circle ?

Thanks

Asif

kalidMarch 18, 2014 at 2:02 pmHi Asif, actually that’s not my animation, but the one that inspired my own.

The plot is actually of the height on the circle as we traverse it at a constant speed, so it’s a sine wave. Sine and cosine can be defined on the unit circle, see http://betterexplained.com/articles/intuitive-trigonometry for more. Hope that helps!

User901March 22, 2014 at 8:18 pmA very good explanation, but I wonder if it might be a bit too oversimplified in places? Simplification is good but i think calling them position (0 1 2 3) and then recycling arabic numerals for many other purposes just gets confusing after a while.

ShwetaMarch 25, 2014 at 3:42 amGreat explanation!

Just a smaalll request….it would be really helpful if you can do a blog on different distributions…poisson, exponential, etc…intution to these would be great.

kalidMarch 28, 2014 at 2:04 pmHi Shweta, glad you liked it. Thanks for the suggestion — I’d like to do more on probability down the road.

Topics in Sampling: A Short Reading List | Software Sampling of the Pipe OrganMarch 28, 2014 at 7:03 am[…] An Interactive Guide to the Fourier Transform – BetterExplained.com […]

Thinking through | electricbitsApril 4, 2014 at 11:04 pm[…] I ended up at Better Explained, which has a page specifically on the Fourier transform explaining all that good stuff up there – about Euler’s formula, about a way to think […]

lexxyApril 14, 2014 at 11:23 amvery very appetising

RaviApril 18, 2014 at 7:35 pm” The yellow dots are when we actually measure the signal. With 3 cycles defined (0Hz, 1Hz, 2Hz), each dot is 1/3 of the way through the signal. ” — Why is the signal measured only 1/3 of the way ? Why not at any other points ?

kalidApril 22, 2014 at 11:34 amHi Ravi, good question. We need to make measurements quickly enough to capture the fastest-moving signal. Start off with a 0Hz signal, which is constant.

How many measurements do you need? Just 1. Measuring at the beginning will give enough information since it’s a constant value.

Now, how about a cycle which repeats once during the signal? (The 1Hz component). We need to measure at the beginning (t=0) and halfway through (t=1/2). Why halfway?

First, we want our samples to be evenly spaced, but also, we need two measurements to describe the behavior of that 1Hz cycle. Having a single data point at t=0 doesn’t let us fit a curve to it, we need two points to “lock in” the cycle (many different 1Hz cycles can have the same value at t=0, but have different phase offsets).

A 2Hz cycle is similar: it repeats twice during the interval. We get the starting point (t=0) and two other data points (t=1/3 and t=2/3) to lock in the phase cycle of this 2Hz signal. Eventualy I’d like to do a follow-up to explain this more, but the main idea is if you have a fast-moving signal, you need more data points to catch (and describe) its behavior.

AnonymousApril 24, 2014 at 5:43 pmThanks a lot ! I never understood the fourier before. You really made this topic easy and fun.

Eric VApril 30, 2014 at 10:53 pmWonderful site! I will be spending more time here.

I appreciate both your use of simple analogies and your disclaimer as to their limitations; I like your raft and river comparison for how far an analogy can take you.

I recently came across a curious discussion of how Fourier transforms may be used in quantum physics to explain how a particle like an electron can appear to be both particle and wave together. I had some trouble visualizing some of the descriptions but this site with the interactive animations pulled it all together quite well for me. Visually seeing how a ‘time pulse’ can be generated from the summation of all possible wave functions helped me visualize there are two equivalent ways to describe the electron:

a) summation of all applicable quantum waveforms derived from an infinite series of Feynman diagrams

b) a ‘chunk’ of probability that appears localized in time and space (particle) but tapers off to nill at greater distances (wave)

To those who doubt the usefulness and need for analogy, I leave you with the words of Erwin Schrodinger:

“If you can not, in the long run, explain what you have been doing, your doing has been worthless.”

kalidApril 30, 2014 at 11:33 pmThanks Eric, really appreciate the comment.

Wow, that’s a great analogy with with electron, it’s a way to see how both a probability waveform (Fourier cycle components) and a particle (time spike) can describe the same phenomena — awesome!

Great Schrodinger quote too, if our understanding dies with us, what’s the point?

Pradeep MaskeriMay 18, 2014 at 11:11 pmReally wonderful site!! I recently bumped into the site and read few articles. Each one gave me Aha moment. Thank you for that.

Fourier transform is well explained , but I have question about -ve sign in front of ‘i’ in forward transform. From your article on imaginary number I learned that negative ‘i’ is clock wise rotation . In animation we see all circles going CCW which is natural for increasing degrees , but ‘i’ is negative. Why?

Also why ‘i’ is positive for reverse transform

BartMay 21, 2014 at 5:06 pmThis is great explanation for those who struggle with math and want to click without being a math guru. The part I struggle the most with is seeing a sound as a whole in the time domain, sampling it and applying the ft. Let’s say the word “hello” is sent over the air and each letter corresponds to specific frequency , amplitude and phase: (made up example)

H – 5hz

E – 28hz

L – 100hz

L – 100hz

O – 330hz

Assumption is that the word hello lasts exactly 1second.

How does this word looks in the time domain graph? Would we have to divide whole 1second into every hz value and spread out accordingly? For example 1/5 , 1/28 , etc.

If above is true the next step would be to sample the time domain?

Let’s say we sample at 600hz?

What does the sample contain? Does it contain every amplitude from every frequency at sampling time or it’s value is the result of then FT? What is the sensor device that can sense all those different frequency to allow sampling, ft and so on. How this device knows the difference between 10hz and let’s say 13000hz?

I understand that ft converts all signals into one but above drives my brain crazy.

BartMay 24, 2014 at 8:27 amJust to add up to my question.

Is the signal coming to microphone (the magic devices I though about in my question) already a sum of all signals within the frequency range of the microphone? In other words is the sound coming to mic the total of all frequencies that could be constructed via FT if we would know every frequency value?

BillyMay 25, 2014 at 1:35 pmHi Kaild,

Firstly, congratulations on a well written article. I love the idea behind the site. If I understand you correctly any signal is a series of time spikes, whose frequencies are phase shifted to produce constructive interference at each spike.

However, I tried computing the signal (4,4,0,0) using the method you describe in the full analysis section and my 1hz term gave me an amplitude of 2 (and not 1.41 as given by the graph) ie, 1hz=4/4:0 4/4:-90 0/4:180 0/4:90 = 2:180.

I’m obviously missing something here (and godamit I thought I had it!)

Kind regards. B

Eric VMay 26, 2014 at 8:54 pm@Pradeep Maskeri

Good observation and question. You’re putting some concepts together well to notice the negative power of i and think it should be a CW rotation.

Let me see of I can fill in some of the details.

The Fourier Transform (FT) is not exactly a rotational transform in the way you are thinking. Instead the FT takes one thing that can have an associated idea of rotation, and transforms it to another thing that can also have an associated idea of rotation. The FT does not take one complex number and transform it to give one complex number that has been rotated, instead it takes one method of representing a complicated bunch of stuff and transforms it to give a different description of the same stuff. The forward and reverse transform then are not forward and reverse rotations of a complex number, but rather the following:

– forward, start with a bunch of basic things (sin and cos) turn them into one complicated thing (composite waveform of arbitrary shape)

– reverse, start with one complicated thing and turn it into a bunch of simple things.

Hope this helps.

Eric V

Eric VeatchMay 26, 2014 at 10:32 pm@Bart

Your second question points toward the answer to some of the missteps in the first question.

Please don’t be offended by use use of the word ‘missteps’. I’ve made them a plenty and will make more. In the physical sciences it is a beautiful thing to make missteps and wrong guesses, greater still to voice them and ask questions. It demonstrates growth.

I can answer your question by telling you a thing that I claim is true. I only warn you ahead of time that it’s kind of a lie. Imagine the chagrin of the poor souls who came up with the corpuscular theory of light (http://en.wikipedia.org/wiki/Corpuscular_theory_of_light)

only to learn it’s all wrong, light is a wave not a particle. Then along comes quantum physics and tells us it is a particle, absolutely it’s a particle. We know this because the equations that govern it are, well, wave equations… but I digress.

Here is the great lie I have to tell you that, for now, is “true”.

You are right, the sound arriving at the microphone is already the sum of all frequencies. What arrives at the microphone is just a single pressure wave with a complicated shape, not a whole bunch of sin and cos waves. The Fourier Transform (FT) just lets us look at it as if it were a bunch of sin and cos waves. Then we can perform some tricky math with it. We can send it through a computer and do all sorts of jazzy things like take an old Parlophone mono recording of a concert with a rude telephone ringing in the background and remove just that sound. I saw a recording engineer at Abbey Roads studio do this with some pretty fancy software, blew my mind!

You also start asking, “What is the sensor device that can sense all those different frequency to allow sampling”? For a lovely game of chasing rabbits down holes, go ahead and see what Wikipedia has to say about the Nyquist Sampling Theorem. It’s good fun and a lovely headache. Let me see if I can shorten it. Lets say you have the setup you’ve provided, a human voice saying the word hello, and that sound hits a microphone. We want to record it to play back later, but we want to record it digitally! Start with what the mic gives us, an electric voltage wave that has the same complicated shape as the pressure wave that hit the mic. Take a ‘sample’ to see how strong the voltage is every so often. The strength will just get converted to a number (this is a binary number that can be stored digitally). As the voltage varies from -100% to +100% the digital number that comes out of our ADC (analog to digital converter) is a number between 0 and 256 (for 8 bit encoding). But how often is ‘every so often’? By the Nyquist Theorem, twice for each cycle of the highest frequency we want to represent. Humans have a tough time hearing any sound at a frequency higher than 20K Hz (repeats every 0.05ms). So you take 2 samples every 0.05ms. Each sample is an 8 bit number. Store it as a file. To play it back; read the first 8 bits, convert it in a DAC (3 guesses what DAC stands for) to a voltage between -2V and +2V, send it to an amp then speakers, repeat for each subsequent group of 8 bits. I left out a detail or two. This lets you faithfully record a sound up to 20kHz. If a higher frequency sound hit the mic our sampling would have missed it.

As for my ‘true’ lie… the Fourier Transform isn’t just about sound. It can be about anything that is represented as a wave (like a quantum wave function for an electron, or an atom, or a cat, or the universe). It lets us take a ‘thing’ that we want to look at and express it in one of 2 ways:

-single waveform complicated shape

-many waveforms simple shape

From the standpoint of sound wave we like to think the ‘real’ thing is the single complicated waveform. The other mess of an infinite number of basic shaped sin and cos waves are not really ‘real’ they are just a convenient mathematic way to treat the object. If the wave is the quantum waveform of a photon we may like to view it the same way. The photon is a ‘real’ object. The ‘real’ part is the single quantum waveform, or is it? However, the single waveform can have a position operator applied to it, to ask the question “where are you, oh little photon?”. Likewise it can have a momentum operator performed on it to ask the question “how fast are you going?” Werner Heisenberg discovered an interesting relationship between those two tasks. Yes it was math alone that caused him to propose his Uncertainty Principle. In this case the sum of all the ‘little’ equations (where, when, how fast, how much charge, how much mass, etc.) may seem to be more real than just the composite wave function, which really is just a probability cloud of nothingness.

The Fourier Transform just gives us a way to go back and forth between the parts, and the composite. Its up to us to decide which version we want to work with.

kalidMay 29, 2014 at 11:01 amThanks Eric for the thoughtful comments (as always!)

@Billy: Great question. When combining the spikes for (4, 0, 0, 0) and (0, 4, 0, 0) we need to take the phase shifts into account.

The first spike is at t=0 and has components without any phase: 1, 1, 1, 1.

The second spike occurs at t=1 and needs to adjust its components to: 1, 1:-90, 1:-180, 1:-270

What happens when we combine the ingredients?

The terms that are perfectly in phase (aligned) can just be added, so the 0Hz component becomes 2:

2 x x x

But how about the 1Hz component? In the first spike it has phase of 0, in the second spike it has a phase of -90. This is like going 1 mile East (0 degrees) then 1 mile South (-90). The result is going sqrt(1^2 + 1^2) = sqrt(2) = 1.41 at a SouthEast direction (-45 degrees).

So, we get

2 1.41:-45 x x

The other terms can be worked out similarly. Great question and something I’d like to clarify: the cycle ingredients can be “out of sync” (due to their phase) and may not combine simply. They can even cancel when fully out of phase (1:-90 and 1:+90 will cancel out and give nothing, like going 1 mile North then 1 mile South).

jerry gregoireJune 11, 2014 at 8:08 amStumbled on to better explained last night. Really enjoying it.

My ah ha moment with Fourier is when I looked at the trig identities and realised that two sinusoids multiplied together resulted in another sinusoid centered on the x axis, unless they were the same frequency, in which case the result would be all above the x-axis, (basic orthogonality). This meant that if I summed the product I would always get zero, unless I had the ‘key’ frequency then I would get a value. So Fourier decomposition was just repeatedly multiplying a signal by different sinusoids, ‘secret keys’, to ‘extract’ out its contribution.

signalJune 14, 2014 at 3:44 amHello everyone,i am doing my project in image processing.. i have done video segmentation using the Fourier transform . I applied 3-D fft on video (gray image(2D)+no of video frames(1D)=3D) and Obtained magnitude and phase spectrum and reconstructed video frames back from the phase spectrum only . i am doing coding part using Matlab software

I have found that moving part pixel intensity values becomes dominant (means its intensity values are increased so much) compared to stationary part intensities in reconstructed frames of original frames .(e.g.in waterfall and traffic on road, water part and moving car’s intensity values are increased respectively compared to the stationary background). i want to know how did this happen?

ARJune 26, 2014 at 9:58 amYou didn’t emphasize the basic idea that the Fourier transform is a special case of a phenomenon that takes place in any real vector space with an inner product. Once you get that it’s just not that fancy and it’s only scary because we write it in a scary fashion, life becomes easier.

As a mathematician, I find it much easier to think of L^2 as being orthogonally spanned by the e(nx) functions and taking the Fourier transform is the analog of writing out an unknown vector in coordinates. What’s so hard about that?

This abstract perspective helps you practically too. You become less reliant on formulas since you have a good global understanding of the notion of a Fourier transform. In some sense, you’re rephrasing this when you talk about smoothies but I don’t know how effective the metaphor is.

Huge caveat: I am a mathematician and “math that anyone can understand” is often math that I have a hard time understanding because of the way it’s presented.

kalidJune 27, 2014 at 4:08 pmHi AR, thanks for the comment!

My primary learning philosophy is “blurry to sharp” (successive refinement) instead of “full detail, top-to-bottom” (walk through the formal definition, even slowly). My blurry version of the Fourier Transform is that it uses filters to break a whole into parts, much like a smoothie can be separated into constituent ingredients (there’s likely many analogies, but I like smoothies).

To get technical, sure, we’ve projected a function onto an infinite set of orthogonal basis functions defined by e^ix — but to me that’s the *mechanism*, not the goal. The goal was to filter a signal into parts for easy analysis, which can be done via an integral, or perhaps mechanically (our ear essentially runs a mechanical Fourier Transform on the incoming sound waves, and as a result we can hear several sounds simultaneously), and so on. It’s a bit like describing a car as a “horseless carriage” (what it looks like) or an “auto-mobile” (how it behaves — it moves itself) or a “vehicle driven by an internal combustion engine”. The latter is the most specific, but not likely to be the most approachable or helpful to a newcomer.

When learning a topic, I need to understand what it does / why it does it, before the how. From there, I can appreciate both the abstractions and subsequent implementation details. When writing, I basically write for myself — what do I wish I had heard up front? One of the trickiest things when explaining is avoiding the Curse of Knowledge and remembering what it’s like before the concept clicked. After it clicked, hearing “project onto orthogonal basis” is a nice reminder, but before it clicks, it would (for me) have been dutifully accepted but not really internalized. (“Sure, ok, we can hypothetically project a function onto other functions. But do I feel what’s going on? Not really.”) That said, everyone’s goals are different. Appreciate the feedback!

signalJune 28, 2014 at 12:14 amis there anybody to answer my question given in post no.176????????????

mAXJune 29, 2014 at 7:46 amFantastic!

AceJuly 22, 2014 at 11:35 amI found this article incredibly helpful as a high school student in need of college-level mathematics concepts. This article helped me understand the basic concept of what the Fourier transform does, and for anyone who needs to know why it works with more math (but still only high school level), I would recommend Stephen’s link to his essay: http://linuxbio.med.buffalo.edu/Fourier/AC_Signal_Processing.html I found it incredibly easy to understand as well as very helpful. One thing about it, though: make sure you keep reading if you don’t understand something, because it is probably fully explained in the next paragraph or two.

SeyiJuly 22, 2014 at 12:18 pmFourier Transform cannot get anymore explicit… And… you made it free… You’ve got a very large heart – never forget that. God bless you!!

Stephen BeschJuly 29, 2014 at 11:22 amSignal,

I suspect that there are several reasons you’ve not received any replies. First thing is that as soon as you move the FFT into 2-dimensional space it moves very quickly away from the core ideas of this thread. Secondly, I think that it is not clear exactly what you are asking. As far as I can tell, what you are doing is 1) taking a time series of images and running a 2D FFT on each. Then 2) throwing away the amplitude data and 3)Inverse transforming the images back into the spatial domain.

The real problem is in the statement of the next part of the problem – to wit: “I have found that moving part pixel intensity values becomes dominant”. I suspect that you are referring to the reverse transformed images. What’s more I suspect that you are also referring to an image by image comparison when specifying increase or decrease.

Anyway, keep in mind that the FFT tells you about periodicity. In 2 dimensions, this means how bits of the image are spaced (and oriented). Think about a picket fence – this would have a very strong “DOT” at a point corresponding to the picket fence’s spacing (i.e., distance from the center in the frequency domain) and orientation (i.e., angle of the radial line connecting the “DOT” to the center) in the original image. Incidentally, there should also be a “DOT” corresponding to the width of each individual picket as well as “DOT”s representing pixel spacing and size.

Now, in the next step you throw away all the data about fixed spacings in the image (the stuff that’s not moving) and keep only the data about stuff whose periodic relationship to the scene has changed (that is, the phase has changed) from image to image (The “moving” stuff), and the wonder why moving abjects are enhanced.

Does this help

Bob AllisonJuly 31, 2014 at 8:24 pmIn this section on Fourier transforms:

“I could say “2-inch radius, start at 45 degrees, 1 circle per second, go!”. After half a second we should be at the same spot: starting point + amount traveled = 45 + 180 = 225 degrees (on a 2-inch circle

I might be missing something basic, or there is a mistake.

If it is 1 circle per second, then I would say after 1 second we would have completed a circle and be back to the same place or starting point. How, on a circle, would you be back at the same spot after 225 degrees? In half a second at one circle per second I would think we would be 1/2 way around a circle, at a spot opposite where we started.

CarlAugust 1, 2014 at 10:00 amThanks for writing this- hope it’s part of a future book. This link might be helpful for those who want to understand it from the frequency perspective:

http://www.dspguru.com/sites/dspguru/files/conv-dsp-tutorial.pdf

kalidAugust 1, 2014 at 3:42 pm@Bob: Ah, that phrase wasn’t clear. I meant that by following the instructions, we’d each be at 225 degrees on our own circles (we’re at the corresponding positions on our own circle).

I’ve clarified the wording, thanks!

@Carl: Thanks!

Tibor SimonAugust 4, 2014 at 5:21 amHey!

Very nice material. Thank you.

I have noticed a small typo in the Appendix: Projecting Onto Cycles section. You have mixed up the Fourier transform with the inverse Fourier transform ;)

Jenn NgAugust 11, 2014 at 12:23 pmHey!

Super helpful.

So how would you create a linear trajectory with a sum of sine and cosine graphs, any amplitude?

johnAugust 13, 2014 at 6:36 pmyou might enjoy this website

http://1ucasvb.tumblr.com/page/2

shikharAugust 26, 2014 at 1:32 pmToo good! Fourier transform is more clear to me now than it was ever before QQ

iecAugust 29, 2014 at 7:15 amaha!

Stephen BeschAugust 29, 2014 at 9:36 amJenn Ng

Sorry it took so long to reply but here is how I would answer your question. First, you are proposing to transform a non-periodic function of the form f(t)=At. By definition you can’t do this with the Fourier series being discussed here. You need to use the full integral definition instead. That is, multiply your function by the complex exponential e^-(jwt) and integrate. (That is, integrate Ate^(-jwt) dt). You should get some function of w that is a complex exponential. (w is the radial frequency 2*pi*f). Once you get this, use euler’s formula to re-write the complex exponential as an infinite sum of sines and cosines. This will give you the indefinate integral. Depending on what you want, you will probably need to handle infinities in the integral limits when finding the definate integral – a real pain but doable. Admittedly this is all very tedious but it can be made to work.

Stephen BeschAugust 29, 2014 at 12:04 pmJenn,

As a follow-on, you might be interested to know about the old Maxim that a Square Wave is made up of an infinite number of even harmonics while a Triangle wave is made up of an even number of Odd harmonics. In either case the amplitude of each term decreases as a function of frequency. If you don’t believe it, try graphing the first 10 (even or odd) harmonics. If you get the phase and amplitudes right, you will see a really good approximation of a square wave or a triangle wave emerge as you add harmonics. Even Sin(t)+0.5Sin(2t) will already have a square wave character.

Stephen BeschAugust 29, 2014 at 12:07 pmOOPS – That was supposed to be an infinite number of Odd harmonics.

signalSeptember 4, 2014 at 10:18 pmHello everyone,i have a doubt….

I know that for a given signal, the sampling frequency Fs must be twice or more than maximum frequency of the signal Fm. It is easy to understand the concept for a 1D signal. But I don’t know how to calculate sampling frequency or Nyquist rate for a multidimensional signal like 2D image.So can anyone help me regarding it.???

CheyneSeptember 9, 2014 at 12:34 amFantastic guide, one of the best I’ve read! Thanks much for sharing this.

Jake YuSeptember 9, 2014 at 2:56 pmUgh how is everyone else understanding this? I got so confused after the applet was introduced..What do the the different paths of the different “motor cars” mean? Are you saying that every wave is a sum of infinitely smaller waves?

someone help

Stephen BeschSeptember 10, 2014 at 6:31 am@Jake

“Are you saying that every wave is a sum of infinitely smaller waves?”

Instead of worrying about what one analogy or another means, look to the fundamental nature of a periodic signal and the ideas embodied in Fourier’s conjecture – i.e., that any periodic waveform can be represented as a sum of sine and or cosine waves. So, take some complex periodic waveform. By definition, it must have a period and it must repeat identically in each of these periods. This period is the fundamental frequency. Well if we remove the fundamental what are we left with? The answer is simply all the other frequencies that make up the waveform. Fourier’s methods allow us to pick any one of those frequencies and remove it. Each time we do this the waveform becomes simpler until at last there is only one frequency left. Fourier does not constrain the sizes of those frequency components – only their frequencies.

Stephen BeschSeptember 10, 2014 at 6:41 am@Signal

The 2D FFT is admittedly more confusing, but to answer your question about nyquist and sample rate for a 2D fft, in particular with regard to images, you have to think in terms of “spatial frequencies”. For example, how often does some feature repeat and what is the smallest feature that you need to resolve. In an image, sample rate corresponds to the number of pixels in a given spatial unit. So, for example, if you have a mosquito in a picture, and the mosquito fills a space smaller than 2 pixels, it will fall below the Nyquist sampling limit. Indeed, you may see a speck in the image, but there will be no information about the size of that speck – only that it is there. Further, you would need at least 2 pixels covering the smallest feature of the mosquito – say a small stripe on its back or it’s antennae – to resolve these either. So, to summarize, for an image, sampling frequency is pixels per unit length and nyquist defines the resolution limit.

David FlavellSeptember 22, 2014 at 7:31 amGreat article – really helpful and empowering

AnonymousSeptember 22, 2014 at 12:33 pmvery nice work!

but if you could provide intuitive explanations about forward FFT that will be great!

The demonstrations here seem to be inverse FFT to me.

NidhiOctober 8, 2014 at 12:34 amThank you very much!! fallen in love with your brain..

Learn Difficult Concepts with the ADEPT Method | BetterExplainedOctober 10, 2014 at 10:16 am[…] Fourier Transform […]

T. K. PrasadOctober 10, 2014 at 7:32 pmNice introduction!

Learn Difficult Concepts with the ADEPT Method - PostlyOctober 11, 2014 at 5:17 am[…] FOURIER TRANSFORM […]

ThomasOctober 16, 2014 at 5:22 pmWhy did you end your tutorial just when you started explaining the math part of the math?

All you’ve done is teach the why. What about the how? That’s the part that’s difficult.

Andy LewisOctober 30, 2014 at 5:51 amEXCELLENT site! My mind has opened.

I recall my days at secondary school in Wales being taught, parrot-fashion: “The square on the hypotenuse is the sum of the squares on the opposite two sides. Now, get on with it!” – Cue blank looks from us all.

Where were you dude?!!!

I think I will use these lessons for my kids, that is how valuable I think your site is. Well done Sir and thank you for taking the time to make this available.

BTW, I would love to see your insights into Z-Transforms and how to APPLY the damn things! :0)

Andy

VinNovember 2, 2014 at 2:03 amYou rock!

BastiNovember 8, 2014 at 4:01 pmBamm!! Your explanation rocks! :)

DhireshNovember 11, 2014 at 12:50 pmExcellent explanation, really really useful. Cheers!

AnNovember 27, 2014 at 11:58 amIt helps me very much! Up to now, I hardly recognize anyone even my professors as a real teacher. Today, you are the real one. Thank you!

kalidNovember 29, 2014 at 1:09 pmThanks An!

IvonneDecember 14, 2014 at 6:09 pmAwesome!

This is probably the most useful thing I’ve seen on the internet so far. I don’t know I would have been able to understand this sh*t without you. Thanks a lot.

sukeDecember 15, 2014 at 4:21 amThis is really useful. I studied Fourier Transformations thirty years ago as an undergraduate and longed to understand what I was doing!

We used them for Crystallography: a FT of a crystal structure shows you what its x-ray picture will look like… but I still don’t understand why? Can you explain?

TharunJanuary 2, 2015 at 9:20 amThank you very much for such a beautiful explanation and for all the effort to make it so intuitive! Very inspiring!

EdJanuary 7, 2015 at 5:21 amEpic

FrankJanuary 14, 2015 at 12:19 pmThis is a phenomenal article. Should be used in universities worldwide. I feel much better about becoming an electrical engineer. Thanks.

kalidJanuary 14, 2015 at 7:21 pmThanks Frank! Really glad you enjoyed it :).

BrandoJanuary 15, 2015 at 2:19 pmSorry if this is a dumb question, but I am confused about one thing, what is a time spike exactly?

Like what is the difference btw (,) and [] in your notation?

kalidJanuary 15, 2015 at 2:32 pmNo worries, let me see if I can clarify. Imagine our signal has 4 datapoints. At t=0 the signal has value a, at t=1 it has value b, and so on:

(a b c d)

We can see this signal as 4 separate signals:

(a 0 0 0) + (0 b 0 0) + (0 0 c 0) + (0 0 0 d)

That is, the signal we’re looking at is really made up of a “spike” that shows up for an instant and disappears. (Usually we think of a signal as a single, smooth entity but what if we “pixelate” it and look at it piece by piece?)

The Fourier Transform helps us create an individual spike, i.e. how to make (a 0 0 0) only using circular components. Next, we can recreate (0 b 0 0) with circles, and then (0 0 c 0), and finally (0 0 0 d).

If we know how to create each instant of the signal (each spike), we can combine the recipes to generate the entire signal.

Notation-wise, I used () when talking about the signal’s original data points in time, and [] when talking about the circular pattern that would help us model the signal. It might not be clear enough in the article though.

Ph.CJanuary 19, 2015 at 1:09 amJust got introduced to Fourrier Transform and i was lucky enough to read your article. Very insightful on many level.

I just have to work a bit on the math now, but the intuition is there.

Thank you for this.

PJanuary 27, 2015 at 7:46 amGot lost when you started talking about “time spikes”. I still don’t really understand anything tbh. Not really sure I understand “time points” either from the first simulation.

kalidJanuary 28, 2015 at 11:44 am@P: Good feedback, thanks. The “time spike” is my informal name for a delta function, which is a burst of activity at a single instant and 0 activity otherwise (for example: http://en.wikipedia.org/wiki/Kronecker_delta). I clarified the post a bit.

Fourier Series and Transforms | IEEE IIT RoorkeeJanuary 30, 2015 at 12:08 pm[…] analysis. While preparing for the discussion we came across some interesting resources like http://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/. This article taught us to be intuitive. While discussing its applications we have come across a […]

Roger J BrownFebruary 14, 2015 at 5:17 pmKalid

I continue to be fascinated, dare I say MESMERIZED by your website. Today I discovered your excellent piece on Fourier Transforms which brought back memories. Nearly 20 years ago I was writing my dissertation and had occasion to use the FT. I confess that I struggled to learn only sort of how it worked (my dissertation was not in mathematics). Would that your site had existed then.

That got me thinking about how you have many components that can be combined into much more complex ideas, essentially the beauty of math itself. You might be interested in just one example near to my area of interest which is extreme value theory.

Your site touches on the stock market. Elsewhere it deals with probability. Through the concept of risk these are related. But the story gets better. Most of the headlines in the popular press are about extreme values, mostly headed as “crashes” or “meltdowns” in order to sell more page views. Indeed, the risk manager who fails to allow for extreme values is at more risk than he perceives, especially if his view of risk is through the famous (and simple) normal distribution.

It turns out that the normal distribution (which appeals to the Central Limit Theorem) is a special case of a more general class of distributions known as Stable-Paretian (from Pareto, which is discussed in your 80/20 article). The S-P distribution appeals to the Generalized Central Limit Theorem. S-P distributions allow for extreme values, popularized as “long tailed” or “black swan-type” therefore more accurately describing the actual risk in the real world. The practical problem is that, except for the normal and two others, the pdf for Stable distributions does not exist. BUT a solution is found in the fact that the S-P characteristic function (which always exists) and its pdf is a Fourier Transform pair! As you would say: Whablamo! We have a way to model rare events in a conventional fashion. Once you have a pdf a lot of things get easier. There is a lot of detail about this at http://www.mathestate.com for those interested.

Anyway, thanks for not only bringing back fond memories but deepening my understanding of my own research.

My best

RJB

SidneiFebruary 15, 2015 at 5:21 amVery good work!

kalidFebruary 15, 2015 at 7:03 pmHi Roger, thanks so much for the note. I really want to get into stats this year as it’s a giant gap in my intuition. Glad the article was helpful for your research! :)

mohamedFebruary 22, 2015 at 1:36 pmHello,

I do not understand teh differances between continuous fourier transform and discrete fourier transform?

Examples from real life are need!

What are the differances between these two?

menooMarch 1, 2015 at 3:37 amthat was fascinating, keep writing! i would appreciate it, if you could post something about hilbert transform as well; and thanks for the great explanation, it really worked for me :)

JonnyDamnnoxMarch 4, 2015 at 1:28 pmIt’s largely just a vector space of function where you can decomponse each element into components with sin and cosine as function. And the Fourier transform is just a change of basis in this vector space.

JonnyDamnnoxMarch 4, 2015 at 1:31 pm“….decomponse each element into components with sin and cosine as function. ….” I mean sin and cosine as basis of course ;)

Evi1M4chineMarch 7, 2015 at 12:50 pmHey, the section “Making A Spike In Time” could be improved, by not presenting the “position of each cycle” table just like that, before explaining it. Because people will try to understand things the moment they read them, and not know to put them “on hold” for a coming explanation. But even putting them“on hold” is a serious problem, because it takes away one of only 6-9 active memory slots, and makes processing anything that builds upon that blocker impossible.

I was stuck for way too long, until I saw the explanation *below*, and still felt very uncomfortable, having to first read below, then jump up and *now* be able to understand the table, and then jump back down behind the explanation again.

In fact, this is a general concept: Never mention anything before its explanation. Inside its explanation is acceptable, if the reader is aware he’s inside at that point. (In the above example, one isn’t.)

If you could make that a principle of all articles on this site, it would be a big factor in making sure the articles are understandable. :)

Also: Could you make every headline and embedded thing (like tables, those graph animations, images, etc) linkable via a anchor, that would be nice. :)

JackMarch 14, 2015 at 10:01 amHi Kalid,

Fantastic site, and great explanation of the Fourier Transform! I wrote up my own explanation of the Discrete Fourier Transform which is more focused on signal processing. May be interesting for your readers!

http://jackschaedler.github.io/circles-sines-signals/

ArunApril 3, 2015 at 12:02 pmKalid.. amazing work! your intuitions link to natural truths..and explains another dimension.

Thank you for sharing this.

rampyApril 7, 2015 at 1:13 pmThis is a peice of artwork ! Great work . Consider it a charity at Warren Buffet level to make this so intutitve to understand.

rampyApril 7, 2015 at 1:13 pmThis is a peice of artwork ! Great work . Consider it a charity as Warren Buffet level to make this so intutitve to understand.

sophyApril 25, 2015 at 4:44 amgreat storytelling..

can u plz tell me why do we have to multiply an exponential raised to a complex number meaning that IT HAS TO BE rotated to get frequency information?

NicoApril 26, 2015 at 7:31 amGreat article. Well done!

KunalMay 14, 2015 at 10:19 amKalid, this was by far the best article on fourier transform! Your methodology of teaching is marked with brilliance! Thanks a lot for sharing this!

MaukkaMay 19, 2015 at 12:37 pmHey, im studying LTI system’s response to everlasting exponential e^st and trying to get better undestanding why fourier transform of system’s impulse response will appear in the convolution equation of e^st and h(t) ?

y(t)=integral(h(u)x(t-u))du = integral(h(u)e^s(t-u)du) =e^st integral(h(u)e^-su)du =e^st H(s)

where H(s) is system transfer function = fourier transform of impulse response. Why fourier appear in this equation and how to think about it in light of this article.

System output at time t will be …h(0)e^st+h(1du)e^s(t-1du)+h(2du)e^s(t-2du)…so you have to sum current and previous input values effects to get the output at time t. This is done by delaying input (rotating backwards) and multiplied with impulse response value at that time and taking integral of this. This is same as fourier transform of h.

i would need more intuition and insight about the relationship of convolution and fourier transform.

Thanks for your help

RichardMay 25, 2015 at 7:43 amFantastic article!

ObjectMatrix,June 28, 2015 at 1:47 amGreat article Kalid. This will help to intuitive learners.

Fourier, in addition to his work in theoretical physics and math, he was also the first to discover the greenhouse effect. http://geosci.uchicago.edu/~rtp1/papers/NatureFourier.pdf

ZackJuly 6, 2015 at 4:24 amI spent four years studying electrical engineering at a decent university and FT’s were never explained this clearly. What a wonderful article!

kalidJuly 6, 2015 at 9:15 am@Zack: Awesome, glad it helped!

Alan TomaltyAugust 9, 2015 at 12:46 pmCan anyone post all the mistakes Fourier made in his original article when applying Fourier transforms in the heat equation. Stephen Hawking did not comment on the article when he included it in his book “God created the Integers”

AbhiAugust 14, 2015 at 7:36 amThanks you so much… thanks a million or maybe more…

I was messed up with fourier transform from last few months, in my mind !! Never understood its physical interpretation or it existence and working… After a lot of and extensive search from online and offline, I bumped into this.. and this post answered evrything !!

This is an awesome post !!

Keep the great work up !!

Erdal YeikAugust 26, 2015 at 4:10 amReally very clear, very simple explanation.I feel as you are talking here. Thank You

MingSeptember 3, 2015 at 1:58 pmHi Kalid,

This is absolutely fantastic, as always. Thank you so much for this article!

I had a question about how the Fourier Transform works when there are several different time spikes of different amplitudes, e.g. (0 6 0 2 8 0). I noticed that if you plug something like that into your Fourier program (which is awesome, by the way!), the “recipe” that it outputs is a bit more complicated – each simple wave has a slightly different amplitude, so it seems like you’re not using the “tentative recipe” anymore. How do you work out what these individual amplitudes are?

Thanks, and sorry if I misunderstood anything!

kalidSeptember 3, 2015 at 10:44 pmHi Ming, glad you enjoyed it!

So, the recipe for each time spike has to be scaled by the size of the spike. Let’s say we just want (1 0 0 0) as a time spike. This would be equal strengths from each possible frequency, or

In this case, there’s no phase offset needed. Now, let’s say we have the spike of (0 2 0 0). We still need equal strengths, except this time it’s double, since we want to sum to 2.0 and not 1.0:

Whoops! We need to add in the phase offsets. It should be:

since each Hz component needs to line up at t=1, not t=0. If we were to combine the signals (1 2 0 0) we would have:

The first term [0Hz component] can combine easily, to get 3/4. But the other terms have to be added like they are vectors:

1/4 pointing at 0 degrees + 1/2 pointing at -90 degrees is, with some trig:

Amplitude: sqrt[ (1/4)^2 + (1/2)^2 ] = .559

Angle: atan( -(1/2) / (1/4)) = -63.43 degrees

If you plug in (1 2 0 0) into the simulator, you get

which are the first two terms. The others can be computed similarly. Of course, it’s a pain to do all this trig — we typically keep the components (amplitude + angle) as complex numbers (a + bi) so we can simply add them up to combine them. The simulator shows the phase offset as an actual angle to help visualize them. But the Fourier Transform formula only deals with complex numbers.

Phew — hope that helps!

Hunt BlatzSeptember 10, 2015 at 7:09 amThank you for this explanation.

I would like to run a lab experiment with a three microphones and a speak.

My thought is to align them, microphone, microphone, speaker, microphone.

Analyze the sound from the first two microphones for the sound pattern that matches both, based on the distance between the microphones, and feed the inverse waveform through a carefully located speaker. Then measure the results with the third microphone.

I only know some basic electronics. Any thoughts on how I might set this up?

kalidSeptember 10, 2015 at 10:12 pmHi Hunt, I don’t know much about electronics (much less than you), but you can definitely use the Fourier Transform to analyze the incoming waveforms and perhaps do some transformations. (Here’s a software example). Hardware, I’m out of my element! =)

Bob HigbeeSeptember 14, 2015 at 8:35 amYour article probably “loses” the average reader (including me) when you introduce “e^1x” in the figure “Two Paths, Same Result”.

All I currently know is that e = 2.718 281 828 … and when you use this number as an exponential “base”, you get the “natural logarithm”. I am unfamiliar with how “e^1x” can be used to represent, as you state, “angle and distance”.

What part of the term “e^1x” is the angle and what part is the distance? I tried to assume that “x” was the distance in “e^1x”, but after punching some #s in my calculator, I got more confused, for example, e^0 = 1 (just like 10^0 = 1), and e^1 = 2.718 281 828 … Anyway, you need a side tutorial to explain how vector polar notation can be expressed as “e^1x”.

On the good side, your interactive graphics showing how to go from circles to sinusoids were fantastic.

Another bad side – You shove the readers off the edge of the cliff when you present the FFT equations for Xk & xn. You can’t go on about smoothies and then assume that the reader knows that the Greek symbol “epsilon” means “sum the stuff on the right from, for example, item “n” = 0 through and including item “N-1″”. Also, you don’t explain at all how these equations deconstruct the smoothie. It would be better for you to confess that you really don’t know how FFT works, but that you (like me), know very precisely what it does, but are clueless regarding the specific math steps required to achieve the results,

For example, all I really know about FFT (and what I knew coming in to this article) is that when you pour a smoothie into it and you get the resulting amplitude-versus-frequency-response spectrum chart (graph), the “bumps” in the spectrum show the amount (amplitude) of the original smoothie ingredients and the frequency associated with the amplitude spike (bump) shows the rate of application of that particular ingredient (to continue with your smoothie example, which was a good example by the way).

JacqSeptember 17, 2015 at 7:25 amBrilliant and easy-to-understand description of what the Fourier Transform does. Thanks.

SureshOctober 1, 2015 at 8:20 pmThanks a lot. Many sites simply gives us the formula and explain in a very abstract way. I had understood that Fourier transform has a lot of application, but, couldn’t understand what exactly it is trying to do.

But, you have made it very clear now, by giving enough analogies and visualization.

Thanks a lot!!!

AnngOctober 13, 2015 at 10:17 amThanks, it helped me a lot! Great job with the article.

dOctober 17, 2015 at 1:46 amGood description thanks. Miniscule criticism: SI units please! :)

LukeOctober 21, 2015 at 3:06 pmThanks for this article – especially the leadups expaining the mathematics of complex numbers, euler’s identity, etc., those were really helpful. The rotation analogy makes it all much more intuitive. I was excited to read the Fourier article here, feeling like there was a pot of gold at the end that would finally tell me how the smoothie filters worked, but I must admit I left it a little confused still. I’ve long understood WHAT the Fourier transform does and what it’s useful for, and thanks to your explanations I can do the equations now and understand roughly how the different parts work in a complex-rotational context. But I’m still totally baffled as to WHY this works. Why is it that integer-frequency’d sinusoids happen to be able to add up in such a way that they magically cancel each other out at the right places and can represent any possible sampled time-domain function? Maybe I just need to meditate on the math more? I’ll probably check out Stephen’s “AC Signal Processing” link above, sounds like he gets into the why a little more. But if you get time to dig into the why a little more at some point I’d love to read it, your explanation style is really clear and fun to read.

kalidOctober 21, 2015 at 4:24 pmHi Luke, great question. (Btw, this confused mathematicians in Fourier’s time as well.)

Why it works is a deep question, https://www.quora.com/What-is-an-intuitive-way-of-explaining-how-the-Fourier-transform-works has more details (see the first answer). I also like this analogy (“a fly in the room”):

https://movieblow.wordpress.com/2011/11/06/how-to-remember-fourier-series-without-really-trying/

Here’s my 2 cents:

Projection (the dot product) is how we find how much of “x is in y”, essentially giving a readout. If we pick a point in the x/y plane, we might say its coordinates are (1,1). It means that the coordinate is 1 when projected onto the x-axis, and 1 when projected onto the y-axis.

Our choice of axes can change: if we use the “NorthEast, SouthWest” axes, then that same point is (1.414, 0). [sqrt(2) at a 45-degree angle].

The Fourier Transform basically says “Every possible sinusoid is the set of axes that you can project your function onto. You’ll get a listing of how much of each sinusoid is present in your signal.”

The reason *why* these sinusoids are enough is fairly intricate, but in short: we have an infinity of distinct sinusoids to use. It’s a pretty big lego box, and likely that some combination adds up to our signal. (And we can see it happening in small portions if we handle one instant at a time.)

LukeOctober 22, 2015 at 9:51 pmThanks Kalid – I read the links you mentioned a couple times, think I’m at least getting a sense of it. The orthogonal basis vectors analogy is useful – like in linear algebra you could potentially define a space with many different choices of basis vectors, as long as they’re at least partially orthogonal to each other (i.e. stretch into every dimension of the space at least a little). And I guess the integer-frequency sinusoids are analogous to perfectly orthogonal basis vectors? Not sure I have that right but the general idea makes some sense.

I saw it mentioned in a few places (e.g. https://www.youtube.com/watch?v=h6QJLx22zrE ) that the Fourier transform is essentially performing a *correlation* for each component sinusoid, directly comparing them by multiplying and summing. That was helpful – it’s checking in a simple brute-force way how much a given time signal correlates with different frequencies, rather than taking the signal apart in some more “magical” way.

So I understand how the smoothie filters work :). Why the particular fruits 0 to N-1 Hz are all that’s needed for every possible N-ingredient smoothie is still a little mysterious, but if I get time I’ll brush up on some of the math involved and check out some of the other links people mentioned and hopefully understand it better. Thanks for the elaborations!

Job BouwmanOctober 29, 2015 at 7:14 pmSo many good explanations here!

However, I think I have a new perspective here, got some 80 votes on Quora in one week:

https://www.quora.com/What-does-Fourier-Transform-physically-mean/answer/Job-Bouwman

Cheers!

JoeOctober 30, 2015 at 11:09 am1. I don’t understand why there is a 1/N in inverse fourier transform rather than fourier transform. I know I am wrong, cuz a lot of equations say that. But my calculation tells me the 1/N should be in the fourier transform. Try [1 3 6 5] in the frequency domain, which is (15 -5 -1 -5) in the time domain,( here N is 4). For example, in 0Hz if you follow the equation, then the the value of the first time spike should be (1 + 3 + 6 + 5) / 4 = 15 / 4, which is different from the result.

2. When we do the inverse Fourier Transform, the result xn (value of the signal at time n) is real number, so actually we should only take the real part of the complex result on the right, is that correct?

JustinOctober 31, 2015 at 3:34 amThis was pretty neat https://84c67cd8f568acc648fb74bc321df20db70c2600.googledrive.com/host/0B3p9nx7jwyf9MjFtY3d1aXVBMjA/fourier.gif

sreenichNovember 1, 2015 at 3:54 pmHi Kalid,

Excellent article! Great work! I loved mathematics, and have understood lot of concepts intuitively and have liked it learning that way. I never understood Fourier transforms till today.

I was able to memorize and theoretically understood the formulas and get very good grades during my Engineering studies, which was about 20 years ago, but this is the best article on Fourier transforms.

Sreeni

Syed AdnanNovember 8, 2015 at 12:19 amExcellent work and really helping way and material. Great work done.

kalidNovember 8, 2015 at 2:15 pm@Sreeni and @Syed: Thank you!

@Joe: Great question. For the 1/N term, we just need that factor to be applied when doing the transform and then doing the inverse. So, we could have 1/N on the forward transform, or 1/N on the inverse, or 1/sqrt(N) on each part. It’s a convention about where we apply that factor.

When we do the inverse transform, we get our original signal back. If our original signal was purely real, then we’ll get that back. The “ingredient list” (i.e., the result of the forward transform) can have real and imaginary parts since it must track the phase & amplitude of each frequency. Doing the inverse transform means all the imaginary components cancel, leaving us with our original (real) signal. [If we had put in a complex signal in the beginning, the inverse transform would return that complex signal.]

AliNovember 12, 2015 at 12:06 amFantastic material!

BhavyaNovember 27, 2015 at 8:39 amGreat article Kalid! I thought I understood Fourier transform during college, but your article has enhanced and refined my understanding.

If you can, please do try to follow up with more topics of college engineering maths – laplace transform, z transform etc. Thanks!

-Bhavya

GowNovember 28, 2015 at 10:07 amNamaste Kalid,

I didn’t get the simulation part. Would you explain me how you related the imaginary plane (real and imaginary as axes ) consisting of that circle with the wave on its right side (Amplitude and time as axes).? And I know that amplitude of an imaginary number is (or size)=sqrt(a^2 + b^2). Now,

1st position( zero degrees):

On circle : a=1,b=0

On the right side : Amplitude=1.

2nd position(90 degrees):

On circle : a=0,b=1

On the right side : Amplitude=0. Question: If Amplitude=sqrt(a^2 + b^2), shouldn’t this be 1..?

And this doesn’t hold good even when you make ‘vertical’ axis as ‘real’. Where am I going wrong..?

I’m not able to move further.

Thanks Kalid

kalidDecember 3, 2015 at 1:28 am@Gow: Great question. The left side shows the position on the circle (real + imaginary part) and the right side shows the magnitude of the real part only (which changes as you go around the circle).

BenApril 2, 2016 at 10:23 pmAbsolutely briliant. Thank you so much for this!

JoelMay 2, 2016 at 12:30 amKalid, Really nice article.

Maybe here’s a proof for this part: “When every cycle has equal power and 0 phase, we start aligned and cancel afterwards.” Or at least an argument:

If all the cycles are at 1 (max) at time 0, then they must be less than 1 just after zero. So, the superimposed signal must decrease away from zero. For the superimposed signal to increase again, we need all the cycles to line up. But since they are all on a different speed that is very unlikely (impossible?).

KanwalMay 4, 2016 at 7:24 amGreat article so creatively explained :D. Thank you !!

susie[email protected]May 5, 2016 at 12:00 pmWhy the number of frequencies equal to the number of samples? How about the number of samples much greater than the number of frequencies?

laxmi sundarMay 15, 2016 at 1:11 amyour explanation too good.. made my interest in fourier transform..!! tanx…

randMay 21, 2016 at 4:27 pmGreat article, thanks!!!

Sadhana SenthilkumarMay 23, 2016 at 1:09 amthis is brilliant!

AllenMay 29, 2016 at 12:21 pmGr8 article!

yangMay 29, 2016 at 8:14 pmthank u for make math simple and understandable!

FarahJune 1, 2016 at 4:33 pmAmazing , thank you so much

jeff agarJune 5, 2016 at 12:15 pmYou are awesome! thank you so much!

JoeJune 5, 2016 at 3:51 pmyeah honestly i didnt like that analogy – there are plenty of more practical analogies that could have been used

ShirleyJune 28, 2016 at 8:31 amQuestion:

When you are coding the FFT, are you actually using Euler formula, or the sin and cosine?

kalidJuly 2, 2016 at 12:47 pmWhen coding, you have to use sine/cosine because most languages don’t support imaginary numbers. Therefore, you can’d do Math.pow(e, i*x);

ShirleyJune 28, 2016 at 12:11 pmIt is mind-boggling, but i keep thinking about “who/what is travelling on the circular path”?

I played the Hubert go! animation , it is very interesting and useful. Somehow I can physically feel the motion changes: stop, start, slow, bouce back….. It is something repeating…. and circular is traveling back-n-forth.

There are connections, but I cannot draw one. Would u help me?

What is traveling on the circle?

ShirleyJune 28, 2016 at 7:31 pmcircle and sine…. still not clicking…..

The only way that i can connect the two is the alternating current where i can see the coil rotate (making a circle) and the current depends on the sines…..

So what is moving in circle in the general case?

kalidJuly 2, 2016 at 12:51 pmGood question. Ultimately, sine (and cosine) just generate numbers in a pattern. Instead of a very “jumpy” pattern like 0 1 0 -1…

We have a very smooth pattern like 0 .1 .2 . 3 … .98 .99 1 .99 .98. Notice that the pattern takes large steps in the beginning then slows down as we reach the max (1.0).

We humans decide to think of this as “something moving” (which is just a visualization trick) but ultimately it’s about how smoothly a set of numbers changes. If it helps, you don’t need to think of anything moving, any more than the sequence 1, 2, 3, 4 “moves”.

ShirleyJune 30, 2016 at 8:43 amIn Sturat Riffle’s article, I find this confusing: “The inputs and outputs are actually complex numbers, so to feed a real signal (like some music) into the Fourier transform, we just set all the imaginary components to zero.” —–What does this mean? Why set imaginary components to zero???

The drawings he has, sort of make sense. but somehow, I cannot relate them to the math components.

I find it tempting to quickly accept some ideas and sparks and convince myself that I understand it. But unfortunately, I am still baffled about why it would work! I know that it does work, and I know there is math proof behind it. But I keep asking: why it would work????

Any people still confused and paranoid like me? Please raise your hand. I think there are still some gaps in understanding.

kalidJuly 2, 2016 at 12:53 pmThe Fourier transform can work on 2d signals (i.e., a set of data with both a real and imaginary component).

A sound file is just a set of pressure readings (from 0 to max), so there is no need for the second dimension. Put another way, the Fourier Transform is a car with two passengers, we just leave the other seat empty (when looking at sound waves).

ShirleyJuly 2, 2016 at 3:24 pmHaha, i thought i figured out (or, at least i find an explanation i am comfortable with). Kalid, i sent you an excel file, pls check it and let me know if it makes sense.

Thanks!

JeffJuly 3, 2016 at 8:35 amThe approach in this article takes an input with N samples and creates N components at different frequencies.

However, based on my understanding of the Fast Fourier Transform, if there’s an input with N real samples, there are only N/2+1 components at different frequencies.

How should I think about this discrepancy?

Thanks!

ShirleyJuly 4, 2016 at 7:06 pmI only started viewing the FFT today, according to my preliminary understanding, there are some redundant calculations in DFT. For example, DFT involves matrix.vector multiplication, which is essentially a bunch of data multiplied and added together. A simple and naive example: if you are calculating a1*b1+a2*b2+a3*b3+a4*b4, you need to multiply four times and add them together. Then the FFT found some patterns that a3*b3+a4*b4 is somehow related to a1*b2+a2*b2, therefore you would simplify your work by calculating only the a1*b1+a2*b2 part, and use the the relations to get a3*b3+a4*b4…..

This is my naive understanding so far, anyone pls correct me if I am wrong.

BTW , i am still reading, will update once i know more.

ShirleyJuly 5, 2016 at 9:42 amHave you guys seen how sieves work?

https://en.wikipedia.org/wiki/Sieve

I saw people used them at construction site to separate stones of different sizes: each sieve is of holes of different size, ie, 30mm, 20mm, 10mm,…etc. And you pass the mix through the 30mm one, so you get all the stones above 30mm, then you pass the remaining thru 20mm to get 20mm-30 stones, then the 10mm…

I personally find it very comparable to the Fourier filter processes. Reason I am bring it up is because there is a process of “aligning the sample with the filter” which I can see appear in both cases: in Fourier, I see the multiplication of each data points by the vector as alignment while in the sieve case, you let the mixture through the sieve and you shake them, then the stones of appropriate sizes will touch the holes— and to me this is alignment!

I am so happy to see a one-to-one mapping of the analogy and the math formula!

Ebuwa famousJuly 5, 2016 at 4:37 pmyou are the bomb khalid. i look forward to become like you

J.BJuly 8, 2016 at 10:31 amDude,

this is so awsome and understandable. Cool! Thanks a lot!!!!

SoundnoobJuly 10, 2016 at 3:12 pmReading this was straight mind porn. Excellent.

Niklas KarvonenJuly 14, 2016 at 1:44 amAbsolutely great! Thank you for this.

SundaramJuly 28, 2016 at 10:23 pmI found this presentation (https://www.youtube.com/watch?v=FjmwwDHT98c) by Will Cox in OSCON 2014 to be an intuitive introduction to FT and it lists this BetterExplained page as “See Also” in the last slide.

Teddy MatindeAugust 1, 2016 at 8:53 amGreat article! I hold in high esteem those that take complexities such as this, and make it digestible for the rest of us. I have been through my algorithms book quite a few times, and some online articles and this by far has been the most insightful. Made me realize how off I was just reading the formulas.

An observation, at some point, you talk about amplitude, then you jump into strength. Took me some head scratching to relate the two. Maybe spell it straight out, give a more explicit explanation.

kalidAugust 1, 2016 at 6:31 pmThanks Teddy, great feedback. I use strength/amplitude interchangeably, I’ll make it consistent :).

VijayAugust 2, 2016 at 11:25 amHello Kalid. Is it possible to combine 1000s of signals (say sine wave), with same phase and amplitude, but with different frequencies and use FT to filter out each individual frequency?. If yes, how is this represented in equations (the filtering process)?. Thank you.

Ivo EvertsAugust 3, 2016 at 12:23 amI am astonished, excellent job.

ShirleyAugust 9, 2016 at 10:22 amI have another question:

1) (at a specific frequency), Fourier transform output a complex number telling me the magnitude of a certain frequency component;

2) Inverse transform multiply the complex-valued result by another complex number (from the circle) , therefore, result is also complex??? — question is, how am I going to interpret this result? shouldn’t our real-time value observed be a real value?

Can anyone please shed some lights?

ShirleyAugust 9, 2016 at 10:30 amEh, sorry another question:

once we know the magnitude of the frequency components and the phase,

why do we need the inverse formula at all?

Can’t I recreate signal as Mag1*sum(w1(t+phase))+Mag2*sum(w2(t+phase))+…??

We already know the recipe, why would I want to go through the circle again to recreate the original signal???

Thanks!!!

kalidAugust 26, 2016 at 3:30 pmThe inverse formula is basically that, it’s just a description of how to add up the pieces to create the original signal again.

EliseAugust 16, 2016 at 7:58 amThis was the best article about fourier transform intuition I’ve ever read, thank you very much.

BillyPilgrimAugust 22, 2016 at 7:44 pmThank you so much, truly helpful, you’ve saved me an immense amount of time and energy

AdamAugust 23, 2016 at 6:31 pmGreat article. It took me a while, but I was able to understand everything you said. I just wanted to ask how the mixed-number values of Xk are interpreted. This might just be a show of my weakness when it comes to imaginary numbers, but I don’t understand how something like anabsorption spectrum can be put together with values like’ 6-2i’. Is there something I’m missing?

ShirleyAugust 24, 2016 at 8:30 amI think the length (module) of the complex number 6-2i will be the amplitude of such frequency component, which is sqrt(36+4) in this case;

if you plot (6,-2) on the graph, it will tell you the phase. So basically tg(theta)=-1/3, implying the phase of such frequency component.

kalidAugust 26, 2016 at 3:29 pmGreat question. A circular path at a certain speed (such as 1Hz, or 1 cycle per second) has two additional parameters:

1) How strong is it?

2) Where does it start?

We encode both of these data point using imaginary numbers. A plain number like “6” means it has strength “6” and starts at 0 degrees, as we’d expect. A number like “6 – 2i” means the strength is sqrt(6^2 + 2^2) = 6.32, and it has a starting angle of atan(-2/6) = -18 degrees.

There are other ways to encode these two pieces of information, but complex numbers are compact.

AliSeptember 1, 2016 at 12:05 pmThank you so much for the great explanation!

AMDSeptember 15, 2016 at 11:46 amGreat explanation. It was not until I read this article as a grad student in engineering that I fully understood the purpose and inner workings of the Fourier Transform. Thanks for posting!

TonySeptember 26, 2016 at 4:25 amCongratulations to a work very well done, great explanation with the abstractions. Helped me alot! Thanks

dpoOctober 5, 2016 at 9:38 amWow!! wonderful article.

TriOctober 6, 2016 at 5:47 amThe best explanation of the FT on the web. Thanks

MeghanOctober 24, 2016 at 12:58 pmThis is a pretty good article, I really liked the animations! The recipe analogy was kind of hard to understand without knowing about FT already because you combined math properties with fruit which doesn’t really make intuitive sense. One thing I had trouble with though is that this explains DTFS and not really DTFT. I think the two things are supposed to be the same but from Oppenheim’s book it seems that DTFT just separates a LTI response into shifted impulse responses and attaches a frequency to each impulse response. Then when you inverse the FT you basically inverse each shifted impulse response. Whereas in DTFS when you sum over all the frequency equations that is basically inverting the DTFS since you recover the time domain signal. Can someone explain why they are similar?

MeghanOctober 24, 2016 at 1:38 pmNever mind, I figured it out :|

For anyone who’s curious, a DTFT basically sums over all the frequency responses like DTFS does but it does from -pi to pi omegas instead of having a limited frequency range like DTFS. So everything just happens to cancel to 0 for everything except at the signal for the shifted impulse. I think.

veena krishnaOctober 27, 2016 at 2:50 amVery good explanation. Enjoyed it

ArvindOctober 30, 2016 at 1:02 amThank you so much. You’re revolutionizing the way Math is being taught. I’ve never seen anything like this in 30 years. You should setup a patreon or some donation on your site.

IanNovember 2, 2016 at 5:18 amI’m so sad to say that I am still struggling to understand this article. As much as I’d love to, it’s just beyond my intuition. I got lost just after the first mention of the spinning dots graph.

Maybe I’m just stupid.

Ali ShakibaNovember 4, 2016 at 2:53 amHi there,

Thanks for your time and effort to explain things better.

I wonder how do you design the (interactive) animations and the tools that you use to draw these figures and graphs?

Thanks

kalidJanuary 24, 2017 at 8:08 pmHi Ali, the animations were done in Javascript. If you right click and view source you can see the source code for the animations.

Sourav GaraiNovember 14, 2016 at 4:39 amThis helped me learn a lot!

AbdelNovember 15, 2016 at 12:39 amThank you so much ! Great job done, now it time to make translation on french, spanish …

pujolNovember 19, 2016 at 10:30 amIt’s OK, but still confusing.

AaronDecember 16, 2016 at 6:35 pmMind equals blown

Thank you :)

ApostropheShyDecember 30, 2016 at 10:37 amHow does the Fourier transform work if there are two waves of the same frequency at different phases?

Luke HankinsApril 17, 2018 at 6:14 pmNot an expert, but I would imagine there would be some scaled and shifted circle at the same frequency that could fully capture the information of both waves.

Amplitude 1 at 0 degrees + Amplitude 2 at 180 degrees = Amplitude 1 at 180.

Every angle should be possible but would involves sine/cosine of the angle between them.

ArgieJanuary 4, 2017 at 11:19 pmHi,very very nice work!,

but I have a small complain, I had to go to comments in order to realize that we speak about DTF and not just TF, I also have a proposal, if you want and like make an article for Laplace transform too, it will be very helpful!

Thanks!

Argie

ArgieJanuary 4, 2017 at 11:46 pm*correction, DFT and FT(continuous)

ChrisJanuary 9, 2017 at 10:22 amThat is a really shitty attitude to have

41 Key Machine Learning Interview Questions with AnswersJanuary 16, 2017 at 3:52 pm[…] method to decompose generic functions into a superposition of symmetric functions. Or as this more intuitive tutorial puts it, given a smoothie, it’s how we find the recipe. The Fourier transform finds the set of […]

William PenaJanuary 19, 2017 at 4:23 pmLook at the fish deeply and explain what is observed. Thimk.

JackJanuary 20, 2017 at 8:41 amAha!

KiranFebruary 2, 2017 at 6:02 amThis is how you explain things, very nice… Great wrk…. Thnx guys…

Understanding the Fourier transform – Irene's Blog/PortfolioFebruary 6, 2017 at 7:41 am[…] than jumping into the symbols, BetterExplained people experience the key idea firsthand by using a “smoothie” […]

References | The Church of ZeroFebruary 11, 2017 at 6:14 pm[…] Fourier Transform – Better Explained The Fourier Transform.com […]

Ashwin VadivelFebruary 13, 2017 at 6:17 amsensational article

Fourier Transform | blog.vxcrew.chFebruary 14, 2017 at 11:34 pm[…] https://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/ […]

Understanding Fast Fourier Transform from scratch – to solve Polynomial Multiplication. | Ash's BlogFebruary 23, 2017 at 3:29 am[…] Fourier analysis is the decomposition of any mathematical function into a series of sine and cosine waves (sinusoids). If you wish to learn more, here are some links that help build the intuition – a quora answer on fft, an interactive guide to Fourier Transform. […]

On-page SEO Part 1: 10X CONTENT in 4 Steps - Red Door StudiosMarch 1, 2017 at 6:28 pm[…] 98. https://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/ […]

jacobMarch 6, 2017 at 5:07 pmThanks…

Soumya MondalMarch 15, 2017 at 7:50 amThe most fun learning experience I ever had,Period!

Ondicelle - Ocasapiens - Blog - Repubblica.itMarch 21, 2017 at 6:44 am[…] ulteriore miglioramento dell'analisi di Fourier, una serie di equazioni/setacci per filtrare il segnale incostante e più o meno frequente dal […]

OSU StudentMarch 22, 2017 at 9:05 amThis is so much better than how my professor explained it. Oh wait, he didn’t even explain it. People nowadays tend to explain things as if we’re robots. Since I’m not one, I tend to lose out; but THIS kind of explanation is exactly what I (and most of us who actually care about understanding the material) need. You’re better than a professor. You need to get out there and make the world a better place.

matthiasApril 10, 2017 at 7:34 amAbsolutely awesome explanation, thank you so much!

matthiasApril 13, 2017 at 3:34 pmI suggest this as a proof for “When every cycle has equal power and 0 phase, we start aligned and cancel afterwards. (I don’t have a nice proof yet…”:

https://i.imgur.com/PHw8D9b.png

It is using the formula for the geometric sum.

Also, to get a visual idea why the cycles cancel out draw the complex numbers being summed up as a vector addition chain. This will create a regular polygon (with N vertices, identical internal angles of 2PI/N and edges all of same length) that starts and ends at the zero vector.

MuditApril 14, 2017 at 12:50 pmCan you also do an intuitive guide to convolution please?

SarahApril 18, 2017 at 8:11 pmThank you!! I can’t even imagine how much time you may have put in to making this. Consider it appreciated!

Jay ParekhApril 30, 2017 at 12:15 pmIt was a great article I have seen on a Fourier transform.

Thanks

J TMay 2, 2017 at 12:20 pmGreat article, thank you sir.

How We Hear (or, An Introduction to Fourier Analysis) | Something of the MarvelousMay 10, 2017 at 10:17 am[…] you’d like to learn more about Fourier transforms and analysis, you can find some good explanations out there that don’t start out by slapping you in the face with all the math. There are also […]

SirrobMay 11, 2017 at 7:30 pmFantastic. I spent hours in college trying to grasp this. The analogies are perfect and the explanation is a work of art. I can tell that much effort was placed in writing this up.

MillerMay 17, 2017 at 5:23 pmKalid,

Love the article, great explanation. My one question is why we need to go up to N-1 Hz for N time steps. Why can we not represent a time series of length four (i.e. [4 0 0 0]) using 0 Hz, 1 Hz and 2 Hz?

kalidMay 22, 2017 at 10:53 amGreat question. There’s a symmetry in that 1Hz forward is the same as 3Hz backward. (Analogy: Imagine a 12 hour clock. Jumping forward 4 hours at a time (12, 4, 8, 12, 4) is the same as jumping backwards 8 hours at a time (12, 4, 8, 12). I’d like to do a follow-up, but try putting

[0 1 0 0] and [0 0 0 1] in the simulation and look at the patterns. The waves are different but the time points are the same. When transform runs, it splits the strength equally between these frequencies (we can’t allow one without the other).

Johnny ChanMay 22, 2017 at 1:24 pmThe combination of your examples and the JavaScript Sine Animation really helps me understanding / getting that intuition of the Fourier Transform concepts. After reading your examples and playing with the Sine Animation program, I finally turned that “huh?” to “Aha!” – thank you so much!

Johnny Chan

@jAtlas7 | Mathalope.co.uk

Kehinde O. AyodeleJune 12, 2017 at 2:32 amGod bless you for this.

NcikJune 18, 2017 at 2:10 amWhat do the time values [1 -1] mean? Could someone kindly explain this to me?

aviJune 20, 2017 at 12:58 amit means amplitude is 1 at beginning and -1 at midpoint, as 2signal are in question. if there are 3signal for example [1 -1 -2] then divide time interval into 3parts t0,t1,t2, here resultant signal will have amplitude 1 at t0, -1 at t1 and -2 at t2.

aviJune 20, 2017 at 12:53 amHi,

shouldn’t this [1 1:-72 1:-144 1:-216 1:-288] be equal to this [1:-72 1:-144 1:-216 1:-288 1:-360].

If not why?

DSP – bjtransistorJuly 7, 2017 at 11:17 pm[…] Fourier Transform vs. Fourier Series […]

Abhash SinhaJuly 15, 2017 at 11:34 amI usually read the concept and move on. But for the first time your article pushed my cursor to comment section. What a wonderful way to explain. Make class 5 students read this and even they will understand it. Kudos!!!

ElizaJuly 15, 2017 at 2:07 pmI know this post is ages old, but I ended up here because I was trying to understand what the Fast Fourier Transform algorithm I used to analyse and isolate portions of an audio file was actually doing. I couldn’t follow everything in your explanation, but I definitely caught on to more than I ever expected to! Now if I deduced correctly, where a Fourier Transform is a function, an FFT is simply the algorithm that computes that function, right?

kalidJuly 27, 2017 at 10:05 pmCorrect, the FFT is an optimization to the algorithm to run faster. The computed result is the same.

PrasobhJuly 20, 2017 at 7:13 amExcellent ! Keep going

AmolAugust 4, 2017 at 6:05 amReally Cool! Respect!

Hans G.August 6, 2017 at 1:35 pmHi, as pretty much everything else in this site, this article is great!

I do have an improvement suggestion though.

More precisely, in the section entitled “Moving The Time Spike”.

In such section, you present a small table, which I ll copy below:

Time 0 1 2 3

————

0Hz: 0 0 0 0

1Hz: 0 1 2 3

2Hz: 0 2 0 2

3Hz: 0 3 2 1

You mention that each cell there represents the position of the cycle at the instant.

I couldnt quite get it. For instance, let us take the 2Hz cycle at time 1. Its position is “2”… but “2” what?

Does it refer to the x-axis or to the y-axis? I find it confusing because the x-axis represents amplitude, and the y-axis represents time. Hence, the “2” probably does not refer to any of them… Is it perhaps the phase?

Genesia SAugust 11, 2017 at 1:22 amHi! Thanks so much for the article. You made me really understand Fourier Transform, though I can see why no one believed Joe for over a decade years ago (a line is a combination of circles say whaaat?). Haha!

*PS: Just a quick add, would make it clearer if the frequency and time domain graphs’ axes were labelled. :)

How to choose your decoupling capacitor - My *nix worldSeptember 9, 2017 at 12:16 pm[…] second graph is the Fourier transform of the first one where on x-axis we have the log of the frequency (f) and on the y-axis the log of […]

RISHISeptember 10, 2017 at 7:25 pmaccording to the explanation the fourier series coefficients a_n and b_n should be divided by 2…can anyone explain the formulas?

Fortran and the Fourier Transform – bebecom.co.nz | The Pilgrim Programmer's ProgressSeptember 11, 2017 at 8:41 pm[…] also found the following resources useful: Better Explained | An Interactive Guide to the Fourier Transform Wikipedia | The Cooley-Tukey FFT Algorithm Smith, S. | The Scientist and Engineer’s Guide to […]

NeilSeptember 12, 2017 at 2:40 amI also prefer the 1/N in front of the DFT rather than the inverse. However, there are some useful practical implications of having in front of the inverse – it’s not required for an inverse FFT, so it’s slightly nicer to have the DFT and FFT output the same non-normalized values.

aling1472September 12, 2017 at 8:25 pmAwesome,Thanks

LakshyaSeptember 13, 2017 at 6:41 amFinally! An article which explained me in easiest words, what a Fourier Transform, what it does and how?

Thank you so much for this!

I am so impressed that I’m even gonna put my real e-mail id. Haha

Why Sine Wave? – My Own FortuneSeptember 20, 2017 at 4:48 pm[…] the meantime, there’s a nice explanation at BetterExplained, and a great treatment of the whole subject in Dr. Steven Smith’s Scientist and […]

swansonSeptember 26, 2017 at 10:50 amSorry, I have read up to “Making a spike in time” several times and always get stuck. You use the term, “position,” but it is not defined. Further, no context for Modulo 4 is provided. I am aware of what type of division it is, but why 4 and not some other number?

kalidSeptember 29, 2017 at 1:41 pmHi, check out the video just posted, it should help explain the way the time spike works. The modulo 4 is because we have 4 data points in that example.

George WilliamsSeptember 28, 2017 at 2:01 pmJust great! I finally get it!~ Your ethical commitment to making things absolutely as simple as possible and yet sill true, is awesome. Why don’t they teach like this! All boats would be lifted. Thank you.

kalidSeptember 29, 2017 at 11:52 amThanks George!

George WilliamsSeptember 28, 2017 at 2:02 pmSo, Kalid have you ever done one of these wonderful tutorials on the subject of Convolution?

kalidSeptember 29, 2017 at 11:53 amI’m working on a convolution tutorial, I have some rough notes here: https://aha.betterexplained.com/t/convolution/679

RobertOctober 8, 2017 at 5:48 amHi. I am an adult electronics hobbyist.

This is an excellent simulation and explanation.

Long live the applied (and theoretical) mathematicians.

I just would rather speak to… and learn from… the former ;)

thank you

TylerOctober 10, 2017 at 10:43 amIm interested using this method for a statistical analysis on oil production and produced water. This is my first time using the Fourier analysis and was wondering if you could help me get started.

RyanOctober 10, 2017 at 7:19 pmFantastic explanation, thanks!

La Guía definitiva de la Transformada de Fourier paso a pasoOctober 11, 2017 at 4:50 am[…] >> Accede al artículo de betterexplained.com y ¡flipa! […]

AlkOctober 18, 2017 at 6:03 amOooo God……. what u guys have done …..its fabulous ..amazing ..awesome….

I never enjoyed math in this way in my entire engineering college life….. We had a tough time understanding those concepts…… but you have proved.. topics could be explained in much more interesting way .

Thanks for this … n digging more into this site….. ;-)

GargamelOctober 24, 2017 at 3:51 amGreat article!

Week 3 – 10/27/17 – SIG AlgorithmOctober 27, 2017 at 4:14 am[…] Interactive Guide to the Fourier Transform […]

Fred McginnisNovember 18, 2017 at 12:48 amMany thanks for unraveling the mystery of Fourier Series.

ReduNovember 25, 2017 at 5:37 amHow correct is it to say “A 1Hz cycle goes 1 revolution in the entire 4 seconds”..?

kalidNovember 28, 2017 at 9:54 pmI’m using “Hz” loosely here to mean “cycle during the signal” and not “cycles per second”. So here, a 1Hz component finishes a single revolution over the duration of the signal.

Episode 149 – “Suppose you play a C-major chord” Waves Part 2 | Don't Panic GeocastDecember 15, 2017 at 1:47 pm[…] Interactive Guide to the Fourier Transform […]

Better Explained – Drew’s BorgDecember 18, 2017 at 8:05 am[…] An Interactive Guide To The Fourier Transform […]

SarfarazDecember 20, 2017 at 2:04 amWhat does the following mean:

“When our cycle is 4 units long, cycle speeds a half-cycle apart (2 units) will either be lined up (difference of 0, 4, 8…) or on opposite sides (difference of 2, 6, 10…).”

In particular, what does “cycle speeds a half-cycle apart” even mean? That sounds like a grammatical typo!

KalidFebruary 5, 2018 at 2:26 pmIt could be worded better. Speeds of 0Hz and 2Hz are 2 units apart, as are 1Hz and 3Hz.

Shruti palanDecember 31, 2017 at 8:08 amDoes multiplying e^(2*pi*k*n/N) with X(k) to get x(n) mean we want the imaginary as in the rotational component of time signal as well, or else x(n) can be formed by using just summation of X(k) which consists of amplitude and phase, why do we bother multiplying it with e^(2*pi*k*n/N) factor which shows the speed with which signal is moving?

Patrick AndradeJanuary 10, 2018 at 10:00 pmCongratulations for this explanation… It was very clear. I’d like know if you used some specific software to make that animations or if it was made with pure javascript language..

KalidFebruary 5, 2018 at 2:25 pmThe animation was in plain javascript (you can view source on the animation).

Bob TivnanJanuary 13, 2018 at 9:31 amYou sir have a gift. I have been teaching math for twenty years, and I have heard countless explanations of Fourier series. This is hands down the most elegant and accessible explanation I have ever heard. Thank you for your contribution- it will impact my own teaching.

Wayne KingOctober 28, 2018 at 5:41 amIf you were really a maths teacher you wouldn’t confuse fourier series and fourier transform, youre just a faking little cocksucker

PRAVIN KAPADIJanuary 22, 2018 at 10:32 amI am very much impressed by the way it is explained . It is very easy to understand FT.Thanks

OTR Links 01/31/2018 – doug — off the recordJanuary 30, 2018 at 9:31 pm[…] An Interactive Guide To The Fourier Transform – BetterExplained […]

The Fourier Transform, explained beautifully – The Home for Wayward StatisticiansFebruary 3, 2018 at 4:05 am[…] At the Better Explained blog, Kalid Azad hits another home run with An Interactive Guide to the Fourier Transform. […]

whxFebruary 7, 2018 at 5:50 pmNice article，thanks a lot

chupo_croFebruary 11, 2018 at 7:32 pmAwesome visualization. To make it work offline ‘http:’ has to be added in front of ‘//’ in the linked scripts’ URLs.

JisanFebruary 24, 2018 at 2:35 amHi, you can add the video of 3 blue 1 brown too. Great article, by the way……

gary bApril 9, 2018 at 4:31 pmwell done Sir!

Respect for the time and effort required to make the difficult seem trivial

JacquelineApril 11, 2018 at 8:03 amI didn’t understand the part of the positions that cancel, I asumed position 0 is East, 1 North, 2 West and 3 South, but I’m not quite sure

kalidApril 17, 2018 at 6:06 pmYes, positions across from each other cancel when added. Positions can be seen on an x,y grid:

East = (1, 0)

West = (-1, 0)

North = (0, 1)

South = (0, -1)

East + West = (1, 0) + (-1, 0) = (0, 0)

Asma OsamaApril 12, 2018 at 12:04 pmI would like to thank you for everything :)

Pulla SuryaApril 26, 2018 at 9:58 ambro thanks alot this is for the first time i enjoyed by reading… it feels me more than doni last ball six in the world cup thanks alot

threniApril 29, 2018 at 6:47 amThis is all right, but many aspects are “better explained” by rooting about with a search engine.

HillshiftJune 16, 2018 at 7:37 amSources? Care to point them out to readers and the author? Or did you just feel like being a snooty ****?

threniJune 16, 2018 at 7:59 amThanks for what you take to be insult, I do believe I might just be able to take it for a slight compliment, considering the querulous source. Yes, I believe that the issues can be better explained elsewhere. And no, I don’t care to do your work for you by pointing them out, nor that the dichotomy between pointing them out and being a snooty **** is anything but a false one.

Shaymaa MathStarMay 17, 2018 at 3:28 amHow do you display your graphsthrough the site ?

Drew KanarekMay 31, 2018 at 6:08 pmAn Interactive Guide To The Fourier Transform[…]Tone of voice is a powerful part of verbal communication, and provides greater depth of that means to the message.[…]

mark rJune 21, 2018 at 2:34 amGreat explanation. It really helps to have a simple model of what we are doing. Something that’s bothering me is the missing negative in the exponential for the synthesis formula. On the one hand it makes sense if you see the analysis formula as a change of basis:

X=Wx

Where W is change of basis matix. If you take the hermitian transpose of W (which is orthomormal) we can rearrange to get the synthasis formula:

x=Hermitian(W)X.

From symmetry of values in W we just to take the complex conjugate of W. Hence the difference in sign in the two formulas.

This doesn’t fit into the idea of saying the timepoint = contributations to this time point from each frequency. Is there a simple way of explaining the need of the negative value?

Aaron RoperJuly 13, 2018 at 7:25 amI’m having trouble with the instructions under the Discovering the Full Transform section. Say I want the time signal (3 2 1 0). I divide it into each time spike (3 0 0 0) (0 2 0 0) (0 0 1 0) (0 0 0 0). Then I divide a,b,c, and d by 4 to get (.75 0 0 0) (0 .5 0 0) (0 0 .25 0) (0 0 0 0). So then the recipe for each time spike is (.19 .19 .19 .19) (.13 .13:-90 .13:180 .13:90) (.06 .06:180 .06 .06:180) (0 0 0 0). This is the point where I get lost. When I type in the signal to the simulation I get [1.5 .71:-45 .5 .71:-45]. How do I go from the recipes for the time spikes to that input for the cycles? What do you mean by loop through each frequency for the full transform?

John JacobyJuly 29, 2018 at 2:47 pmHey like Aaron I’m also having trouble with the actual calculation of combining multiple times spikes. It’s clearly not just adding together the amplitudes and angles. I can’t seem to reverse engineer what’s going on when I type something like 0 3 2 into the time half of the animation. Where did .88 and the weird decimal angles come from?

kalidAugust 1, 2018 at 1:13 pmHi John,

Great question. We can’t directly add amplitudes and angles, we need to use trig to figure out their combined effect when they’re added.

For example:

* Drive 3 miles at a 30 degree angle [assume 0 degrees is horizontal] * Then, drive 4 miles at a 50 degree angle.

What is your final position, the combined effect? (It’s unlikely to be exactly 7 miles away, or at 80 degrees, right?)

Using trig, we can combine the horizontal and vertical coordinates:

x position: 3*cos(30) + 4*cos(50) = 5.169 miles horizontal

y position: 3*sin(30) + 4*sin(50) = 4.564 miles vertical

Put back as amplitude/angle, this is:

magnitude = sqrt(5.2^2 + 4.6^2) = 6.94 miles

angle = atan(4.564/5.169) = 41.4 degrees

Hope that helps.

gawkfaceAugust 13, 2018 at 7:33 pmWhoa smoothie from recipe…

Smooth…

Rohin BardhanSeptember 3, 2018 at 11:39 amIn the first equation, when I try to add the the X(subscript) n IE. The values of the signal at time n, then I do not get the required cycle values IE required Xk values. For example when I type in (5 4 2 3) in time, I get [3.5 0.79:-18.4 0 0.79: 18.4] in cycles. Why don’t I get (5 + 4 + 2 + 3) in case of zero Hertz if we just add the xn’s , as in the first equation for transformation from the time domain to the frequency domain.

Rohin BardhanSeptember 3, 2018 at 11:45 amAnother query, does measuring the signal N no. of times always mean that there will be 0 to N-1 Hertz in the signal. And also can’t there be frequencies more than N-1 Hz in the signal measured for just N times IE. With only N time points?

Simon WarringtonSeptember 16, 2018 at 2:37 pmBrilliant explanation. Now I can help others see the magic in Fourier analysis and transforms. Thanks!!

Joe SmithSeptember 25, 2018 at 4:05 pmno such thing as better or not

Luca DorigoOctober 4, 2018 at 2:43 amKalid, this is wonderful. It would be amazing if you could expand on this (properties of the fourier transform like translation in time/frequency, transform of derivatives, etc.) – textbooks really, really lack insight on these matters.