# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# dddtreecfs

Extract dual-tree/double-density wavelet coefficients or projections

## Syntax

``out = dddtreecfs(outputtype,wt,outputspec,outputindices)``
``out = dddtreecfs(outputtype,wt,outputspec,outputindices,'plot')``

## Description

example

````out = dddtreecfs(outputtype,wt,outputspec,outputindices)` extracts the coefficients or subspace projections from the 1-D or 2-D wavelet decomposition, `wt`. If `outputtype` equals `'e'`, `out` contains wavelet or scaling coefficients. If `outputtype` equals `'r'`, `out` contains wavelet or scaling subspace projections (reconstructions).```

example

````out = dddtreecfs(outputtype,wt,outputspec,outputindices,'plot')` plots the signal or image reconstruction or specified analysis coefficients. You can include the `'plot'` option anywhere after the `wt` input.```

## Examples

collapse all

Obtain the complex dual-tree wavelet transform of the 1-D noisy Doppler signal. Reconstruct an approximation based on the level-three detail coefficients

Load the noisy Doppler signal. Obtain the complex dual-tree transform down to level 3.

```load noisdopp; wt = dddtree('cplxdt',noisdopp,3,'dtf1');```

Plot a reconstruction of the original signal based on the level-three detail coefficients

`xr = dddtreecfs('r',wt,'scale',{3},'plot');`

Load the noisy Doppler signal. Obtain the complex dual-tree transform down to level 3.

```load noisdopp; wt = dddtree('cplxdt',noisdopp,3,'dtf1');```

Create a cell array of vectors to obtain the second- and third-level detail coefficients from each of the wavelet filter bank trees.

`outputindices = {[2 1]; [2 2]; [3 1]; [3 2]};`

The first element of each vector in the cell array denotes the level, or stage. The second element denotes the tree.

Extract the detail coefficients.

`out = dddtreecfs('e',wt,'ind',outputindices);`

`out` is a 1-by-4 cell array. The cell array elements contain the wavelet coefficients corresponding to the elements in `outputindices`. For example, `out{1}` contains the level-two detail coefficients from the first tree.

Load the noisy Doppler signal. Obtain the complex dual-tree transform down to level 3.

```load noisdopp; wt = dddtree('cplxdt',noisdopp,3,'dtf1');```

Create a cell array of vectors to obtain the second- and third-level detail coefficients from each of the wavelet filter bank trees.

`outputindices = {[2 1]; [2 2]; [3 1];[3 2]};`

The first element of each vector in the cell array denotes the level, or stage. The second element denotes the tree.

Create a structure array identical to the `wt` output of `dddtree` with all the coefficients equal to zero except the first- and second-level detail coefficients.

`out = dddtreecfs('e',wt,'cumind',outputindices);`

Use the complex dual-tree wavelet transform to isolate diagonal features in an image at +45 and –45 degrees.

Load and display the `xbox` image.

```load xbox; imagesc(xbox)```

Obtain the complex dual-tree wavelet transform down to level 3.

```fdf = dtfilters('FSfarras'); df = dtfilters('qshift10'); wt = dddtree2('cplxdt',xbox,3,fdf,df);```

Isolate the +45 and -45 diagonal image features in the level-one wavelet coefficients. Plot the result.

`out = dddtreecfs('e',wt,'ind',{[1 3 1 2]; [1 3 2 2]},'plot');`

## Input Arguments

collapse all

Output type, specified as `'e'` or `'r'`. Use `'e'` to obtain the scaling or wavelet coefficients. Use `'r'` to obtain a projection, or reconstruction, onto the appropriate scaling or wavelet subspace.

Wavelet transform, specified as a structure. The structure array is the output of `dddtree` or `dddtree2`.

Output specification, specified as one of `'lowpass'`, `'scale'`, `'ind'`, or `'cumind'`. The output specifications are defined as follows:

• `'lowpass'` — Outputs the lowpass, or scaling, coefficients or a signal/image approximation based on the scaling coefficients. If you set the output specification to `'lowpass'`, do not specify `outputindices`. If the `outputtype` is `'e'`, `out` is a structure array with fields identical to the input structure array `wt` except that all wavelet (detail) coefficients are equal to zero. If the `outputtype` is `'r'`, `out` is a signal or image approximation based on the scaling coefficients. The signal or image approximation is equal in size to the original input to `dddtree` or `dddtree2`.

• `'scale'` — Outputs the coefficients or a signal/image approximation based on the scales specified in `outputindices`. If the `outputtype` is `'e'`, `out` is a cell array of structure arrays. The fields of the structure arrays in `out` are identical to the fields of the input structure array `wt`. The coefficients in the `cfs` field are all equal to zero except the coefficients corresponding to the scales in `outputindices`. If the `outputtype` is `'r'`, `out` is a signal or image approximation based on the scales in `outputindices`. The signal or image approximation is equal in size to the original input to `dddtree` or `dddtree2`.

• `'ind'` — Outputs the coefficients or a signal/image approximation based on the tree-position indices specified in `outputindices`. If the `outputtype` is `'e'`, `out` is a cell array of vectors or matrices containing the coefficients specified by the tree-position indices in `outputindices`. If the `outputtype` is `'r'`, `out` is a cell array of vectors or matrices containing signal or image approximations based on the corresponding tree-position indices in `outputindices`.

• `'cumind'` — Outputs the coefficients or a signal/image approximation based on the tree-position indices specified in `outputindices`. If the `outputtype` is `'e'`, `out` is a structure array. The fields of the structure array are identical to the fields of the input structure array `wt`. The coefficients in the `cfs` field are all equal to zero except the coefficients corresponding to the tree positions in `outputindices`. If the `outputtype` is `'r'`, `out` is a signal or image approximation based on the coefficients corresponding to the tree-position indices in `outputindices`.

Example: `'ind',{[1 1]; [1 2]}`

Output indices, specified as a cell array with scalar or vector elements. If `outputspec` equals `'scale'`, a scalar element selects the corresponding element in the `cfs` field of `wt`. If `outputspec` equals `'ind'` or `'cumind'`, the elements of `outputspec` are row vectors. The first element of the row vector corresponds to the element in the `cfs` field of `wt`. Subsequent elements in the row vector correspond to the indices of the array contained in the cell array element.

Example: `'scale',{1;2;3}`

## Output Arguments

collapse all

Signal or image reconstruction or coefficients, returned as a vector, matrix, structure array, cell array of vectors or matrices, or cell array of structure arrays. The form of `out` depends on the value of `outputspec` and `outputindices`.