F2 Digital signals
F2.1 Binary and decimal numbers
The number system that is in everyday use is founded on ten different numbers:-
0, 1, 2, 3, 4, 5, 6, 7, 8 & 9.
This number system is known as the Decimal system.
These numbers on their own are called UNITs and enable numbers in the range 0 to 9 to be represented.
For numbers that are larger than 9 a second column of numbers is needed.
This second column is called the TENs column. So 9+1 would be represented by putting a 1 in the tens column and a 0 in the units column e.g.
10.
For 9+2 a one is put in the tens column and the one unit left over is put into the units column, e.g.
11.
For 9+5, ten is subtracted, and a 1 is put in the tens column. This leaves 4 units and so a 4 is put in the units column, e.g.
14.
In this way numbers up to 99 can be represented. For numbers greater than this another column is needed to represent 99+1 i.e. the HUNDREDs. So for 99+1, a one is put in the hundreds column. This would leave no tens and no units, so a 0 is put in the tens column, and a 0 in the units column, e.g.
100.
For the number given by 99+5, a 1 is put in the hundreds column, leaving no tens and four units and so 99+5 is written as
104.
In this way numbers up to 999 can be represented. Beyond this another column needs to be introduced. This is called the THOUSANDs column. Etc.
The units column represents single numbers
i.e. nx1 (n x 100)
where n is any number between 0 and 9.
The tens column represents numbers multiplied by ten
i.e. n x 10 (n x 101)
where n is any number between 0 and 9.
The hundreds column represents numbers multiplied by 100 (10 x 10),
i.e. n x 10 x 10 (n x 102)
The thousands column represents numbers multiplied by 1000 (10 x 10 x 10),
i.e. n x 10 x 10 x 10 (n x 103)
And so on
Computers are very basic machines. Since they work using digital electrical circuits, they only have two states; ON which is represented by a 1 and OFF which is represented by a 0. Such a number system is called BINARY.
This means that a computer can only count to 1 before it needs to introduce another column, the TWOs column (compare with the tens column in the Decimal system).
So for 1+1, a one is put in the twos column, leaving a 0 in the units column,
i.e. 1+1=10.
So 1+1+1 = 11.
But for the next number it is necessary to introduce another column, the FOURs column so that
1+1+1+1=100.
(Compare this with the hundreds column in Decimal.)
The next column to introduce is the EIGHTs column.
It should be clear that each time it is necessary to introduce another column it is multiplied by two again. (Compare this with the way in which each new column was multiplied by ten in the Decimal system.)
So in the binary system the columns are:
UNITs(20)
TWOs(21)
FOURs(22)
EIGHTs(23)
SIXTEENs(24)
etc.
The number in the Units column has less effect on the value of the overall number than any of the other columns and so is called the Least Significant Bit (LSB). The number in the Sixteens column has more impact on the value of the number than any of the other columns and so is called the Most Significant Bit (MSB).
Addition, subtraction, multiplication and division operations in binary are all done in the same way as in the decimal system except that the largest number that there can be in any column is 1.
Changing number bases.
Changing binary numbers to decimal numbers is relatively easy if the following method is used.
Above each column of the number to be converted write the decimal equivalent.
Start with the units column and write down how many units there are.
Then go to the next column to the left and work out the value of that column. Write this number down so that it is ready to add to the units value. Then do the same to the next column to the left and repeat this until the decimal equivalent of each column is written down. Then add up the numbers. This will be the decimal equivalent of the number.
eg. Convert 10101 in binary to decimal.
Step 1:-16 8 4 2 U
1 0 1 0 1
Step 2:-Add up the totals from each column,
i.e. 16 + 4 + 1 = 21
Therefore 10101 in binary equals 21 in decimal.
Converting decimal numbers into binary numbers is a little more difficult but following the rules below simplifies the process. Find the column number in binary that is just smaller than the decimal number. Subtract this number from the decimal. The number of times you did the subtraction is the number that you write in the column. Repeat the process with each successively smaller column number until finally the units are left.
e.g. Convert 23 into binary.
The binary column number that is just smaller than the decimal number is 16.
So 23-16 is 7. This is smaller than 16 and so we put a 1 in the 16s column.
The next smaller column number is 8. But 7 is smaller than 8 and so there are no 8s and so a 0 is put in the 8s column.
The next smaller column number is 4. 7-4 = 3, so a 1 is put in the 4s column.
The next smaller column number is 2 and so 3-2 = 1 so a 1 is put in the 2s column and leaving 1 unit, so 23 in denary is:-
16 8 4 2 U
1 0 1 1 1
Therefore 23 in denary equals 10111 in binary.
F2.2 The difference between analogue and digital signals
An analogue signal is one which can take any and every value between a maximum and minimum value. The diagram below represents an analogue signal whose voltage varies with time. Such a signal could be produced by whistling into a microphone
As a result, the analogue signal has an infinite number of possible values between the upper and lower limit. The relative absolute value of the output voltage determines the information carried by the signal and so it is important that this voltage does not suffer any distortion of additions from noise or interference.
A digital signal, on the other hand, only has two possible values, usually identified as a High value or logic 1 and a Low value or logic 0. The diagram below represents a digital signal whose output voltage varies with time.
The absolute value of the output voltage of a digital signal is not important as the information is not determined by the precise voltage. For the digital circuit receiving the signal, it will interpret any value above the upper red dotted line as a logic 1 and any value below the lower dotted line as a logic 0. The information is actually carried in the binary values made up from the 1s and 0s. Since the logic level is not determined by an absolute voltage, digital signals are relatively immune to distortion, noise and interference.
F2.3 Advantages of Digital signals.
There are many advantages to transmitting information digitally.
With an analogue signal, the information is carried as the relative absolute value of the output voltage and so any changes to this voltage in the form of noise, interference or distortion will change the information. With a digital signal, the information is actually carried in the binary values made up from the 1s and 0s. Since the logic level is not determined by an absolute voltage, digital signals are relatively immune to distortion, noise and interference.
To further ensure the accuracy of digital signals, various error checking methods can be employed. These essentially involve checking the received information with the transmitted information. If there is any discrepancy, then the information can be retransmitted. This is not possible with analogue signals.
To improve the security of digital signals, they are often encrypted (turned into a secret code) before they are transmitted and then decrypted by the receiver. Anyone intercepting such encrypted signals will find it difficult to decipher the information unless they have access to the process (or cipher) used to encrypt the signals. Encryption of digital signals does not degrade the quality of the information at all. Analogue signals can be "scrambled" to make interception more difficult, but the process causes significant distortion and the quality of the analogue information is degraded. A popular method of scrambling an analogue signal is to repeatedly change the frequency of the signal in a manner that is known to the recipient only.
Analogue audio and video signals contain a significant amount of information that is not used by our ears or eyes. For example, with audio signals, any frequencies that are below 20Hz or above 20kHz would be outside the range that a human can hear. Digital signal processing is able to remove this unnecessary information and so compress the amount of information that is transmitted resulting in the information being transmitted in less time.
Analogue signals have to be transmitted in real time; it is not usually feasible to transmit the information faster. Digital signals, on the other hand, can be transmitted rapidly and in short bursts, with the receiver reconstructing the information back to real time. As a result, it is possible to interlace other digital signals along the same transmission medium using a technique known as Time Division Multiplexing (TDM). See F2.6
The disadvantage associated with digital signals compared to analogue signals stems from the conversion process from analogue to digital and back again. If the sample rate is low when the analogue signal is being converted to digital, then high frequency information is lost leading to the signal being degraded.
When the digital signal is converted back to analogue, it is important that the output voltage of the Digital to Analogue Converter (DAC) is proportional to binary number input, otherwise the analogue output voltage will be distorted. However, the mass production of high performance ADC and DAC integrated circuits (ICs) in recent years has ensured that it is cheaper to work with digital signals than work directly with analogue signals.
See F2.4
F2.4 The transmission and reception of digital signals.
The process of converting an analogue signal to digital, transmitting it and then converting it back to an analogue signal is shown in the diagram below.
The clock controls the operation of the transmitting section by ensuring that all of the processes are synchronised. It will operate at the rate that the analogue information is to be sampled and so will determine when each sample is to be made.
The sample and hold subsystem is used to store in an analogue memory (usually a capacitor) the voltage of the analogue signal. This is done so that the voltage to be converted is not changing during the analogue to digital conversion process. If it does, it is possible for the ADC to make an inaccurate conversion, so resulting in errors in the transmitted signal.
The analogue to digital converter (ADC) subsystem, as its name implies, actually carries out the analogue to digital conversion process and will produce as an output a binary number which represents the voltage of the analogue signal as sampled by the sample and hold subsystem. This binary number is usually in the form of 8 to 24 bit parallel data.
It would be possible to use a separate transmission medium for each of the separate bits of the ADC output, but this would be impractical over anything other than a very short distance.
The parallel to serial converter subsystem is used to convert the parallel information from the ADC into serial form so that the data can all be sent along a single transmission medium.
The transmitter subsystem produces a carrier waveform that is modulated by the serial data from the parallel to serial converter, e.g. if the data was to be sent by optical fibre, then the transmitter would be an infrared laser diode.
The medium is what links the transmitter to the receiver- this could be cables, optical fibres or free space as used by radio systems e.g. Bluetooth.
The receiversubsystem may include amplifiers and regenerators depending on the type of transmission medium and the distance between the transmitter and the receiver. The purpose of the receiver will be to produce a digital signal that can be passed to the next subsystem.
The serial to parallel converter subsystem is needed to convert the serial information from the receiver into parallel data that can be passed to the digital to analogue converter. It is important that the serial to parallel converter is able to synchronise itself to the incoming serial signal in order that it can carry out the conversions accurately. This is achieved by transmitting along with the data, information about when each byte of data starts and ends. Error checking information may also be included with the transmitted signal so that the receiver will be able to detect if there are any errors in the received data.
The digital to analogue converter subsystem (DAC) converts the parallel digital data back into an analogue signal. It is important that the output of the DAC is as linear as possible with the binary input data other wise the analogue output waveform will contain distortion and will not be a faithful representation of the original analogue signal.
F2.5 Bit rate and quality.
The more frequently an analogue signal is sampled and the more bits of data each sample is converted into, the greater the faithfulness of the digital signal to the original analogue signal. Unfortunately, both a high sample rate and large number of bits significantly increase the bandwidth required to transmit the digital signal. With a normal CD, the music is sampled 44,100 times per second and both left and right channels are converted into a 16 bit digital signal. If a low sample rate is used and the ADC produces few bits of data, then serious distortion occurs. The example below illustrates this.
The output from the sample and hold subsystem is a pulse amplitude modulated (PAM) signal, as shown in the diagram below.
The PAM signal is measured or quantized using an ADC and then, converted to a serial digital signal using a serial to parallel converter(shift register). The resulting output from the system is a serial stream of binary digits (bits) representing the original analogue signal. This is known as a Pulse Code Modulated (PCM) signal
The information signal voltage waveform is shown in the top graph. The middle graph represents the pulse amplitude modulated signal with the 3-bit number representing each sample directly underneath the sample. The bottom graph represents the PCM signal, with the binary value of each sample being transmitted sequentially.
In this simple example, the ADC converter produces a three bit output which gives a poor resolution of the original signal. It should be noted that the ADC converter rounds the signal level down during conversion and that the bit rate of the PCM signal is three times the sampling frequency. Re-plotting the sampled signal levels on a graph will reveal a reconstructed waveform that has considerable distortion compared to the original waveform. This is because the ADC is only three bits. In practical systems the ADC will be at least eight bits giving much better resolution of the reconstructed signal.
The time interval between each sample is determined by the sampling frequency, which must be at least twice that of the highest frequency component of the sampled waveform. In this example the ADC generates a three bit number which means the sample will be encoded into 8 discrete levels. This leads to quantisation errors as the signal will have a range of values which are encoded with the same digital value. The effect of these errors can be seen in the black line on the diagram below which shows what happens when the digital signal is converted back to analogue form by a DAC.
Comparing the analogue output from the DAC with the original signal shows that the resolution of the output signal is very poor. Quantisation error can be reduced and signal resolution improved by increasing the number of bits in the ADC and DAC processes. An 8-bit ADC and DAC will resolve the signal into 256 possible levels (0 - 255) which will lead to a substantial reduction in quantisation error.
F2.6 Time division multiplexing
Time division multiplexing is a technique that enables several digital signals to share the same transmission medium. This has the advantage of increasing the amount of data that can be transmitted as well as reducing the cost. In any analogue to digital system each signal is sampled periodically and the information is encoded. It is then sent, in sequence, along the medium. The samples are received, in sequence, and then decoded, to reconstitute the original signal.
Consider the following example.
The band width of a voice signal for the telephone system is 4kHz. To ensure that information is not lost, the sampling rate must be at least twice the highest frequency, i.e. 8000 times per second. This means that the analogue signal is sampled every 125µs. The voltage level of each sample is then binary encoded, typically as an eight bit number to form a PCM signal.
If the PCM signal is to be sent over a transmission medium with a bandwidth of 2MHz, then the duration of each transmitted bit can be set at 0.5s. If there are 8-bits in each sample then each complete sample will take only 4s to send. Since the signal is only sampled every 125s, it will leave 121µs before the next sample is to be sent. Therefore it is possible, in theory, to insert another 30samples, each taking 4µs, from 30 different signals into this remaining 121s interval. This will mean that 31 different signals can be sent along the transmission medium. This is shown in the diagram below.
Here the byte (8 bits) representing the encoded value for the first sample from signal 1 (S1) occupies 4s of time. The remaining 121 s may be occupied by samples from signal 2 (S2), signal 3 (S3) and so on. After 125 s the next sample from signal 1 is sent etc.