C++
C#
VB
JScript
All

Signal Processing


Copyright (C) 2005 IENT-RWTH Aachen

Signal processing functions are not automatically included in the vector and matrix calculations. You have to explicitly include the corresponding header file.

This example shows how to use the convolution to filter a signal.

#include "array/vector.h"
#include "signal/conv.h"

int main()
{
  DenseVector<float>::self X(4, "1 2 3 4");
  DenseVector<float>::self Y(3, "0.25 0.5 0.25");
  DenseVector<float>::self Z;
  Z=conv(X,Y);
  cout << Z << endl;
}

This example shows how to use the Fast Fourier Transform on vectors and matrices.

#include "array/matrix.h"
#include "signal/fft.h"

int main()
{
  DenseVector<float>::self X1(4, "1 2 3 4");
  DenseVector<complex<float> >::self Y1=fft(X1);
  cout << Y1 << endl;

  DenseMatrix<float>::self X2(4,4, "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16");
  cout << fft(X2) << endl;
}

This example shows how to use the Discrete Cosine Transform on vectors and matrices.

#include "array/matrix.h"
#include "signal/dct.h"

int main()
{
  DenseVector<float>::self X1(4, "1 2 3 4");
  DenseVector<float>::self Y1=dct(X1);
  cout << Y1 << endl;

  DenseMatrix<float>::self X2(4,4, "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16");
  cout << dct(X2) << endl;
}

See Also

Tutorial