/HKScM-2022/js
/HKScM-2022/css
/HKScM-2022/images
/en/web/scm
link link link link
Hong Kong Science Museum
  • About Us
  • Visit
  • Exhibitions
  • Events
  • Online Explore
LanguageEN繁簡
  • EN
  • 繁
  • 簡
Thu, 12 May 2022 18:45:36 +0800
Curator's Blog

Pulse-width Modulation - from Digital Display to 1-bit Music
Published on 30 January 2024

With the rapid development of technology, we are spending more and more time using electronic devices. However, staring at a digital display for an extended period can cause eye strain or even headaches. One possible culprit under scrutiny is the use of pulse-width modulation (PWM) by screen manufacturers to adjust screen brightness.

PWM is a technique for controlling the average power output of a binary electrical signal. It achieves this by continuously alternating the output between "on" (high voltage) and "off" (zero volt) states, while adjusting the ratio of the time spent in each state over a fixed time interval. It finds extensive use across various applications, such as reducing the average power delivered and mimicking an analogue signal.

Take an example of an LCD display that uses PWM to control brightness. When the brightness is set to 100%, the display receives a constant supply of high voltage. If we dim the display, the whole screen undergoes rapid on-off cycles at a frequency that is not visible to the human eye. For example, if the display is on for half of the time and off for the other half, it results in a 50% perceived brightness level. To further decrease the brightness level to 25%, the on-time is reduced by an additional 50%.


Although the flickering of displays occurs at a very high frequency, some individuals may be sensitive to it, resulting in the headaches that they experience. It is, therefore, recommended to limit the duration of usage, especially when the display is set to a lower brightness level.

While this may be considered a nuisance by some, another use of PWM once breathed life into a computer audio system that was initially thought to be capable only of producing "beeping" sounds. The computer in question was the ZX Spectrum, the first affordable home computer of the 1980s.

To keep the cost down, the onboard sound interface of the ZX Spectrum was equipped with a "beeper" speaker, which offered a 10-octave range of 1-bit playback, limited to just a single channel. The raw melodic output would be similar to a monophonic greeting card.


Your browser does not support the video tag.

But rather than stifling creativity, this constraint acted as a catalyst and drove innovative solutions to overcome technical obstacles. One of the solutions is to make use of PWM to generate polyphonic, multi-channel music.

In a speaker, the pitch of the tone produced is determined by the voltage frequency, i.e., the number of cycles per second.


To create polyphonic music, which involves two or more independent melodies playing simultaneously, a signal has to carry multiple voltage frequencies. These waveforms combine with each other, resulting in either the addition or subtraction of amplitude, i.e., constructive or destructive interference.

However, in a 1-bit environment, simply combining two waveforms leads to extreme distortion. This is because 1-bit waveforms can only have amplitudes of zero or one, making it impossible to accurately deliver additional signals.


Given that the pitch of a tone is determined by its frequency, signals with different percentages of on-time (duty cycle) but the same frequency, albeit different in the fullness of sound, will have the same pitch.



Your browser does not support the video tag.

Taking advantage of this phenomenon, composer programmers reduced the on-time to as low as around 6.25% to minimize the chance of waveform peaks colliding with each other as much as possible. In this way, numerous frequencies can be fitted into the same signal, generating polyphonic music.


Your browser does not support the video tag.

Although this technical constraint no longer exists nowadays, 1-bit music composition has found its place as a niche within the music community, with new songs being released each year.

Apart from the above two examples, can you name other fields where PWM is also used?

Hong Kong Science Museum
Follow Us
  • instagram
  • facebook
  • youtube
Subscribe "Hong Kong Science Museum e-News"
Address
2 Science Museum Road,
Tsimshatsui East,
Kowloon, Hong Kong
 
  • Contact Us
  • Download Area
  • GovHK
  • Hong Kong Space Museum
  • Science Promotion Unit
  • LCSD
  • LCSD e-Magazine
  • LCSD Museums
  • LCSD Edutainment Channel
  • LCSD Plusss
  • Culture and Tourism Information of Guangdong, Hong Kong and Macao
Copyright © 2025 Leisure and Cultural Services Department. All Rights Reserved.
  • Privacy Policy
  • Important Note
  • Sitemap
Last Modified: