Hey friends, welcome to the YouTube channel
ALL ABOUT ELECTRONICS. In this video, we will briefly learn about
the ADC and DAC. So, this ADC stands for the Analog to Digital
converter and as its name suggests it converts the analog signal into the digital signal. Similarly, this DAC stands for the Digital
to Analog Converter and it converts the digital input into the analog signal. And knowingly or unknowingly, we all are using
this ADC and DAC in our day to day life. For example, whenever we are streaming the
music on our smartphone then this digital bit stream is converted into the electrical
signal and through the smartphone speaker, we are able to hear this music. And here this DAC inside the smartphone converts
the digital bit stream into the analog signal. Similarly, while talking on the phone, the
microphone converts our voice into the electrical signal and using this ADC this signal is digitized
and it is transmitted in the form of radio waves. Similarly, at the receiver side, using the
DAC this received digital data is converted into the analog signal and through the speaker,
we are able to hear the voice of the other person. So, in short, in our day to day life, by some
or other way, we are using this ADC and the DAC. But then the question arises, why we are using
this ADC and the DAC. And what is the need of converting the signal
back and forth in this analog and the digital domain? So, let's find out the answer. Now, most of the signals which we find around
us are analog in nature. For example, the temperature, pressure, sound
or velocity, all signals are analog in nature. And using the transducer, this analog signal
is converted into the electrical signal. But still, these signals remain analog in
nature. Now, these analog signals are very susceptible
to the noise, particularly whenever they are used in the communication. Apart from that, it is very difficult to process
and store these analog signals. On the other end, the digital signals are
less susceptible to the noise and they are easy to process and store in the digital domain. And that is why the analog signals are converted
into the digital signal so that they can be easily processed and stored. And whenever it is required, then using the
DAC it is possible to retrieve these signals. But these conversions are not lossless. That means during the conversion, some information
of the analog signal will be lost. Because if you see the analog signal, then
it is continuous in time as well as in the amplitude. So, if this analog signal is varying in a
certain range, then it can take any value in the given range. For example, let's say, if this analog signal
is varying from 0 to 5V, then it can take any value between this 0 to 5V. Therefore, theoretically, we can say that
the analog signal has infinite resolution. But whenever this signal is converted into
the digital signal, then it is discrete in time as well as discrete in amplitude. So, understand that let's see the steps which
are involved in the analog to digital conversion. So, first of all, the analog signal is sampled
at a particular rate. And after the sampling, this signal is quantized
in the finite levels. And after the quantization, this signal is
encoded in the binary format. So, one by one, let's understand it in detail. And first of all, let's talk about the quantization. So, in this quantization process, a sampled
signal is assigned a particular value from the discrete set of values. So, as you can see here, the signal is quantized
in the 16 different levels and a sampled signal is assigned a nearest value form this 16 levels. And the resolution of the ADC decides, how
the assigned value or the quantized value is close to the actual value. So, usually, this resolution is defined in
the number of bits. And here, this bit refers to the number of
bits in which the quantized signal is going to get encoded. So, basically, this resolution defines the
minimum change in the input signal which can be detected by the ADC. So, for a given ADC, if the resolution is
n bits, then in a binary number system, the total number of discrete levels which can
be defined is equal to 2 to the power n. That means the input signal will get quantized
into 2 to the power n levels. So, for example, for a one ADC if the resolution
is 3 bits then the input signal will get quantized into 8 levels. And in terms of the voltage, this resolution
can be defined as the full-scale range of the ADC divided by the 2 to the power total
number of bits. Where the full-scale range is the maximum
voltage range which can be converted by the ADC. And sometimes, it is also defined as the Vref
divided by 2 to the power n. So, let's say, for a 3 bit ADC, the full-scale
range is 10V, then the resolution of the ADC, is equal to 10 divided by 2 to the power 3. That is equal to 1.25V.
That means the minimum change in the input which can be detected by the ADC is equal
to 1.25V. So, if the change in the input signal is less
than 1.25V, then it won't get detected by the given ADC. On the other end, if the full-scale range
of the ADC is 1V, in that case, the resolution of the ADC will be equal to 1V divided by
2 to the power 3. That is equal to 125 mV. So, now the minimum change which can be detected
by the ADC is equal to 125 mV. So, in this way, by changing the reference
voltage, the minimum detectable voltage can be increased. But at the same time, the conversion range
of the ADC will also reduce. So, in a way, we can say that there is a trade-off
for changing the reference voltage of the given ADC. But keeping the same reference voltage, by
increasing the number of bits, we can increase the resolution. For example, the resolution of 8 bit ADC with
10V of the reference voltage is equal to 10V, divided by 2 to the power 8.
which is roughly around, 39 mV. So, this 8 bit ADC will now be able to detect
the change of even 39 mV. So, in short, by increasing the number of
bits, we can increase the resolution. So, this graph shows the transfer function
of the 3 bit ADC with a full-scale range of 1V. And as you can see, this transfer function
looks like a staircase. And this blue line shows the ideal transfer
function of the ADC. That means if the resolution of the ADC is
infinite, in that case, the transfer function would look like a straight line. So, for this 3 bit ADC, the minimum detectable
voltage or the resolution will be equal to 1V divided by 2 to the power 3. That is equal to 0.125V.
That means whenever the input voltage is between 0 to 0.125V, in that case, it will be considered
as zero. And the output of the ADC will change only
when the input goes above this 0.125V. So, due to this quantization process, the
error will be introduced in the output of the ADC. And this error is known as the quantization
error. So, for a 3 bit ADC, with 1V of voltage range,
the quantization error is equal to 0.125V. Or in general, irrespective of the number
of bits and the reference voltage, it can be defined in terms of LSB. So, we can say that the quantization error
is equal to 1 LSB. Because here if you see in the transfer function,
each step corresponds to 1LSB. So, of course, this quantization error can
be reduced by increasing the number of bits. But just by shifting the transfer function
to the left, we can reduce the quantization error from 1 LSB to 0.5 LSB. And to explain that let me simplify this horizontal
axis. So, now if you see, whenever the input is
between 0 to 0.5V, then the output of the ADC is equal to 000. And it will change, whenever the input goes
above this 0.5V. So, now the maximum possible error in the
output is equal to plus-minus 0.5V. Or we can say that the maximum possible error
in the output is now plus or minus 0.5 LSB. Alright, so this is all about the quantization. Now, let's talk about sampling. Now, as I said, the first step in the conversion
process is the sampling. That means the analog signal is sampled at
a particular rate. And as you can see, the more sample we take,
the more accurately we can represent the analog signal. Now, according to the Nyquist sampling theorem,
the sampling rate should be at least, 2 times the maximum frequency of the input signal. So, that after the sampling, the signal can
be reconstructed. So, for a sine wave with a maximum frequency
of f max, the minimum sampling rate should be equal to 2 times fmax. And if the sampling rate is less than this,
then the aliasing effect will be seen in the reconstructed waveform. That means the frequency of the constructed
signal will be less than the original signal. So, to avoid this aliasing effect, the sampling
rate should be at least 2 times the maximum frequency. Alright so now let's see what happens when
the input is a square wave. So, let's say, we have a square wave with
frequency fo. And we are sampling this square wave, with
a sampling rate which is more than the 2 fo. So, according to the theorem, we should be
able to reconstruct this square wave. But if you are aware, apart from the fundamental
frequency, the square wave also contains the harmonics. And due to that, no matter what is the sampling
rate, the aliasing effect will occur in the constructed signal. And to avoid that the anti-aliasing filter
is always used with the ADC. So, before sampling, the signal is passed
through this anti-aliasing filter which is basically a low-pass filter. So, for the given ADC, if the maximum sampling
frequency is let's say fs, then the cut-off frequency of this low-pass filter should be
equal to fs/2. So, using this anti-aliasing filter, we can
remove the high-frequency components and we can reduce the effect of aliasing. So, in this way, the sampling is also a very
important parameter for the ADC. Now, so far we have assumed that during the
conversion, just after the sampling, immediately the signal is quantized and the encoded. But in reality, the ADC will take some time
for the quantization as well as in the encoding. So, during that time, the signal should remain
constant. And for that, the sample and hold circuit
is always used with the ADC. So, this sample and hold circuit samples the
signal and holds the output to the same value until the next sample is taken. So, if you see the overall block diagram of
the ADC, then it can be represented like this. That means first using the sample and hold
circuit, the signal is sampled and then it is quantized and encoded. So, these are the basic steps for analog to
digital conversion. And similarly, let's briefly discuss about
the DAC. So, in case of the DAC, according to the digital
bit stream, the analog signal is generated and here how accurately the signal is reconstructed
that depends on the resolution of the DAC. For example, a 12 bit DAC can reconstruct
the signal more accurately than the 3 bit DAC. And by improving the resolution, we can improve
the accuracy of the output waveform. So, the important parameters for the DAC are
a resolution, reference voltage and the settling time. So, basically here this settling time decides
the maximum frequency which can be reconstructed by the DAC. And apart from these parameters, here is the
list of the other important parameters for the ADC and DAC.
which includes the gain and the offset error, non-linearity, and the total harmonic distortion. So, in the upcoming videos of the ADC and
DAC, we will learn more about all these parameters. Now, this ADC and DAC can be designed in different
ways. And each design has some advantages over the
other designs. For example, some ADCs provide a better resolution,
while the other ADCs have faster conversion time. So, here is the list of different types of
ADCs and DACs which are commonly used in the electronics. So, one by one, we will see all these types
of ADC and DAC in the upcoming videos. But first of all, we will start with the DACs. So, I hope in this brief discussion, you understood
what is ADC and DAC and why they are used in the electronics. And what are the important parameters for
the ADC and the DAC. So, if you have any question or suggestion,
do let me know here in the comment section below. If you like this video, hit the like button
and subscribe to the channel for more such videos.