# Basic Filter Query

Started by September 3, 2003
```Hi,

The order of a digital filter is the number of previous inputs (stored
in the processor's memory) used to calculate the current output.

My doubt is, how can one estimate the current output based on the
previous inputs ?

E.g in Adaptive Noise cancellation, if FIR filter is used, then the
output of the filter is,

y[n] = x[n]*h + x[n-1]*h + ... + x*h[n]

If x is the noise source,then how do u estimate the current output
based on the past inputs of x ?

+---------+        s[n]   (+)+--+
Speech ------>| Channel |----------------->|  |-----+--> e[n]
Source        +---------+                  |__|     |
^(-)   |
+---------+       +----/----+  |      |
Noise ------>| Channel |------>| Adaptive|--+      |
Source        +---------+   x[n]| Filter  | y[n]    |feedback
+-/------ +         |
/                  |
+-------------------+

e[n] = s[n] - y[n]

The qn is,

y[n] has all the components of previous noise inputs.
When u obtain e[n], does it not affect the output?
If not, then how do the charecteristics of previous inputs
influence the
present output (i.e cancelling the noise) ?

Sandeep
```
```"Sandeep Chikkerur" <sandeep_mc81@yahoo.com> wrote in message
> Hi,
>
> The order of a digital filter is the number of previous inputs (stored
> in the processor's memory) used to calculate the current output.
>
> My doubt is, how can one estimate the current output based on the
> previous inputs ?
>
> E.g in Adaptive Noise cancellation, if FIR filter is used, then the
> output of the filter is,
>
> y[n] = x[n]*h + x[n-1]*h + ... + x*h[n]
>
> If x is the noise source,then how do u estimate the current output
> based on the past inputs of x ?
>
>                +---------+        s[n]   (+)+--+
>  Speech ------>| Channel |----------------->|  |-----+--> e[n]
>  Source        +---------+                  |__|     |
>                                               ^(-)   |
>                +---------+       +----/----+  |      |
>   Noise ------>| Channel |------>| Adaptive|--+      |
>  Source        +---------+   x[n]| Filter  | y[n]    |feedback
>                                  +-/------ +         |
>                                   /                  |
>                                  +-------------------+
>
>
>      e[n] = s[n] - y[n]
>
> The qn is,
>
>     y[n] has all the components of previous noise inputs.
>     When u obtain e[n], does it not affect the output?
>     If not, then how do the charecteristics of previous inputs
> influence the
>     present output (i.e cancelling the noise) ?

Because you said "noise" and not "interference", with this block diagram,

If the input to the adaptive filter is random noise, then the adaptive
filter will simply shut off at all frequencies - so as not to add to e[n].
Any random noise added to s[n] will increase e[n] and the objective of this
configuration is to minimize e[n] - so the filter will shut off, it will
become a no-pass filter.

Now, if the noise has any periodic components, and these same interfering
periodic components are in s[n], then the filter can adjust to remove these
by subtracting a "replica".  Assuming that the adaptive filter is relatively
narrow band and the temporal rate of change is correspondingly small, you
may be able to predict the output.

A more direct method for prediction under these circumstances and using the
same sort of approach would look like this:

s[n]    (+)+--+
Source --+-------------------------------->|  |-----+--> e[n]
|                                 |__|     |
|                                   ^(-)   |
|    +---------+       +----/----+  |      V
+--->| Delay L |------>| Adaptive|--+      |
|    +---------+ s[n-L]| Filter  | y[n]    |feedback
|                      +-/------ +         |
|                       /                  |
|                      +---------<---------+
|                                          |
|                                          |
|    +---------+       +----/----+         V
+---------s[n-L+k]| Filter  | y[n+k]  |feedback
+-/------ +         |
/                  |
+---------<---------+

Here, the delay L is used to decorrelate any noise that's in the source.
With this done, the filter shuts off at all frequencies except at those
parts of the source that are periodic.
If you *copy* the adaptive filter but feed it with a less-delayed version of
the source with delay L-k, you get a predictor.
Note that the output of the original adaptive filter is a "cleaned up"
version of the source with only the periodic components emerging - less
random noise.  So, presumably so is the output of the new adaptive filter

Not that this is the best method for prediction, but it's a takeoff from
where you started.  It still only works for the periodic components that are
in the source.  If the source is a ramp then you might want to investigate
Kalman filters.

Fred

```
```"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<vRp5b.697\$v22.569811@feed2.centurytel.net>...
> "Sandeep Chikkerur" <sandeep_mc81@yahoo.com> wrote in message
> > Hi,
> >
> > The order of a digital filter is the number of previous inputs (stored
> > in the processor's memory) used to calculate the current output.
> >
> > My doubt is, how can one estimate the current output based on the
> > previous inputs ?
> >
> > E.g in Adaptive Noise cancellation, if FIR filter is used, then the
> > output of the filter is,
> >
> > y[n] = x[n]*h + x[n-1]*h + ... + x*h[n]
> >
> > If x is the noise source,then how do u estimate the current output
> > based on the past inputs of x ?
> >
> >                +---------+        s[n]   (+)+--+
> >  Speech ------>| Channel |----------------->|  |-----+--> e[n]
> >  Source        +---------+                  |__|     |
> >                                               ^(-)   |
> >                +---------+       +----/----+  |      |
> >   Noise ------>| Channel |------>| Adaptive|--+      |
> >  Source        +---------+   x[n]| Filter  | y[n]    |feedback
> >                                  +-/------ +         |
> >                                   /                  |
> >                                  +-------------------+
> >
> >
> >      e[n] = s[n] - y[n]
> >
> > The qn is,
> >
> >     y[n] has all the components of previous noise inputs.
> >     When u obtain e[n], does it not affect the output?
> >     If not, then how do the charecteristics of previous inputs
> > influence the
> >     present output (i.e cancelling the noise) ?
>
> Because you said "noise" and not "interference", with this block diagram,
> the answer is "you can't".
>
> If the input to the adaptive filter is random noise, then the adaptive
> filter will simply shut off at all frequencies - so as not to add to e[n].
> Any random noise added to s[n] will increase e[n] and the objective of this
> configuration is to minimize e[n] - so the filter will shut off, it will
> become a no-pass filter.
>
> Now, if the noise has any periodic components, and these same interfering
> periodic components are in s[n], then the filter can adjust to remove these
> by subtracting a "replica".  Assuming that the adaptive filter is relatively
> narrow band and the temporal rate of change is correspondingly small, you
> may be able to predict the output.
>
> A more direct method for prediction under these circumstances and using the
> same sort of approach would look like this:
>
>                                    s[n]    (+)+--+
>    Source --+-------------------------------->|  |-----+--> e[n]
>             |                                 |__|     |
>             |                                   ^(-)   |
>             |    +---------+       +----/----+  |      V
>             +--->| Delay L |------>| Adaptive|--+      |
>             |    +---------+ s[n-L]| Filter  | y[n]    |feedback
>             |                      +-/------ +         |
>             |                       /                  |
>             |                      +---------<---------+
>             |                                          |
>             |                                          |
>             |    +---------+       +----/----+         V
>                  +---------s[n-L+k]| Filter  | y[n+k]  |feedback
>                                    +-/------ +         |
>                                     /                  |
>                                    +---------<---------+
>
>
>
>
> Here, the delay L is used to decorrelate any noise that's in the source.
> With this done, the filter shuts off at all frequencies except at those
> parts of the source that are periodic.
> If you *copy* the adaptive filter but feed it with a less-delayed version of
> the source with delay L-k, you get a predictor.
> Note that the output of the original adaptive filter is a "cleaned up"
> version of the source with only the periodic components emerging - less
> random noise.  So, presumably so is the output of the new adaptive filter
> except it's advanced in time.
>
>
> Not that this is the best method for prediction, but it's a takeoff from
> where you started.  It still only works for the periodic components that are
> in the source.  If the source is a ramp then you might want to investigate
> Kalman filters.
>
> Fred

Hello Mr. Fred,

Thank you.
But let me take the following example.

/^\           /^\
/   \         /   \        ----> s{t} (Sinusoidal Signal)
/     \       /     \                  (Source Signal)
/       \     /       \
\   /         \
\ /
V

/|     /|
| |    | |
| |    | |    ----->x(t) (Periodic noise signal)
/  |   /  |               (Reference signal)
|   |  |
|___|  |___

0--1--2--3--4--5--6--7------------------------------->n
(Discrete Time axis)

Now say, u want to obtain the output at n = 3

i.e
y = x*h + x*h+....+x*h (y[n] is the o/p of the
filter)

=> e = s-y

if y is expanded, then

e = s - ( x*h + x*h+....+x*h )

=> The o/p e[n] produces only one component. (only at n = 3)

But how abt the extra components (x*h+....+x*h )which
are getting into e ? Don't they further disturb e ?

Of course, due to the -ve sign e will be reduced, but how do the
previous inputs influence in reducing the error on present o/p
practically?

Taking a numerical example,
The following figs are in amplitudes

s = 2
x = 1

After interfering with source signal, s = 2.5 (Assuming channel
delay)

Now
e = s - ( x*h + x*h+....+x*h )
= 2.5  - ( 1.5 )
= 1

Now, is the original signal not disturbed due to the other inputs ?