# Connexions

You are here: Home » Content » Blind Source Separation Via ICA: Implementation

### Recently Viewed

This feature requires Javascript to be enabled.

### Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

# Blind Source Separation Via ICA: Implementation

Summary: This module details the implementation of a blind source separation system using fast ICA.

Note: You are viewing an old version of this document. The latest version is available here.

## Blind Source Separation via ICA:

### Implementation

In order to implement our design to enable the separation of two audio signals, we require two microphones and a processing computer with audio output capabilities. When two microphones are present in an environment with two sources, then they will record a mixing of both these signals, weighted by coefficients base on distance away from the microphone (remember that as a signal is further away from a recording source, the quieter it will be).

The mixed signal inputs of these microphones must then be imported into a processing computer that is able to run code based in C or MatLab (or potentially any other language, but the most efficient algorithm is run in MatLab and C).

The model for these mixed signals can be represented in matrix notation by:

x = As

As we can see, the signal vector is multiplied by some mixing matrix A. Therefore to isolate the signals s based on the mixed signals x we must find an inverse matrix A-1. To do this we implement a piece of Matlab code known as FastICA. The math behind the algorithm is explained elsewhere but the most important piece of code, the iteration to find the inverse mixing matrix, is displayed here:

% Take a random initial vector of length 1 and orthogonalize it

% with respect to the other vectors.

if initialStateMode == 0

w = randn (vectorSize, 1);

elseif initialStateMode == 1

w=whiteningMatrix*guess(:,round);

end

w = w - B * B' * w;

w = w / norm(w);

 

 wOld = zeros(size(w)); 

 wOld2 = zeros(size(w)); 

 

 % This is the actual fixed-point iteration loop. 

 % for i = 1 : maxNumIterations + 1 

 i = 1; 

 gabba = 1; 

 while i <= maxNumIterations + gabba 

 if (usedDisplay > 0) 

 drawnow; 

 end 

 

 % Project the vector into the space orthogonal to the space 

 % spanned by the earlier found basis vectors. Note that we can do 

 % the projection with matrix B, since the zero entries do not 

 % contribute to the projection. 

 w = w - B * B' * w; 

 w = w / norm(w); 

 

 if notFine 

 if i == maxNumIterations + 1 

 if b_verbose 

 fprintf('\nComponent number %d did not converge in %d iterations.\n', round, maxNumIterations); 

 end 

 round = round - 1; 

 numFailures = numFailures + 1; 

 if numFailures > failureLimit 

 if b_verbose 

 fprintf('Too many failures to converge (%d). Giving up.\n', numFailures); 

 end 

 if round == 0 

 A=[]; 

 W=[]; 

 end 

 return; 

 end 

 % numFailures > failurelimit 

 break; 

 

This iteration will guess a row of the demixing matrix (w in the code) and then run through a loop until it finds a projection that agrees with the statistical analysis behind the decoding.

After running on the supplied mixed signals, the program will output what it thinks are the two original sources and the demixing matrix. We can then use these outputs to complete a variety of tasks such as removing noise from the original signals, matching the original signals with other signals to detect base elements of the mixed signal, or even just simply outputting the original signals through a speaker system.

 
 Content actions Share content Share module: Give feedback: E-mail the module authors Download module as: PDF | More downloads ... Add module to: My Favorites Login Required (?) 'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'. | A lens I own Login Required (?) Definition of a lens Lenses A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust. What is in a lens? Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content. Who can create a lens? Any individual member, a community, or a respected organization. What are tags? Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens. | External bookmarks Footer More about this module: Metadata | Downloads | Version History How to reuse and attribute this content How to cite and attribute this content This work is licensed by John Steinbauer, Mark Eastaway, and Angela Qian under a Creative Commons Attribution License (CC-BY 2.0), and is an Open Educational Resource. Last edited by John Steinbauer on Dec 17, 2007 4:13 pm -0600. 
 
 var _gaq = _gaq || []; function trackthisGoogleAnalytics(strCode) { try { _gaq.push(['user._setAccount', strCode]); _gaq.push(['user._trackPageview']); } catch(err) {} } var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-7903479-1']); _gaq.push(['_setDomainName', '.cnx.org']); _gaq.push(['_trackPageview']); _gaq.push(['hewlett._setAccount', 'UA-5033010-1']); _gaq.push(['hewlett._setDomainName', '.cnx.org']); _gaq.push(['hewlett._trackPageview']);