Dyadic upsampling.
Syntax
Y = dyadup(X,evenodd)
Y = dyadup(X)
Y = dyadup(X,evenodd,'type')
Y = dyadup(X,'type',evenodd)
Description
dyadup implements a simple zero-padding scheme very useful in the wavelet reconstruction algorithm.
Y = dyadup(X,evenodd), where X is a vector, returns an extended copy of vector X obtained by inserting zeros. Whether the zeros are inserted as even- or odd-indexed elements of Y depends on the value of positive integer evenodd:
If you omit the evenodd argument, dyadup(X) defaults to evenodd = 1 (zeros in odd-indexed positions).
Y = dyadup(X,evenodd,'type') or Y = dyadup(X,'type',evenodd), where X is a matrix, return extended copies of X obtained by inserting:
Columns in X
|
If 'type' = 'c'
|
Rows in X
|
If 'type' = 'r'
|
Rows and columns in X
|
If 'type' = 'm'
|
If you omit the evenodd or 'type' arguments, dyadup defaults to evenodd = 1 (zeros in odd-indexed positions) and 'type' = 'c' (insert columns).
Examples
% For a vector.
s = 1:5
s =
1 2 3 4 5
dse = dyadup(s) % Upsample elements at odd indices.
dse =
0 1 0 2 0 3 0 4 0 5 0
% or equivalently
dse = dyadup(s,1)
dse =
0 1 0 2 0 3 0 4 0 5 0
dso = dyadup(s,0) % Upsample elements at even indices.
dso =
1 0 2 0 3 0 4 0 5
% For a matrix.
s = (1:2)'*[1:3]
s =
1 2 3
2 4 6
der = dyadup(s,1,'r') % Upsample rows at even indices.
der =
0 0 0
1 2 3
0 0 0
2 4 6
0 0 0
doc = dyadup(s,0,'c') % Upsample columns at odd indices.
doc =
1 0 2 0 3
2 0 4 0 6
% Using default values for dyadup and dyaddown, we have:
% dyaddown(dyadup(s)) = s.
s = 1:5
s =
1 2 3 4 5
uds = dyaddown(dyadup(s))
uds =
1 2 3 4 5
% In general reversed identity is false.
See Also
dyaddown
References
G. Strang, T. Nguyen (1996), Wavelets and Filter Banks, Wellesley-Cambridge Press
[ Previous | Help Desk | Next ]