0:00

Many signal processing problems can be solved using very simple filters so

it is important to master the simple structures.

We have already seen some examples such as the leaky integrator and

the moving average.

In general, when we use low order sections, we can intuitively understand

what goes on in the frequency domain just by looking at pole-zero plot.

Consider the problem of designing a simple lowpass.

We want the low frequencies to go through.

We want to remove the high frequencies and we can use such a filter in audio

problems, in communication engineering or in control systems.

We have seen a very simple example of a lowpass which is the leaky integrator.

But now we know the transfer function by heart.

It's this one.

And we also know the CCDE, we can plot the poles and

the zeros of the leaky integrator on the complex plane.

And we find that there's only one pole in lambda.

So when lambda is less than one, the filter is stable.

In the frequency domain, the frequency response looks like this.

And it gets more and

more concentrated around the origin as lambda gets closer to 1.

The block diagram for the filter is a simple feedback loop

with a unit delay that pipes back the output into the input.

Now that we know how to design a leaky integrator,

we can adapt the design to obtain a resonator.

A resonator is a narrow bandpass filter that is often used to

detect the presence of a sinusoid of a given frequency.

A classic circuit that uses resonators is a detector for DTMF signals.

DTMF stands for dual-tone multi-frequency signalling and

it is the way an analog telephones

communicates to the central office to dial a number.

Whenever you press a number on the dial pad of telephone,

you generate two frequencies that will have to be decoded at the central office

to determine which key you have press.

[SOUND] The idea is to obtain a resonator by

shifting the passband of the leaky integrator.

Remember the leaky integrator has a pole in lambda here and

the idea is to move the pole radially around the circle of radius lambda

to shift the passband at the frequency that we're interested in selecting.

Since we want a real filter, we also have to create a complex conjugate pole

at an angle that is minus omega 0.

The transfer function of the system is simply H(z) equal to

some gain factor that we will determine later.

Divided by first two order terms

that correspond to the two poles in the complex plane.

As for the poles, we can conveniently express them as lambda times e

to j omega 0, were omega 0 is the frequency we want to select.

The time domain the output is a gain times

the input- a1y[n- 1]- a2y[n- 2].

So we have two output samples that are delayed and fed back into the input.

The coefficients a1 and

a2 we can determine if we work out the product of these first order terms.

Let's work a little bit on the transfer function.

We start in factor form.

And then we can work out the product, to obtain this form,

in which we can find the coefficients that we will have to use in the CCDE.

So, a1 is 2 times lambda, cosine of omega 0,

whereas a2 is minus magnitude of lambda square.

In the frequency domain, the resonator indeed behaves as we expected.

We have now two peaks in the frequency response that are centered

on the frequency of interest omega 0 which in this example is equal to pi over 3.

The phase is again non-linear as we expect from a leaky integrator, albeit modified.

The problem with this resonator is that it's not very selective

because the passbands are quite spread out.

We can improve the selectivity of the resonator by choosing a value for

lambda that is closer to 1.

And indeed if we choose lambda equal to 0.99 for

same frequency of omega 0 equal to pi over 3, we obtain

two peaks that are much more narrow and centered around the frequency of interest.

As for the filter structure, this time we have two delays.

It's a simple feedback loop once again.

But a second ordered feedback loop in which the input is first delayed by

the first delay and then pipe back via the factor 2 lambda cosine of omega 0.

And then delayed again and piped back via the factor magnitude of lambda square.

6:04

Transfer function is very easy, it's 1- z to the -1.

And the CCDE is equally easy,

the output is computed as the difference of two subsequent samples.

So x[n]- x[n- 1].

If we plot the frequency response, this is the characteristic we obtain,

indeed the Fourier transform will be set to 0 and 0.

However, this is definitely not an acceptable characteristic because it

introduces a very big attenuation over almost the entirely of the frequency

support.

What we want really is a notch.

Which is to say, we want to put the Fourier transform at 0 and 0 and

leave the rest of the spectrum untouched.

So we need to somehow improve on the design,

and if we remember the circus tent method, we know that we can push

up the z-transform by putting a pole in the vicinity of the 0.

So we try and do that and we combine therefore,

the effect of a 0 and 1 with the effect of a pole close to one,

and inside the unit circle, for obvious reasons of stability.

7:09

so, this is really the combination of a notch in zero, which is given by

the numerator here, and of a leaky integrator after the denominator.

In the time domain, we have that the output is now lambda

times the output at n- 1 + x[n]- x[n- 1].

If we plot the modified notch,

we obtain a characteristic that varies with different values of lambda.

As lambda grows closer to 1, the notch becomes more narrow.

And so here for instance the example is for lambda = 0.98 and

we have achieved a very selective DC removal.

The filter structure is very simple.

We will exploit the direct form two that we have seen in the previous module and

share the delay between the feed forward and the feed back part of the filter.

Finally, let's consider the hum removal filter.

The hum removal is to the DC notch what the resonator was to the leaky integrator.

In other words, the hum removal is a DC notch whose stop band

will shift in order to be able to eliminate a specific frequency.

A classic use case for the hum removal is in music.

Amplifiers and electric guitars tend to pick up the hum

generated by the AC current in the mains.

That frequency is 50Hz in Europe and 60Hz in North America.

50 or 60Hz are well within the hearing range, so

not only is the hum audible, but it is also particularly irritating.

So we need a filter to remove the hum.

And we need to make sure that we tune this filter according to whether we're playing

in Europe or North America.

The strategy is going to be exactly the same

as the one we use to derive the resonator.

We take a DC notch that has a zero in one and a pole next to it.

And we move both the pole and

the zero along the circle of radius lambda and one respectively.

Of course in order to have a real system, we have to introduce a complex conjugate

pull and a complex conjugate zero at an angle that is minus omega zero.

When we do that, we obtain a second order transfer function with a second order

numerator, and a second order denominator.

If we plot the frequency response, we get the characteristic that we're looking for.

And we're placing the notches now at a frequency of interest, omega 0.

The structure is a standard direct form two implementation where we have shared

the delays between the feed forward and the feed back part of the filter.

And the coefficients can be worked out by carrying

out the products between the first order terms in the transfer function.