/************************************************************************
 *                                                                      *
 * Copyright (c) 2007 Synfora, Inc.  All rights reserved.               *
 *                                                                      *
 * This file contains Confidential Information of Synfora, Inc.         *
 * In addition, certain inventions disclosed in this file may be        *
 * claimed within patents owned or patent applications filed by         *
 * Synfora or third parties.  Any use of Synfora's copyrighted works,   *
 * confidential information, patented inventions, or patent-pending     *
 * inventions is subject to the terms and conditions of your written    *
 * license agreement with Synfora, Inc.                                 *
 * All other use and disclosure is strictly prohibited.                 *
 *                                                                      *
 ************************************************************************/

#include "pico.h"
#include "fir.h"

short x[L][M];
short w[N];
short y[L][M-N];

char task_num;

void fir() {
  int i,j;

  for (i=0; i < M-N; i++) {
    short sum = 0;
    #pragma unroll j
    for (j=0; j < N; j++) {
      sum += ((w[j] * x[task_num][i+j]) >> (EXPY-EXPX-EXPW));
    }
    y[task_num][i] = sum;
  }
}
