private Matrix getDCTMatrix()
  {
    //compute constants
    double k = Math.PI/numberFilters;
    double w1 = 1.0/(Math.sqrt(numberFilters));//1.0/(Math.sqrt(numberFilters/2));
    double w2 = Math.sqrt(2.0/numberFilters);//Math.sqrt(2.0/numberFilters)*(Math.sqrt(2.0)/2.0);

    //create new matrix
    Matrix matrix = new Matrix(numberCoefficients, numberFilters);

    //generate dct matrix
    for(int i = 0; i < numberCoefficients; i++)
    {
      for(int j = 0; j < numberFilters; j++)
      {
        if(i == 0)
          matrix.set(i, j, w1 * Math.cos(k*i*(j + 0.5d)));
        else
          matrix.set(i, j, w2 * Math.cos(k*i*(j + 0.5d)));
      }
    }

    //ajust index if we are using first coefficient
    if(!useFirstCoefficient)
      matrix = matrix.getMatrix(1, numberCoefficients-1, 0, numberFilters-1);

    return matrix;
  }