{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "This is an [jupyter](http://jupyter.org) notebook.\n", "Lectures about Python, useful both for beginners and experts, can be found at http://scipy-lectures.github.io.\n", "\n", "Open the notebook by (1) copying this file into a directory, (2) in that directory typing \n", "jupyter-notebook\n", "and (3) selecting the notebook." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Blind Source Separation\n", "## Independent Component Analysis\n", "\n", "***\n", "A notebook by ***Shashwat Shukla*** and ***Dhruv Ilesh Shah***\n", "***\n", "___Required Packages:___ Python(2.7+), NumPy, SciPy Toolkit, Matplotlib\n", "***\n", "In this tutorial we will learn how to solve the Cocktail Party Problem using Independent Component Analysis(ICA).\n", "We will first take a look at Principle Component Analysis(PCA). The limitations of PCA will naturally lead to an understanding of what ICA does." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Overview\n", "## The Cocktail Party Problem(CPP)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So what is the Cocktail Party Problem? \n", "Imagine you are at a party where a lot of different conversations are happening in different parts of the room. As a listener in the room, you are receiving sound from all of these conversations at the same time. And yet, as humans, we possess the ability to identify different threads of conversation and to focus on any conversation of our choice. How do we do that? And how can we program a computer to do that?\n", "So this is essentially the Cocktail Party Problem: Given **m** sources(conversations at the party for example), and some number of sound receivers, separate out the different signals. (We will talk about how many receivers we need later.)\n", "\n", "We need to make some mathematical assumptions and also phrase the problem more formally.\n", "\n", "### The data\n", "\n", "So first of all, our signals here are the sounds coming from different sources. \n", "At every (uniformly spaced) discrete interval of time we record **m** samples, one at each of our **m** microphones.\n", "\n", "Note the implicit assumptions that we have made here:\n", "\n", "**1)** There are as many microphoneses as there are independent conversations(sources) going on in the room. This assumption allows us to come up with a method to retrieve all the m independent signals. We can say that our system is **critically determined**(and is not under- or over- determined). Henceforth, we shall only consider this case in the tutorial.\n", "\n", "**2)** Each microphone records a reasonably distinct combination of the independent signals. This simply amounts to not keeping two microphones too close to each other. Due to practical computational limits (see floating point math), it is always best to have easily distinguishable recordings. \n", "\n", "How are we recording this data? We simply record the amplitude of the sound at each instant. Recording the pressure amplitude is a convenient thing to do(and is what a microphone does. A transducer then converts the pressure amplitude to a voltage).\n", "Note that we are recording the signals at discrete intervals of time (at a rate assumed to be greater than the Shannon Sampling rate)and will be working only in the time domain with these discrete signals.\n", "\n", "One very important thing: We assume that the sound that any receiver records is a **linear combination** of sounds from the different sources. This is a reasonable assumption to make as pressure adds linearly. Each receiver will receive a different linear combination: If the first receiver is closer to a particular speaker than the second receiver, then the linear weight of this speaker will be proportionately higher for the first receiver.\n", "\n", "![Cocktail Party Problem](Notebook/cocktail_1.png)\n", "