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.

Â