Wavelet Toolbox | ![]() ![]() |
Syntax
Y = wextend(TYPE,MODE,X,L,LOC)
Description
The valid extension types (TYPE) are listed in the table below.
TYPE |
Description |
1, '1', '1d' or '1D' |
1-D extension |
2, '2', '2d' or '2D' |
2-D extension |
'ar' or 'addrow' |
Add rows |
'ac' or 'addcol' |
Add columns |
The valid extension modes (MODE) are listed in the table below.
LOC = 'l' (or 'u') for left (or up) extension.
LOC = 'r' (or 'd') for right (or down) extension.
LOC = 'b' for extension on both sides.
LOC = 'n' null extension.
The default is LOC = 'b'.
L is the length of the extension.
LOC is a 1D extension location.
The default is LOC = 'b'.
L is the number of rows to add.
LOC is a 1D extension location.
The default is LOC = 'b'.
L is the number of columns to add.
LOC = [LOCROW,LOCCOL]
where LOCROW
and LOCCOL
are 1D extension locations or 'n' (none).
The default is LOC = 'bb'.
L = [LROW,LCOL]
where LROW
is the number of rows to add and LCOL
is the number of columns to add.
Examples
% Original signal.
x = [1 2 3]
x =
1 2 3
% 1-D extension length.
l = 2;
% Zero-padding extensions 1-D.
xextzpd1 = wextend('1','zpd',x,l)
xextzpd1 =
0 0 1 2 3 0 0
xextzpd2 = wextend('1D','zpd',x,l,'b')
xextzpd2 =
0 0 1 2 3 0 0
% Symmetric extension 1-D.
xextsym = wextend('1D','sym',x,l)
xextsym =
2 1 1 2 3 3 2
% Periodic extension 1-D.
xextper = wextend('1D','per',x,l)
xextper =
3 3 1 2 3 3 1 2
% Original image.
X = [1 2 3;4 5 6]
X =
1 2 3
4 5 6
% 2-D extension length.
l = 2;
% Zero-padding extension 2-D.
Xextzpd = wextend(2,'zpd',X,l)
Xextzpd =
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 1 2 3 0 0
0 0 4 5 6 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
% Symmetric extension 2-D.
Xextsym = wextend('2D','sym',X,l)
Xextsym =
5 4 4 5 6 6 5
2 1 1 2 3 3 2
2 1 1 2 3 3 2
5 4 4 5 6 6 5
5 4 4 5 6 6 5
2 1 1 2 3 3 2
![]() | wentropy | wfilters | ![]() |