annotate 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 |
|
rev |
line source |
samer@4
|
1 function [Y,Z]=divnorm(F,X)
|
samer@4
|
2 % divnorm - Do divisive normalisation of a sequence of vectors.
|
samer@4
|
3 %
|
samer@4
|
4 % divnorm ::
|
samer@4
|
5 % ([[N,L]] -> [[1,L]]) ~'function to compute norm',
|
samer@4
|
6 % [[N,L]] ~'array of L N-dim vectors'
|
samer@4
|
7 % -> [[N,L]] ~'normalised vectors (ie unit 2-norm)',
|
samer@4
|
8 % [[1,L]] ~'array of normalisation factors'.
|
samer@4
|
9 %
|
samer@4
|
10 % ie, if [Y,Z]=divnorm(X),
|
samer@4
|
11 % then X = repmat(Z,size(X,1),1).*Y
|
samer@4
|
12 %
|
samer@4
|
13 % TODO: might like to smooth the envelope before dividing.
|
samer@4
|
14 Y = vecop1(@rdivide,X,F(X));
|
samer@4
|
15
|