File: filter1.cpp

package info (click to toggle)
qsstv 9.5.8-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,928 kB
  • sloc: cpp: 47,579; makefile: 4
file content (50 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

/*
*    File filter1.c
*
* implements filter routine a la MATLAB
* for real data in vector sigin[]
*
* PA0MBO - M.Bos
* Date Feb 21st 2009
*
* result is stored in y[]
* dataLen is number of elements in input (sigin) and mih is length of
* the filter vector h[]
*
*/


/*************************************************************************
*
*                           PA0MBO
*
*    COPYRIGHT (C)  2009  M.Bos 
*
*    This file is part of the distribution package RXAMADRM
*
*    This package is free software and you can redistribute is
*    and/or modify it under the terms of the GNU General Public License
*
*    More details can be found in the accompanying file COPYING
*************************************************************************/


#include <stdio.h>

void drmfilter1(float *sigin, float *out, float *coef, int dataLen, int coefLen)
{
  int i, j;


  for (i = 0; i < dataLen; i++)

    {
      out[i] = 0.0;
      for (j = 0; ((j <= i) && (j < coefLen)); j++)

        {
          out[i] += coef[j] * sigin[i - j];
        }
    }
}