# Connexions

You are here: Home » Content » Edge Detection

### Recently Viewed

This feature requires Javascript to be enabled.

# Edge Detection

Summary: This module investigates the use of Matlab filters to determine when notes are played within a recording from an electric guitar.

In order to determine the speed at which the user is playing it is first necessary to determine where in the recording individual notes are plucked. When a note is played on the guitar, a sharp peak occurs which is then followed by a decay as the vibrations in the string dampen. To determine where these edges occur the signal is first low pass filtered to remove some of the noise, then it is convolved with an edge detector function which produces a signal with peaks located at large edges (where notes are played).

Due to the non-uniform qualities of guitar waveforms, an edge detector function with rounded edges produced the best results. A good function to use for an edge detector function is the derivative of a Gaussian. This produces a filter that can be tuned to work well with certain frequencies specific to the instrument being tested.

After the original signal is convolved with the Gaussian edge detector the result is a signal with peaks located where edges occurred in the original signal. A simple algorithm is used to create a vector of zeros with ones located at the locations of the peaks. Due to the nature of the guitar signal, it is not uncommon for the convolved signal to contain "double peaks" where two or more closely spaced peaks are created to represent what should be considered a single edge. To accommodate for this error, the algorithm is designed that once it finds a peak, it ignores any other peaks that occur within a given threshold range.

To use the information produced by the edge detection to determine how fast the user is playing, the vector of ones and zeros representing peak locations is windowed into equal length chunks. The values within each of these chunks are summed together to determine the number of notes played within that window of time. From this, the program can determine whether the user was playing fast or slow during that period of time based on whether the number of notes played is above or below a previously decided threshold.

 Media File: EdgeDetect.m
 Media File: GaussianFilter.m

## Content actions

PDF | EPUB (?)

### What is an EPUB file?

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

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?

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