Mercurial > hg > smallbox
comparison util/ksvd utils/add_dc.m @ 70:c3eca463202d
(none)
author | idamnjanovic |
---|---|
date | Wed, 16 Mar 2011 14:16:57 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
69:5f1f436057ca | 70:c3eca463202d |
---|---|
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 |