Day 20

Tuesday, April 18, 2017

7.5 and 7.6

2017_04_18/20170418_131256.jpg 2017_04_18/20170418_131301.jpg 2017_04_18/20170418_131308.jpg

Sounds and their spectra

Assertion: our perception of a ("stationary") sound is determined by its spectrum (the frequencies and the amplitudes).

Analysis

This code plots the spectrum of a sound in a wav file: plot_spectrum.py

Example wav files: guitar low E, piano low F, brass bar

Here is the spectrum of the brass bar:

brass_bar_spectrum.png

And here is the spectrum of the low piano note:

piano_spectrum.png

(Notice that the "fundamental" (the lowest frequency) is almost not present.)

Synthesis

This code produces a sound with components we specify: replicate_sound.py

Let us see if we can synthesize the recorded brass bar sound above using frequencies and amplitudes read from the spectrum of the recording:

synthesized_brass.wav

Drum (circular stretched membrane)

Let's record the sound a drum, and analyze and synthesize it.

Solving the wave equation on a disk

Let's solve this problem, find the spectrum, and see if it matches the recording of the real drum.

Online tone generator in case it's useful

online_tone_generator.png