Frequency Spectrum (FFT Analysis)FFT Size: 2048 | Max Frequency: -- Hz
Post-Lab Quiz
Test your understanding of audio signal processing concepts demonstrated in this lab.
Question 1: Time-Delay Implementation
How is the 5-second delay implemented in the waveform display?
A) By using a setTimeout function that delays drawing by 5 seconds
B) By storing audio data in a circular buffer and reading from a position 5 seconds behind the write position
C) By processing the audio at a slower sampling rate
D) By using a low-pass filter that introduces phase delay
Correct Answer: B
The 5-second delay is implemented using a circular buffer that continuously stores incoming audio data. The visualization reads from a position in the buffer that is 5 seconds behind the current write position, creating a fixed delay without interrupting real-time processing.
Question 2: FFT Resolution
What determines the frequency resolution of the FFT spectrum display?
A) The sampling rate of the audio input
B) The FFT size (number of samples used in the transform)
C) The gain setting of the microphone
D) Both A and B
Correct Answer: D
Frequency resolution (Δf) is determined by both the sampling rate (fs) and FFT size (N): Δf = fs/N. A higher sampling rate increases the frequency range, while a larger FFT size provides finer frequency resolution within that range.
Question 3: Nyquist Theorem
If the audio is sampled at 44.1 kHz, what is the maximum frequency that can be accurately represented in the spectrum display?
A) 44.1 kHz
B) 22.05 kHz
C) 11.025 kHz
D) 88.2 kHz
Correct Answer: B
According to the Nyquist-Shannon sampling theorem, the maximum frequency that can be accurately represented is half the sampling rate (fs/2). For a 44.1 kHz sampling rate, this is 22.05 kHz.
Question 4: Web Audio API Nodes
Which Web Audio API node is primarily responsible for performing the FFT analysis in this lab?
A) GainNode
B) AnalyserNode
C) DelayNode
D) OscillatorNode
Correct Answer: B
The AnalyserNode provides real-time frequency and time-domain analysis of audio data. It performs FFT internally and allows access to frequency data through methods like getByteFrequencyData().
Question 5: Circular Buffer Advantage
What is the main advantage of using a circular buffer for implementing the 5-second delay?
A) It requires less memory than a linear buffer
B) It allows continuous real-time processing without allocating new memory for each sample
C) It automatically applies a low-pass filter to the audio
D) It increases the sampling rate of the audio
Correct Answer: B
A circular buffer uses a fixed amount of memory by overwriting old data when the buffer is full. This is efficient for real-time streaming applications like audio processing, where we need constant-time operations for both writes and reads without frequent memory allocations.