Microphone Frequency Visualization with FFT
Run the Microphone Frequency Visualization with FFT MicroSim Fullscreen
Edit Microphone Frequency Visualization with FFT MicroSim with the p5.js Editor
Sample iframe
You can add this MicroSim to your course website by adding the following HTML element:
1 | |
Here is a FFT Microphone Visualizer MicroSim that follows the standard responsive design template. Here are the key features:
Key Features
Audio Analysis: Uses p5.js AudioIn and FFT objects to capture and analyze microphone input in real-time, displaying frequency spectrum data as colorful bars.
Start/Stop Control:
- A "Start" button in the control region that allows users to start/stop audio recording without clearing the display - when stopped, the last spectrum remains visible.
- Max Frequency Slider - allows you to set the highest frequency displayed
Responsive Design: Follows the standard MicroSim layout with separate drawing and control regions that adapt to different screen sizes.
Visual Feedback:
- Color-coded frequency bars (blue for low frequencies, red for high frequencies)
- Real-time frequency and amplitude scaling
- Peak frequency detection and display
- Status indicators showing recording state
Educational Value: Students can observe how different sounds (voice, music, noise) create different frequency patterns, helping them understand concepts like:
- Frequency analysis and Fourier transforms
- Audio signal processing
- Harmonic content in different sounds
- Real-time data visualization
Usage Instructions
- Click "Start" to begin microphone input (browser will request permission)
- Make sounds near the microphone to see the frequency spectrum
- Click "Stop" to pause recording (spectrum remains visible)
- Click "Start" again to resume recording
The visualization shows frequency on the x-axis (0 to ~22kHz) and amplitude on the y-axis, with the peak frequency displayed in the control area. This provides an excellent hands-on way to explore audio signal processing concepts.
Lesson Plan
Learning Objectives
By the end of this lesson, students will be able to:
- Explain what the Fast Fourier Transform (FFT) does conceptually
- Identify the relationship between time domain sound and frequency domain representation
- Recognize harmonic patterns in different types of sounds
- Understand the frequency ranges of human hearing (20 Hz - 20 kHz)
Grade Level
9th-12th Grade Physics or Music Technology
Duration
30-45 minutes
Prerequisites
- Basic understanding of sound as vibration
- Familiarity with the concept of frequency and pitch
Materials Needed
- Computer with microphone (built-in or external)
- Various sound sources (tuning fork, musical instruments, smartphone with tone generator app)
Lesson Activities
Introduction (5 minutes)
- Discuss how sound is a pressure wave traveling through air
- Explain that the FFT converts time-domain signals to frequency-domain
- Show that complex sounds are made of multiple frequencies combined
Exploration Activities (20 minutes)
- Human Voice: Have students speak, hum, or sing different notes and observe the frequency patterns
- Vowel Sounds: Compare the spectra of different vowel sounds (ah, ee, oh, oo)
- Whistling: Observe the nearly pure single frequency of a whistle
- Clapping: See the broadband spectrum of an impulse sound
- Musical Instruments: If available, show the harmonic series of different instruments
Discussion Questions (10 minutes)
- Why do different instruments playing the same note sound different?
- What frequencies does the human voice typically produce?
- How does the spectrum change when you change pitch vs. loudness?
Assessment
Students identify mystery sounds by their frequency spectra alone, then verify by listening.
References
-
Fast Fourier Transform - Wikipedia - Mathematical background and history of the FFT algorithm
-
Seeing Sound: Introduction to Spectral Analysis - University of Connecticut - Physics of sound visualization
-
p5.js Sound Library Reference - Official documentation for the p5.js FFT and audio analysis functions