SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Sampling Rate : SignalProcessing/UpSample

SignalProcessing

 UpSample
 up-sample a signal

 Calling Sequence UpSample( A, factor, phase )

Parameters

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

Options

 • container : Array, predefined Array for holding results

Description

 • The UpSample( A, factor, phase ) command up-samples the signal in the Array A.
 • The effect of this command is to place factor - 1 zeroes between each pair of samples in the Array A.
 • 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 N * 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[UpSample] command is thread-safe as of Maple 17.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $\mathrm{interface}\left('\mathrm{rtablesize}'=20\right):$
 > $A≔\mathrm{Array}\left(\left[1,2,3,4,5,6\right],'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right)$
 $\left[\begin{array}{cccccc}1.0& 2.0& 3.0& 4.0& 5.0& 6.0\end{array}\right]$ (1)
 > $\mathrm{UpSample}\left(A,1\right)$
 $\left[\begin{array}{cccccc}1.0& 2.0& 3.0& 4.0& 5.0& 6.0\end{array}\right]$ (2)
 > $\mathrm{UpSample}\left(A,2\right)$
 $\left[\begin{array}{cccccccccccc}1.0& 0.0& 2.0& 0.0& 3.0& 0.0& 4.0& 0.0& 5.0& 0.0& 6.0& 0.0\end{array}\right]$ (3)
 > $\mathrm{UpSample}\left(A,3\right)$
 $\left[\begin{array}{cccccccccccccccccc}1.0& 0.0& 0.0& 2.0& 0.0& 0.0& 3.0& 0.0& 0.0& 4.0& 0.0& 0.0& 5.0& 0.0& 0.0& 6.0& 0.0& 0.0\end{array}\right]$ (4)
 > $\mathrm{UpSample}\left(A,3,0\right)$
 $\left[\begin{array}{cccccccccccccccccc}1.0& 0.0& 0.0& 2.0& 0.0& 0.0& 3.0& 0.0& 0.0& 4.0& 0.0& 0.0& 5.0& 0.0& 0.0& 6.0& 0.0& 0.0\end{array}\right]$ (5)
 > $\mathrm{UpSample}\left(A,3,1\right)$
 $\left[\begin{array}{cccccccccccccccccc}0.0& 1.0& 0.0& 0.0& 2.0& 0.0& 0.0& 3.0& 0.0& 0.0& 4.0& 0.0& 0.0& 5.0& 0.0& 0.0& 6.0& 0.0\end{array}\right]$ (6)
 > $\mathrm{UpSample}\left(A,3,2\right)$
 $\left[\begin{array}{cccccccccccccccccc}0.0& 0.0& 1.0& 0.0& 0.0& 2.0& 0.0& 0.0& 3.0& 0.0& 0.0& 4.0& 0.0& 0.0& 5.0& 0.0& 0.0& 6.0\end{array}\right]$ (7)
 > $C≔\mathrm{Array}\left(1..18,'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right):$
 > $\mathrm{UpSample}\left(A,3,'\mathrm{container}'=C\right)$
 $\left[\begin{array}{cccccccccccccccccc}1.0& 0.0& 0.0& 2.0& 0.0& 0.0& 3.0& 0.0& 0.0& 4.0& 0.0& 0.0& 5.0& 0.0& 0.0& 6.0& 0.0& 0.0\end{array}\right]$ (8)
 > $C$
 $\left[\begin{array}{cccccccccccccccccc}1.0& 0.0& 0.0& 2.0& 0.0& 0.0& 3.0& 0.0& 0.0& 4.0& 0.0& 0.0& 5.0& 0.0& 0.0& 6.0& 0.0& 0.0\end{array}\right]$ (9)
 > $A≔\mathrm{Array}\left(\left[I,-I,1+I,I-1\right],\mathrm{datatype}=\mathrm{complex}\left[8\right]\right)$
 $\left[\begin{array}{cccc}0.0+1.0I& 0.0-1.0I& 1.0+1.0I& -1.0+1.0I\end{array}\right]$ (10)
 > $C≔\mathrm{Array}\left(1..8,'\mathrm{datatype}'='\mathrm{complex}'\left[8\right]\right):$
 > $\mathrm{UpSample}\left(A,2,1,'\mathrm{container}'=C\right)$
 $\left[\begin{array}{cccccccc}0.0+0.0I& 0.0+1.0I& 0.0+0.0I& 0.0-1.0I& 0.0+0.0I& 1.0+1.0I& 0.0+0.0I& -1.0+1.0I\end{array}\right]$ (11)
 > $C$
 $\left[\begin{array}{cccccccc}0.0+0.0I& 0.0+1.0I& 0.0+0.0I& 0.0-1.0I& 0.0+0.0I& 1.0+1.0I& 0.0+0.0I& -1.0+1.0I\end{array}\right]$ (12)
 > 

Compatibility

 • The SignalProcessing[UpSample] command was introduced in Maple 17.