Introduction to Digital Images and Signals
Welcome! In this chapter, we are exploring the heart of modern communication. We live in a world where photos, videos, and music are sent across the globe in an instant. But how does a physical wave (like light or sound) turn into something a computer can understand and send? We will look at how images are broken down into numbers, how signals are "sampled," and why digital communication is often better than the old-fashioned "analogue" ways.
Note: This chapter focuses on the digital side of communication. For how lenses create images or how waves are polarised, see the other chapters in this section.
1. Digital Images: The World in Numbers
A digital image isn't a smooth picture; it is actually a giant grid of tiny squares. Each square is called a pixel (short for "picture element").
Storage as an Array
Each pixel in an image is stored as a number (or a set of numbers). These numbers represent the brightness or colour of that specific spot. A computer sees an image as an array of numbers. By changing these numbers, we can change the look of the image.
Bits and Bytes
Computers use binary (0s and 1s) to store information.
• A bit is the smallest unit of information (either a 0 or a 1).
• A byte is a group of 8 bits.
The more bits we use for each pixel, the more levels of brightness we can show. This is known as the "bit depth."
Calculating Information
To find out how much "information" is in an image, we use this simple formula:
\( \text{Total Information (bits)} = \text{Total Pixels} \times \text{bits per pixel} \)
If you know the number of brightness levels (\( N \)) you want to show, you can calculate the number of bits (\( b \)) required using:
\( N = 2^b \)
or
\( b = \log_2 N \)
Example: If a pixel has 256 different brightness levels, how many bits are needed?
\( 256 = 2^8 \), so \( b = 8 \) bits (or 1 byte).
Quick Takeaway: An image is just a grid of pixels. More pixels mean better resolution; more bits per pixel mean more realistic shades and colours.
2. Image Manipulation
Because digital images are just arrays of numbers, we can use mathematical rules to change them. While you don't need to do these calculations in the exam, you must understand what these processes do:
- Varying Brightness: Adding a constant value to every pixel's number makes the whole image brighter.
- Varying Contrast: Multiplying the pixel values by a constant spreads out the range of numbers, making the darks darker and the lights lighter.
- Reducing Noise: "Noise" is random speckle or graininess. We can reduce it by replacing a pixel's value with the average value of its neighbours (smoothing).
- Detecting Edges: This involves looking for places where pixel values change suddenly (like from light to dark). It’s useful for medical scans or self-driving cars.
- False Colour: We can assign specific colours to certain ranges of numbers. This helps highlight details that the human eye might miss (like in satellite weather maps).
3. Sampling and Signalling
A signal is a way of carrying information, usually as a changing voltage over time. Real-world signals (like your voice) are analogue—they vary continuously. To make them digital, we must "sample" them.
The Process of Sampling
Sampling means measuring the value of the analogue signal at regular time intervals and turning those measurements into binary numbers.
Resolution Levels:
The number of bits used for each sample determines the "resolution" of the signal. If we have a certain amount of background noise, we use this formula to find the maximum useful bits:
\( b = \log_2 \left( \frac{V_{\text{total}}}{V_{\text{noise}}} \right) \)
Don't worry if this seems tricky: It just means that if the noise is too loud, there’s no point in using tiny, precise measurement levels because you'd just be measuring the noise!
The Minimum Sampling Rate
How often do we need to sample a signal? If we don't sample fast enough, we lose high-frequency details.
Rule: The minimum sampling rate must be greater than 2 times the maximum frequency in the signal.
\( \text{Sampling Rate} > 2 \times f_{\text{max}} \)
Did you know? This is why CDs are sampled at 44.1 kHz. Since humans can hear up to 20 kHz, the sampling rate must be more than 40 kHz to capture all the sounds we can hear!
Transmission Rate
This is the speed at which data is sent.
\( \text{Transmission Rate (bits per second)} = \text{samples per second} \times \text{bits per sample} \)
4. Digital vs. Analogue
Why do we bother turning everything into digital signals?
Advantages of Digital:
• Noise: Analogue signals pick up noise, and every time you amplify the signal, you amplify the noise too. Digital signals also pick up noise, but because they are just 1s and 0s, it is easy for the receiver to ignore the noise and "clean up" the signal.
• Storage and Processing: Digital data can be compressed, encrypted, and processed by computers easily.
Disadvantages of Digital:
• Information Loss: If the sampling rate or bit depth is too low, the digital version won't be a perfect copy of the original.
• Bandwidth: Digital signals often require a wider range of frequencies (bandwidth) to transmit quickly.
Key Takeaway: Digital signals are preferred because they are "noise-resistant." We can perfectly regenerate a digital signal even if it gets slightly distorted during travel.
5. Summary Table for Calculations
In your exam, you may need to use these formulas. Remember to use the \( \log_2 \) button on your calculator!
| To find... | Use this formula: |
|---|---|
| Number of alternatives (\( N \)) | \( N = 2^b \) |
| Number of bits (\( b \)) | \( b = \log_2 N \) |
| Info in an image | \( \text{pixels} \times \text{bits per pixel} \) |
| Transmission rate | \( \text{samples per second} \times \text{bits per sample} \) |
| Max bits (with noise) | \( b = \log_2 (V_{\text{total}} / V_{\text{noise}}) \) |
Common Mistake to Avoid: When calculating the minimum sampling rate, students often forget the "2x" rule. If a signal has frequencies up to 5 kHz, you must sample at more than 10,000 samples per second.
You've reached the end of this chapter's notes. Ready to move on? Check out the next chapter on "Sensing" to see how we measure physical properties using circuits!