AI summary by TwinMind

The Engineering Inside Wireless Earbuds || How do Wireless Earbuds and Audio Codecs Work?

Branch Education

17m 41s

Wireless Earbuds Overview

  • Complete mystery how wireless earbuds work vs wired headphones
  • 9 distinct technologies inside tiny plastic earbuds:
    • Speaker, audio codecs, Bluetooth, system on chip (SoC), printed circuit board (PCB), accelerometers, lithium ion battery, microphones, noise cancellation
  • Focus on audio codecs specifically
  • Video structure: 4 parts covering teardown, conceptual overview, digital audio representation, detailed explanations

Apple AirPods 2 Teardown

  • Opening extremely difficult/destructive due to glue
  • Components from outside to inside:
    • Outer plastic earpiece + mesh dust cover
    • Rubber protective shell + optical sensor
    • Speaker with 4 key components: diaphragm, suspension/spider, voice coil, magnet
    • Complex circuitry folded into tiny package
  • Circuit board structure:
    • 3 separate PCBs folded together with flexible wires
    • Top board: 2 speaker connection points, microchip for Bluetooth connectivity/audio decoding, accelerometers, programmable SoC
    • Second board: low power stereo audio processing chip/audio codec
    • Flat cable antenna adjacent to battery
    • Microphone at back for noise reduction
    • Third board connected to battery
    • Additional small board with MEMS microphone (grain of rice size)
    • Mesh dust cover + charging contacts at bottom

Conceptual Operation Overview

  • Bluetooth communication channel established between paired headphones/smartphone
  • Process flow:
    • Smartphone grabs audio data from flash storage
    • Decompresses audio, stores in working memory as long set of numbers
    • Compresses/divides into packets per Bluetooth specs
    • Converts packets to electromagnetic waves/photons
    • Sends via Bluetooth to earbuds
    • Earbuds receive, disassemble, decompress packets back to value sets
    • Audio codec converts digital values to analog electrical waveform
    • Waveform sent to voice coil attached to diaphragm
    • Voice coil moves back/forth per waveform
    • Diaphragm movement creates air pressure waves
    • Pressure waves sensed by ear, interpreted as sound by brain

Audio Codec Fundamentals

  • Codec = coding and decoding
  • Software/hardware converting data between formats while compressing/decompressing
  • Audio codec functions:
    • Decoding: digital values/numbers → analog waveform (digital-to-analog conversion/DAC)
    • Encoding: analog microphone signal → digital values (analog-to-digital conversion/ADC)
  • Used in all technology for data type conversion
  • Video codecs actively decompress video data during viewing

Digital Audio Representation Basics

  • Analog audio waveform → digital list of numbers
  • Process simpler than expected - no complex mathematics
  • Method: place analog waveform on graph, capture values at set time intervals
  • Digital audio = long list of values/points waveform passes through
  • Example: 23 microseconds between each data point
  • Audio codec process: plots points on graph, connects dots, smooths line, sends analog waveform to speaker
  • Audio files in editing software show constituent points when zoomed in
  • Process called digitization/analog-to-digital conversion

Sampling Rate Details

  • X-axis = time, data points/samples spaced 23 microseconds apart
  • Alternative: 1 microsecond spacing = 1 million samples/second (1 MHz) = 100+ MB for 60 seconds audio
  • 23 microsecond spacing rationale:
    • Based on average human ear sound perception ability
    • Human hearing range: up to ~20 kHz (1 wave every 50 microseconds)
    • Higher frequencies inaudible to humans
    • Engineers ignore frequencies humans can't hear
  • Capturing 20 kHz max frequency requires 2 data points per full wave
  • Results in 1 data point every 23 microseconds
  • Standard sampling rates:
    • 44.1 kHz (44,100 samples/second) - most common for music/podcasts
    • 48 kHz - second most common
  • Why slightly more than double human hearing frequency: Nyquist theorem specifics in comments

Bit Depth and Quantization

  • Question: how many bits (1s/0s) per sample for binary representation
  • 1 bit per sample test:
    • Each sample = 1 or 0
    • Recreation looks nothing like original - insufficient
  • 2 bits per sample test:
    • 4 possible values per sample
    • Still poor match to original waveform
  • Optimal bit depth varies:
    • Audio CD: 16 bits per sample
    • 16 bits = 2^16 = 65,536 different Y-axis values
    • Technical term: "bit depth of 16 bits"
    • Higher quality: 24 or 32 bits per sample
  • Process terminology:
    • Analog signal → values = quantization
    • Assigning bits to values = pulse code modulation

Audio File Formats

  • Uncompressed digital audio (16-bit values at 44.1 kHz):
    • ~10.5 MB per 60 seconds, 2-channel audio
  • MP3 (320 kbps stereo):
    • Reduces to ~2.4 MB per 60 seconds
    • Processes every millisecond of audio
    • Psychoacoustic algorithm removes elements humans can't hear well:
      • Exceptionally low volume sounds
      • Very high pitched sounds
      • Sounds very close together
    • Lossy compression format
  • Lossless formats (ALAC, FLAC):
    • Don't discard data
    • Compress by finding patterns/redundant data
    • Represent patterns more efficiently than uncompressed
  • File compression = complex topic requiring dedicated videos

Future Content Plans

  • 9 technologies in wireless earbuds require separate episodes
  • Current video coverage status mentioned
  • Working on additional topic videos
  • Complete wireless headphone understanding requires full series

TwinMind

Get summaries like this for your own meetings

TwinMind takes notes in the background during meetings, lectures, and calls, then writes the summary for you.

Free plan to get started

No bot joins your calls

Phone, desktop & Chrome apps

Your next meeting, summarized like this

TwinMind listens in the background and turns meetings, lectures, and calls into searchable notes you can chat with. Start free.

Available on phone, desktop & Chrome

Your next meeting, summarized like this

TwinMind listens in the background and turns meetings, lectures, and calls into searchable notes you can chat with. Start free.

Available on phone, desktop & Chrome

Your next meeting, summarized like this

TwinMind listens in the background and turns meetings, lectures, and calls into searchable notes you can chat with. Start free.

Available on phone, desktop & Chrome