diff normcol.m @ 3:ee2a86d7ec07

Added support functions
author danieleb@code.soundsoftware.ac.uk
date Wed, 15 Jun 2011 11:26:03 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/normcol.m	Wed Jun 15 11:26:03 2011 +0100
@@ -0,0 +1,15 @@
+function [x n] = normcol(x)
+%NORMCOL normalise the columns to unit length
+%
+% [x n] = normcol(x)
+%
+% normalises the columns of the input matrix x and returns a vector n
+% containing the initial norm of the columns.
+%
+% ----------------------------------------------------------- %
+%  Daniele Barchiesi, daniele.barchiesi@eecs.qmul.ac.uk       %
+%  Centre for Digital Music, Queen Mary University of London  %
+%  Apr. 2011                                                  %
+% ----------------------------------------------------------- %
+n = sqrt(sum(conj(x).*x,1));
+x = x*diag(1./n);
\ No newline at end of file