Skip to content Skip to navigation

Connexions

You are here: Home » Content » Detecting Note Onsets

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

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

      What is in a lens?

      Lens makers point to Connexions 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 Connexions member, a community, or a respected organization.

    • External bookmarks
  • E-mail the author

Lenses

What is a lens?

Definition of a lens

Lenses

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

What is in a lens?

Lens makers point to Connexions 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 Connexions member, a community, or a respected organization.

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 module is included inLens: Rice University ELEC 301 Project Lens
    By: Rice University ELEC 301As a part of collection:"ELEC 301 Projects Fall 2006"

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

Recently Viewed

Detecting Note Onsets

Module by: Nicholas Berndsen

Summary: This module explains how a vector representing a song played by a piano can be analyzed to determine when each note is depressed.

A music file can be stored on a computer in the form of a vector, with each successive element of the vector representing the next sample taken from the song. A song lasting s seconds, sampled at a frequency of f, is represented by a vector of length s*f. CD quality music is sampled at a rate of 44.1kHz, causing even short songs to take up large amounts of space.

A recorded piano note is usually very sinusoidal, has a sharp, almost immediate rise, and a slow and steady exponential decay. In order to determine the times during a recording of a piano when a note is hit, the sharp rise of a note is taken advantage of through an edge-detection filter.

The first step in this process is the take the absolute value of the signal. This gives the signal a non-zero absolute value, which gives the signal a detectable envelope.

Figure 1
Figure 1 (abs2.png)

Next, this signal is convolved with an edge detection filter using fast-convolution techniques. A filter of length 5200 for a song sampled at 44.1kHz seems to work very well. The filter is the first derivative of a Gaussian pulse, and will output a positively valued spike for positive edges, and a negatively valued spike for negative edges, or drop-offs.

Figure 2
Figure 2 (gaussian.png)
Figure 3
Figure 3 (points.png)

The last step is simply a matter of assigning peaks to note depressions. Basically, every relative minimum that occurs above a certain threshold value (0.1, in this case) is counted as a note depression. Negatively-value peaks are largely artifacts due to notes decaying too steeply, and are thus ignored. The following plot places red stems for every detected note depression over the original song where the note most likely occurred. It is simple to tell that in this case, the note depression detection went without error.

Figure 4
Figure 4 (scalehits.png)

Comments, questions, feedback, criticisms?

Send feedback