Representing text, sound and images
แนะนำใหม่
15:06
ทำไมคอมพิวเตอร์จึงใช้เลขสองฐาน
ภายในโปรเซสเซอร์มีสวิตช์ขนาดเล็กนับพันล้านตัว แต่ละตัวสามารถเป็นได้แค่ เปิด หรือ ปิด นั่นคือสิ่งที่คอมพิวเตอร์มีทางกายภาพจริง — ไม่มีสาม, ไม่มีเจ็ด, ไม่มี…
บรรยายภาษาอังกฤษ · สลับคำบรรยายภาษาอังกฤษและภาษาจีนได้
ในบทเรียนนี้
| English | ความหมาย |
|---|---|
| binary/ˈbaɪnəri/ | A number system using base two, with the digits zero and one. |
| data/ˈdeɪtə/ | Recorded facts, observations or values used for analysis or processing. |
| file/faɪl/ | A named collection of data stored and managed as a unit. |
| character/ˈkærɪktə/ | A text unit such as a letter, digit, punctuation mark or other symbol. |
| character set/ˈkærɪktə set/ | ชุดอักขระ |
| ASCII/ˈæski/ | |
| bits/bɪts/ | |
| Unicode/ˈjuːnɪkəʊd/ | ยูนิโค้ด |
| storage/ˈstɔːrɪdʒ/ | |
| sound wave/saʊnd weɪv/ | A vibration that travels through a material as changes in pressure. |
| sampling/ˈsæmplɪŋ/ | การสุ่มตัวอย่าง |
| Sample rate/ˈsæmpl reɪt/ | Samples per second (Hz ). |
| samples | |
| Hz | |
| sample resolution/ˈsæmpl ˌrezəˈluːʃn/ | ความละเอียดของการสุ่มตัวอย่าง |
| resolution/ˌrezəˈluːʃn/ | ความละเอียด |
| amplitude/ˈæmplɪtjuːd/ | The maximum displacement from an equilibrium position. |
| bitmap image | A grid of dots — pixels. |
| pixels/ˈpɪkslz/ | พิกเซล |
| Colour depth/ˈkʌlə depθ/ | The number of bits per pixel. |
| file size |
ข้อความ เสียง และรูปภาพในรูปแบบ binary
- ข้อมูลไม่ใช่แค่ตัวเลข — ข้อความ เสียง และ รูปภาพ ก็กลายเป็น binary เช่นกัน
- แต่ละประเภทมีวิธีการของตัวเอง
- ความสมดุลในทุกสิ่ง: คุณภาพที่ดีขึ้นหมายถึง ไฟล์ที่มีขนาดใหญ่ขึ้น
การแทนที่ข้อความ
- แต่ละตัวอักษรถูกกำหนดหมายเลขไว้ เก็บในรูป binary ชุดของตัวอักษร + หมายเลข theirs คือ character set
- ASCII ASCII uses 7 bits → 128 characters (enough for English letters, digits, symbols).
- Unicode ใช้บิตมากขึ้น → ตัวอักษรมากมาย (หลายภาษา สัญลักษณ์ Emoji) — แต่ข้อความเดียวกันใช้ พื้นที่จัดเก็บมากกว่า


การแทนเสียง
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.
การแทนที่เสียง
- คลื่นเสียงมีความเรียบลื่น; เพื่อจัดเก็บคอมพิวเตอร์จะวัดความสูง ณ ช่วงเวลาปกติ — sampling
- Sample rate = จำนวน samples ต่อวินาที (Hz); sample resolution = บิตต่อ sample
- อัตราและความละเอียดที่สูงขึ้น → บันทึกที่แม่นยำยิ่งขึ้น แต่ไฟล์ใหญ่ขึ้น


The sample rate of a sound recording is:
ความยาก 1/5 · 100 เหรียญ + บอนัสน้อยๆ เมื่อทำสำเร็จครั้งแรกในวันนี้
Sample rate = samples per second (Hz); sample resolution = bits per sample.
การแทนที่รูปภาพ
- ภาพ bitmap เป็นตารางของจุด — pixels
- Resolution = จำนวนพิกเซล (เช่น $1920 \times 1080$)
- Colour depth = จำนวนบิตต่อพิกเซล
- ความละเอียดและความลึกสีที่สูงขึ้น → คุณภาพดีขึ้น แต่ไฟล์ใหญ่ขึ้น


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}$ สี หรือประมาณ 16.7 ล้านสี ทำให้เฉดสีดูราบรื่น
- แต่ละพิกเซลต้องใช้ 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.
คุณเข้าใจแล้ว
- ข้อความ: character set เชื่อมโยงตัวอักษรกับตัวเลข; ASCII = 7 บิต (128), Unicode = มากกว่า (emoji), ไฟล์ใหญ่ขึ้น
- เสียง: sampling บันทึกคลื่น; sample rate (Hz) + sample resolution (bits)
- รูปภาพ: pixels; resolution (จำนวนพิกเซล) + colour depth (bิต/พิกเซล)
- ทั้งสามอย่างนี้: คุณภาพสูงขึ้น → ไฟล์ใหญ่ขึ้น
เกิดปัญหาอะไรขึ้น? เฉพาะทีมเว็บไซต์เท่านั้นที่เห็นข้อมูลนี้