1
00:00:00,750 --> 00:00:03,770
In real life not all signals are
band-limited.

2
00:00:03,770 --> 00:00:06,020
And if we sample non-band-limited signals
there

3
00:00:06,020 --> 00:00:08,190
will be a nasty effect called aliasing.

4
00:00:08,190 --> 00:00:10,950
You may remember this effect in Module
Two.

5
00:00:10,950 --> 00:00:14,199
We had seen the wagon wheel effect where
wagon wheels would go backwards.

6
00:00:15,240 --> 00:00:19,260
Here we are going to explore this in
detail, specifically with sinusoids.

7
00:00:19,260 --> 00:00:21,690
And we are going to see that if a sinusoid
is

8
00:00:21,690 --> 00:00:25,775
not sampled fast enough, then it will fall
back into seemingly a

9
00:00:25,775 --> 00:00:27,550
lower-frequency sinusoid.

10
00:00:27,550 --> 00:00:30,420
So there is an infinite set of sinusoids
that

11
00:00:30,420 --> 00:00:33,962
when sampled, all looks the same in their
sampled version.

12
00:00:33,962 --> 00:00:34,196
The

13
00:00:34,196 --> 00:00:35,170
[INAUDIBLE]

14
00:00:35,170 --> 00:00:38,730
phenomenon is very fundamental.
And we need to understand it in detail.

15
00:00:40,130 --> 00:00:44,800
>> Module 6.4.
Sampling and Aliasing - Introduction.

16
00:00:47,120 --> 00:00:51,000
We will see what happens if we do
so-called Raw sampling.

17
00:00:51,000 --> 00:00:53,720
So we take any signal, we sample it.

18
00:00:53,720 --> 00:00:56,090
When it's band-limited, everything goes
fine.

19
00:00:56,090 --> 00:00:58,940
When it's not band-limited, things can go
wrong

20
00:00:58,940 --> 00:01:02,890
and we'll see specifically this with
Sinusoidal aliasing.

21
00:01:02,890 --> 00:01:05,160
Which is a phenomenon when, sampled

22
00:01:05,160 --> 00:01:08,260
sinusoid actually looks like another
sinusoid.

23
00:01:10,430 --> 00:01:14,990
Remember how we do sinc sampling.
So we take a sinc function.

24
00:01:14,990 --> 00:01:18,980
We scale it by Ts, we shift it by n times
Ts.

25
00:01:18,980 --> 00:01:23,330
And we take the inner product with x of t
to get the sample, xn.

26
00:01:23,330 --> 00:01:28,180
This can be written as the convolution
between sinc Ts.

27
00:01:28,180 --> 00:01:32,940
So we denote scaling of the sinc function
by Ts at location nTs.

28
00:01:32,940 --> 00:01:35,470
In a block diagram we take

29
00:01:35,470 --> 00:01:41,400
x of T, we go through a low pass filter,
an ideal low pass filter of bandwidth

30
00:01:41,400 --> 00:01:47,625
omega N, and we take samples every Ts
seconds to derive a sequence xn.

31
00:01:51,830 --> 00:01:54,350
Raw sampling is when we don't care about

32
00:01:54,350 --> 00:01:56,950
first taking the inner product with the
sinc function.

33
00:01:56,950 --> 00:01:58,930
So we just take xt.

34
00:01:58,930 --> 00:02:02,910
And every Ts seconds we take a sample xn.

35
00:02:05,150 --> 00:02:07,800
So you must remember the wagonwheel
effect.

36
00:02:07,800 --> 00:02:12,190
We had seen simulated movie how a wheel
could go backwards,

37
00:02:12,190 --> 00:02:15,600
if we were not careful about having a high
sampling rate.

38
00:02:17,580 --> 00:02:20,250
The complex exponential is a familiar
character.

39
00:02:20,250 --> 00:02:25,470
Now we look at the continuous time complex
exponential, xt is e to the j.

40
00:02:25,470 --> 00:02:27,510
Capital omega naught times t.

41
00:02:27,510 --> 00:02:30,600
It's always periodic, it has a period 2 pi
over

42
00:02:30,600 --> 00:02:31,405
capital omega.

43
00:02:31,405 --> 00:02:36,610
Note all angle speeds are allowed, so
fourier transform of this complex

44
00:02:36,610 --> 00:02:42,380
exponential is a delta, that is seated at
omega is equal to omega naught.

45
00:02:42,380 --> 00:02:44,730
It is obviously band-limited to omega
naught.

46
00:02:47,550 --> 00:02:51,770
If we look at this continuous time complex
exponential on the unit

47
00:02:51,770 --> 00:02:56,290
circle, then it is a phaser that runs
around the unit circle.

48
00:02:58,820 --> 00:03:03,893
If we take samples of this continuous time
complex exponential, so

49
00:03:03,893 --> 00:03:07,380
xn is e to the j, on omega naught, Ts
times n.

50
00:03:07,380 --> 00:03:11,830
Then they're all samples or snapshots at
regular intervals of this rotating point.

51
00:03:11,830 --> 00:03:15,402
So resulting digital frequency is small
omega naught,

52
00:03:15,402 --> 00:03:18,080
which is equal to omega naught times Ts.

53
00:03:18,080 --> 00:03:18,290
Okay.

54
00:03:18,290 --> 00:03:22,910
So please note the difference between
small omega and capital omega.

55
00:03:25,870 --> 00:03:32,080
When Ts is smaller than pi over capital
omega 0, or small omega 0 is smaller than

56
00:03:32,080 --> 00:03:37,159
pi, then the phaser will advance in small
steps as we can see here on this figure.

57
00:03:39,760 --> 00:03:45,190
When Ts is become pi omega 0 and 2 pi
omega 0, that is

58
00:03:45,190 --> 00:03:51,400
small omega 0 is between pi and 2 pi, then
the phaser advances in big steps.

59
00:03:51,400 --> 00:03:53,890
However this looks as if it were going in

60
00:03:53,890 --> 00:03:57,160
a negative direction, as you can see here,
it steps

61
00:03:57,160 --> 00:04:00,230
in small steps, and it looks like it's
going

62
00:04:00,230 --> 00:04:02,978
in the opposite directions than what it is
actually going.

63
00:04:02,978 --> 00:04:04,958
Finally, when Ts

64
00:04:04,958 --> 00:04:10,898
is bigger than 2 pi over omega naught, or
small omega

65
00:04:10,898 --> 00:04:16,442
naught is bigger than 2 pi, than again we
think it

66
00:04:16,442 --> 00:04:22,550
goes in the positive direction.
But it does actually don't full circle.

67
00:04:22,550 --> 00:04:23,950
Plus the little step.

68
00:04:23,950 --> 00:04:28,670
So we see that is large frequency looks
actually like a small frequency.

69
00:04:28,670 --> 00:04:30,010
Okay, we see x1,

70
00:04:30,010 --> 00:04:35,660
x2, x3, x4 and so on, as if it were going
in small steps.

71
00:04:35,660 --> 00:04:39,120
And so this large frequency actually
mimics like a

72
00:04:39,120 --> 00:04:42,491
small frequency, and that's a phenomenon
we call aliasing.

73
00:04:45,140 --> 00:04:47,600
Let's look what happens when we
reconstruct or

74
00:04:47,600 --> 00:04:51,500
interpolate based on the samples we have
just seen.

75
00:04:51,500 --> 00:04:54,057
Let's look at this in a blog diagram.

76
00:04:54,057 --> 00:04:57,670
So we have x of t.
We sample with a sampling period Ts.

77
00:04:57,670 --> 00:05:00,820
Then we interpolate again with a spacing
of Ts.

78
00:05:00,820 --> 00:05:02,680
And we get x-hat of t.

79
00:05:02,680 --> 00:05:06,340
What is x-hat of t, with respect to x of
t?

80
00:05:06,340 --> 00:05:10,640
Now let's look at the output, x-hat of t,
and what frequency

81
00:05:10,640 --> 00:05:14,620
will be reproduced.
So the first case is easy.

82
00:05:14,620 --> 00:05:19,920
That's when the sampling period Ts is more
than pi over omega naught.

83
00:05:19,920 --> 00:05:20,440
Why?

84
00:05:20,440 --> 00:05:23,140
Because we are meeting the sampling
theorem and so the

85
00:05:23,140 --> 00:05:26,900
same frequency that went in should
actually also come out.

86
00:05:26,900 --> 00:05:30,465
So the digital frequency in this case,
digital frequency small omega

87
00:05:30,465 --> 00:05:35,910
naught is between 0 and pi and the output
is indeed

88
00:05:35,910 --> 00:05:40,912
what went in, e to the j omega naught t.
The second case is

89
00:05:40,912 --> 00:05:46,204
when Ts is in intermediate range, so
between

90
00:05:46,204 --> 00:05:51,910
pi over omega naught and 2-pi or omega
naught.

91
00:05:51,910 --> 00:05:56,390
The additional frequency now is beyond pi
but smaller than 2-pi.

92
00:05:56,390 --> 00:06:01,380
So we see this in this formula here.
And then the output.

93
00:06:01,380 --> 00:06:03,620
We'll have a different frequency than the
input.

94
00:06:03,620 --> 00:06:11,380
Then if we can see omega one, which is
equal to omega naught minus 2-pi over Ts.

95
00:06:11,380 --> 00:06:11,850
Okay.

96
00:06:11,850 --> 00:06:14,330
So there's alrea, already aliasing
happening.

97
00:06:15,370 --> 00:06:18,280
Because you have this shift in frequency
here that

98
00:06:18,280 --> 00:06:23,600
transforms the original omega naught into
the output omega one.

99
00:06:23,600 --> 00:06:26,500
Finally, the red case, the third

100
00:06:26,500 --> 00:06:28,870
one here when Ts is bigger than 2 pi over

101
00:06:28,870 --> 00:06:33,830
omega naught, then the digital frequency
would be beyond 2pi.

102
00:06:33,830 --> 00:06:37,830
Okay, now you know that frequencies are
between 0 and 2 pi, so that doesn't really

103
00:06:37,830 --> 00:06:39,590
have a meaning except that they chose that

104
00:06:39,590 --> 00:06:42,700
this frequency will be folded back through
aliasing.

105
00:06:42,700 --> 00:06:46,685
And it results in an output here, e to the
j omega

106
00:06:46,685 --> 00:06:51,730
2t where omega 2 is simply omega naught
now taken module 2

107
00:06:51,730 --> 00:06:54,410
pi over Ts.
Okay.

108
00:06:54,410 --> 00:06:58,490
And this is definitely a different
frequency than what went in.

109
00:06:58,490 --> 00:07:02,560
This point is so important that we are
going to go through it one more time.

110
00:07:02,560 --> 00:07:06,040
Now, with a sinusoid, and using
frequencies in hertz.

111
00:07:06,040 --> 00:07:09,490
Remember that we usually take frequencies
in radiance.

112
00:07:09,490 --> 00:07:14,010
So frequency in radiance is simply
frequency in hertz times 2 pi.

113
00:07:14,010 --> 00:07:16,785
Our signal, xt, is cosine of

114
00:07:16,785 --> 00:07:20,810
2 pi F0 of t.
So, F0 is a frequency in hertz.

115
00:07:20,810 --> 00:07:24,690
The samples xn are simply x at multiples
of Ts.

116
00:07:24,690 --> 00:07:27,470
So that's cos of omega 0 n.

117
00:07:27,470 --> 00:07:29,775
Omega 0 is 2 pi.

118
00:07:29,775 --> 00:07:34,080
F0 over Fs, where Fs is simply 1 over the
sampling period.

119
00:07:34,080 --> 00:07:36,960
Okay, we often go back between frequencies

120
00:07:36,960 --> 00:07:40,120
and sampling periods and hertzes and
radians.

121
00:07:40,120 --> 00:07:41,860
So, you have to be used to jump

122
00:07:41,860 --> 00:07:43,690
back and forth with these notions.

123
00:07:46,470 --> 00:07:48,600
Now we are going to sample the sinusoid.

124
00:07:48,600 --> 00:07:51,858
When the sampling frequency Fs is bigger
than

125
00:07:51,858 --> 00:07:54,930
2F0, so F0 is the maximum frequency, we're

126
00:07:54,930 --> 00:07:57,510
on a sinusoid, so that's a good case

127
00:07:57,510 --> 00:08:01,160
when we sample twice above the Nyquist
frequency.

128
00:08:01,160 --> 00:08:04,190
Then the digital frequency omega naught is
between 0 and pi.

129
00:08:04,190 --> 00:08:05,180
Everything is okay.

130
00:08:05,180 --> 00:08:10,800
When Fs is exactly equal to 2F0, then
omega naught is equal to pi.

131
00:08:10,800 --> 00:08:12,000
And the signal xn

132
00:08:12,000 --> 00:08:13,650
is simply minus 1 to the n.

133
00:08:13,650 --> 00:08:17,330
And so that's a maximal digital frequency
that we're going to see.

134
00:08:17,330 --> 00:08:21,620
Then when Fs is between F0 and 2F0, so it
is

135
00:08:21,620 --> 00:08:27,000
sub Nyquist sampling, then omega 0 is
between pi and 2pi.

136
00:08:27,000 --> 00:08:31,998
And we actually see a negative frequency
corresponding to pi over omega 0.

137
00:08:31,998 --> 00:08:37,398
Finally, when Fs is smaller than F0, which
amounts to omega 0 being bigger than 2pi,

138
00:08:37,398 --> 00:08:39,360
then we have full aliasing.

139
00:08:39,360 --> 00:08:46,230
So the digital frequency is simply omega 0
mod 2pi, and this can be a much different

140
00:08:46,230 --> 00:08:49,780
frequency from the input frequency of the
sinusoid, as we shall see.

141
00:08:52,430 --> 00:08:57,700
Let us see this sampling in action, namely
on cosine 6 pi of t.

142
00:08:57,700 --> 00:09:04,760
So, F0 is 3Hz, the correct sampling
frequency Fs has to be 6Hz or higher.

143
00:09:04,760 --> 00:09:07,724
So lets' start with Fs 100Hz, so that's

144
00:09:07,724 --> 00:09:11,255
highly oversampled, you can see the red
dots.

145
00:09:11,255 --> 00:09:15,160
Are very close approximation to the
continuous time function.

146
00:09:15,160 --> 00:09:16,890
Take Fs 50Hz.

147
00:09:16,890 --> 00:09:17,670
That's still much

148
00:09:17,670 --> 00:09:23,940
bigger than the, limit frequency 6Hz.
So, still a very good approximation.

149
00:09:23,940 --> 00:09:25,450
Fs10Hz.

150
00:09:25,450 --> 00:09:30,210
This is still on the right side of the
Nyquist sampling.

151
00:09:30,210 --> 00:09:32,770
And we still see the sinusoid, but it
starts

152
00:09:32,770 --> 00:09:35,450
to be quite a sparse sampling of the
sinusoid.

153
00:09:35,450 --> 00:09:37,890
F 6Hz is exactly the limit.

154
00:09:37,890 --> 00:09:42,804
So the samples alternate between plus 1
and minus 1, which is the maximum

155
00:09:42,804 --> 00:09:46,650
digital frequency.
Fs 2.9Hz.

156
00:09:46,650 --> 00:09:51,270
Now we are actually below F0 and clearly
writing into F aliasing.

157
00:09:51,270 --> 00:09:54,060
And we can see we have a few points here.

158
00:09:54,060 --> 00:09:58,480
But it doesn't really look like it's
adequate representation of the sine wave.

159
00:09:58,480 --> 00:10:03,450
So we rescale, we take an interval of 2,
instead of the interval of 1 from before.

160
00:10:03,450 --> 00:10:07,970
We still see that these points you know,
do not give a good

161
00:10:07,970 --> 00:10:11,474
impression of the sine wave.
So let's extend to an

162
00:10:11,474 --> 00:10:15,430
interval of 4, to an interval of 10.
And now we see

163
00:10:15,430 --> 00:10:19,770
a sinusoid appearing.
But this sinusoid actually has a frequency

164
00:10:19,770 --> 00:10:26,242
of 0.1Hz, as you can see.
It has a full cycle here between 0 and 10,

165
00:10:26,242 --> 00:10:33,560
and because of aliasing, so the resulting
frequency is actually 2.9Hz modulo 3Hz.

166
00:10:33,560 --> 00:10:39,310
And that is minus 0.1Hz, or because it is
symmetric

167
00:10:39,310 --> 00:10:44,780
it is equal to a frequency of 0.1Hz.
So it's a totally aliased version

168
00:10:44,780 --> 00:10:50,500
of the initial cosine function that we
had, and we see another cosine

169
00:10:50,500 --> 00:10:55,030
which happens to be of 0.1Hz rather than
of 3Hz.

170
00:10:55,030 --> 00:10:59,480
So that's the phenomenon of aliasing, very
nicely graphically shown here.

