0:01

Hi everybody.

Now we are going to talk about

convolutions and linear systems.

If you've watched the functions are vectors tutorial, and it made sense,

then this shouldn't seem too crazy.

It relies heavily on the concept of projecting one

function onto other.

Okay, what does a linear system do?

1:19

is another signal, another function, something like that.

So the linear system takes in a function x of t and

it spits out a function y of t.

When you learn about a new system or a new operation,

it's always important to keep track of the nature of the input and output.

That is the first step to resolving confusion.

So, a linear system take as input a function of time and

its output is also a function of time.

2:09

So filtered is the key word.

And we name the filter f of t.

With a more mathematical vocabulary,

you would say that the output is

the convolution of the filter and input.

So, to get the output, you convolve the filter with the input.

2:40

So this is probably best explained through an example.

Let's say we have an input signal.

So, here we're going to do an example.

We have an input signal, that looks something like that.

Who knows where it came from, just some input signal and

we're going to stick it through this linear filter or this linear system and

try to figure out what the output is going to look like.

Now how do we characterize the linear system?

We characterize the linear system by its filter, f of t.

So let's say our filter looks something like this.

This is t and this is f(t).

3:30

Let's say that the filter is 0, for times really really far in the past,

and then for times just a little bit in the past,

maybe at minus 1, it goes up to the value of 1,

and then at 0 it drops down to the value of minus 1,

And then it comes back to 0 and stays at 0 for all of eternity.

That's what our filter looks like.

We want to figure how do you get

y(t) from x(t), and f(t).

So let's go through things one step at a time.

4:13

Let's say we're trying to figure out y(5).

So we're trying to figure out the value of our output at time five seconds,

for example.

How do we do this.

Well, first we have to pick a window.

Our filter is let's say this was also one second,

no let's, let's say this was 0.5 seconds and

this was minus 0.5 seconds centered at zero.

So our window is the length of our filter which is just one second.

So that will be the length of the window.

So what do I mean when I say window, why is that a useful concept.

What it means is that, if we're trying to find y(5),

first we look up x(5) which is maybe, 5 is right there.

5:11

And we draw a window around x(5).

Since our filter is centered at zero we're going to center our window around x(5),

so this is the window, around x(5).

Now what we're going to to do is draw the filter, in right there, just like that.

So that's our f(t).

So y(5) is equal to the projection

of f(t) onto x(t) in that window.

7:02

So it'll be somewhere near zero.

So the integral with x(t) and f(t) dt,

over that window, is something like, maybe not quite zero,

maybe it's minus 0.2, and that's it.

That's our y(t).

It was the projection of our filter onto x(t),

where we center the window at the current time.

7:38

So that equals -0.2.

Not too bad right?

What if we wanted to find y(6)?

Now what we do as again we find t equals six maybe over here.

We select our window [SOUND] draw

the filter in the window.

Multiply the curves together so now its maybe big negative,

small positive, take the integral.

8:43

So how it works is that.

You'd pick up your filter and you place it over x(t) and

you slide it along very slowly and

at every point you notice where, or you write down where the center of

the filter is, you figure out what your window is, and

you do the projection of your filter onto x(t) in that window.

And you write down your answer.

That's y(t).

And then you slide it along just a little bit.

Do the same thing, except now the window is shifted.

And write down your answer again.

And that's your next y(t).

And you can go through this and do the whole thing to get an entire signal y(t).

9:29

So let's zoom in and go over just one more time.

So here, of course that's t, here is x(t).

Some kind of noisy sign wave like that.

We have our filter, this is f(t), sorry we used blue before.

f(t), that's t, and

we wanted to figure out y(t).

So what you do.

Let's say t=3, find 3.

Draw your window.

Remember the window is the width of your filter,

of the non-zero part of your filter.

You draw the filter within the window, multiply the filter and

the input signal together within that window and do the integral.

And that gives you

10:37

Actually, maybe it's a little more than zero.

So that's y(3), 3, y(t) and that's y(3).

If we do the same thing over here, draw the filter,

calculate the product, do the integral and get a new point on your output graph.

So maybe this is y(6).

And if you were to do this for every point in time,

you might get something that looked like that.

11:59

This is when y(t) is the highest so y(4) is highest.

This is because if we were to draw our filter over t=4,

so just like that, and calculate y(t) from there.

What do we get?

Well, in this first half, the filter and

x(t) are positive, so we get a positive signal.

And in the second half, the filter and x(t) are both negative, so

we also get a positive signal when we do the product.

12:35

Therefore when we calculate this integral we're going to get a very large number,

much larger than when we had done the projections

at different parts of the signal.

So at this zero crossing right here where it's going,

where this input signal's going from a positive number to a negative number

that's where we get the highest output of our filter.

12:59

And can we understand this in sort of a pictorial way

rather than actually going through and doing the integrals at all these points?

Can we just look at our filter and look at our signal and

get some idea of what will be going on?

And the answer is yes, and the reason is that more or

less a filtering system or a linear system is looking for

parts of the inputs, parts of that resemble the filter.

So the more the input signal resembles the filter,

the higher your output signal will be.

So, if you look at our filter up here, you will see it doesn't,

none of the actual inputs stay too close to the filter, but

if we find the part of the input signal that looks the closest to the filter,

which would be the one where, the one over here around this zero crossing,

that is going to be the signal that yields the highest output.

Because it is a signal that,

it is the part of the signal that looks most similar to the filter.

Because that's the case, because our linear system is looking for

certain features of the input signal,

sometimes we call a linear system a feature detector and

this means that the liner systems responds most strongly

when it encounters a part of the input that looks like it's filter.

So the filter describes the feature that the system is looking for.

And in this week's lectures,

we talked about ways of trying to just start with the output and the input and

try to figure out what feature the system is looking for.

So we try to figure out what filter

the system is using to go from its input to its output.

And in neuroscience you can use methods like reverse correlation or

spike-triggered averaging.

Or spike-triggered covariance analysis to estimate what the filter looks like.

One last note that's not super important for our purposes, but if you go into

an engineering field after this or have come from an engineering field after this,

just be aware that sometimes, when you actually see the math written out,

they will draw the filters backwards.

Meaning that they're flipped around the y axis.

And this is just, kind of a convention people use that

makes writing out the integral a little bit easier.

15:40

So sometimes, for example, you would see a filter like this,

like the one we've talked about drawn like that instead.

And if it's drawn like that all that means is that they would reverse it to the blue

filter before they actually dragged it along the input signal.

That's just a convention to be aware of.

You don't need to worry about it too much, or even at all for

this course, but sometimes that happens.

Okay, that's it for now.

Thanks, guys.

See you next time.