{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Room Impulse Responses (RIRs)\n", "\n", "[return to main page](index.ipynb)\n", "\n", "To measure the impulse response of a room\n", "(more precisely: the impulse response from one specific point in the room to another specific point in the room),\n", "the room can be excited with an impulse (or bang) and the result (= the impulse response) can be recorded with a microphone." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## A Very Simple Measurement Procedure\n", "\n", "In this unit we will measure the impulse response of our seminar room.\n", "There are several possibilities to excite the room - bursting balloons, gunshots, electrical spark discharges, ...;\n", "for simplicity (and for safety reasons), we use two wooden boards which we clap together.\n", "\n", "![Two Wooden Boards](images/wooden_boards.jpg)\n", "\n", "That's not ideal - ideally all frequencies should be excited equally - but it\n", "shall be sufficient for demonstration purposes.\n", "\n", "We will record the room response with the software [Audacity](http://web.audacityteam.org/) and export the result as WAV file (using the menu \"File\" $\\to$ \"Export Audio...\" or \"Export Selected Audio...\").\n", "\n", "As we will see in a later unit, there are *much better* ways to measure room impulse responses!\n", "\n", "If you are not able to join us for the measurement, you can still try the following exercises with this example room impulse response:\n", "\n", "[data/rir_clap.wav](data/rir_clap.wav)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Listening to the Room Impulse Response\n", "\n", "*Exercise:* Listen to the WAV file containing the impulse response.\n", "Do you get a clear impression about the recorded room?\n", "\n", "*Exercise:* Convolve the measured impulse response with different audio signals (see the [`data/`](data/) directory for some example WAV files) and listen to the respective results.\n", "\n", "Does it sound like the measured room? If not, what's different?" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If the resulting signal is too soft or too loud, you can normalize it with the function `tools.normalize()` (defined in [tools.py](tools.py))." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import tools" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "tools.normalize?" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Plotting the Room Impulse Response\n", "\n", "*Exercise:* Plot the impulse response; once with linear amplitude and once in decibel.\n", "Which is more meaningful?" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## A Function for Plotting\n", "\n", "*Exercise:* Write a function called `plot_impulse_response()`, which plots a given impulse response with the following properties:\n", "\n", "* The x-axis shall be labelled with the time in milliseconds.\n", "\n", "* The y-axis shall be labelled with the amplitude in dB, in a way that the absolute maximum of the impulse response is at 0 dB." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Estimating the Reverberation Time\n", "\n", "*Exercise:* Just by looking at the figure, try to estimate the reverberation time $T_{60}$ resp. $T_{30}$ (sometimes also called $RT_{60}$/$RT_{30}$).\n", "This is the time in which the level has decreased by 60 dB resp. 30 dB after the maximum level (corresponding to the direct sound component)." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we estimate the reverberation time for the whole audible frequency range.\n", "The reverberation time can also be measured for certain frequency ranges by sending the impulse response through a filter bank." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Surfing the Web\n", "\n", "In the interwebs, there are many places where you can find room impulse responses.\n", "\n", "A few suggestions:\n", "* Pori Concert Hall\n", "\n", " * overview http://www.acoustics.hut.fi/projects/poririrs/\n", " \n", " * download http://legacy.spa.aalto.fi/projects/poririrs/wavs/omni.zip\n", " \n", " * extract `s1_r1_o.wav`\n", " \n", " * convert from stereo to mono\n", " \n", "* SpACE-Net\n", "\n", " * overview http://www.space-net.org.uk/index-22592.html\n", " \n", " * Maes Howe http://www.space-net.org.uk/node/51/index.html\n", " \n", " * download [B-format: W and X Channels](http://www.space-net.org.uk/files/MH3_000_WX_48k.wav), but only use the \"W\" channel\n", " \n", " * Hamilton Mausoleum http://www.space-net.org.uk/node/52/index.html\n", " \n", " * download [B-format: W and X Channels](http://www.space-net.org.uk/files/HM2_000_WX_48k.wav), but only use the \"W\" channel\n", "\n", " * St Andrew's Church http://www.space-net.org.uk/node/53/index.html\n", " \n", " * download [B-format: W and X Channels](http://www.space-net.org.uk/files/Lyd3_000_WX_48k.wav), but only use the \"W\" channel\n", " \n", " * York Minster http://www.space-net.org.uk/node/54/index.html\n", " \n", " * download [B-format: W and X Channels](http://www.space-net.org.uk/files/Minster1_000_WX_48k.wav), but only use the \"W\" channel\n", "\n", "* EMES Virtual Rooms\n", "\n", " * a few free IRs http://www.emes.de/pageseng/products/Impulsresponse/eimpulse.htm\n", "\n", " * information http://www.emes.de/pdf/Freesampletxt2-1.pdf\n", "\n", " * one example WAV http://www.emes.de/impulsefiles/Gothic%20Church.wav\n", " \n", " * convert from stereo to mono\n", " \n", "* Aachen Impulse Response Database\n", "\n", " * http://www.ind.rwth-aachen.de/en/research/tools-downloads/aachen-impulse-response-database/\n", " \n", "* The World's Longest Reverb\n", "\n", " * article: http://www.independent.co.uk/news/science/now-weve-heard-it-all-acoustic-scientists-shatter-the-world-record-for-longest-ever-echo-9062134.html\n", " \n", " * soundcloud: https://soundcloud.com/sonicwonderland/sonic-wonderland-worlds\n", "\n", "*Exercise:* Download some of them, listen to them, plot them and roughly estimate their reverberation time $T_{60}$.\n", "\n", "Can you recognize the *direct sound*, the *early reflections* and the *late reverb*?" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Solutions\n", "\n", "If you had problems solving some of the exercises, don't despair!\n", "Have a look at the [example solutions](rir-solutions.ipynb)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

\n", " \n", " \"CC0\"\n", " \n", "
\n", " To the extent possible under law,\n", " the person who associated CC0\n", " with this work has waived all copyright and related or neighboring\n", " rights to this work.\n", "

" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.3+" } }, "nbformat": 4, "nbformat_minor": 0 }