1
00:00:09,820 --> 00:00:17,279
This is VLSI data conversion circuits, lecture
10. In the last class, what we saw was
2
00:00:17,279 --> 00:00:28,400
various realisations of sample and hold circuits
suitable for continuous time and discrete
3
00:00:28,400 --> 00:00:36,640
time inputs. And we saw the variation issues
involved like distortion or we saw how
4
00:00:36,640 --> 00:00:42,650
these can be fixed. But no real circuit solution
will work you know up to the full degree
5
00:00:42,650 --> 00:00:49,739
that you expect. We attempted to linearise
the sampling switch by keeping the gate
6
00:00:49,739 --> 00:00:56,559
overdrive fixed and independent of the signal.
And if the gate over drive was truly
7
00:00:56,559 --> 00:01:02,280
independent of the signal then perhaps this
switch would be perfectly linear. But in
8
00:01:02,280 --> 00:01:09,860
practice there is the body effect there is
also some amount of charge sharing between
9
00:01:09,860 --> 00:01:15,110
the
boost capacitor as well as the gate of the
10
00:01:15,110 --> 00:01:19,790
sampling switch. For example, what we said
that we charged a capacitor to voltage V d
11
00:01:19,790 --> 00:01:27,350
d and hooked that up in between the source
and the gate of the sampling switch transistor.
12
00:01:27,350 --> 00:01:31,729
Obviously, the gate of the sampling switch
transistor need some charge in order to be
13
00:01:31,729 --> 00:01:40,509
able to sustain a potential that charge must
be coming from the boost switch. So, coming
14
00:01:40,509 --> 00:01:46,340
from the, I am sorry the boost capacitor.
So, every time you charge the capacitor to
15
00:01:46,340 --> 00:01:47,340
V d d
16
00:01:47,340 --> 00:01:53,649
in pi 1 or phi 2 I do not remember which pair.
And you hook it in between the gate and
17
00:01:53,649 --> 00:02:02,450
the source there will be some charge lost.
So, all these second order effects lead to
18
00:02:02,450 --> 00:02:04,780
some
small dependence of the resistance of the
19
00:02:04,780 --> 00:02:08,280
switch on the input signal. So, they will
indeed
20
00:02:08,280 --> 00:02:14,780
cause distortion this distortion may be very
small. But they will indeed cause distortion
21
00:02:14,780 --> 00:02:20,329
and so will the body effect. So, as soon as
you designed a circuit like this the first
22
00:02:20,329 --> 00:02:24,769
thing
that you would like to find it out is how
23
00:02:24,769 --> 00:02:30,100
good is my sample. So, where for example,
the
24
00:02:30,100 --> 00:02:36,720
input here is continuous time. And what we
are interested in is not the wave form across
25
00:02:36,720 --> 00:02:44,000
the capacitor all instance of time.
We are only interested in the samples of the
26
00:02:44,000 --> 00:02:49,070
voltage across the capacitor at the end of
the
27
00:02:49,070 --> 00:02:56,140
sampling cycle. Or at during the hold phase
technically speaking the value that is going
28
00:02:56,140 --> 00:03:02,730
to be processed eventually is the held value
on the capacitor. So, what we are interested
29
00:03:02,730 --> 00:03:06,510
in is the.
Distortion.
30
00:03:06,510 --> 00:03:12,540
Distortion or we are interested in the properties
of the sequence of voltages which are on
31
00:03:12,540 --> 00:03:27,470
the hold capacitor. So, in other words let
us say we have a continuous time input signal.
32
00:03:27,470 --> 00:03:36,109
And we pass this through our sample and hold
system or track and hold system the
33
00:03:36,109 --> 00:03:47,250
output of interest is the sampled sequence
x of N. And traditionally we have been used
34
00:03:47,250 --> 00:03:50,560
to
analysing nonlinearity of systems or testing
35
00:03:50,560 --> 00:03:56,290
nonlinearity of systems using what is with
called the sine wave test. The idea is to
36
00:03:56,290 --> 00:04:01,750
put in a pure sinusoid into a system if the
system
37
00:04:01,750 --> 00:04:10,410
is a linear system we know that the output
must only contain components at the input
38
00:04:10,410 --> 00:04:14,840
frequency. If you are talking about a continuous
time system when the movement
39
00:04:14,840 --> 00:04:20,030
harmonic start showing up in the output you
can say that definitely this system is not
40
00:04:20,030 --> 00:04:28,560
linear. So, a degree of, how linear the system
is; how small these harmonic components
41
00:04:28,560 --> 00:04:33,700
are in relation to the fundamental component
that you put in?
42
00:04:33,700 --> 00:04:39,230
So, since we have been used to this way of
testing continuous time systems for a long
43
00:04:39,230 --> 00:04:46,060
time. It makes sense to see if you can do
a similar sort of thing with a sample and
44
00:04:46,060 --> 00:04:48,160
hold
where the input is continuous time, but the
45
00:04:48,160 --> 00:04:54,980
output is discrete time. So, before we get
into
46
00:04:54,980 --> 00:05:02,750
the specifics a couple of points that I would
like to point out is if we have a continuous
47
00:05:02,750 --> 00:05:10,970
time sinusoid and we sample it at a rate f
s. Then the sequence you get will be of the
48
00:05:10,970 --> 00:05:24,980
form cos 2 pi f N times N by f s. So, this
is the let us say this is the output of the
49
00:05:24,980 --> 00:05:31,370
sample
and hold provided it is ideal. Now, this is
50
00:05:31,370 --> 00:05:38,360
a discrete time sinusoid, as we know not all
51
00:05:38,360 --> 00:05:44,780
discrete time sinusoids are periodic correct.
So, what constraints must be satisfied by
52
00:05:44,780 --> 00:05:49,670
f N
and f s? To ensure that the discrete time
53
00:05:49,670 --> 00:05:52,730
sequence is periodic first of all when now,
we
54
00:05:52,730 --> 00:05:55,900
will figure that out. But first of all why
are we instructed in making the discrete time
55
00:05:55,900 --> 00:06:02,250
sinusoid periodic.
To analyse the analyze that.
56
00:06:02,250 --> 00:06:06,760
Right basically what we have been used to
is in the domain of continuous time systems.
57
00:06:06,760 --> 00:06:12,630
We look at the output of the system we decompose
it into a Fourier series and measure
58
00:06:12,630 --> 00:06:15,510
the strength of the second harmonic component.
And third harmonic component which
59
00:06:15,510 --> 00:06:19,950
are basically saying I will compute the Fourier
series of the continuous time output and
60
00:06:19,950 --> 00:06:26,311
look at coefficients of the harmonics which
are basically terms in the Fourier series.
61
00:06:26,311 --> 00:06:29,460
So,
we would like to attempt an analogous situation
62
00:06:29,460 --> 00:06:37,510
here which is you compute the Fourier
series of the output which here happens to
63
00:06:37,510 --> 00:06:39,080
be.
Discrete.
64
00:06:39,080 --> 00:06:48,480
Discrete time and if you want to compute a
Fourier series it only make sense if the
65
00:06:48,480 --> 00:06:51,490
periodic sequences, sequences periodic. So,
that is where we start off and we have
66
00:06:51,490 --> 00:06:59,020
wondering now whether this sample sequence
is periodic. And by definition what is the
67
00:06:59,020 --> 00:07:07,810
periodic signal? It must be identical to something
which has been shifted by N samples.
68
00:07:07,810 --> 00:07:13,940
Because the sequence is discrete time which
means that if this sequence has to be
69
00:07:13,940 --> 00:07:27,300
periodic cos of 2 pi f N times small N by
f s must be exactly equal to cos 2 pi f N
70
00:07:27,300 --> 00:07:36,540
times
N plus capital N by f s where the large case
71
00:07:36,540 --> 00:07:44,650
N denotes the period of the discrete time
sequence.
72
00:07:44,650 --> 00:08:27,460
Now, what this means is that this is simply
.
73
00:08:27,460 --> 00:08:34,519
And what this is
telling you is that if one is interested in
74
00:08:34,519 --> 00:08:39,089
making the discrete time sequence periodic
then
75
00:08:39,089 --> 00:08:45,500
this factor 2 pi times f N by f s time’s
capital N.
76
00:08:45,500 --> 00:08:49,210
Integer minus
Must be m integer multiple of.
77
00:08:49,210 --> 00:08:55,550
2 pi.
2 pi. So, in other words 2 pi times f in by
78
00:08:55,550 --> 00:09:22,760
f s times N must be 2 pi times m where m must
be an integer which means that f N by f s
79
00:09:22,760 --> 00:09:34,960
must be of the form m by N. So, the moral
of
80
00:09:34,960 --> 00:09:42,710
the story is that if you want that discrete
time output to be periodic with a period of
81
00:09:42,710 --> 00:09:47,690
N
samples. Then you just cannot choose any old
82
00:09:47,690 --> 00:09:52,800
frequency for the continuous time input it
must be related to the sampling rate in some
83
00:09:52,800 --> 00:10:00,450
way. And that way is that the ratio of the
input frequency to the sampling frequency
84
00:10:00,450 --> 00:10:08,510
must be of the form m by N where m is the
m
85
00:10:08,510 --> 00:10:10,540
and N are integers.
86
00:10:10,540 --> 00:10:17,240
So, this is the first thing that 1 has to
bear in mind. Now, suppose we choose f in
87
00:10:17,240 --> 00:10:22,870
this way
in other words if we choose f in to be m by
88
00:10:22,870 --> 00:10:28,750
N time’s f s. Then the resulting sequence
is
89
00:10:28,750 --> 00:10:36,149
periodic by if the choice of f in and the
period is N samples. Now, what we have at
90
00:10:36,149 --> 00:10:40,360
hand
is a periodic signal with the period of N
91
00:10:40,360 --> 00:10:46,290
samples and this can be decomposed into a.
Discrete time.
92
00:10:46,290 --> 00:10:51,430
Discrete time, Fourier series; this is very
analogous to the continuous time Fourier series
93
00:10:51,430 --> 00:11:00,810
that you probably more familiar with. So,
x of N can be expressed as the sum of many
94
00:11:00,810 --> 00:11:06,589
sinusoids in the continuous time case how
many sinusoids would be necessary to.
95
00:11:06,589 --> 00:11:10,580
2.10 point.
Express an arbitrary continuous time signal
96
00:11:10,580 --> 00:11:16,490
infinite number of Fourier coefficients would
be needed; however, in discrete time you need
97
00:11:16,490 --> 00:11:26,050
exactly N sinusoids. And the usual thing
we write them as sum of complex exponentials
98
00:11:26,050 --> 00:11:32,500
with the understanding that the
coefficients for a real signal will be you
99
00:11:32,500 --> 00:11:35,120
know the magnitude will be even and phase
will
100
00:11:35,120 --> 00:11:41,500
be odd. So, that when you add them up the
imaginary terms go away I am sure you all
101
00:11:41,500 --> 00:11:48,250
familiar with this from your d s p classes.
So, in general therefore, this must be the
102
00:11:48,250 --> 00:12:01,361
sum
of k sinusoids each with a frequency of what
103
00:12:01,361 --> 00:12:03,550
is the fundamental frequency.
2 pi by N 2 pi by N.
104
00:12:03,550 --> 00:12:11,430
The fundamental frequency of this decomposition
will be 2 pi by.
105
00:12:11,430 --> 00:12:18,800
N
N and its harmonics. So, the harmonics will
106
00:12:18,800 --> 00:12:24,180
be multiples by 2 pi n. So, there will be
k
107
00:12:24,180 --> 00:12:31,810
and you have the sequence index which is N
and k must run from.
108
00:12:31,810 --> 00:12:36,810
0 to 0 to N minus 1.
0 to.
109
00:12:36,810 --> 00:12:44,600
N minus 1.
N minus 1 very nice all. So, I will now introduce
110
00:12:44,600 --> 00:12:52,180
to you to some jargon, you might have
already heard this N is often referred to
111
00:12:52,180 --> 00:12:57,740
as important. No is what is it called it is
often
112
00:12:57,740 --> 00:13:02,149
chosen to be a power of 2 I will mean, we
will come to the reasons behind that little
113
00:13:02,149 --> 00:13:05,740
later
on. But have you heard of any I mean what
114
00:13:05,740 --> 00:13:16,390
do you call n? No I mean it is a. So, in the
data convertor power lines this is often called
115
00:13:16,390 --> 00:13:27,160
the record length. It is merely the period
of
116
00:13:27,160 --> 00:13:45,420
the discrete time sequence that you are analysed
all and this each of these frequencies 2
117
00:13:45,420 --> 00:13:53,800
pi by N times k. So, this will be 2 pi by
N twice 2 pi by N all the way up to 2 times
118
00:13:53,800 --> 00:13:57,610
by N
times N minus N. And these are what are called
119
00:13:57,610 --> 00:14:20,350
frequency bins all. So, what do you
think each spacing of the bin corresponds
120
00:14:20,350 --> 00:14:28,380
to in continuous time? This is all the way
from
121
00:14:28,380 --> 00:14:34,790
either 0 to f s or f s by 2 to minus f s by
2 to.
122
00:14:34,790 --> 00:14:39,740
F s.
F s by 2. And there are how many bins are
123
00:14:39,740 --> 00:14:40,740
there?
N.
124
00:14:40,740 --> 00:14:48,850
N bins so the resolution of the equivalent
continuous time signal frequency resolution
125
00:14:48,850 --> 00:14:56,990
wise is f s by n. So, often this is called
the bin width f s by N is the width of the
126
00:14:56,990 --> 00:15:11,060
bin all.
So, this is just simply jargon the discrete
127
00:15:11,060 --> 00:15:18,209
time Fourier series need not concern itself
at all
128
00:15:18,209 --> 00:15:24,209
with sampling rate. You just have a sequence;
you are perfectly free to compute this
129
00:15:24,209 --> 00:15:30,180
discrete Fourier series, what why we bring
in sampling rate is because we understand
130
00:15:30,180 --> 00:15:34,790
that the sequence has come by sampling.
.
131
00:15:34,790 --> 00:15:40,329
A continuous time signal at a sampling rate
f s which is why f s you know f s by N all
132
00:15:40,329 --> 00:15:53,560
this stuff makes sense for us you understand.
Now, if the input sequence is periodic and
133
00:15:53,560 --> 00:15:57,290
in other words if it is been derived from
a continuous time signal where the input
134
00:15:57,290 --> 00:16:01,420
frequency. And the sampling frequency have
been chosen in such a manner as to make x
135
00:16:01,420 --> 00:16:09,120
of N periodic. And if the input happen to
be a sine wave then when you compute the
136
00:16:09,120 --> 00:16:14,080
Fourier series, how many coefficients do you
think one will be non zero.
137
00:16:14,080 --> 00:16:18,680
Only one of the.
Pardon.
138
00:16:18,680 --> 00:16:28,070
Sir I think 2.
You understand the question.
139
00:16:28,070 --> 00:16:41,070
So, let us say I chose a times cos of 2 pi
and f in happen to be say some m by N times
140
00:16:41,070 --> 00:16:52,240
f s.
And this is sampled at the rate f s the resulting
141
00:16:52,240 --> 00:17:09,070
sequence therefore, is a cos 2 pi m by N
times N correct. So, if I now compute the
142
00:17:09,070 --> 00:17:18,569
discrete Fourier series of this sequence which
we all agree is periodic what would I get?
143
00:17:18,569 --> 00:17:20,790
2.
I will get.
144
00:17:20,790 --> 00:17:31,679
2 divided by 2 non 0 coefficients 1 corresponding
to the n-th bin correct. And one
145
00:17:31,679 --> 00:17:37,929
corresponding to the minus m-th bin I mean
the, you can understand the bins are being
146
00:17:37,929 --> 00:17:49,450
either going from 0 to N minus 1 and with
a understanding that after N by 2 there will
147
00:17:49,450 --> 00:17:55,210
be
correspond to mirror. There will be a mirror
148
00:17:55,210 --> 00:18:01,539
image of the components below N by 2
correct this is a consequence of the real
149
00:18:01,539 --> 00:18:04,360
nature of the signal that we are decomposing
into
150
00:18:04,360 --> 00:18:14,340
a Fourier series this is clear all. So, if
I if I plot these coefficients on a log scale
151
00:18:14,340 --> 00:18:18,870
typically
you plot these on a log scale. Because you
152
00:18:18,870 --> 00:18:21,769
are hoping that the circuits that you design
the
153
00:18:21,769 --> 00:18:24,570
second harmonic and third harmonic will be.
Small.
154
00:18:24,570 --> 00:18:29,590
Very very small compared to the fundamental.
So, that it does not make sense to plot
155
00:18:29,590 --> 00:18:38,440
them on a linear scale it makes sense to plot
them on a log scale. So, if you plot the
156
00:18:38,440 --> 00:18:45,159
discrete Fourier series coefficients on a
log scale with the index running from 0 to
157
00:18:45,159 --> 00:18:48,740
N
minus 1 you will see or you expect to see
158
00:18:48,740 --> 00:19:07,549
2 spikes 1 at m and 1 at N minus. So, this
is
159
00:19:07,549 --> 00:19:26,350
sorry I am not a very good artist. So, on
somewhere here. So, this must be N minus 1
160
00:19:26,350 --> 00:19:34,830
minus or N minus m.
N minus m.
161
00:19:34,830 --> 00:19:50,960
This is the axis of symmetry. So, apart from
the n-th bin all the other bins must
162
00:19:50,960 --> 00:20:03,999
technically be 0. So, if you plot them on
the log scale log of say modulus of the d
163
00:20:03,999 --> 00:20:11,140
f t you
will get.
164
00:20:11,140 --> 00:20:17,899
Minus infinity.
You must get minus infinity for all coefficients
165
00:20:17,899 --> 00:20:25,379
and only you know whatever you get this
log of you know it depends on the amplitude
166
00:20:25,379 --> 00:20:45,289
of the signal only that bin will be non zero.
So, I just let me show you an example.
167
00:20:45,289 --> 00:20:55,039
So, this is an example of a d f t that you
get I have taken a sinusoid that sinusoid
168
00:20:55,039 --> 00:21:00,619
happens
to be I have chosen in this example N to be
169
00:21:00,619 --> 00:21:13,200
1020 4 and f N by f s I have chosen to be
129
170
00:21:13,200 --> 00:21:26,820
by 1024. And sure enough the 120 ninth bin
shows a very large magnitude in relation to
171
00:21:26,820 --> 00:21:32,929
all the strengths of the signals in all the
other bins this is the log scale. So, this
172
00:21:32,929 --> 00:21:40,059
is the log
of the
173
00:21:40,059 --> 00:21:49,059
magnitudes of the Fourier coefficients as
I run index from 0 to 10 2 4. What is this
174
00:21:49,059 --> 00:21:57,379
telling you the difference between the input
tone and all the other tones which must
175
00:21:57,379 --> 00:22:01,759
technically be what?
Sinusoidal.
176
00:22:01,759 --> 00:22:07,220
It must technically be infinite, why because
1 is log 0 which is minus infinity. But
177
00:22:07,220 --> 00:22:14,700
machine precision will limit the ratio that
you can get. And typically when you do this?
178
00:22:14,700 --> 00:22:23,149
You will find this actually 20 log mod A m.
So, this difference in d b is about 300 d
179
00:22:23,149 --> 00:22:25,700
b
that is what you are expect with a regular
180
00:22:25,700 --> 00:22:34,489
computer. You understand I mean there will
be
181
00:22:34,489 --> 00:22:40,639
quantization effects when you compute the
Fourier series coefficients. Because of finite
182
00:22:40,639 --> 00:22:53,409
precision effects and all this other stuff
and this is what you get hm. And as we expected
183
00:22:53,409 --> 00:23:13,129
1024 minus 129 will also show a spike since
the stuff about 512 is a mirror image
184
00:23:13,129 --> 00:23:18,590
of the
bins below 512 as far as magnitudes are concerned.
185
00:23:18,590 --> 00:23:26,179
We just need to worry about 1 half
of this of these coefficients is this clear
186
00:23:26,179 --> 00:23:29,980
all now that we understand this.
187
00:23:29,980 --> 00:23:38,539
Let us move forward and see what happens in
our sample and hold. What we saw last
188
00:23:38,539 --> 00:23:48,679
time was when the sampling switch is non-linear
you can model it as the input being
189
00:23:48,679 --> 00:23:55,590
distorted due to the second and third order
coefficients non-linear coefficients of the
190
00:23:55,590 --> 00:24:10,729
resistor. And then so, this is a nonlinearity
and then you have an ideal
191
00:24:10,729 --> 00:24:15,399
switch and a
capacitor that is that was the model that
192
00:24:15,399 --> 00:24:25,889
we arrived at for any switch where the switch
resistance depends on the input voltage. So,
193
00:24:25,889 --> 00:24:34,740
now, because this element is non-linear if
the input was a sinusoid what can you say
194
00:24:34,740 --> 00:24:39,039
about the components of the signal there.
Please note that that is still a continuous
195
00:24:39,039 --> 00:24:42,590
time signal. So, what do you think if this
was a f
196
00:24:42,590 --> 00:24:46,979
N what kind of frequency components do you
expect to find at the output of the nonlinear
197
00:24:46,979 --> 00:24:59,169
block? You will find multiples of f
N and even though f N may satisfy the nyquist
198
00:24:59,169 --> 00:25:06,529
criterion clearly it is just a matter of counting
high enough. You will find some harmonic
199
00:25:06,529 --> 00:25:18,669
which does not satisfy the nyquist criterion.
So, if this is f s soon enough you will find
200
00:25:18,669 --> 00:25:21,629
a
harmonic which does not satisfy the nyquist
201
00:25:21,629 --> 00:25:24,830
criterion. So, it will. So, when you sample
it
202
00:25:24,830 --> 00:25:29,539
at f s, what will happen? It will alias back.
203
00:25:29,539 --> 00:25:37,500
So, by looking at the discrete time sequence
one should be able to carefully analyse it
204
00:25:37,500 --> 00:25:46,859
and reconstruct what the continuous time signal
look like you understand. So, let me
205
00:25:46,859 --> 00:26:07,399
illustrate this with an example all how can
you guess what the input signal must have
206
00:26:07,399 --> 00:26:14,629
been? There are how many sinusoids are there?
333 sir.
207
00:26:14,629 --> 00:26:23,140
Sure enough because we have we discard half
of this picture there are 3 sinusoids. Good
208
00:26:23,140 --> 00:26:29,809
and reasonable assumption to make is that
the fundamental tone is much stronger in
209
00:26:29,809 --> 00:26:32,170
amplitude than.
The harmonics.
210
00:26:32,170 --> 00:26:35,830
The harmonics I mean if the harmonics are
bigger that the fundamental then you have
211
00:26:35,830 --> 00:26:44,419
big problem all. And let me also indicate
to you that this is in the d b scale. So,
212
00:26:44,419 --> 00:26:51,169
this is 20
log magnitude of the series Fourier series
213
00:26:51,169 --> 00:26:58,080
coefficient. So, clearly there are 3 tones
and if
214
00:26:58,080 --> 00:27:04,470
we say the biggest om4 is the fundamental.
This is the fundamental and it is roughly
215
00:27:04,470 --> 00:27:11,029
this
is again 129 by 1024 times f s because the
216
00:27:11,029 --> 00:27:22,479
peak happens to be at 129 bin. And I have
already told you that N is 1024. So, the second
217
00:27:22,479 --> 00:27:33,759
harmonic will lie where. So, as you can
see 129 by 1020 4 f s is basically means that
218
00:27:33,759 --> 00:27:44,849
input tone is roughly at f s by 10 correct.
So, the second harmonic will be at 2 f s by
219
00:27:44,849 --> 00:27:50,349
10. So, will that alias to lower frequency
or
220
00:27:50,349 --> 00:28:00,344
will
it be if the input frequencies are roughly
221
00:28:00,344 --> 00:28:03,440
f s by 10 the second harmonic is at what
frequency?
222
00:28:03,440 --> 00:28:08,629
F s by 5 f s by.
F s by 5 or 2 f s by 10. So, the question
223
00:28:08,629 --> 00:28:12,809
is does this component satisfy the nyquist
criterion.
224
00:28:12,809 --> 00:28:16,820
Yes it will satisfy the nyquist criterion.
Yes. So, and sure enough when you look at
225
00:28:16,820 --> 00:28:33,409
the spectrum this will be twice 129 by 1020
4 which is 258 by 1020 4 times f s. So, this
226
00:28:33,409 --> 00:28:39,840
will lie in the 258 bin correct what about
the
227
00:28:39,840 --> 00:28:47,200
third harmonic? Will it alias.
No yes.
228
00:28:47,200 --> 00:28:53,490
It is roughly the input tone is roughly f
s by 10 third harmonic is 3 f s by 10 which
229
00:28:53,490 --> 00:28:59,109
is less
than 5 f s by 10 5 f s by 10 is highest frequency
230
00:28:59,109 --> 00:29:10,979
beyond which things will alias back. So,
this is indeed the third harmonic and is 357
231
00:29:10,979 --> 00:29:22,850
f s by 1024 and the other half of the spectrum
is simply this mirrored about the centre correct.
232
00:29:22,850 --> 00:29:29,519
So, in other words if the frequency is
sufficiently small. Then the first few harmonics
233
00:29:29,519 --> 00:29:38,879
you know will be able to read them on a
graph like you normally are used to doing.
234
00:29:38,879 --> 00:29:43,869
Now, where do you think the fourth harmonic
of which will lie?
235
00:29:43,869 --> 00:29:54,279
4 into.
220 times 2 is what?
236
00:29:54,279 --> 00:29:59,440
516.
516 by 1024 times f s wherever it is alias
237
00:29:59,440 --> 00:30:02,399
or not.
No yes sir yes sir.
238
00:30:02,399 --> 00:30:10,350
It will alias and it will look like what.
1024 minus 0.1.
239
00:30:10,350 --> 00:30:24,289
So, it will look like 516 512. So, it will
look like 580 f s by N 24 all. So, in this
240
00:30:24,289 --> 00:30:26,200
example
since only second and third harmonics are
241
00:30:26,200 --> 00:30:31,929
considered we see that everything seems the
way we used to in a continuous time system.
242
00:30:31,929 --> 00:30:37,499
There is no none of this alias is happening
as you keep sweeping the frequency axis. You
243
00:30:37,499 --> 00:30:43,129
will find that you can go on for any
number of harmonics and there would be components.
244
00:30:43,129 --> 00:30:48,899
Now, because of sampling some
of these harmonics will fold back. And in
245
00:30:48,899 --> 00:30:54,909
this example there have been only second and
third harmonics and there is no aliasing of
246
00:30:54,909 --> 00:31:01,249
the harmonic components. Now, let us look
at
247
00:31:01,249 --> 00:31:13,769
another example
248
00:31:13,769 --> 00:31:26,249
this shows the log magnitude
of a discrete time sequence which is
249
00:31:26,249 --> 00:31:28,779
periodic, first of all.
250
00:31:28,779 --> 00:31:44,869
Let us try and identify the number of input
tones, how many input tones are there?
251
00:31:44,869 --> 00:31:51,639
6.
So, you discard 1 of the picture. So, how
252
00:31:51,639 --> 00:31:59,620
many tones are there? There are still 3 tones
like before all. And again let us assume that
253
00:31:59,620 --> 00:32:02,080
the fundamental is most dominant 1 which is
the fundamental.
254
00:32:02,080 --> 00:32:07,879
Around 250.
Around 250 its turn out to be actually turns
255
00:32:07,879 --> 00:32:24,710
out to be 247 by 1025 times f s all. Now,
what happens to be second harmonic?
256
00:32:24,710 --> 00:32:36,159
4494.
494. So, which is the third harmonic.
257
00:32:36,159 --> 00:32:41,479
494.
So, this is the.
258
00:32:41,479 --> 00:32:46,229
Second harmonic.
Second harmonic all. So, this is 490 4 by
259
00:32:46,229 --> 00:32:53,549
1024 times f s, what happens to the third
harmonic?
260
00:32:53,549 --> 00:32:58,820
That will alias.
It will alias back, because clearly third
261
00:32:58,820 --> 00:33:01,200
harmonic is too high in frequency roughly
the
262
00:33:01,200 --> 00:33:07,190
input is at 1 quarter the sampling rate. So,
the third harmonic is at 3 quarters the
263
00:33:07,190 --> 00:33:11,499
sampling rate which will after aliasing look
like.
264
00:33:11,499 --> 00:33:15,129
Quarter.
Roughly a quarter of the sampling rate. So,
265
00:33:15,129 --> 00:33:21,190
the third harmonic is actually this, you
understand? So, this is the second harmonic
266
00:33:21,190 --> 00:33:41,830
while this is the third harmonic. So, if there
are higher harmonics. Now, for example, where
267
00:33:41,830 --> 00:33:44,559
do you think the fourth harmonic will
be?
268
00:33:44,559 --> 00:33:50,809
Symmetric.
It will be I mean the input is roughly about
269
00:33:50,809 --> 00:33:58,009
quarter the sampling rate. So, the fourth
quadratic would be roughly the sampling rate
270
00:33:58,009 --> 00:34:03,970
a sampling rate I mean a signal at the
sampling rate will alias to. I mean clearly
271
00:34:03,970 --> 00:34:06,029
it does not satisfy nyquist it will alias
to
272
00:34:06,029 --> 00:34:11,790
roughly d c. So, the fourth harmonic actually
of this particular sinusoidal will probably
273
00:34:11,790 --> 00:34:31,580
lie somewhere somewhere here does make sense.
So, when you interpret the spectrum on
274
00:34:31,580 --> 00:34:38,440
the Fourier series decomposition of the periodic
output sequence of a sample and hold.
275
00:34:38,440 --> 00:34:49,179
Or going forward this is going to be quantized
also you need to be careful in looking at
276
00:34:49,179 --> 00:34:55,301
the spectrum. And figuring out which tone
is actually what you understand I mean if
277
00:34:55,301 --> 00:35:00,240
you
very naive and looked at this the spectrum
278
00:35:00,240 --> 00:35:05,390
I mean you would be very confused. I mean
279
00:35:05,390 --> 00:35:12,270
typically you expect the third harmonic to
be if at 3 times the fundamental. But you
280
00:35:12,270 --> 00:35:14,280
do
not see any of that happening you see some
281
00:35:14,280 --> 00:35:18,400
tone very close to the input.
And you could mistakenly conclude that there
282
00:35:18,400 --> 00:35:29,170
are actually you know 2 signals 1 which is
getting distorted by a second order distortion.
283
00:35:29,170 --> 00:35:36,000
And another tone which is close to the
input tone, but if you know that this came
284
00:35:36,000 --> 00:35:45,610
from a sample and hold. The tone which is
sitting you know next to the input tone is
285
00:35:45,610 --> 00:35:48,550
not really some rogue tone. But it is the
third
286
00:35:48,550 --> 00:35:58,200
harmonic distortion which is gotten aliased,
because of sampling you understand does
287
00:35:58,200 --> 00:36:08,110
make sense. So, while we have done this for
a sample and hold when we do nyquist
288
00:36:08,110 --> 00:36:13,430
convertors, you will find that the same principles
apply the only difference is that the
289
00:36:13,430 --> 00:36:20,770
sample signal is further quantised? And then
you take you decompose that quantized
290
00:36:20,770 --> 00:36:30,380
sequence into a discrete Fourier series. And
you know plot these harmonics plot the
291
00:36:30,380 --> 00:36:39,160
spectrum and you will see tone sticking out
at various parts of the spectrum. And it is
292
00:36:39,160 --> 00:36:42,360
for
you to sit and figure out which tone is coming
293
00:36:42,360 --> 00:36:56,810
from which harmonic all. The next thing I
want to point out is the following.
294
00:36:56,810 --> 00:37:11,250
Now, we all agree that f N by f s must be
chosen as a ratio m by N where m and N are
295
00:37:11,250 --> 00:37:20,280
integers a few of a few kind of said N must
be a multiple of. 2.2 or rather a power of
296
00:37:20,280 --> 00:37:27,830
2.
So, why should N be a power of 2? So, they
297
00:37:27,830 --> 00:37:39,110
are technically speaking there is nothing
illegal about decomposing any arbitrary sequence
298
00:37:39,110 --> 00:37:43,700
into its Fourier series components
here. So, turns out that if the length of
299
00:37:43,700 --> 00:37:49,920
the sequence is a multiple of is of the form
some 2
300
00:37:49,920 --> 00:37:56,820
power something. Then you know extremely efficient
fast algorithms can be I mean exist
301
00:37:56,820 --> 00:38:02,490
to compute these Fourier series coefficients
and that is called the fast Fourier transform.
302
00:38:02,490 --> 00:38:07,590
Or thee f f t all then of course, this made
a lot of sense in the old days where computing
303
00:38:07,590 --> 00:38:13,560
power was was restricted.
But for the kind of the stuff that we deal
304
00:38:13,560 --> 00:38:17,350
with at you know this may, you may as well
call
305
00:38:17,350 --> 00:38:23,150
this simply legacy. We just use to using a
2 power something for the for the f f t for
306
00:38:23,150 --> 00:38:26,360
the
record length and we continue to do. So, though
307
00:38:26,360 --> 00:38:32,120
there is no there is no earthly reason for
doing it I mean given our data complexity.
308
00:38:32,120 --> 00:38:39,760
I mean let us say 1024 point sequence or a
1020 point sequence will virtually take the
309
00:38:39,760 --> 00:38:47,320
same time when you run it on a computer
these days you understand. So, traditionally
310
00:38:47,320 --> 00:38:52,230
this is chosen to be a power of 2. So, let
me
311
00:38:52,230 --> 00:39:03,480
call this 2 to the power p and in our example
this happens to be 2 to the power 10. So,
312
00:39:03,480 --> 00:39:13,840
that 1024 point f f t or the record length
of the sequence is 1024. Now, if this happens
313
00:39:13,840 --> 00:39:17,150
to
be a power of 2 there are many ways of choosing
314
00:39:17,150 --> 00:39:27,450
an integer n. So, let us say you want to
test your sample and hold at; obviously, several
315
00:39:27,450 --> 00:39:29,531
input frequencies you just do not want to
put in d c.
316
00:39:29,531 --> 00:39:35,120
And make sure that the output is working out
you want to be able to sweep the input
317
00:39:35,120 --> 00:39:40,720
frequency over the entire range of operation.
Or expected operation of your sample and
318
00:39:40,720 --> 00:39:47,570
hold and make sure that the performance of
the circuits is good for wide range of
319
00:39:47,570 --> 00:39:55,260
frequencies. So, for example, let us say you
want to check your sample and hold at
320
00:39:55,260 --> 00:40:05,970
roughly f s by 4. So, what do you think is
a good choice for the input frequency? We
321
00:40:05,970 --> 00:40:19,320
know that this equality must be satisfied
and let us for argument sake say N is 1024.
322
00:40:19,320 --> 00:40:21,570
And
we want to test our sample and hold or the
323
00:40:21,570 --> 00:40:25,100
performance of the sample and hold needs to
be characterized at a frequency of say f s
324
00:40:25,100 --> 00:40:31,100
by 4. So, what suggestion I mean what is your
choice of m? This is the only thing to be
325
00:40:31,100 --> 00:40:37,230
determined for example, 1 choice could be
f N
326
00:40:37,230 --> 00:40:57,740
by f s is 256 by 1024 being sure enough. It
satisfies this constraint m is an integer
327
00:40:57,740 --> 00:41:02,660
N is an
integer. So, can you make any comment about
328
00:41:02,660 --> 00:41:12,210
this particular choice for example, 256 is
255 is 257 is all of them will result in an
329
00:41:12,210 --> 00:41:20,450
input frequency which is about f s by 4. Please
note that this constraint is only needed.
330
00:41:20,450 --> 00:41:22,950
So, that the resulting discrete time sequence
is.
331
00:41:22,950 --> 00:41:27,010
Periodic.
Periodic it is only a trick for characterisation
332
00:41:27,010 --> 00:41:32,460
it does not mean that the input will I mean
the sample and hold will not work. If this
333
00:41:32,460 --> 00:41:36,270
equality is not satisfied does make sense
and is
334
00:41:36,270 --> 00:41:43,610
as it turns out 256 or 255 or 251 or 257.
All these numbers for N seem like reasonable
335
00:41:43,610 --> 00:41:52,450
choices because they are all integers. So,
let me say I choose 256 as m. So, f N by f
336
00:41:52,450 --> 00:42:15,870
s is
256 by 1024, what do you think will happen
337
00:42:15,870 --> 00:42:23,310
you put I mean do you understand the
question. The input frequency is 256 by 1024
338
00:42:23,310 --> 00:42:28,700
times f s it has been passed through the
sample and the hold, because of nonlinearities
339
00:42:28,700 --> 00:42:33,730
in the sample and hold, what is
happening?
340
00:42:33,730 --> 00:42:35,860
Harmonics be.
Harmonics are being generated.
341
00:42:35,860 --> 00:42:40,590
So, let us take I mean. So, what harmonics
will be generated the second harmonic will
342
00:42:40,590 --> 00:42:43,980
be
at what frequency?
343
00:42:43,980 --> 00:42:54,260
512 by 1024 times f s the third harmonic will
be at.
344
00:42:54,260 --> 00:43:02,950
I mean which bin of the f f t will it fall
on?
345
00:43:02,950 --> 00:43:10,920
0.268 point.
768 is.
346
00:43:10,920 --> 00:43:12,920
first.
347
00:43:12,920 --> 00:43:14,860
Not first, why first?
Sampling.
348
00:43:14,860 --> 00:43:16,850
Alias.
Aliasing aliasing.
349
00:43:16,850 --> 00:43:21,860
It will alias. So, what frequency will it
to what bin will it alias?
350
00:43:21,860 --> 00:43:25,830
3 naught 6.
256 into 3 minus 512.
351
00:43:25,830 --> 00:43:38,620
226 256.
Correct. So, it will alias back to 256 by
352
00:43:38,620 --> 00:43:45,530
correct does make sense at all, what will
happen
353
00:43:45,530 --> 00:43:53,130
to the fourth harmonic?
It will go to the DC.
354
00:43:53,130 --> 00:44:05,620
It will go to the DC, fifth harmonic.
Yes sir, suppose 18.
355
00:44:05,620 --> 00:44:09,790
6 harmonic.
512 by.
356
00:44:09,790 --> 00:44:12,620
What about the seventh harmonic?
256.
357
00:44:12,620 --> 00:44:19,230
256. So, 357 etcetera were all alias to.
1 bin.
358
00:44:19,230 --> 00:44:27,880
1 bin, the same bin there will be some components
at d c which correspond to fourth the
359
00:44:27,880 --> 00:44:37,850
eighth and the twelfth harmonics and so on.
You understand, what is happening here?
360
00:44:37,850 --> 00:44:45,480
So, what is the moral of the story? So, the
question now, after we have gone through this
361
00:44:45,480 --> 00:44:53,470
discussion is 256 by 1024 are good choice
for the input frequency. If yes why if not
362
00:44:53,470 --> 00:44:54,470
why
not?
363
00:44:54,470 --> 00:45:01,690
Sir it is the sample length which is like
the same within a period if you are.
364
00:45:01,690 --> 00:45:09,630
No, can you know tie it to the discussion
we just had
365
00:45:09,630 --> 00:45:16,360
what did we just discuss if the input
tone was of the form 256 by 1024 times f s.
366
00:45:16,360 --> 00:45:29,780
Then we find that several of the harmonics
are aliasing on to in this particular case
367
00:45:29,780 --> 00:45:33,720
the same bin and in this very particular case
all
368
00:45:33,720 --> 00:45:38,790
the odd harmonics 357 and so on are all aliasing
onto the same bin as the fundamental
369
00:45:38,790 --> 00:45:48,380
correct. Because 256 was where the fundamental
was the third harmonic is also aliasing
370
00:45:48,380 --> 00:45:55,840
onto to the 256 bin. The seventh is also aliasing
onto the 256 bin and so on.
371
00:45:55,840 --> 00:46:06,150
So, if you naively look at the spectrum, what
will you conclude? There is there will be
372
00:46:06,150 --> 00:46:10,010
something at d c corresponding to the fourth
and all this fourth eighth and so on. But
373
00:46:10,010 --> 00:46:11,510
you
do not you are just looking at the spectrum
374
00:46:11,510 --> 00:46:17,770
trying to infer what the sample and hold is
doing? And if I choose this particular input
375
00:46:17,770 --> 00:46:25,740
frequency it looks as if there is a d c offset
which I say hey d c offset is with me. Because
376
00:46:25,740 --> 00:46:33,910
I know it can be fixed in the system then
there is a tone at F s by 2 which corresponds
377
00:46:33,910 --> 00:46:45,210
to the second harmonic. But there seems to
be no other harmonics at all you understand
378
00:46:45,210 --> 00:46:51,380
if you simply look at the spectrum there will
be no other harmonics because all the harmonics
379
00:46:51,380 --> 00:46:53,720
have.
Alias drawn to.
380
00:46:53,720 --> 00:46:56,990
Same size bin.
The same bin and this particular case it is
381
00:46:56,990 --> 00:47:02,110
they have aliased on to the.
Same input.
382
00:47:02,110 --> 00:47:08,250
The fundamental bin itself there by wrongly
leading you to conclude that the
383
00:47:08,250 --> 00:47:14,640
performance of a sample and hold is a lot
better than it actually is you understand.
384
00:47:14,640 --> 00:47:19,050
And
we will also come to time a domain understanding
385
00:47:19,050 --> 00:47:23,860
of this. But in the frequency domain
we can see that if you make a poor choice
386
00:47:23,860 --> 00:47:33,350
of m several harmonics will alias onto the
same band or into the same bin there by making
387
00:47:33,350 --> 00:47:43,670
it very difficult to you to design various
harmonics. And sometimes also they can also
388
00:47:43,670 --> 00:47:48,400
if in this particular choice for this
particular choice of frequencies. For example,
389
00:47:48,400 --> 00:47:54,490
we see that all the harmonics odd
harmonics alias onto the bin where the fundamental
390
00:47:54,490 --> 00:47:57,070
lies. And then you look at the
391
00:47:57,070 --> 00:48:01,490
spectrum and say wow my sample and was working
great, because I do not see any odd
392
00:48:01,490 --> 00:48:09,700
harmonic distortion at all. So, you basically
fooling yourself by a clearly inappropriate
393
00:48:09,700 --> 00:48:17,310
choice of input frequency the sampling frequency
is fixed. So, the input frequency is 1
394
00:48:17,310 --> 00:48:26,240
that you have choice over and you chosen a
particularly bad value and why is this bad.
395
00:48:26,240 --> 00:48:32,720
If harmonics are there.
No, I mean harmonics are there that that they
396
00:48:32,720 --> 00:48:34,930
are being generated by the sample and hold
there is nothing you can do about it.
397
00:48:34,930 --> 00:48:40,440
We will not be able to we will not able to.
This is a bad choice of input frequency because
398
00:48:40,440 --> 00:48:46,360
several of the components. Harmonic
components are alias onto the.
399
00:48:46,360 --> 00:48:51,430
Same band.
Same band all I mean you could somehow magically
400
00:48:51,430 --> 00:49:00,120
come up with perhaps a sample and
hold somehow many harmonics alias onto the
401
00:49:00,120 --> 00:49:06,870
same bin. Because of a wrong choice of f
in and if by chance the magnitudes are same
402
00:49:06,870 --> 00:49:14,080
and the phase is exactly opposite. You know
they could cancel and then you say wow my
403
00:49:14,080 --> 00:49:22,020
sample and hold is fantastic. It is distortion
free you understand and that is clearly not
404
00:49:22,020 --> 00:49:32,350
correct you understand. So, what do you
think? We should enforce on of our choice
405
00:49:32,350 --> 00:49:36,070
on m not only the f in should be chosen in
a
406
00:49:36,070 --> 00:49:47,260
way that f in by f s is of the form m by N
that is necessary, but that is not sufficient.
407
00:49:47,260 --> 00:49:49,550
So,
in the frequency domain feature, what do you
408
00:49:49,550 --> 00:49:56,090
think we should do we should make sure
that whatever m we choose the harmonics must
409
00:49:56,090 --> 00:50:02,041
not be on there.
The harmonics should not fall on the.
410
00:50:02,041 --> 00:50:08,440
Same bin..
On the same bins, you understand I mean a
411
00:50:08,440 --> 00:50:15,460
case in point is being here for example, we
chose the input frequency to be 247 by 1024
412
00:50:15,460 --> 00:50:24,860
times f s. And note that this is the second
harmonic and this is the third harmonic if
413
00:50:24,860 --> 00:50:33,790
we are pushed this 247 to 256, what is
happening? This guy will move to f s by 2
414
00:50:33,790 --> 00:50:36,870
and the third harmonic will lie on.
256.
415
00:50:36,870 --> 00:50:43,330
256 making it impossible to figure out, what
is really happening in the sampling? So, the
416
00:50:43,330 --> 00:50:49,710
next time, we will look at what we need to
do to fix this problem. In other words it
417
00:50:49,710 --> 00:50:56,760
is just
boils down to choosing m in a way that.
418
00:50:56,760 --> 00:50:57,760
.
Harmonics.
419
00:50:57,760 --> 00:51:10,420
Do not alias back on to the same bins multiple
harmonics do not alias into the same bins.