# Fourier Decomposition

Tags:
1. Apr 24, 2015

### ramdas

Hello everyone have a look at this video of Fourier Decomposition of an image.also we know that Fourier series is given in the image as

Here in the above formula there are summation terms of cosine and sine functions.I want to ask few queries regarding it.

1.In the given video at bottom middle there is plot of extracted waves .My doubt is whether these waves means cosine (or sine) functions from the summation terms of the Fourier series formula?

2.Whether these images(plot of Extracted waves ) are called as basis images(functions) in mathematics?

Note: Although above Fourier Formula is for 1D signal and video is of 2D image,please keep in mind Fourier series formula for 2D signal.

#### Attached Files:

• ###### fouriersum.jpg
File size:
13 KB
Views:
143
2. Apr 24, 2015

### Hesch

The bottom middle video shows nothing but an animated cartoon: ////------|||||

In the left and right video you can see harmonics/groups of harmonics being moved from left to right, starting with the lower harmonics and ending with the higher harmonics. You can see, that the right image at the beginning is very blurred because it's missing the higher harmonics which sharpens the picture. Almost at the end you can see only the outlines/edges of "the photographer" ( very famous photo in studies of picture-manipulation ) in the left video, because only the higher harmonics are left here. So the left video contains only "edges" in the picture. The smoother shades have been moved.

In the fourier-transform a harmonic is located on a circle with its center in origo. Lower harmonics close to the center. So when a harmonic/group of harmonics are moved from left to right, actually a circle/group of circles are moved as parts of the fourier-transform. It is areas that are moved, containing lots of complex coefficients. These areas are added to the right transform which then is inverse-transformed as a whole, step by step.

A complex coefficient, say ( 3 + j5 ) represents ( 3*cos(something) + 5*sin(something) ). I don't understand what these "things" are as they are a result af a fourier-transform of a fourier-transform. If you alter a complex coefficient in the fourier-transform at a specific location, you don't alter a specific pixel in the spatial image. You alter the whole image. You can see it in the video: Move a circle in the fourier-domain and you will "move sharpness" in the spatial domain.

Recommendation: Put the mathematical books away for a while and play with fourier-transforms/image-manipulation instead. See what happens to your image. You will then learn the "mental" connections between the spatial domain and fourier domain.

Then I have a question for you: If you change the coefficient to the 0. harmonic (should be a real value, located in origo in the fourier-domain) to a complex value, what happens to the spatial image? Say it is 300, then change it to 212 + j212 ( with the same power ).

I don't know. I have never tried.

Last edited: Apr 24, 2015
3. Apr 24, 2015

### Staff: Mentor

Hesch, you gave a very good answer, but I disagree with your statement
The middle part shows the harmonic(s) under consideration, the one(s) that are being moved from the left image to the right image. Although there is that animated movement...

4. Apr 24, 2015

### Hesch

I understand the intension of the middle part, and when the pattern IIIIIII is shown, it corresponds to moving two groups of coefficient located nearby say ±20 on the real axis in the fourier-domain. But the left and right videos show that it is circles (with center at origo ) that are moved, which should not be represented by IIIIIII or //////.

5. Apr 24, 2015

### ramdas

sir you can consider basis functions instead of basis images also instead of video you can also refer the below image which shows few plots of different extracted waves from an image

6. Apr 25, 2015

### BruceW

When you superpose several plane waves, you can get an image which appears circular. On the right, it is showing the image that results when we superpose several plane waves. At least, I think that is what the person has done.

edit: Also, I (ony slightly) see circles on the image when it is in the middle. So maybe the video itself has some Aliasing issues, and is not perfectly showing the image it is meant to.

Last edited: Apr 25, 2015
7. Apr 25, 2015

### BruceW

As an example, here is a contour plot made up of only two plane waves which are moving perpendicular to each other, have same wavelength (which is larger than the image box), and which are shifted relative to the middle of the image box. So the person who made the video above may have used something similar to this as the first two terms in his superposition. (although I don't know what he/she used, I'm just taking a guess).

#### Attached Files:

• ###### contourplot.jpg
File size:
49.9 KB
Views:
120
8. Apr 25, 2015

### Hesch

The shown images "below" in #5 looks like extraction from a spatial image ( not at fourier power-plot ). If they were an extraction from a fourier-plot, I'd like to see the corresponding spatial image. You would extract both high and low frequenies by using these patterns, and that is not what is seen in the left and right video in #1. Here at first low frequencies are extracted, then higher frequencies. Look at the middle video, showing the corresponding spatial part that are extracted, showing an image with finer an finer "granularity": This means that concentric circles with growing radius are successive extracted.

This thread concerns fourier-transforms of an image. The video in #1 shows spatial images ( at least as for the left and right video ). When I'm speaking of extracting/moving circles, circles in the fourier-domain are meant. In a fourier-plot low frequencies are located at origo, and higher frequencies away from the center. So when you extract a circle in the fourier-domain, you are extracting a harmonic in the spatial image. The video shows that when you at first move the lower frequencies, you will get a blurred spatial image, but as you add higher frequencies (moving circles with larger radius), you will increase the sharpness of the spatial image - you will add treble to the music.

Maybe you wonder why the fourier-transform of an image is in two dimension, and that I can speak of a circle in a frequency domain. Well, that's because if you move a pick-up (for a LP) across a spatial image, the "music" heard depends on in which direction/angle you are moving the pick-up. You cannot have an angle in an one-dimensional space. ( A groove in a LP is "one-dimensional" ).

9. Apr 25, 2015

### BruceW

I see what you mean now. You are talking about superpositions of harmonics (in the spatial-domain). But I don't think this is what the person is doing in the video. If you look at the first term, it looks like just a plane wave. If it was an entire harmonic, it would have variation in both directions, not just the x-direction. So for this reason, I think the person is actually using a superposition of plane waves, not of harmonics. But I'm not certain, I haven't looked at what the person has done in detail. So you might be right.

10. Apr 25, 2015

### Hesch

Do you mean the first extraction: It looks like a wave from a tsunami. And yes, it should have variations in all direction ( well, at least in 4 " ±directions " ) as for the 1. harmonic, due to discreet data in the fourier-transform.

But I don't think the intension of the middle video is to show the dynamics of the wave itself, but to show that harmonics are transferred from left video to right video:

11. Apr 25, 2015

### BruceW

But in the picture of the first extraction, it looks like the intensity only varies from left to right. If the first extraction was a harmonic, it would presumably have an intensity that varies in both directions. i.e. it would not look like a tsunami wave. Therefore, I think that each extraction is a plane wave, not a harmonic. In two dimensions, you can use a Fourier series which is made up of plane waves to represent a 2-d function (i.e. a grayscale picture), by this equation:
$$f(x,y)= \displaystyle\sum_{j,k} \ C_{j,k} \ \cos( jx+ky+ \phi_{j,k} )$$
where the sum is over the positive integers. As long as you use enough terms here, you should be able to approximate any 'nice' and smooth function (on a finite interval). And note that each term is just a plane wave. In the video, each extraction looks like a plane wave, so therefore I think the person is using this equation. (again, I'm not certain about this, it's just my first guess).

12. Apr 25, 2015

### Hesch

I agree, but what can I do?

I'm just looking at the left and right video, intensively watching what is happening here (regarding the middle video as a cartoon): The edges are sharpened vertical and horizontal at the same time, not at first the vertikal and then the horizontal edges.

13. Apr 26, 2015

### BruceW

when you superpose several plane waves, as long as they are in different directions, you will 'sharpen' the image in both directions. If you look at the contour plot I made in post #7, you can see the intensity is greatest in the lower-left, and is less in the other quadrants of the image. So the image has been 'sharpened' in both directions. But, I made this image using just two plane waves.

14. Apr 26, 2015

### Hesch

I don't regard the fourier-transform of an image as a superposition of several plane waves, but a sum of harmonics, included their phases. The transform is a two-dimensional complex matrix. You can plot the "power" of the content of the matrix (strong power = bright dots). Here again "the photographer" ( spatial image in (a), the power-plot of the transform in (b) ).

Looking at (b) you see the dominant directions to be ( in order ):

1) Vertical power (90°): Perpendicular to horizontal edges in (a). (angle = 0°).
2) Power ≈ -10°: Edges of the leftmost leg of the stand. (angle = 80°).
3) Power ≈ 20°: Edges of the rightmost leg of the stand. (angle = -70°).

So edges in an image has more than two directions (both directions). Only the number of harmonics in (b) limits the number of inverse-transformed edge-directions in (a). Extracting circles from the transform, you will extract sharpening in all directions of edges in the spatial image.

15. Apr 26, 2015

### BruceW

uh... the link doesn't work for me. It takes me to google search, but not on any particular webpage.
About the problem, I'm not saying that it's not possible to decompose the image as harmonics. I'm just saying that it seems like the person in the video has not done that. If I click on the link you put in the first post, it says below the video that the "Goal is to visualize that (2D) images can be decomposed into sinusoidal waves". So it seems to me that in the video, the person is extracting plane waves from the image, not harmonics.

16. Apr 27, 2015

### Hesch

Yes, a fourier-transform decomposes a spatial image into sinusoidal functions (their phase included) in 2D. The 1. harmonic has a period exactly equal to the width/heigth of the spatial image. The 2. harmonic has a period that is half of the width/heigth, and so on. I don't know the resolution used by scanning the spatial image, but maybe the scanned image is decomposed into 800 different frequencies, which all are higher harmonics of the 1. harmonic. So all frequencies are harmonics of the fundamental frequency (the 1. harmonic). The 0. harmonic ("dc-voltage") states the mean-brightness of the image. The value of the coefficient to this harmonic must be real. Therfore my question at the end in #2.

None of the videos in #1 show a power-plot of the fourier-transform or what areas are extracted from the fourier-domain. All videos show the spatial result (the inverse transformed) of an extraction (the middle video by some animated cartoon).

Edit: Reviewing the video again, I can see that the image is decomposed into 7000 harmonics.

Last edited: Apr 27, 2015
17. Apr 28, 2015

### BruceW

The sinusoidal terms that I'm talking about are like:
$$\cos( jx+ky+ \phi_{j,k} )$$
I'm pretty sure this is not a 2d harmonic. When I think of 2d harmonics, I'm thinking of the various eigenmodes of a membrane stretched over a drum, i.e. something like this: http://en.wikipedia.org/wiki/Vibrations_of_a_circular_membrane But I guess it would look a little different, since our 'drum' is square shaped, not circular. (And of course, our image is not vibrating with time, so we would choose a particular constant amplitude for each harmonic). Maybe we are talking about different things when we are talking about harmonics? What would be your definition of a harmonic?

18. Apr 28, 2015

### Hesch

19. Apr 28, 2015

### BruceW

that page only mentions the 1d harmonics, which I think we both agree are sinusoids. But for 2d, they are not sinusoids (as mentioned in the link I gave, which I am essentially using as my definition of Harmonics in 2d). So if the "Goal is to visualize (that) 2D images can be decomposed into sinusoidal waves", then we should not be trying to use harmonics.

Try to think about it another way, if we have a sinusoid (i.e. plane wave) in 2d, this means it varies in one direction, and does not vary in the perpendicular direction. But, to have a harmonic, we must have the function going to zero at the edges of our boundary. But since there is one direction in which our wave does not vary, this means the wave would have to be zero everywhere. Therefore, we cannot use sinusoids as harmonics in 2d. If we try to even just think up a 1st harmonic, using a plane wave in 2d, it is not possible.