📚 2 Text, sound and images | 文本、声音和图像
In IGCSE Computer Science, understanding how text, sound, and images are represented digitally is essential. These three types of data are converted into binary so that computers can store, process, and transmit them efficiently. By exploring character encoding, sound sampling, and bitmap image structures, students gain insight into digital systems and data compression.
在IGCSE计算机科学中,理解文本、声音和图像如何以数字形式表示至关重要。这三类数据被转换为二进制,以便计算机能够高效地存储、处理和传输。通过探索字符编码、声音采样和位图图像结构,学生可以深入了解数字系统和数据压缩。
1. Character Encoding: ASCII and Unicode | 字符编码:ASCII与Unicode
Computers represent text by mapping each character to a binary number. The most basic standard is ASCII (American Standard Code for Information Interchange), which uses 7 bits to encode 128 characters, including letters, digits, and control codes. For example, uppercase 'A' is 1000001 in binary (decimal 65). Extended ASCII uses 8 bits to include additional symbols, supporting 256 characters.
计算机通过将每个字符映射到二进制数来表示文本。最基本的标准是ASCII(美国信息交换标准代码),它使用7位编码128个字符,包括字母、数字和控制码。例如,大写字母'A'的二进制为1000001(十进制65)。扩展ASCII使用8位来包含额外符号,支持256个字符。
As international communication expanded, the need for a more comprehensive system led to the development of Unicode. Unicode typically employs 16 bits per character, enabling the representation of over 65,000 characters covering numerous scripts and symbols. UTF-8 is a popular variable-length encoding backward compatible with ASCII.
随着国际交流的扩展,需要更全面的系统,从而催生了Unicode。Unicode通常每个字符使用16位,能够表示超过65,000个字符,涵盖众多文字和符号。UTF-8是一种流行的可变长度编码,向后兼容ASCII。
2. Sampling Sound: From Analogue to Digital | 声音采样:从模拟到数字
Sound is produced by vibrations in the air, creating continuous analogue waves. To convert this into digital data, a process called sampling is used. At fixed time intervals, the amplitude of the wave is measured and converted into a binary number. The sampling rate (frequency) is the number of samples taken per second, measured in hertz (Hz).
声音由空气振动产生,形成连续的模拟波。为了将其转换为数字数据,使用称为采样的过程。在固定的时间间隔,测量波的振幅并将其转换为二进制数。采样率(频率)是每秒采集的样本数,以赫兹(Hz)为单位。
Bit depth, also known as sample resolution, determines how many bits are used to store each sample. A higher bit depth allows more precise amplitude representation, reducing quantization noise. Common bit depths are 8-bit (telephone quality) and 16-bit (CD quality).
位深度,也称为采样分辨率,决定存储每个样本使用多少位。更高的位深度允许更精确的振幅表示,减少量化噪声。常见的位深度有8位(电话质量)和16位(CD质量)。
3. Common Audio Sampling Standards | 常见音频采样标准
The Nyquist theorem states that the sampling rate must be at least twice the highest frequency to be captured. Since human hearing typically ranges up to 20 kHz, CD-quality uses 44.1 kHz to accurately reproduce sound. Stereo audio records two separate channels, effectively doubling the data rate.
奈奎斯特定理指出,采样率必须至少是要捕捉的最高频率的两倍。由于人类听觉通常可高达20 kHz,CD音质使用44.1 kHz以准确重现声音。立体声音频记录两个独立声道,实际上使数据速率加倍。
For voice-only applications like telephony, an 8 kHz sampling rate with 8-bit depth is standard, providing an intelligible signal while conserving bandwidth. Higher standards, such as 48 kHz and 24-bit, are used in professional audio recording.
对于像电话这样仅语音的应用,8 kHz采样率和8位深度是标准,在节省带宽的同时提供可理解的信号。更高的标准,如48 kHz和24位,用于专业音频录制。
4. Calculating Sound File Size | 计算声音文件大小
Uncompressed audio file size can be predicted using the formula below. For mono (single channel) sound, the size in bits is given by:
未压缩音频文件大小可以使用以下公式预测。对于单声道声音,以位为单位的大小由下述公式给出:
File size (bits) = Sampling rate (Hz) × Bit depth × Duration (s)
To obtain the size in bytes, divide by 8. If the audio has multiple channels (e.g., stereo), multiply by the number of channels.
要得到以字节为单位的大小,除以8。如果音频有多个声道(如立体声),乘以声道数。
kHz, 16-bit: Size = 44,100 × 16 × 180 × 2 = 254,016,000 bits = 31,752,000 bytes ≈ 30.3 MB.
例如,一首3分钟的立体声歌曲,44.1 kHz,16位:大小 = 44,100 × 16 × 180 × 2 = 254,016,000 位 = 31,752,000 字节 ≈ 30.3 MB。
5. Representing Images: Bitmap Basics | 图像表示:位图基础
A digital image in bitmap form is composed of a grid of small squares called pixels. Each pixel's colour is stored as a binary number. In a black-and-white image, 1 bit per pixel is sufficient (0 for black, 1 for white). To add shades of grey, more bits are needed: 2 bits yield 4 shades, 8 bits produce 256 shades.
位图形式的数字图像由称为像素的小方块网格组成。每个像素的颜色存储为二进制数。在黑白图像中,每个像素1位足够(0表示黑,1表示白)。要增加灰度,需要更多位:2位产生4种灰度,8位产生256种灰度。
The term colour depth (or bit depth) refers to the number of bits used to represent the colour of a single pixel. Common colour depths are 8-bit (256 colours), 16-bit (high colour), and 24-bit (true colour).
颜色深度(或位深度)指用于表示单个像素颜色的位数。常见的颜色深度有8位(256色)、16位(高彩色)和24位(真彩色)。
6. Colour Depth and Resolution | 颜色深度与分辨率
r resolution means more detail and larger file size. Coupled with colour depth, it determines the overall data requirement.
分辨率描述图像中的像素数量,通常以宽度×高度给出,例如1920×1080。更高的分辨率意味着更多细节和更大的文件大小。加上颜色深度,它决定了总体数据需求。
A 24-bit colour image uses 8 bits each for red, green, and blue channels, yielding approximately 16.7 million possible colours. This is sufficient for photographic quality and is often called true colour.
一个24位彩色图像对红、绿、蓝通道各使用8位,产生约1670万种可能的颜色。这对于照片质量已足够,通常称为真彩色。
7. Image File Size Calculation | 图像文件大小计算
The uncompressed size of a bitmap image is straightforward to calculate:
未压缩的位图图像大小可以直接计算:
Image file size (bits) = Width (pixels) × Height (pixels) × Colour depth (bits per pixel)
divide by 8. For example, a 1024×768 image with 24-bit colour requires: 1024 × 768 × 24 =
Published by TutorHao | IGCSE Science Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图