comparison Problems/private/add_dc.m @ 10:207a6ae9a76f version1.0

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