annotate DL/RLS-DLA/private/add_dc.m @ 63:e08af264ef93

(none)
author idamnjanovic
date Tue, 15 Mar 2011 12:23:35 +0000
parents ad36f80e2ccf
children
rev   line source
idamnjanovic@60 1 function x = add_dc(y,dc,columns)
idamnjanovic@60 2 %ADD_DC Add DC channel to signals.
idamnjanovic@60 3 % X = ADD_DC(Y,DC) adds the specified DC value to the (possibly
idamnjanovic@60 4 % multi-dimensional) signal Y, returning the result as X. DC should be a
idamnjanovic@60 5 % scalar value.
idamnjanovic@60 6 %
idamnjanovic@60 7 % X = ADD_DC(Y,DC,'columns') where Y is a 2D matrix and DC is an array of
idamnjanovic@60 8 % length size(Y,2), treats the columns of Y as individual 1D signals,
idamnjanovic@60 9 % adding to each one the corresponding DC value from the DC array. X is
idamnjanovic@60 10 % the same size as Y and contains the resulting signals.
idamnjanovic@60 11 %
idamnjanovic@60 12 % See also REMOVE_DC.
idamnjanovic@60 13
idamnjanovic@60 14 % Ron Rubinstein
idamnjanovic@60 15 % Computer Science Department
idamnjanovic@60 16 % Technion, Haifa 32000 Israel
idamnjanovic@60 17 % ronrubin@cs
idamnjanovic@60 18 %
idamnjanovic@60 19 % April 2009
idamnjanovic@60 20
idamnjanovic@60 21
idamnjanovic@60 22 if (nargin==3 && strcmpi(columns,'columns')), columns = 1;
idamnjanovic@60 23 else columns = 0;
idamnjanovic@60 24 end
idamnjanovic@60 25
idamnjanovic@60 26 if (columns)
idamnjanovic@60 27 x = addtocols(y,dc);
idamnjanovic@60 28 else
idamnjanovic@60 29 x = y + dc;
idamnjanovic@60 30 end
idamnjanovic@60 31
idamnjanovic@60 32
idamnjanovic@60 33