Representing text, sound and images
引入
15:06
计算机为何使用二进制
处理器内部有数十亿个微型开关。每个开关只能处于开或关的状态。这就是计算机物理上拥有的全部——没有三,没有七,没有…
英文讲解 · 可切换中英文字幕
本课内容
| English | 释义 | 拼音 |
|---|---|---|
| binary/ˈbaɪnəri/ | 二进制 | èr jìn zhì |
| data/ˈdeɪtə/ | 数据 | shù jù |
| file/faɪl/ | 文件 | wén jiàn |
| character/ˈkærɪktə/ | 字符 | zì fú |
| character set/ˈkærɪktə set/ | 字符集 | zì fú jí |
| ASCII/ˈæski/ | ASCII码 | ASCII mǎ |
| bits/bɪts/ | 比特 | bǐ tè |
| Unicode/ˈjuːnɪkəʊd/ | 统一码 | tǒng yī mǎ |
| storage/ˈstɔːrɪdʒ/ | 存储空间 | cún chǔ kōng jiān |
| sound wave/saʊnd weɪv/ | 声波 | shēng bō |
| sampling/ˈsæmplɪŋ/ | 采样 | cǎi yàng |
| Sample rate/ˈsæmpl reɪt/ | 采样率 | cǎi yàng lǜ |
| samples | 采样点 | cǎi yàng diǎn |
| Hz | 赫兹 | hè zī |
| sample resolution/ˈsæmpl ˌrezəˈluːʃn/ | 采样分辨率 | cǎi yàng fēn biàn lǜ |
| resolution/ˌrezəˈluːʃn/ | 分辨率 | fēn biàn lǜ |
| amplitude/ˈæmplɪtjuːd/ | 振幅 | zhèn fú |
| bitmap image | 位图图像 | wèi tú tú xiàng |
| pixels/ˈpɪkslz/ | 像素 | xiàng sù |
| Colour depth/ˈkʌlə depθ/ | 颜色深度 | yán sè shēn dù |
| file size | 文件大小 | wén jiàn dà xiǎo |
用二进制表示文本、声音和图像
- 数字不是唯一的数据——文本、声音和图像也都可以用二进制表示。
- 每种数据都有自己的表示方法。
- 它们都存在一个权衡:质量越高,文件越大。
表示文本
- 每个字符都被赋予一个数字,并以二进制存储。字符及其对应数字的集合称为字符集。
- ASCII 使用 7 位 → 可表示 128 个字符(足以表示英文字母、数字和符号)。
- Unicode 使用更多位 → 可表示多得多的字符(多种语言的文字、符号和表情符号)——但相同的文本需要更多存储空间。

表示声音
y = a sin(bt + c)
Sound is a 波; sampling records its height many times a second.
How many different characters can 7-bit ASCII represent?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
7 bits give 2^7 = 128 characters.
Compared with ASCII, Unicode:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Unicode covers many languages and emoji, needing more bits — so the same text is larger than in ASCII.
Match each idea to what it means.
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
More bits can represent more characters or colours, or give greater sample resolution; sample rate is the number of samples per second.
表示声音
- 声波是平滑的;为了存储声波,计算机每隔固定时间测量一次波的高度——这就是采样。
- 采样率 = 每秒的采样点数(Hz,赫兹);采样分辨率 = 每个采样点的位数。
- 更高的采样率和采样分辨率 → 录音更准确,但文件更大。

The sample rate of a sound recording is:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Sample rate = samples per second (Hz); sample resolution = bits per sample.
表示图像
- 位图图像是由点组成的网格,这些点称为像素。
- 分辨率 = 像素的数量(例如 $1920 \times 1080$)。
- 色彩深度 = 每个像素的位数。
- 更高的分辨率和色彩深度 → 质量更好,但文件更大。

The colour depth of an image is:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Colour depth is bits per pixel — more bits means more possible colours.
Increasing an image's resolution and colour depth will:
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
More pixels and more bits per pixel mean better quality but a larger file.
例题:提高色彩深度
一张照片以相同分辨率保存两次,色彩深度分别为 8 位和 24 位。每次能显示多少种颜色?文件大小会发生什么变化?
- 颜色数量为 $2^{\text{colour depth}}$:8 位可表示 $2^8 = 256$ 种颜色;24 位可表示 $2^{24}$ 种,约 1670 万种颜色,因此色调看起来平滑。
- 每个像素现在需要 24 位,原来需要 8 位,因此像素数量相同时,文件大小变为原来的 3 倍。更高的质量总是需要更多存储空间。
How many different colours can an image with a colour depth of 4 bits show?
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
$2^4 = 16$.
A recording's sample rate is doubled and nothing else changes. What happens?
难度 1/5 · 今日首次完成可获 100 金币及少量额外奖励
Twice as many samples per second follow the wave more closely, and each sample needs storing.
你掌握了
- 文本:一个字符集把字符映射到数字;ASCII = 7 位(128),Unicode = 更多(表情符号),更大的文件
- 声音:采样记录波;采样率(Hz)+ 采样分辨率(位)
- 图像:像素;分辨率(像素数)+ 色彩深度(位/像素)
- 在所有三者中:更高的质量 → 更大的文件
出了什么问题?只有网站团队能看到这些信息。