File: FIfiltAP.html

package info (click to toggle)
libtsp 3r0-1
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 5,096 kB
  • ctags: 1,798
  • sloc: ansic: 14,464; sh: 1,217; makefile: 182
file content (83 lines) | stat: -rw-r--r-- 2,390 bytes parent folder | download
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<HTML>
<HEAD>
<TITLE>TSP (libtsp/FI) - FIfiltAP</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>FIfiltAP</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
void FIfiltAP (const float x[], float y[], int Nout, const float h[],
int Ncof)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Filter a signal with an all-pole IIR filter
</DL>
<H4>Description</H4>
The procedure filters an input signal using an all-pole filter.  The filter
is specified by its direct-form feeback coefficients h[i],
<PRE>
          1                    N-1       -i
  H(z) = ----  ,  where C(z) = SUM h[i] z    .
         C(z)                  i=0
</PRE>
<P>
The output is calculated as
<PRE>
  h[0]*y[k] = x[k] - h[1]*y[k-1] - h[2]*y[k-2] - ...
                                 - h[Ncof-1]*y[k-Ncof+1].
</PRE>
Normally, the first coefficient is unity, i.e. h[0]=1.  A non-unity value
will result in a gain scaling of the response.
<P>
The output array y[.] must be primed with mem=Ncof-1 previous output values.
On return the top mem values in y[.] can serve as the memory values for the
next invocation of this routine.
<P>
This routine can also be called with a single array x[.] of length mem+Nout,
<PRE>
  FIfiltAP (&amp;x[mem], x, Nout, h, Ncof)
</PRE>
Before entering this routine, the first mem values of x[.] are set to
previous output values, while the next Nout values are new input values.
On return, the Nout new output values replace the input values, starting at
x[mem].  If the top mem elements are shifted down to the bottom of the array,
these can serve as the previous output values for the next call to this
routine.
<H4>Parameters</H4>
<DL>
<DT>
 -&gt; const float x[]
<DD>
Input array of data, Nout values
<DT>
&lt;-&gt; float y[]
<DD>
Output array of samples.  This array is of length Ncof-1+Nout.  On input,
the first Ncof-1 values should represent past output values.  On output,
Nout new output samples are appended to this array.
<DT>
 -&gt; int Nout
<DD>
Number of new output samples to be calculated
<DT>
 -&gt; const float h[]
<DD>
Array of Ncof all-pole filter coefficients.  The first coefficient must
be non-zero.
<DT>
 -&gt; int Ncof
<DD>
Number of filter coefficients
</DL>
<H4>Author / revision</H4>
P. Kabal  Copyright (C) 1997
/ Revision 1.11  1997/10/10
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>