view general/numerical/divnorm.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents e44f49929e56
children
line wrap: on
line source
function [Y,Z]=divnorm(F,X)
% divnorm - Do divisive normalisation of a sequence of vectors.
%
% divnorm ::
%    ([[N,L]] -> [[1,L]]) ~'function to compute norm',
%    [[N,L]]    ~'array of L N-dim vectors'
% -> [[N,L]]    ~'normalised vectors (ie unit 2-norm)',
%    [[1,L]]    ~'array of normalisation factors'.
%
% ie, if [Y,Z]=divnorm(X),
% then X = repmat(Z,size(X,1),1).*Y
%
% TODO: might like to smooth the envelope before dividing.
Y = vecop1(@rdivide,X,F(X));