Processing Sound

Reading: Ch. 14


We are distributing various supporting files related to these topics:

MATLAB support for sound

Digitized sounds can be manipulated as a one-dimensional array of numbers per channel. We will rely on MATLAB's builtin support

Plotting audio waves

A simple function for plotting stereo sound
function plotStereo(y, fs)
  subplot(2,1,1);
  x = linspace(0, length(y)/fs, length(y));
  plot(x,y(:,1), 'b');      % plot in blue
  ylabel('Left');
  xlabel('seconds');
  axis([0 length(y)/fs -1 1]);
  grid on;
  subplot(2,1,2);
  plot(x,y(:,2), 'r');       % plot in red
  ylabel('Right');
  xlabel('seconds');
  axis([0 length(y)/fs -1 1]);
  grid on;

Synthesizing sounds

We examined how to develop pure tones of a given frequency as a cosine wave, or to take an existing instrument waveform and to alter its frequency to produce notes at other pitches. We then examined high-level approaches to representing songs as a series of notes, or as a composition of overlayed notes.

All of our full source code is available at the link near the top of this page. But a highlight of the signatures we used are as follows.


MIDI format

Here are some external links to information about MIDI format:
http://cnx.org/content/m15049/latest
http://faydoc.tripod.com/formats/mid.htm

Our goal is to write a MATLAB program that can process authentic midi files and produce a sound wave for the music (at least a simplified one that ignores changes in instruments).

This lead to the following additional functionality.


Last modified: Wednesday, 08 April 2009