In [6]:
from nussl import jupyter_utils, AudioSignal
from wand.image import Image as WImage

from IPython.core.display import display, HTML
display(HTML("<style>.container { width:65% !important; font-size:1em;}</style>"))
In [2]:
from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
Out[2]:

Figure 2.2

The auditory scene starts with a pure sine tone and then a sine tone plus overtones. When the entire stack of sine tones starts to modulate slightly in frequency, the perception is that someone has started singing.

In [7]:
WImage(filename='../bregman_24.pdf')
Out[7]:
In [5]:
audio = [
    ('bregman24/demonstration.mp3', 'Demonstration of frequency micromodulation'),
]
for a, l in audio:
    print(l)
    jupyter_utils.embed_audio(AudioSignal(a), display=True)
Demonstration of frequency micromodulation

Figure 2.5

Rising tones and falling tones can easily be isolated using the 2DFT. Each row contains the time-frequency representation and its associated 2DFT. When different quadrants are symmetrically masked out in the 2DFT, one can isolate either rising components or falling components in a mixture.

In [8]:
WImage(filename='../rising_vs_falling.pdf')
Out[8]:
In [9]:
audio = [
    ('rising_vs_falling/mix.mp3', 'Mixture of a rising tone and a falling tone'),
    ('rising_vs_falling/rising.mp3', 'Separation by 2DFT (falling tone)'),
    ('rising_vs_falling/falling.mp3', 'Separation by 2DFT (rising tone)'),
]
for a, l in audio:
    print(l)
    jupyter_utils.embed_audio(AudioSignal(a), display=True)
Mixture of a rising tone and a falling tone
Separation by 2DFT (falling tone)