dtfilters
Analysis and synthesis filters for oversampled wavelet filter banks
Description
Examples
Filters for Complex DualTree Wavelet Transform
Obtain valid filters for the complex dualtree wavelet transform. The transform uses Farras nearly symmetric filters for the first stage and Kingsbury Qshift filters with 10 taps for subsequent stages.
Load the noisy Doppler signal. Obtain the filters for the first and subsequent stages of the complex dualtree wavelet transform. Demonstrate perfect reconstruction using the complex dualtree wavelet transform.
load noisdopp; df = dtfilters("dtf2"); dt = dddtree("cplxdt",noisdopp,5,df{1},df{2}); xrec = idddtree(dt); max(abs(noisdoppxrec))
ans = 1.3056e13
Filters for DoubleDensity Wavelet Transform
Obtain valid filters for the doubledensity wavelet transform.
Load the noisy Doppler signal. Obtain the filters for the doubledensity wavelet transform. The doubledensity wavelet transform uses the same filters at all stages. Demonstrate perfect reconstruction using the doubledensity wavelet transform.
df = dtfilters("filters1"); load noisdopp; dt = dddtree("ddt",noisdopp,5,df,df); xrec = idddtree(dt); max(abs(noisdoppxrec))
ans = 2.3892e13
DualTree and DoubleDensity Wavelet Transforms Using Filter Names and Filters
Load a 1D signal.
load noisdopp
x = noisdopp;
"dwt"
 Critically sampled discrete wavelet transform
The critically sampled discrete wavelet transform can be applied to 1D and 2D data. The filter can be any valid orthogonal or biorthogonal wavelet name, or "farras"
.
Specify a valid filter name. Use dtfilters
to obtain the corresponding decomposition filters. Confirm the decomposition filters are returned as a twocolumn matrix.
fname = "db4";
df = dtfilters(fname);
df
df = 8×2
0.0106 0.2304
0.0329 0.7148
0.0308 0.6309
0.1870 0.0280
0.0280 0.1870
0.6309 0.0308
0.7148 0.0329
0.2304 0.0106
Use dddtree
to obtain two wavelet decompositions of the 1D signal. Use the filter name for the first decomposition, and the filters for the second decomposition.
wtA = dddtree("dwt",x,3,fname); wtB = dddtree("dwt",x,3,df,df);
Confirm the wavelet coefficients in the decompositions are equal.
for k=1:length(wtA.cfs) t = max(abs(wtA.cfs{k}(:)wtB.cfs{k}(:))); fprintf("level %d maximum difference: %f\n",k,t) end
level 1 maximum difference: 0.000000 level 2 maximum difference: 0.000000 level 3 maximum difference: 0.000000 level 4 maximum difference: 0.000000
Confirm the filters in both decompositions are equal.
max(abs(wtA.filters.FDf(:)wtB.filters.FDf(:)))
ans = 0
max(abs(wtA.filters.Df(:)wtB.filters.Df(:)))
ans = 0
max(abs(wtA.filters.FRf(:)wtB.filters.FRf(:)))
ans = 0
max(abs(wtA.filters.Rf(:)wtB.filters.Rf(:)))
ans = 0
"ddt"
 Doubledensity wavelet transform
The doubledensity wavelet transform can be applied to 1D and 2D data. Valid filter names for the doubledensity wavelet transform are "filters1"
, "filters2"
, and "doubledualfilt"
.
Use dtfilters
to obtain the filters corresponding to "filters1"
. Inspect the filters. Confirm the decomposition filters are returned as a threecolumn matrix.
fname = "filters1";
df = dtfilters(fname);
df
df = 6×3
0.1430 0.0185 0.0460
0.5174 0.0669 0.1666
0.6396 0.0739 0.0031
0.2443 0.0004 0.6776
0.0755 0.5811 0.4681
0.0546 0.4222 0
Use dddtree
to obtain two wavelet decompositions of the 1D signal. Use the filter name for the first decomposition, and the filters for the second decomposition.
wtA = dddtree("ddt",x,3,fname); wtB = dddtree("ddt",x,3,df,df);
Confirm the filters in both decompositions are equal.
max(abs(wtA.filters.FDf(:)wtB.filters.FDf(:)))
ans = 0
max(abs(wtA.filters.Df(:)wtB.filters.Df(:)))
ans = 0
max(abs(wtA.filters.FRf(:)wtB.filters.FRf(:)))
ans = 0
max(abs(wtA.filters.Rf(:)wtB.filters.Rf(:)))
ans = 0
Use dtfilters
to obtain the filters corresponding to "doubledualfilt"
. Inspect the filters. Confirm the decomposition filters are returned as 1by2 cell array consisting of threecolumn matrices.
fname = "doubledualfilt";
df = dtfilters(fname);
df
df=1×2 cell array
{10x3 double} {10x3 double}
Use dddtree
to obtain two wavelet decompositions of the 1D signal. Use the filter name for the first decomposition, and the filters for the second decomposition.
wtA = dddtree("ddt",x,3,fname); wtB = dddtree("ddt",x,3,df{1},df{2});
Confirm the filters in both decompositions are equal.
max(abs(wtA.filters.FDf(:)wtB.filters.FDf(:)))
ans = 0
max(abs(wtA.filters.Df(:)wtB.filters.Df(:)))
ans = 0
max(abs(wtA.filters.FRf(:)wtB.filters.FRf(:)))
ans = 0
max(abs(wtA.filters.Rf(:)wtB.filters.Rf(:)))
ans = 0
"realdt"
 Real oriented dualtree wavelet transform
The real oriented dualtree wavelet transform can only be applied to 2D data. Valid filter names are:
Any orthogonal or biorthogonal wavelet name, but only as a firststage filter.
"dtfP"
, whereP
can equal 1, 2, 3, 4, or 5."FSfarras"
, but only as a firststage filter."qshiftN"
, whereN
can equal 6, 10, 14, 16, or 18, for stages > 1.
Obtain a 2D image.
x2 = x'*x;
Use dtfilters
to obtain the decomposition filters corresponding to "dtf1"
. Confirm the filters are returned as 1by2 cell array consisting of 1by2 cell arrays.
dtf = dtfilters("dtf1")
dtf=1×2 cell array
{1x2 cell} {1x2 cell}
Obtain the filters corresponding to "FSfarras"
and "qshift6"
. Confirm the filters are returned as 1by2 cell array consisting of twocolumn matrices.
fs = dtfilters("FSfarras")
fs=1×2 cell array
{10x2 double} {10x2 double}
qs = dtfilters("qshift6")
qs=1×2 cell array
{10x2 double} {10x2 double}
Confirm the dtf
filters are equal to the fs
and qs
filters.
max(abs(dtf{1}{1}(:)  fs{1}(:)))
ans = 0
max(abs(dtf{1}{2}(:)  fs{2}(:)))
ans = 0
max(abs(dtf{2}{1}(:)  qs{1}(:)))
ans = 0
max(abs(dtf{2}{2}(:)  qs{2}(:)))
ans = 0
Use dddtree2
to obtain two realdt
decompositions of the image. Use the filter name "dtf1"
for the first decomposition, and the filters fs
and qs
for the second decomposition. Confirm the wavelet coefficients in both decompositions are equal.
wtA = dddtree2("realdt",x2,4,"dtf1"); wtB = dddtree2("realdt",x2,4,fs,qs); for k=1:length(wtA.cfs) t = max(abs(wtB.cfs{k}(:)wtA.cfs{k}(:))) end
t = 0
t = 0
t = 0
t = 0
t = 0
"cplxdt"
 Complex oriented dualtree wavelet transform
The complex oriented dualtree wavelet transform can be applied to 1D and 2D data. Valid filter names are:
Any orthogonal or biorthogonal wavelet name, but only as a firststage filter.
"dtfP"
, whereP
can equal 1, 2, 3, 4, or 5."FSfarras"
, but only as a firststage filter."qshiftN"
, whereN
can equal 6, 10, 14, 16, or 18, for stages > 1.
Use dtfilters
to obtain the decompositions filters corresponding to the db4
orthogonal wavelet and the Kingsbury Qshift filter with 14 taps.
wf = dtfilters("db2")
wf = 4×2
0.1294 0.4830
0.2241 0.8365
0.8365 0.2241
0.4830 0.1294
qf = dtfilters("qshift14")
qf=1×2 cell array
{14x2 double} {14x2 double}
Use dddtree
and the filters to obtain the complex oriented dualtree wavelet decomposition of the 1D signal.
wtA = dddtree("cplxdt",x,4,{wf,wf},qf);
Demonstrate perfect reconstruction.
xrec = idddtree(wtA); max(abs(xrec(:)x(:)))
ans = 3.4159e12
"realdddt"
 Real doubledensity dualtree wavelet transform
The real doubledensity dualtree wavelet transform can only be applied to 2D data. Valid filter names are:
"dddtf1"
"self1"
"self2"
Use dtfilters
to obtain the decomposition filters corresponding to "dddtf1"
. Confirm the filters are returned as 1by2 cell array consisting of 1by2 cell arrays.
fname = "dddtf1";
df = dtfilters(fname)
df=1×2 cell array
{1x2 cell} {1x2 cell}
Use dddtree2
to obtain two wavelet decompositions of the image. Use the filter name for the first decomposition, and the filters for the second decomposition. Confirm the decompositions are equal.
wtA = dddtree2("realdddt",x2,4,fname); wtB = dddtree2("realdddt",x2,4,df{1},df{2}); for k=1:length(wtA.cfs) t = max(abs(wtB.cfs{k}(:)wtA.cfs{k}(:))) end
t = 0
t = 0
t = 0
t = 0
t = 0
"cplxdddt"
 Complex doubledensity dualtree wavelet transform
The complex doubledensity dualtree wavelet transform can be applied to 1D and 2D data. Valid filter names are:
"dddtf1"
"self1"
"self2"
Use dtfilters
to obtain the decomposition filters corresponding to "self1"
. Confirm the filters are returned as 1by2 cell array consisting of 1by2 cell arrays.
fname = "self1";
df = dtfilters(fname)
df=1×2 cell array
{1x2 cell} {1x2 cell}
Use dddtree
to obtain two wavelet decompositions of the 1D signal. Use the filter name for the first decomposition, and the filters for the second decomposition. Confirm the decompositions are equal.
wtA = dddtree("cplxdddt",x,4,fname); wtB = dddtree("cplxdddt",x,4,df{1},df{2}); for k=1:length(wtA.cfs) t = max(abs(wtB.cfs{k}(:)wtA.cfs{k}(:))) end
t = 0
t = 0
t = 0
t = 0
t = 0
Input Arguments
name
— Filter name
"dtf1"
 "dddtf1"
 "self1"
 "self2"
 ...
Filter name, specified as a character vector or string scalar. Valid
entries for name
are:
Any valid orthogonal or biorthogonal wavelet name. See
wfilters
for details. An orthogonal or biorthogonal wavelet is only valid when the filter bank type is"dwt"
, or when you use the filter as the first stage in a complex dualtree transform,"realdt"
or"cplxdt"
.Note
An orthogonal or biorthogonal wavelet filter is not a valid filter if you have a doubledensity,
"ddt"
or dualtree doubledensity,"realdddt"
or"cplxdddt"
, filter bank. An orthogonal or biorthogonal wavelet filter is not a valid filter for complex dualtree filter banks for stages greater than 1."dtfP"
— With P equal to 1, 2, 3, 4, or 5 returns the firststage Farras filters ("FSfarras"
) and Kingsbury Qshift filters ("qshiftN"
) for subsequent stages. This input is only valid for a dualtree transform,"realdt"
or"cplxdt"
. Setting P = 1, 2, 3, 4, or 5 specifies the Kingsbury Qshift filters with N = 6, 10, 14, 16, or 18 taps, respectively."dddtf1"
— Returns the filters for the first and subsequent stages of the doubledensity dualtree transform. This input is only valid for the doubledensity dualtree transforms,"realdddt"
and"cplxdddt"
."self1"
— Returns 10tap filters for the doubledensity wavelet transform. This option is only valid for doubledensity wavelet transforms,"realdddt"
, and"cplxdddt"
."self2"
— Returns 16tap filters for the doubledensity wavelet transform. This option is only valid for doubledensity wavelet transforms,"realdddt"
, and"cplxdddt"
."filters1"
— Returns 6tap filters for the doubledensity wavelet transform,"ddt"
."filters2"
— Returns 12tap filters for the doubledensity wavelet transform,"ddt"
."farras"
— Farras nearly symmetric filters for a twochannel perfect reconstruction filter bank. This option is meant to be used for onetree transforms and is valid only for an orthogonal critically sampled wavelet transform,"dwt"
. The output ofdtfilters
is a twocolumn matrix. The first column of the matrix is a scaling (lowpass) filter, and the second column is a wavelet (highpass) filter."FSfarras"
— Farras nearly symmetric firststage filters intended for a dualtree wavelet transform. With this option, the output ofdtfilters
is a cell array with two elements, one for each tree. Each element is a twocolumn matrix. The first column of the matrix is a scaling (lowpass) filter, and the second column is a wavelet (highpass) filter."qshiftN"
— Kingsbury Qshift Ntap filters with N = 6, 10, 14, 16, or 18. The Kingsbury Qshift filters are used most commonly in dualtree wavelet transforms for stages greater than 1."doubledualfilt"
— Filters for one stage of the doubledensity dualtree wavelet transforms,"realdddt"
or"cplxdddt"
. This option can also be used in the doubledensity wavelet transform,"ddt"
.
This table can help you decide which filter to choose:
Type of Wavelet Decomposition  Valid Filters 

"dwt" — Critically sampled
(nonredundant) discrete wavelet transform (1D and
2D) 

"ddt" — Doubledensity wavelet
transform (1D and 2D) 





Output Arguments
df
— Decomposition (analysis) filters
matrix  cell array
Decomposition (analysis) filters, returned as a matrix or cell array of matrices.
rf
— Reconstruction (synthesis) filters
matrix  cell array
Reconstruction (synthesis) filters, returned as a matrix or cell array of matrices.
References
[1] Abdelnour, A. F., and I. W. Selesnick. “Design of 2Band Orthogonal nearSymmetric CQF.” In 2001 IEEE International Conference on Acoustics, Speech, and Signal Processing. Proceedings (Cat. No.01CH37221), 6:3693–96. Salt Lake City, UT, USA: IEEE, 2001. https://doi.org/10.1109/ICASSP.2001.940644.
[2] Kingsbury, Nick. “Complex Wavelets for Shift Invariant Analysis and Filtering of Signals.” Applied and Computational Harmonic Analysis 10, no. 3 (May 2001): 234–53. https://doi.org/10.1006/acha.2000.0343.
[3] Selesnick, Ivan W., and A. Farras Abdelnour. “Symmetric Wavelet Tight Frames with Two Generators.” Applied and Computational Harmonic Analysis 17, no. 2 (September 2004): 211–25. https://doi.org/10.1016/j.acha.2004.05.003.
[4] Selesnick, I.W. “The DoubleDensity DualTree DWT.” IEEE Transactions on Signal Processing 52, no. 5 (May 2004): 1304–14. https://doi.org/10.1109/TSP.2004.826174.
Version History
Introduced in R2013b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)