view support/normcol.m @ 6:e2a029a70df3

rearranged directories
author danieleb@code.soundsoftware.ac.uk
date Thu, 16 Jun 2011 13:43:16 +0100
parents normcol.m@ee2a86d7ec07
children 2e42f5fb764d
line wrap: on
line source
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);