1
00:00:00,120 --> 00:00:03,900
So the aim for this lecture is say we forget about these frequencies.

2
00:00:04,230 --> 00:00:09,570
We just have this plot here just as data, and we want to figure out what are the three frequencies

3
00:00:09,570 --> 00:00:11,070
that are superimposed here.

4
00:00:11,910 --> 00:00:14,490
And for this, we will use these so-called for your transform.

5
00:00:15,300 --> 00:00:20,370
I will not explain to you, why did Fourier transform will give us the characteristic frequencies?

6
00:00:21,000 --> 00:00:25,140
We just assume that this is correct is is something one can derive in mathematics.

7
00:00:25,500 --> 00:00:30,810
And here we want to just implement this and test how it works and see that it really works.

8
00:00:31,980 --> 00:00:38,520
So the equation here means that we have some intensity, which I call Whitehill, but it doesn't really

9
00:00:38,520 --> 00:00:38,940
matter.

10
00:00:39,180 --> 00:00:45,690
You could give it any name you want, and it's a function that now doesn't depend on the time, as previously

11
00:00:45,690 --> 00:00:50,280
we had why of Ti, but now it depends on the frequency omega.

12
00:00:51,300 --> 00:00:56,040
And it is calculated by calculating such an integral over the time.

13
00:00:56,520 --> 00:01:02,130
And actually, we integrate here from minus infinity to plus infinity, which of course we cannot really

14
00:01:02,130 --> 00:01:02,580
do here.

15
00:01:02,580 --> 00:01:07,080
So we must be clever about these values and find some tricks.

16
00:01:07,800 --> 00:01:12,840
And then we integrate over our system or a signal, which will be this one here.

17
00:01:13,140 --> 00:01:13,590
Of T.

18
00:01:14,100 --> 00:01:21,600
And then here's two factor that I mentioned it's an exponential function with an imaginary argument.

19
00:01:21,840 --> 00:01:26,460
So this will be the imaginary unit I, which is the square root of minus one.

20
00:01:27,180 --> 00:01:31,980
And then we have here the omega, which is the argument of our function and the time.

21
00:01:32,940 --> 00:01:33,840
So it works like this.

22
00:01:34,290 --> 00:01:41,280
You basically take a value for Omega, for example, zero point five and then you put it in here.

23
00:01:41,280 --> 00:01:45,990
And then from this, you calculate this integral, then you go to the next value of 0.6.

24
00:01:46,320 --> 00:01:47,190
Calculate again.

25
00:01:47,520 --> 00:01:53,040
And so you will get a function y tilde of omega, which we will let them have a look at later.

26
00:01:53,370 --> 00:02:00,280
And I can tell you already that this function omega tilde is no sorry y told off omega will give you

27
00:02:00,280 --> 00:02:04,740
a very pronounced peaks at the frequencies that we can see here.

28
00:02:05,880 --> 00:02:07,710
So let's go ahead and implement this.

29
00:02:08,460 --> 00:02:19,800
We need first of all, Omega is equal to, as an example, 0.3 and then into Grant, which will be this

30
00:02:19,800 --> 00:02:24,690
one here is basically given S and P dot array.

31
00:02:26,430 --> 00:02:27,060
And then.

32
00:02:29,710 --> 00:02:30,400
T list

33
00:02:35,500 --> 00:02:36,010
like this.

34
00:02:36,340 --> 00:02:45,520
And then one over and p dot square root two times and p dot pie than we have.

35
00:02:45,550 --> 00:02:49,380
So I basically put this into the integral doesn't matter if it's outside or inside.

36
00:02:49,390 --> 00:02:57,640
I put it inside now and then we multiply by the wine list and then we have to value and pedaled.

37
00:02:57,640 --> 00:02:58,120
Exp.

38
00:02:59,200 --> 00:03:07,660
The eye is written in Python as 1g times omega times t list.

39
00:03:08,590 --> 00:03:21,970
And then to calculate the value of tilde of Omega, we just write print integral Trump P is sidle of

40
00:03:22,600 --> 00:03:23,360
integrins.

41
00:03:24,280 --> 00:03:31,090
So basically, this means take this array that we have here where our x axis, so which is the time

42
00:03:31,090 --> 00:03:37,200
is still the same and our Y value is changed from y to this whole integral tier.

43
00:03:37,210 --> 00:03:44,080
So one of a square root of two pi times point of T times e to the power of Iomega T and then use the

44
00:03:44,080 --> 00:03:47,770
integral trapezoidal method to this and this will give us just a number.

45
00:03:48,640 --> 00:03:51,880
So you see, it gives us actually a complex number.

46
00:03:52,000 --> 00:03:54,400
So a real part and an imaginary part.

47
00:03:54,850 --> 00:04:00,970
So we probably need something like this absolute value of this.

48
00:04:01,480 --> 00:04:03,540
And then typically you just square it.

49
00:04:03,550 --> 00:04:05,830
This is just like typical practice.

50
00:04:06,790 --> 00:04:07,080
OK.

51
00:04:07,090 --> 00:04:08,410
And so the value would be done.

52
00:04:08,410 --> 00:04:10,150
Four hundred twenty.

53
00:04:11,070 --> 00:04:12,480
That's just a coincidence.

54
00:04:13,560 --> 00:04:20,399
OK, so we have now calculated here actually why till the absolute value squared, which will be what

55
00:04:20,399 --> 00:04:22,050
we will plot in the following.

56
00:04:23,130 --> 00:04:27,240
So this is just a value for one particular omega 0.3.

57
00:04:27,780 --> 00:04:33,300
And now we want to do it, of course, for the whole range of Omega that we are interested in.

58
00:04:34,050 --> 00:04:39,380
So we should probably start at zero because negative frequencies are not so important for us.

59
00:04:39,390 --> 00:04:45,450
Here we take only positive frequencies and then we go to a value where we assume after this we don't

60
00:04:45,450 --> 00:04:46,470
have any peaks left.

61
00:04:47,340 --> 00:04:56,410
If we look at this spectrum here, we would say, OK, what is here the fastest oscillation, which

62
00:04:56,920 --> 00:04:58,470
is the smallest period?

63
00:04:58,800 --> 00:05:01,500
So this will then have the smallest frequency.

64
00:05:01,890 --> 00:05:04,080
So probably something on this length scale here.

65
00:05:04,110 --> 00:05:05,430
What timescale better to see?

66
00:05:05,820 --> 00:05:10,200
And we know already since we know the solution that there is no frequency larger than this one.

67
00:05:10,680 --> 00:05:16,470
So probably it's OK to just look in the range of zero to five and just to be on the safe side, we will

68
00:05:16,470 --> 00:05:18,270
look in the range of zero to 10.

69
00:05:19,440 --> 00:05:27,960
So I will right now 50, which will be the data that we will plot later on, is own rate and the rate.

70
00:05:30,420 --> 00:05:39,970
And first of all, first lists for the first entry of the list will be Omega, which I call on Omega,

71
00:05:40,000 --> 00:05:41,580
and it doesn't really matter here.

72
00:05:42,120 --> 00:05:49,980
And then the next value will be basically what we have written down here, integral trapezoidal acting

73
00:05:49,980 --> 00:05:53,310
on basically this one.

74
00:05:54,510 --> 00:05:55,470
So let me copy this.

75
00:05:56,130 --> 00:06:02,220
So we have integral trapezoidal acting on ENPI array tea list, the square root.

76
00:06:02,310 --> 00:06:11,400
Whilst the exponential and here we just have to change this to on and now we must specify what it is

77
00:06:11,400 --> 00:06:12,870
omega means.

78
00:06:12,990 --> 00:06:22,320
So for this, we have to add here another bracket and like this and then we can write for omega in and

79
00:06:22,560 --> 00:06:26,790
p total in space, starting from zero going to 10.

80
00:06:27,330 --> 00:06:31,830
And then we must specify how many steps we want to have in our omega list.

81
00:06:32,310 --> 00:06:33,710
So I don't know.

82
00:06:33,720 --> 00:06:34,740
1001.

83
00:06:36,030 --> 00:06:36,540
All right.

84
00:06:36,990 --> 00:06:41,220
So this took maybe one second to calculate and now we can go ahead and plot.

85
00:06:41,760 --> 00:06:46,890
So we have on the x axis the frequency

86
00:06:49,440 --> 00:06:52,950
omega and on the y axis

87
00:06:56,250 --> 00:07:02,490
we have the intensity which will actually be absolute value of to the square.

88
00:07:03,570 --> 00:07:07,570
And then we plots peel t dot plots for your transform.

89
00:07:07,590 --> 00:07:11,550
This is our list that we have just calculated after all the values.

90
00:07:12,420 --> 00:07:13,650
Just the first component.

91
00:07:13,650 --> 00:07:15,090
So basically this list here

92
00:07:18,480 --> 00:07:31,170
and then absolute value of f t all the values come on one and the whole thing squared as before, just

93
00:07:31,170 --> 00:07:31,800
like this one.

94
00:07:33,570 --> 00:07:36,230
And now we run into a bit of a problem here.

95
00:07:36,240 --> 00:07:44,430
This is because it says complex warning, so it's not an arrow is just a warning, um, testing a complex

96
00:07:44,430 --> 00:07:46,950
value to a real function.

97
00:07:47,190 --> 00:07:51,270
This called the imaginary part, and I checked before.

98
00:07:51,270 --> 00:07:52,140
What's the problem here?

99
00:07:52,140 --> 00:07:54,660
The problem is actually this list here.

100
00:07:56,010 --> 00:08:01,800
So the list of Omega's, because the list of Omega, since we have here a complex number, it assumes

101
00:08:02,160 --> 00:08:04,740
that these may also be complex numbers.

102
00:08:05,070 --> 00:08:14,970
So this seems to be, for example, zero point zero two plus zero I so always it adds a zero I, which

103
00:08:15,570 --> 00:08:19,920
of course, doesn't mean anything, but it changes the data type to a complex number.

104
00:08:20,280 --> 00:08:26,190
And then if you want to plot something like this gives us a warning that the imaginary part is disregarded.

105
00:08:26,490 --> 00:08:31,230
So in our case, it's really what we want because there is no imaginary part, it's zero.

106
00:08:31,560 --> 00:08:36,330
But just to get rid of this warning, we could write Dot Real, but it's not at all necessary.

107
00:08:38,570 --> 00:08:39,890
So now we have our results.

108
00:08:40,100 --> 00:08:43,220
This is the intensity spectrum over the frequency omega.

109
00:08:43,730 --> 00:08:46,040
And you see we have some pronounced peaks here.

110
00:08:46,670 --> 00:08:53,280
One of them is out to the other one at 3.5 and the other one is here at a very low frequency.

111
00:08:53,300 --> 00:08:54,140
Hard to say.

112
00:08:54,560 --> 00:09:00,260
We would have to analyze the data, but since we know what it is, it is probably 0.3.

113
00:09:00,980 --> 00:09:08,450
So we have now high frequencies to 3.5 and the other one 0.3 we can figure out just in a second.

114
00:09:09,590 --> 00:09:21,710
We basically just rides f t and then all of the values basically from let's say we know that it's at

115
00:09:21,710 --> 00:09:22,700
zero point three.

116
00:09:22,700 --> 00:09:25,220
So let's look at this one.

117
00:09:26,750 --> 00:09:32,450
So this is the range of the points corresponding to Omega from 0.25 to 0.34.

118
00:09:32,990 --> 00:09:38,630
And now, of course, we have to look at the Y values and the absolute values squared.

119
00:09:39,200 --> 00:09:45,050
So maybe you could, of course, make this in a more elegant way, but just to do it quick and dirty,

120
00:09:45,590 --> 00:09:46,730
you could do it like this.

121
00:09:51,240 --> 00:09:52,290
Absolutely, you squirt.

122
00:09:52,830 --> 00:09:58,650
And now you must see here, OK, it increases, and then here we have the maximum and then it decreases

123
00:09:58,650 --> 00:10:06,030
again, and the maximum corresponds to six one two three four five six zero point three.

124
00:10:06,270 --> 00:10:12,480
So this is really the frequency that we see here, and this is corresponding to the frequency here.

125
00:10:13,980 --> 00:10:22,260
So you see really the proof that by using a free transform, we can calculate the specific or characteristic

126
00:10:22,260 --> 00:10:23,790
frequencies of a spectrum.

127
00:10:24,210 --> 00:10:32,310
And it means that our function y of T is superimposed by individual periodic functions that can be cosine

128
00:10:32,310 --> 00:10:36,780
functions that can be sine functions that can be cosine functions with a phase shift.

129
00:10:37,230 --> 00:10:38,470
All of this doesn't matter.

130
00:10:38,490 --> 00:10:45,630
We just are able to figure out the individual frequencies and later in the course, in a later section

131
00:10:45,630 --> 00:10:52,260
about eigenvalue problems, we will really use a Fourier transform to figure out the characteristic

132
00:10:52,260 --> 00:10:56,610
frequencies of a problem where we don't know what the characteristic frequencies.

133
00:10:56,790 --> 00:11:01,410
So this will be really exciting then, and it can really be a useful tool.

