interpolate

Functions

int main(int argc, char *argv[])

interpolate [ option ] [ infile ]

  • -l int

    • length of vector \((1 \le L)\)

  • -m int

    • order of vector \((0 \le M)\)

  • -s int

    • start index \((0 \le S)\)

  • -p int

    • interpolation period \((1 \le P)\)

  • -o int

    • output format \((0 \le O \le 1)\)

      • 0 zero-padding

      • 1 repetition

  • infile str

    • double-type data sequence

  • stdout

    • double-type interpolated data sequence

The input of the command is a sequence of \(L\)-dimensional vectors:

\[ \begin{array}{cccc} \boldsymbol{x}(0), & \boldsymbol{x}(1), & \boldsymbol{x}(2), & \ldots, \end{array} \]
where \(L=M+1\). If \(O=0\), the output is a zero-padded sequence:
\[ \begin{array}{cccc} \underbrace{\boldsymbol{0},\,\boldsymbol{0},\,\ldots,\, \boldsymbol{0}}_{S}, & \underbrace{\boldsymbol{x}(0),\,\boldsymbol{0},\,\ldots,\, \boldsymbol{0}}_{P}, & \underbrace{\boldsymbol{x}(1),\,\boldsymbol{0},\,\ldots,\, \boldsymbol{0}}_{P}, & \ldots, \end{array} \]
where \(\boldsymbol{0}\) is the \(L\)-dimensional zero vector, \(S\) is the number of left-padded zero vectors, and the \(P\) is the interpolation factor. If \(O=1\), each of the vectors is copied \(P\) times:
\[ \begin{array}{cccc} \underbrace{\boldsymbol{0},\,\boldsymbol{0},\,\ldots,\, \boldsymbol{0}}_{S}, & \underbrace{\boldsymbol{x}(0),\,\boldsymbol{x}(0),\,\ldots,\, \boldsymbol{x}(0)}_{P}, & \underbrace{\boldsymbol{x}(1),\,\boldsymbol{x}(1),\,\ldots,\, \boldsymbol{x}(1)}_{P}, & \ldots, \end{array} \]

The following example decimates data in data.d while keeping their original indices.

decimate -p 5 < data.d | interpolate -p 5 > data.dec
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

decimate