Algorithms Index


Pad

Author : Ian Taylor, Bernard Schutz
Date : 20 September 2000
Version: 2.0
 


Contents



Description of Pad


Pad extends the input data set (of type VectorType) with zeros according to the choices that the user makes in the parameter window. The user can choose to place the extra zeros at the beginning or at the end of the data set. The user can choose one of four algorithms for adding zeros, and for three of them the user must supply a value for an appropriate parameter. The four choices are

In all cases, the value computed from the choices in this window is the full length of the extended data set, not the number of zeros to be added. The default choice is GivenMultipleOfLength with the multiple equal to 1. This does nothing. In cases where nothing is done, the output data set is a copy of the input, not a reference to the input itself.

The way that this unit acts on VectorType inputs varies according to the type. A pure VectorType will be extended as described above.  If the data are irregularly sampled, they will be extended with a regular spacing equal to the size of the first or last data interval, according to whether they are placed at the beginning or the end. A SampleSet or a ComplexSampleSet will be extended as described above and its sampling rate will not be changed. A Spectrum or ComplexSpectrum will be extended as described above; its frequency resolution will not be changed, and the parameter nFull (the number of points in the full data set from which it might have been derived by a Fourier transform) is increased to the new size.  If the spectral data are narrow-band, the new length of the extended set is interpreted as the size of nFull, not the size of the bandwidth of the data held in the object. Note that Spectrum and ComplexSpectrum data sets cannot be extended at the front, since it does not make sense to add points below zero frequency. More details are given in the documentation for these spectral types. If the input set is a Histogram, then the data set will be extended as described above. If the zeros are to be added at the beginning and the first delimiter is negative infinity, then nothing is done; similarly if the zeros are to be added at the end and the last delimiter is positive infinity, nothing is done.
 


Using Pad

The user makes the choices of how Pad works in Pad's parameter window. The first line is a choice box for adding zeros at the beginning or the end of the set. The second line is another choice box giving the four alternatives described above. The third line is an integer slider where the user can set  the parameter value needed by three of the methods. If GivenMultipleOfLength is chosen, then this value will be interpreted as the multiple to which the set is to be extended. If GivenPowerOf2 is chosen, then this value will be interpreted as the power to raise 2 to, in order to get the final length of the set. If GivenNumberOfElements is chosen, then this value will be interpreted as the length of the extended data set. If NearestPowerOf2 is chosen, then the parameter value will be ignored.

The default choices are: add data at the end, reaching a given multiple of the existing data set length, with that multiple equal to 1.  This does nothing, since the final length equals the initial one.