DownSample - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

SignalProcessing

 DownSample
 down-sample a signal

 Calling Sequence DownSample( A, factor, phase )

Parameters

 A - Array of real or complex values; the signal factor - posint, down-sample factor phase - nonnegint, (optional) phase

Options

 • container : rtable, predefined Array for holding results

Description

 • The DownSample( A, factor, phase ) command down-samples the signal in the Array A.
 • The effect of this command is to copy one sample from each block of factor samples in A to the output.
 • Before the code performing the computation runs, Maple converts A to a hardware datatype, first attempting float[8] and subsequently complex[8], unless it already has one of these datatypes. For this reason, it is most efficient if A has one of these datatypes beforehand.
 • The phase argument determines an offset, so that the sample value from A occurs phase positions offset in the output array. The value of phase must be non-negative and less than the value of factor.
 • If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array of size iquo( N + factor - 1 - phase, factor ) where N is the number of elements of A, and it must have datatype float[8] if A is real and complex[8] if A is complex.

 • The SignalProcessing[DownSample] command is thread-safe as of Maple 17.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $A≔\mathrm{Array}\left(\left[1,2,3,4,5,6,7,8,9\right],'\mathrm{datatype}'={'\mathrm{float}'}_{8}\right)$
 ${A}{≔}\left[\begin{array}{ccccccccc}{1.}& {2.}& {3.}& {4.}& {5.}& {6.}& {7.}& {8.}& {9.}\end{array}\right]$ (1)
 > $\mathrm{DownSample}\left(A,1\right)$
 $\left[\begin{array}{ccccccccc}{1.}& {2.}& {3.}& {4.}& {5.}& {6.}& {7.}& {8.}& {9.}\end{array}\right]$ (2)
 > $\mathrm{DownSample}\left(A,2\right)$
 $\left[\begin{array}{ccccc}{1.}& {3.}& {5.}& {7.}& {9.}\end{array}\right]$ (3)
 > $\mathrm{DownSample}\left(A,3\right)$
 $\left[\begin{array}{ccc}{1.}& {4.}& {7.}\end{array}\right]$ (4)
 > $\mathrm{DownSample}\left(A,4\right)$
 $\left[\begin{array}{ccc}{1.}& {5.}& {9.}\end{array}\right]$ (5)
 > $\mathrm{DownSample}\left(A,3,0\right)$
 $\left[\begin{array}{ccc}{1.}& {4.}& {7.}\end{array}\right]$ (6)
 > $\mathrm{DownSample}\left(A,3,1\right)$
 $\left[\begin{array}{ccc}{2.}& {5.}& {8.}\end{array}\right]$ (7)
 > $\mathrm{DownSample}\left(A,3,2\right)$
 $\left[\begin{array}{ccc}{3.}& {6.}& {9.}\end{array}\right]$ (8)
 > $C≔\mathrm{Array}\left(1..4,'\mathrm{datatype}'={'\mathrm{float}'}_{8}\right):$
 > $\mathrm{DownSample}\left(A,2,1,'\mathrm{container}'=C\right)$
 $\left[\begin{array}{cccc}{2.}& {4.}& {6.}& {8.}\end{array}\right]$ (9)
 > $C$
 $\left[\begin{array}{cccc}{2.}& {4.}& {6.}& {8.}\end{array}\right]$ (10)

Compatibility

 • The SignalProcessing[DownSample] command was introduced in Maple 17.
 • For more information on Maple 17 changes, see Updates in Maple 17.