#! /usr/bin/perl -w ##! /share/local/bin/perl -w use strict 'refs'; use lib '..'; use CGI qw(:standard); use CGI::Carp qw/fatalsToBrowser/; BEGIN { use CGI::Carp qw(carpout); # use nice error logging # redirect stderr to own log instead of server log $mapname="mun"; ## CHANGE for every script # ERRLOG should have +w permissions for world, and dir path x perms #$ERRLOG="$mapname.error_log"; # path corrected to work on new server. /share/www can't be written to (tleipala, 2008-10-10) $ERRLOG="/share/logs/demos/ica/cocktail/$mapname.error_log"; open(LOG, ">>$ERRLOG") or die("Unable to open my cgi error log $ERRLOG: $!

"); carpout(*LOG); } $SOURCENAME = 'source'; $SOUNDFORMAT = 'wav'; $MIXEDNAME = 'mix'; $ESTNAME = 'est'; $IMAGEFORMAT = 'jpg'; $IMAGEPATH = 'gifs/'; $MAXSOURCES = 9; sub headers { # print html-headers print header(); #print start_html(-title=>'Cocktail party demo'),"

"; print start_html(-title=>'Cocktail party demo',-style=> {'src'=>'cis_cocktail.css'}),"

"; print h1('COCKTAIL PARTY PROBLEM'),"

"; print p,'Imagine you\'re at a cocktail party. For you it is no problem to follow the discussion of your neighbours, even if there are lots of other sound sources in the room: other discussions in English and in other languages, different kinds of music, etc.. You might even hear a siren from the passing-by police car.',"

"; print p,'It is not known exactly how humans are able to separate the different sound sources.',"

"; print 'Independent component analysis',"

"; print 'is able to do it, if there are at least as many microphones or \'ears\' in the room as there are different simultaneous sound sources. In this demo, you can select which sounds are present in your cocktail party. ICA will separate them without knowing anything about the different sound sources or the positions of the microphones.',"

"; } sub end_headers { print p,'ICA Research at Helsinki University of Technology

',"

"; print '



',"

"; print '

',"

"; print '© Jaakko Särelä, Patrik Hoyer and Ella Bingham, graphic design by Petri Saarikko.',"

"; print '

20-04-2005

'."

"; print ' '."

"; for (my $i=0;$i '."

"; print ' ',"

"; print ' ',checkbox(-name=>($i+1),-label=>''),' ',"

"; print ' '."

"; } print '

'."

"; print ' '."

"; foreach $source (@sources) { print ' ',"

"; } print '

'."

"; print ' '."

"; foreach (@sources) { print ' ',"

"; $i++; } print '

'."

"; print ' '."

"; foreach $source (@sources) { if ($source) { print ' ',"

"; } $i++; } print '

'."

"; print ' '."

"; foreach $source (@sources) { if ($source) { print ' ',"

"; $i++; } } print '