What if you could capture every sound perfectly with just the right number of snapshots?
Why Sampling theorem (Nyquist-Shannon) in Signal Processing? - Purpose & Use Cases
Imagine you want to record your favorite song using a simple microphone and then play it back perfectly. You try to capture the sound by taking random snapshots of the audio wave without any plan.
This random capturing leads to a messy recording that sounds distorted or incomplete. Without a clear rule on how often to sample the sound, you miss important details or add confusing noise, making the playback unpleasant and inaccurate.
The Sampling theorem (Nyquist-Shannon) gives a clear rule: sample the sound at least twice as fast as its highest frequency. This ensures you capture all the details perfectly and can reconstruct the original sound without any loss or distortion.
samples = [] for t in random_times: samples.append(record_sound(t))
sampling_rate = 2 * max_frequency samples = [record_sound(t) for t in np.arange(0, duration, 1/sampling_rate)]
It enables perfect digital capture and reconstruction of continuous signals, making clear audio, video, and data transmission possible.
When you listen to music on your phone, the songs are stored digitally using this theorem to ensure the sound is clear and true to the original recording.
Manual random sampling misses important signal details.
Sampling theorem sets the minimum rate to capture all information.
Following it ensures perfect signal reconstruction and quality.
Practice
Solution
Step 1: Understand the sampling theorem
The Nyquist-Shannon theorem says to sample at least twice the highest frequency to capture all information.Step 2: Identify correct sampling rate
Sampling below twice the highest frequency causes aliasing and loss of information.Final Answer:
Sample at least twice the highest frequency of the signal -> Option DQuick Check:
Sampling rate ≥ 2 x highest frequency [OK]
- Thinking sampling rate can be less than highest frequency
- Confusing sampling rate with signal frequency
- Ignoring aliasing effects
fs?Solution
Step 1: Recall Nyquist frequency formula
The Nyquist frequency is half the sampling rate, so nyquist = fs / 2.Step 2: Match formula to options
Only nyquist = fs / 2 correctly divides fs by 2.Final Answer:
nyquist = fs / 2 -> Option AQuick Check:
Nyquist frequency = sampling rate / 2 [OK]
- Multiplying instead of dividing by 2
- Confusing Nyquist frequency with sampling rate
- Using addition or reciprocal incorrectly
highest_freq = 500 sampling_rate = ?
Solution
Step 1: Apply Nyquist theorem to highest frequency
Minimum sampling rate = 2 x highest frequency = 2 x 500 = 1000 Hz.Step 2: Compare with options
Only sampling_rate = 1000 matches 1000 Hz.Final Answer:
sampling_rate = 1000 -> Option AQuick Check:
Minimum sampling rate = 2 x 500 = 1000 [OK]
- Choosing sampling rate equal to highest frequency
- Selecting a rate less than twice the frequency
- Confusing frequency units
fs = 800
nyquist = fs * 0.5
print("Nyquist frequency is", nyquist)Solution
Step 1: Understand calculation of Nyquist frequency
Nyquist frequency = sampling rate divided by 2, which equals fs * 0.5.Step 2: Check code correctness
Code multiplies fs by 0.5 correctly and prints the value 400.0.Final Answer:
The code is correct and will print 400.0 -> Option CQuick Check:
fs * 0.5 = 400.0, print works fine [OK]
- Thinking multiplication by 0.5 is wrong
- Assuming variable case matters here
- Believing print syntax is incorrect in Python 3
Options:
A) No problem, sampling rate is sufficient
B) Aliasing will occur because sampling rate is less than twice highest frequency
C) Aliasing will occur because sampling rate is more than twice highest frequency
D) Signal will be perfectly reconstructed without aliasing
Solution
Step 1: Calculate minimum sampling rate needed
Minimum sampling rate = 2 x 1200 Hz = 2400 Hz.Step 2: Compare given sampling rate with minimum
Given sampling rate is 2000 Hz, which is less than 2400 Hz, so aliasing will occur.Step 3: Understand aliasing cause
Sampling below twice the highest frequency causes signal distortion called aliasing.Final Answer:
Aliasing will occur because sampling rate is less than twice highest frequency -> Option BQuick Check:
Sampling rate < 2 x highest frequency causes aliasing [OK]
- Assuming 2000 Hz is enough for 1200 Hz signal
- Confusing aliasing cause with oversampling
- Thinking aliasing occurs when sampling rate is too high
Ready to prove it?
Pass the test and this pattern moves unknown
