Accelerating the pace of engineering and science

# Documentation

## Description

Y = dyaddown(X,EVENODD) where X is a vector, returns a version of X that has been downsampled by 2. Whether Y contains the even- or odd-indexed samples of X depends on the value of positive integer EVENODD:

• If EVENODD is even, then Y(k) = X(2k).

• If EVENODD is odd,   then Y(k) = X(2k+1).

Y = dyaddown(X,EVENODD,'type') or Y = dyaddown(X,'type',EVENODD), where X is a matrix, returns a version of X obtained by suppressing one out of two:

 Columns of X If 'type'= 'c' Rows of X If 'type'= 'r' Rows and columns of X If 'type'= 'm'

according to the parameter EVENODD, which is as above.

If you omit the EVENODD or 'type' arguments, dyaddown defaults to EVENODD = 0 (even-indexed samples) and 'type'= 'c' (columns).

## Examples

```% For a vector.
s = 1:10
s =
1   2   3   4   5   6   7   8   9  10

dse = dyaddown(s)   % Downsample elements with even indices.
dse =
2   4   6   8  10
% or equivalently
dse =
2   4   6   8  10

dso = dyaddown(s,1) % Downsample elements with odd indices.
dso =
1   3   5   7   9

% For a matrix.
s = (1:3)'*(1:4)
s =
1   2   3   4
2   4   6   8
3   6   9  12

dec = dyaddown(s,0,'c') % Downsample columns with even indices.
dec =
2   4
4   8
6  12

der = dyaddown(s,1,'r') % Downsample rows with odd indices.
der =
1   2   3   4
3   6   9  12

dem = dyaddown(s,1,'m') % Downsample rows and columns
% with odd indices.
dem =
1     3
3     9
```

## References

Strang, G.; T. Nguyen (1996), Wavelets and Filter Banks, Wellesley-Cambridge Press.