Mercurial > hg > ape
view aux/LR2MS.m @ 11:0014c50188da
New and modified auxiliary scripts
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Fri, 19 Jun 2015 19:16:08 +0100 |
parents | 4fd284285159 |
children |
line wrap: on
line source
function y = LR2MS(x) % LR2MS Converts stereo audio signal to MS (mid side). % % by Brecht De Man at Centre for Digital Music, 4 June 2013 if min(size(x)) ~= 2 error('Function LR2MS needs a stereo audio input file.'); end y = zeros(size(x)); % M = L+R, S = L-R y(:,1) = x(1,:) + x(2,:); % mid y(:,2) = x(1,:) - x(2,:); % side % normalise if necessary if max(max(abs(y))) >= 1 y = y/max(max(abs(y))); end end