ArticlePDF Available

Free oscilloscope web app using a computer mic, built-in sound library, or your own files

Authors:

Abstract and Figures

We have developed an online oscilloscope program which allows users to see waveforms by utilizing their computer microphones, selecting from our library of over 30 audio files, and opening any ∗.mp3 or ∗.wav file on their computers. The oscilloscope displays real-time signals against time. The oscilloscope has been calibrated so one can make accurate frequency measurements of periodic waves to within 1%. The web app is ideal for computer projection in class.
Content may be subject to copyright.
Free Oscilloscope Web App Using Computer Mic,
Built-In Sound Library, or Your Own Files
Edward Ball,1 Frances Ruiz2, and Michael J Ruiz3
1 Academo (academo.org), London, UK
2Asheville, NC, USA
3 Department of Physics, University of North Carolina at Asheville, Asheville, North Carolina,
28804, USA
E-mail: info@academo.org, frances.ruiz@gmail.com, and mjtruiz@gmail.com
Abstract
We have developed an online oscilloscope program which allows users to see waveforms by
utilizing their computer microphones, selecting from our library of over 30 audio files, and
opening any *.mp3 or *.wav file on their computers. The oscilloscope displays real-time signals
against time. The oscilloscope has been calibrated so one can make accurate frequency
measurements of periodic waves to within 1%. The web app is ideal for computer projection in
class.
Introduction
Class demonstrations with oscilloscopes gained popularity in the 1950s. The commercial success
of mass-produced cathode-ray tubes for televisions led to the construction of oscilloscopes for
projection in large classrooms. [1] Today it is common for teachers to use oscilloscope software
such as the MacScope II [2]. Our HTML5 oscilloscope is a free web application (app) that
students and teachers can access and run online [3].
Use of the oscilloscope app
An effective use of our oscilloscope is watching the waveform display in real time as the app
responds to sound waves. There are three ways to display sound sources. First, one can use a
microphone to speak, sing, or make any sound in class. The oscilloscope displays the waveform
as the sound is heard. There are four sensitivity settings to choose from, which adjust the vertical
scale of the oscilloscope so that the waveforms fit nicely on the screen. The time scale can be
changed to horizontally expand or compress the visual representation of the waves. One can also
modify the refresh rate by selecting slow or fast response.
A second source of audio is our sound library of over 30 samples that can be chosen from
the app’s built-in sound menu. Finally, the user can open any *.mp3 or *.wav file and watch the
changing waveforms as the audio file is played by the app. Watching the waveforms provides
insight into the physics of sound. See figure 1 for a screenshot of a waveform produced by a
flute.
Figure 1. Screenshot of waveform produced by a flute, courtesy flautist Isabel Ferber.
Our oscilloscope can also be employed to measure frequencies of periodic waves. In
order to closely examine a waveform, users can pause the sound playing from a file, or click the
“Freeze live input” checkbox to obtain a still image of the sound coming through the
microphone.
To measure the period of the periodic tone in figure 1, notice the places where the
waveform crosses the horizontal axis. One crossing takes place at 3.0 ms. See figure 2. The same
corresponding point one period later crosses the horizontal axis at 4.6 ms. The period is found by
subtracting these values to arrive at
4.6 ms 3.0 ms 1.6 msT=−=
. The corresponding frequency
is
1 1000 1000 625 Hz
(in ms) 1.6
fTT
= = = =
.
Figure 2. Measuring the period of a periodic wave on the oscilloscope.
The flautist was playing an
b
E
in the octave above middle C at the instant. This note is
often referred to as 5
b
E. The note being played can be verified by looking at the time 0:03 s
displayed by the audio player for our 7-second flute library file (refer to either figure 1 or figure
2). One can go to a keyboard and play the phrase with the flautist. In this way, the note played at
0:03 s will be found to be
5
b
E
, which has a frequency equal to 622 Hz.1 This independent method
to arrive at the frequency indicates excellent agreement with our measured value of 625 Hz using
our oscilloscope. The experimental error is only 0.5%.
Waveform fidelity of the oscilloscope
Depending on the combination of your computer’s operating system and your chosen
browser, you may recognize subtle waveform differences for certain types of waves. See figures
3a and 3b for the variation of a square-wave display on a Mac and a PC, both using the Chrome
browser.
1 The desired note is 6 semitones above concert A = 440 Hz. Multiplying 440 by the twelfth root of 2 a total of six
times gets you to the desired note at 622 Hz. Or, a teacher can look up the frequencies for the note on the keyboard
online or in a reference book.
Figure 3a. A 1000-Hz square wave on the Mac with Google Chrome. Note that this rendition is
better than what is displayed on the PC seen in figure 3b.
Figure 3b. A 1000-Hz square wave on a PC with Google Chrome. Note that this PC has trouble
with the higher-frequency components of the square wave, essentially filtering out higher
harmonics. The Mac (figure 3a) does a better job reproducing the square wave.
The Mac used to produce figure 3a is excellent at rendering a 1000-Hz square wave,
while the PC in figure 3b introduces ripples. When one passes a square wave through a low-pass
filter in a lab situation, higher frequency harmonics get filtered out, which results in outputs
similar to figure 3b. It appears that our PC-and-browser combination has difficulty registering
the higher-frequency components of the square wave. Such deviations could be due to the audio
processing in the sound card, operating system, or browser. We expect that technology
improvements in the future will resolve such artifacts. Google Chrome, at the writing of this
paper, runs the web app very well.
Conclusion
This paper makes available an HTML5 online oscilloscope for teachers and students. The
oscilloscope is calibrated so that users can typically measure frequencies of periodic waves to
within 1%. We recommend that the app be run online [3] since we keep our version updated
based on the latest quirks of browsers. However, the source files are available for download if
anyone wants to see the code. Any noncommercial use is allowed.
We provide a short video abstract [4] which describes the app and includes video footage
from which several of our library audio files were extracted. The oscilloscope display is
superimposed over the associated video so one can see the video that accompanies the sounds.
We hope teachers and students will have fun in class making their own sounds and watching the
waveforms in real time using our oscilloscope app.
References
[1] Patronis E T 1954 Large-screen oscilloscope, Am. J. Phys. 22 341-3
[2] LoPresto M C 2013 Using musical intervals to demonstrate superposition of waves and
Fourier Analysis Phys. Educ. 48 640-647
[3] Ball E 2017 Oscilloscope: https://academo.org/articles/oscilloscope/
[4] Ruiz M J 2017 Video: Oscilloscope: http://www.mjtruiz.com/ped/oscilloscope/
Authors
Edward Ball received his Master of Physics from Durham University,
UK. He currently works as a web developer and enjoys creating
browser-based interactive demonstrations, particularly those featuring
sound and waves. These demos can be accessed at his Academo
website (academo.org).
Frances Ruiz is a graduate of Carnegie Mellon University, Pittsburgh,
USA. She is an Asheville-based software developer and award-
winning novelist.
Michael J Ruiz is professor of physics at the University of North
Carolina at Asheville (UNCA), USA. He received his PhD in
theoretical physics from the University of Maryland, USA. His
innovative courses with a strong online component aimed at general
students have been featured on CNN.
ResearchGate has not been able to resolve any citations for this publication.
Article
Full-text available
What follows is a description of a demonstration of superposition of waves and Fourier analysis using a set of four tuning forks mounted on resonance boxes and oscilloscope software to create, capture and analyze the waveforms and Fourier spectra of musical intervals.