function [loc] = centroid(x) Returns centroid location of a vector x = vector loc = centroid in units of array index = 0 error condition avoids division by zero, often due to clipping Author: Peter Burns, 1 Oct. 2008 Copyright (c) 2007 Peter D. Burns