Skip to content Skip to navigation Skip to collection information

Connexions

You are here: Home » Content » ELEC 301 Projects Fall 2006 » Pocket Change: Coin FFT Creation

Navigation

Table of Contents

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • Rice University ELEC 301 Projects

    This collection is included inLens: Rice University ELEC 301 Project Lens
    By: Rice University ELEC 301

    Click the "Rice University ELEC 301 Projects" link to see all content affiliated with them.

  • Rice Digital Scholarship

    This collection is included in aLens by: Digital Scholarship at Rice University

    Click the "Rice Digital Scholarship" link to see all content affiliated with them.

Also in these lenses

  • Lens for Engineering

    This collection is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.
 

Pocket Change: Coin FFT Creation

Module by: Tyler J.W. Barth, Aaron D. Cottle, John P. Stallcup, Christopher J. Vaucher. E-mail the authors

Summary: Method to change the image of a coin from a circular collection of pixels to a rectangular matrix of FFTs.

Now that we've identified all the centers of the coins and their radii using the Hough transform, we can begin processing the data of each coin. The problem with comparing coins is that they can be rotated any amount, and because they're circular, there's no way to tell what the orientation is simply by looking at its general shape. To combat this, we can use the FFT and its special properties.

We'll start by converting the pixels of the coin into a rectangular matrix. This effectively changes the coordinate system from Cartesian to Polar, but you can think of it more easily as 'unwrapping' the coin. Start by taking a radius from the center of the coin to the top of the coin. We can use Bresenham's Line Drawing algorithm to calculate which pixels belong in the radius.

Figure 1: A image of a radius from the center to the edge, showing which pixels would be captured.
Coin Unwrapping Radius
Coin Unwrapping Radius (Texas Line Small.jpg)

Capture the pixels along this radius by storing them as a row in a matrix, with the center to the left and the outer edge to the right. Then, capture a new radius, this time with the center in the same place, but the outer edge moved slightly. The outer edge coordinate can be computed by calculating the sine and cosine of a circle with a user-defined radius.

One problem with this approach is that as we compute each radius going around the circle, some radii will take fewer pixels than others. Since MATLAB requires that a matrix must have the same number of columns in each row, we must account for this difference. A simple solution is to remove any data that is too large by always using the minimum possible size for the radius. If the radius that you just took has more pixels than the current matrix length, truncate the outermost pixels from the new radius and store it. On the other hand, if the new radius has fewer pixels than the matrix, this means that the current radius is actually the smallest so far, so we must remove the extra data from the matrix rows before we can insert the new radius. The final product should look like this:

Figure 2: The unwrapped version of the coin in Fig. 1
Unwrapped Coin
Unwrapped Coin (TexasUnwrappedSmall.png)

Once radii have been taken for all 2π radians, the matrix contains all the unwrapped data for the coin. If we were to look at this matrix, and then look at the unwrapped version of an identical but rotated coin, the rotated one would be the same, except shifted vertically:

Figure 3: A shifted unwrapped version of the coin.
Unwrapped Rotated Coin
Unwrapped Rotated Coin (TestTexasShiftedSmall.png)

You can thus think about the rotation of the coin as a delay in time of a periodic signal. We all know from 301 that a delay in the time domain corresponds to a multiplication by a complex exponential in the frequency domain—a change which only affects the phase. Thus, if we take the FFT, the magnitude of the FFT should be the same between the two coins, and we can ignore the phase.

We only need to take the FFT along each circumference, not along the radii. Each circumference is a column in the matrix. Fortunately for us, the FFT() command in MATLAB takes the FFT along each column when given a matrix. Simply passing our unwrapped matrix into the FFT command will return the FFT of the coin, which we can then pass into the ABS() command to find the magnitude.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks