‹ COSMOS Cluster 9 · Maurício de Oliveira

Digital Signals Part I


Audacity

Audacity is freeware for audio editing.

It has a fairly intuitive interface and great documentation and set of tutorials.

In this laboratory you will be asked to install and perform some basic editing operations with Audacity. The following task will get you started in Audacity.

  1. Import an existing audio file into Audacity (File > Import > Audio)
    • Try some from freesound or from here
    • Explore the signal waveform: select, zoom, etc
  2. Select 30s of sound trim (Edit > Remove Special > Trim Audio)
  3. Export audio file as wav (File > Export Audio...)
  4. Create a loop with (Effect > Repeat)

Recording and Playback

You can record and playback sounds into Audacity.

To record select an input source, such as 'Built-in Microphone' simply hit the Record button.

To playback select an output, such as 'Built-in Output' and hit the Play button.

The Pause, Stop, Home and End buttons work as expected.

  1. Select the 'Built-in Microphone' as input
  2. Record for 30-60s
  3. Playback on your computer's built-in speaker

with Littlebits

You will now use Audacity to record and visualize some of the wave forms you produced earlier with Littlebits.

  1. Connect power + oscillator + USB + speaker
  2. Select out
  1. Connect the LB USB module to your computer and select 'Korg' as input
  2. Turn on LB and record for 30-60s
  3. Visualize the waveform in audacity
  4. Plot spectrum (Analyze > Plot Spectrum)
  5. Try square and sawtooth; name the differences
  6. Modify the frequency as you record
  1. Create new project (File > New)
  2. Generate a 440Hz sine wave (Generate > Tone ...)
  3. Plot spectrum (Analyze > Plot Spectrum)
  4. Repeat for square and sawtooth tone
  1. Select 'Korg' as output
  2. Select in and play the waveform back into the LB speaker
  1. Connect power + split + (oscillator | oscillator) + mixer + USB + speaker
  2. Tune and visualize: an octave, a major third, a beat
  1. Create new project (File > New)
  2. Add new audio track (Tracks > Add New > Audio Track)
  3. Generate a 300Hz sine wave on the left channel (Generate > Tone ...)
  4. Generate a 310Hz sine wave on the right channel (Generate > Tone ...)
  5. Playback and listen on your headphones. Did you hear a beat?
  6. Mix and playback to hear the beat (Track > Mix and Render)

with M-Audio Interface

You will now use Audacity to record your instrument or voice using the M-Audio interface.

  1. Connect the M-Audio interface to your computer and select the 'M-Audio' as input
  2. Make sure the M-Audio is configured to 'Mic/Line' and that the '48V' option is off and connect a dynamic microphone to the interface using an XLR cable
  3. Adjust the Gain in the M-Audio interface and stay away from the red to avoid clipping
  4. Click on the Recording Meter to monitor the signal level in Audacity before recording; adjust the Recording Level to avoid clipping.
  5. Record your instrument or voice
  6. Visualize the waveform and the spectrum

Mixing Voice with Audio

In this activity you will record your voice and mix it with your favorite song.

  1. Connect a dynamic microphone to the M-Audio interface and select Mono on both the interface and Audacity
  2. Record a short text using Audacity. Remember to adjust the recording level if needed. If you're not feeling inspired try:
    Shall I compare thee to a summer's day?
    Thou art more lovely and more temperate:
    Rough winds do shake the darling buds of May,
    And summer's lease hath all too short a date
  3. Compress the signal using (Effect > Compressor)
  4. Split the recording halfway (Edit > Clip Boundaries > Split)
  5. Import background song
  6. Select points in the background sound where you want to start the voice excerpts and mark with labels (Tracks > Add Label at Selection)
  7. Use the Time Tool to synchronize your text excerpts with the background track; clips will snap when synchronized with labels
  8. Use the Envelope Tool to lower the background track during the voice parts
  9. Remove excessive background track using (Edit > Select > Cursor to Track End) then (Delete)
  10. Use (Edit > Select > Cursor to Track End) then (Effect > Fade Out) to fade at the end of the track
  11. Use (File > Export Audio) to create a mix with the combined tracks

Harmonic Series

A complex periodic tone, <math>x(t)</math>, with period <math>T</math> and frequency <math>f = 1/T</math> can be decomposed as an infinite sum of sinusoidal tones:

<math> x(t) = \frac{a_0}{2} + \sum_{k = 1}^{\infty} a_k \sin(2 \pi k t/T) + b_k \cos(2 \pi k t / T). </math>

For each particular complex tone it is possible to calculated the coefficients <math>a_0, a_1, a_2, \cdots,</math> and <math>b_1, b_2, \cdots,</math> that best represent the tone. Each sinusoidal component, a.k.a partials or harmonics, has frequency:

<math> f_k = \frac{k}{T} = k f, \qquad f = \frac{1}{T}, \qquad k = 1, 2, \cdots. </math>

Under certain assumptions this representation using an infinite number of sinusoidal tones is exact. This decomposition of a periodic function in partials is known in mathematics as a Fourier Series. In music, where our ability to listen is limited, this means that we are only interested in a finite number of such harmonics. The Fourier Series is the basis of aditive synthesis.

For example, a sawtooth waveform has components <math>a_0 = 0</math> and:

<math> \begin{aligned} a_k &= 0, & b_k &= \frac{2}{\pi k}, & k = 1, 2, \cdots. \end{aligned} </math>

A consequence of the Fourier Series is that a complex tone can be approximated by adding partials. The more partials we add the better the approximation will be, as illustrated by the excellent animation from [1]:

Error creating thumbnail: Unable to save thumbnail to destination

for a sawtooth waveform.

  1. Open up Audacity and set the project sampling rate to <math>f_s = 44100</math>Hz.
  2. Generate and play a 1000Hz sawtooth tone (Generate->Tone...) of amplitude 1.
  3. Listen to the tone.
  4. Zoom in and inspect the waveform.
  5. Create a new project and generate a 1000Hz sinusoidal tone of amplitude 0.64.
  6. Listen to the tone and compare with the sawtooth tone.
  7. For each of the following frequencies and amplitudes:
    (freq, amp)
    2000Hz, 0.32
    3000Hz, 0.21
    4000Hz, 0.16
    5000Hz, 0.13
    6000Hz, 0.11
    7000Hz, 0.09
    8000Hz, 0.08
    9000Hz, 0.07
    10000Hz, 0.06
    create a new track and generate a sinusoidal tone.
  8. Listen to all your tracks simultaneously each time you add a tone and compare with the sawtooth tone.
  9. Mix all tracks in a new track (Tracks > Mix and Render to New Track)
  10. Zoom in the mix track and inspect the waveform.

Recovered from the original course wiki (server backup, August 2024).