Skip to content Skip to navigation Skip to collection information

OpenStax-CNX

You are here: Home » Content » ELEC 301 Projects Fall 2006 » Detecting Note Onsets

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.
 

Detecting Note Onsets

Module by: Nicholas Berndsen. E-mail the author

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)

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 | 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