Audio signals carry sounds as electrical or digital data. Understanding their characteristics helps us analyze and process sounds clearly and correctly.
Audio signal characteristics in Signal Processing
Sampling Rate: number of samples per second (Hz)
Amplitude: strength or loudness of the signal
Frequency: how fast the signal oscillates (Hz)
Duration: length of the audio signal (seconds)
Waveform: shape of the signal over timeSampling rate must be at least twice the highest frequency to capture sound correctly (Nyquist rate).
Amplitude values can be positive or negative, showing the wave's up and down movement.
Sampling Rate = 44100 Hz Amplitude = 0.8 (normalized) Frequency = 440 Hz (A note) Duration = 2 seconds
Sampling Rate = 16000 Hz Amplitude = varies Frequency = varies Duration = 5 seconds
This code creates a simple audio signal of a 440 Hz tone lasting 1 second and plots its waveform for the first 400 samples.
import numpy as np import matplotlib.pyplot as plt # Parameters sampling_rate = 8000 # samples per second frequency = 440 # frequency of tone (Hz) duration = 1 # seconds # Time array t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False) # Generate sine wave (audio signal) signal = 0.5 * np.sin(2 * np.pi * frequency * t) # Plot waveform plt.plot(t[:400], signal[:400]) plt.title('Audio Signal Waveform (440 Hz sine wave)') plt.xlabel('Time (seconds)') plt.ylabel('Amplitude') plt.show()
Audio signals are often represented as arrays of numbers showing amplitude over time.
Higher sampling rates capture more detail but use more data.
Visualizing waveforms helps understand the sound's shape and changes.
Audio signals have key features: sampling rate, amplitude, frequency, duration, and waveform.
These features help us record, analyze, and process sounds effectively.
Simple sine waves are basic building blocks for understanding complex sounds.
Practice
Solution
Step 1: Understand sampling rate meaning
Sampling rate is the number of samples recorded per second in an audio signal.Step 2: Compare with other characteristics
Amplitude is signal strength, frequency is pitch, duration is length of sound.Final Answer:
Sampling rate -> Option DQuick Check:
Samples per second = Sampling rate [OK]
- Confusing frequency with sampling rate
- Thinking amplitude controls sample count
- Mixing duration with sampling rate
Solution
Step 1: Define time vector correctly
Use np.linspace(0, 1, 8000) to create 1 second with 8000 samples.Step 2: Calculate sine wave with correct frequency
Signal = sin(2π * frequency * time), so 2 * np.pi * 440 * t is correct.Final Answer:
t = np.linspace(0, 1, 8000); signal = np.sin(2 * np.pi * 440 * t) -> Option AQuick Check:
Time vector and frequency match signal formula [OK]
- Using np.arange with wrong step size
- Swapping frequency and sampling rate
- Incorrect time vector range
import numpy as np sampling_rate = 1000 frequency = 5 t = np.linspace(0, 1, sampling_rate) signal = 0.5 * np.sin(2 * np.pi * frequency * t)
Solution
Step 1: Understand amplitude scaling
The sine function outputs values between -1 and 1. Multiplying by 0.5 scales amplitude to ±0.5.Step 2: Identify maximum amplitude
Maximum amplitude is the positive peak, which is 0.5 here.Final Answer:
0.5 -> Option BQuick Check:
Amplitude scale factor = 0.5 [OK]
- Confusing frequency with amplitude
- Ignoring the 0.5 multiplier
- Assuming sine max is always 1 without scaling
import numpy as np t = np.linspace(0, 1, 440) signal = np.sin(2 * np.pi * 440 * t)
Solution
Step 1: Check time vector length for sampling rate
Sampling rate is 8000 Hz, so time vector must have 8000 points for 1 second.Step 2: Identify mismatch in code
Code uses 440 points in time vector, which is incorrect for 8000 Hz sampling.Final Answer:
The time vector length should be 8000, not 440 -> Option CQuick Check:
Sampling rate = time vector length [OK]
- Confusing frequency with sampling rate
- Changing sine to cosine unnecessarily
- Using wrong sampling rate value
Solution
Step 1: Use bandpass filter around target frequency
To isolate 440 Hz, apply a bandpass filter centered near 440 Hz to keep that frequency and remove others.Step 2: Analyze filtered signal
After filtering, analyze amplitude and phase to understand the sine wave component.Final Answer:
Apply a bandpass filter around 440 Hz, then analyze amplitude and phase -> Option AQuick Check:
Bandpass filter isolates frequency component [OK]
- Downsampling to frequency value instead of sampling rate
- Confusing filter types and cutoff frequencies
- Misunderstanding duration as filter parameter
Ready to prove it?
Pass the test and this pattern moves unknown
