ec310 lecture 2 - united states naval academy · web viewec312 lesson 17: analog to digital...

15
EC312 Lesson 17: Analog to Digital Conversion (p 199- 224;229-231) Objectives: (a) Provide examples of analog and digital communications systems. (b) Describe the advantages of digital over analog communications. (c) Discuss the basic steps of the analog-to-digital conversion process: sampling and quantizing. (d) Given an analog waveform, sampling rate and resolution, determine the resulting binary A/D output. (e) Calculate the minimum (Nyquist) sampling rate for an analog signal. So in an earlier lesson, we learned about this awesome wonder in the world of communication called modulation. We realized, “Hey, you can’t just go about transmitting at signals at baseband frequencies.” You have to modulate those babies. Send ‘em on up to those higher frequencies. We got outputs that looked like: Now, what type of modulation is this? THAT’S RIGHT! A mplitude M odulation (AM). We could have also used FM or PM. Free Space 1

Upload: lammien

Post on 20-Apr-2018

220 views

Category:

Documents


4 download

TRANSCRIPT

EC312 Lesson 17: Analog to Digital Conversion (p 199-224;229-231)

Objectives:(a) Provide examples of analog and digital communications systems.

(b) Describe the advantages of digital over analog communications.

(c) Discuss the basic steps of the analog-to-digital conversion process: sampling and quantizing.

(d) Given an analog waveform, sampling rate and resolution, determine the resulting binary A/D output.

(e) Calculate the minimum (Nyquist) sampling rate for an analog signal.

So in an earlier lesson, we learned about this awesome wonder in the world of communication called modulation. We realized, “Hey, you can’t just go about transmitting at signals at baseband frequencies.” You have to modulate those babies. Send ‘em on up to those higher frequencies. We got outputs that looked like:

Now, what type of modulation is this? THAT’S RIGHT! Amplitude Modulation (AM).We could have also used FM or PM.

Take a look at the waveform that’s feeding into the transmitter and out of the receiver. Does anything stand out to you? Let’s talk about that waveform and many others like it.

Frequency Modulation (FM) Phase Modulation (PM)

Free Space

1

1. Analog Systems.When you look at the above waveform and many like it, you should notice that it is a signal that varies continuously, not having discrete values. If we observed nature, we would see that nature acts in this continuous, non-discrete pattern. (i.e. changes in pressure, variations in light, sounds, etc.) Analog systems use electrical signals to represent these natural patterns. The electrical signals are referred to as analog signals.

What do you think might be an example of an analog system? Maybe something your Mama’s Mama (aka. Grandma) liked.

AHHH YEAH! We went there. Michael Jackson’s 8-Track album Thriller.

This is a great example of an analog system, but my guess is you have no idea what an 8-Track is. So, let me put some analog systems that may ring a bell. (AM/FM radio, telephone, cassettes, VCR, std TV, the microphone you are singing into at Bancroft’s karaoke night)

So maybe you’re thinking, “I still have no idea what that stuff is!” There’s probably a reason for that. We don’t really use many analog systems anymore. “What do we use,” you ask? Great segue question.

2. Digital Systems.Let’s think for a second about comparisons between what was used in the past (the old people) and what you use (the going to be old people)

Past Device Present DeviceCassettes CD’sVHS (VCR) DVD/Blu-rayStd TV HDTVRotary telephones Cellular phones

Analog signal produced from playing an Oboe into a microphone.

2

Do you see where this is going?

We want the same services but are utilizing a different method by which to get them. We are using digital systems. Digital systems use electrical signals that represent discrete, binary values. The electrical signals are referred to as digital signals. Specifically, binary digital signals use two discrete voltage levels to represent binary 1 or 0. Combining multiple bits into words permits us to represent larger values. Digital circuits operate on digital signals performing logic and arithmetic functions like we saw with our digital logic gates.

Interesting fact and important to the class: Digital signals are not representative of signals that occur in nature. Natural signals must be converted into digital format.

Great! So we’re using a new method to get the same services. Is this a big deal? Or is it like when a textbook changes a couple of example problems and now I have to buy a NEW instead of USED textbook, where there’s no really benefit to getting the NEW.

THIS IS A HUGE DEAL! At this point OUR textbook is very comprehensive, clear, and full of good applications, so please read Chapter 7 (p199-224, and 229-231). The lesson notes will outline the areas we will be concentrating on ,will provide a little different presentation of parts, and will give some examples.

3. Digital advantages.

1. Noise immunity. (What is the number one limiting factor in communications? NOISE)Noise immunity is the most important advantage of digital communications

Receiver circuitry can distinguish between a binary 0 and 1 with a significant amount of noise.

Time (sec)

Vol

tage

(V)

analog signal with noise digital signal with noise

Digital signals can be stripped of any noise in a process called signal regeneration.

Digital signal

3

Consider a network of relay stations.An analog signal is received, amplified and retransmitted at each station.However, the noise is also amplified each link.A digital signal is received, regenerated, then retransmitted at each station.

The noise can be eliminated at each repeater.2. Error detection/corrections. Even if a digital signal does contain bit errors, many of these errors can be fixed at the receiver through the use of error correcting codes.

Error correcting codes allows CDs with minor scratches to be played without errors.

3. Easier multiplexing. Multiplexing is the process of allowing multiple signals to share the same transmission channel, which we will talk about in our next lesson.

4. Easier to process and store. Since digital is the how computers work, digital signals can be easily processed (aka digital signal processing (DSP)) by computers. Similarly the digital format for easier storage of communication signals.An example of DSP would be Garage Band for you musicians or photo editing software for those with a knack for photograph.

DSP allows operations such as filtering, equalization and mixing to be done numerically without the use of analog circuits.DSP also permits data compression (encoding information so fewer bits are needed).

To emphasis this again, these advantages are huge. This is such a big deal that even though communication signal used to be exclusively analog, it is worth the billion and even trillions of dollars that the government and private sector migrate communication signals to digital.

There are some disadvantages to digital communication, the most important is that the bandwidth size required is larger by almost twice that of analog communication. The digital circuitry is also more complex, but generally smaller and less expensive.

4. Conversion from analog to digital.So here’s the million dollar question. If nature produces continuous, non-discrete patterns, how do we create digital signals?

That, my dear midshipman, is one of the many beauties of this class. We will tell you.

Before we can use digital transmission, we must convert the signal of interest into a digital format. The natural pattern (i.e. speech) that we want to transmit will be acquired using an analog device. The analog signal will be translated into a digital signal using a method called analog-to-digital (A/D) conversion, digitizing a signal, or encoding. The device used to perform this translation is known as an analog-to-digital converter or ADC. Through A/D conversion continuously variable analog signals are changed into a series of binary numbers.

Analog signal

Binary numbers

4

There are two steps we will use to convert an analog signal to a digital format as represented by binary numbers.

Steps for A/D conversion:

1. Sampling. This is a process of sampling the analog signal at regular time intervals.

Hopefully, this image makes sense, but if not, you are taking snap-shot values of the analog signals so that you have a fairly accurate representation of how the analog signal changing over time. So what might be an important question to ask right now? Well, let me help you out.

How often do we need to sample the signal? Put another way: How large does our sampling frequency f need to be in order to accurately represent the signal?

Here you can see, we could take a few samples (low sampling rate). I’ll tell you, if you choose that option, when you reconstruct the signal, it will be a terrible representation of the original signal. So let’s choose the highest possible sample rate known to man so your ship’s Comm-O will sound great over the radio. The higher the sampling rate, the higher the cost of the equipment. Anybody have a spare billion $ sitting around?

5

1 1.0005 1.001 1.0015 1.002 1.0025 1.003 1.0035 1.004 1.0045 1.005-1

-0.5

0

0.5

1

Time (sec)

Vol

tage

(V)

0 1000 2000 3000 4000 5000 60000

0.05

0.1

0.15

0.2

0.25

Frequency (Hz)

Vol

tage

(V

)

So then, what sampling rate do I choose? I’m glad you asked.The minimum sampling rate required in order to accurately reconstruct the analog input is given by the Nyquist sampling rate, fN, given by the formula

f N=2 f max, where fmax is the highest frequency component of the analog input.

The Nyquist sampling rate (frequency) is the minimum. In practice, sampling rates are much higher, typically 2 times the Nyquist rate fN. In other words, 4 times fmax. Therefore, we say that the sampling frequency must be more than twice the value of the highest frequency component of the signal:

, where fN is 2fmax

If this rule is violated, a problem called aliasing results. We’ll talk more about aliasing in the lab, but believe me, it’s bad.

Example

Consider the signal from the oboe depicted below in time and frequency domain representations.

1. What is the maximum frequency present in the oboe signal?2. Based upon this, what would be the minimum sampling rate according to Nyquist?3. What would be a practical sampling rate?

So whenever an analog waveform is sampled, a form of modulation called pulse-amplitude modulation ( PAM) occurs. This modulation process creates sidebands and these can cause aliasing, so we can use a low pass filter to get rid of any harmonics we don’t want, and as long we sample more than at least twice the highest frequency component of interest, aliasing will not occur.

2. Quantizing. Quantization is the process of mapping the sampled analog voltages to discrete, binary levels. The number of bits determine the number of levels ( 1 bit is 2 levels, 2 bits is 4 levels, 2^n=#levels).

6

We determine the amplitudes associated with each sample point of an analog signal. We can then convert these amplitudes (real numbers) into binary numbers associated with their levels. ( Look at the figure below as an example)“Ok. I understand that statement, but how did you get 3 bits (i.e. 000, 001, 010, etc.)?”Great question. You are so inquisitive.A device called a quantizer is used that characterizes the length of the binary words they produce.An N-bit quantizer has levels and outputs binary numbers of length N.So, you might see:

Telephones use 8-bit encoding 28 = 256 levelsCD audio uses 16-bit encoding 216 = 65,536 levels

Quantizers are limited to a specific voltage range. For the example above, we will assume that our analog input falls within a range of -1.0 to +1.0 volts.

The quantizer will partition this range into 2N steps of size q , the quantizer step size, given by .

So for the above example, step size will be .q, the step size, is formally called the resolution.

Each of the individual steps, called quantization intervals, is assigned a binary value from 0 to . So when you look at the above example, you can see our quantizer uses 3-bit encoding. This means the intervals will range from 0 to 7. So, 000 is assigned to the voltages from -0.75 to -1.0, 001 is assigned to the voltages from -0.5 to -0.74999…, and so on.

If sampled point falls within that interval (or bin), it is assigned that binary value. For the first sample point at time 0, the voltage is -0.1768, which means that sample is assigned a binary value of 011.The binary representation of the above signal is: 011 100 110 111 111 110 011 001

Alright, we’ve walked through an image together, now it’s your turn.

7

Example

Consider the following analog waveform. This waveform is sampled at a 1-kHz rate and quantized with a 4-bit quantizer (input range -1.0 to +1.0 V). a. Circle the sample points.b. Indicate the quantization intervals and corresponding binary values.c. Indicate the binary number assigned to each sample point. d. What is the stream of binary bits. e. Hand draw the bits as an electrical signal

To give you an idea, here’s the effect of quantizing. See the difference?

0 1 2 3 4 5 6 7 8 9 10

-1.000

-0.875

-0.750-0.625-0.500

-0.375-0.250-0.1250.000

0.1250.2500.3750.500

0.6250.7500.8751.000

Time (ms)

Vol

tage

(V)

4 bit = 16 colors 8 bit = 256 colors

8

So here is the signal we generated above, prior to the example you completed.

0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1

This signal gets transmitted across free space to a receiver... Sort of like what’s shown in the image below, but not exactly. We’ll get into more detail in our next lesson. (I bet you can’t wait…!)

5. Conversion from digital to analog.But how do we recover the information, such that we get to hear your Comm-O singing Michael Jackson’s Thiller.

At the receiver, these binary values must be converted back into an analog signal. This process is called digital-to-analog (D/A) conversion. This is beyond the scope of this course, but you can look at Appendix A at the end of these notes to see an explanation. It is very similar to being the reverse of the analog-to-digital conversion process

Good job. We’ve regenerated our original signal. How does it compare with the original? Let’s see:

0 1 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1

Free Space

9

It’s close. It follows the same general shape. But still… It’s not the same. What’s going on here?

6. Quantization error. Notice that there is some error associated with this conversion process. The error is the difference between analog input and the reconstructed signal. This difference is known as quantization error.

So is it bad? It can be. The quantization error introduces noise into the signal, and as we have said NOISE IS THE NUMBER 1 LIMITING FACTOR IN COMMUNICATION SYSTEMS.

So how do we get rid of the quantization error and its associated noise? Quantization error can be reduced by increasing the number of bits N and increasing the sampling frequency.

0 1 2 3 4 5 6

-1.00

-0.75

-0.50

-0.25

0.00

0.25

0.50

0.75

1.00

Time (ms)0 1 2 3 4 5 6

-1.00

-0.75

-0.50

-0.25

0.00

0.25

0.50

0.75

1.00

Time (ms)0 1 2 3 4 5 6

-1.00

-0.75

-0.50

-0.25

0.00

0.25

0.50

0.75

1.00

Time (ms)

Now you say at this point, “But sir, I still see quantization error.”But you can still see quantization error even with increased bits and increased sampling frequency.That’s true, but the nice thing about human hearing is that eventually it can’t detect the error. The error becomes unperceivable. It just needs to be good enough.

4-bit quantization sampling frequency fs = 2kHz

5-bit quantization sampling frequency fs = 4kHz

8-bit quantization sampling frequency fs = 8kHz

10

Appendix A. Conversion from digital to analog.

At the receiver, these binary values must be converted back into an analog signal. This process is called digital-to-analog (D/A) conversion.

The reconstruction levels are the midpoints of the intervals used by the quantizer.

The incoming bit stream is carefully divided into the correct groups of 3 bits each.

11

LCDR Jennie Wood, CDR Hewitt Hymas, LCDR Jesse Atwood

Help us improve these notes! Send comments, corrections and clarifications to [email protected]

12