Bird
Raised Fist0
Signal Processingdata~20 mins

Analog vs digital signals in Signal Processing - Practice Questions

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Signal Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference in Signal Representation

Which statement best describes the difference between analog and digital signals?

ADigital signals are continuous, and analog signals are discrete.
BAnalog signals represent data with continuous values, while digital signals use discrete values.
CAnalog signals use binary code, while digital signals use waveforms.
DBoth analog and digital signals represent data in the same way.
Attempts:
2 left
💡 Hint

Think about how the signal values change over time.

❓ Predict Output
intermediate
2:00remaining
Sampling an Analog Signal

Given a simple analog signal represented by a sine wave, what is the output of the sampling code below?

Signal Processing
import numpy as np
import matplotlib.pyplot as plt

# Analog signal: sine wave
x = np.linspace(0, 2 * np.pi, 1000)
analog_signal = np.sin(x)

# Sampling at 10 points
sample_points = np.linspace(0, 2 * np.pi, 10)
sampled_signal = np.sin(sample_points)

print(sampled_signal)
A[0.0, 0.707, 1.0, 0.707, 0.0, -0.707, -1.0, -0.707, 0.0, 0.707]
B[0.0, 0.5, 1.0, 0.5, 0.0, -0.5, -1.0, -0.5, 0.0, 0.5]
C[1.0, 0.866, 0.5, 0.0, -0.5, -0.866, -1.0, -0.866, -0.5, 0.0]
D[0.0, 0.64278761, 0.98480775, 0.8660254, 0.34202014, -0.34202014, -0.8660254, -0.98480775, -0.64278761, 0.0]
Attempts:
2 left
💡 Hint

Check the sine values at equally spaced points between 0 and 2π.

❓ data_output
advanced
1:30remaining
Quantization Levels in Digital Signals

What is the number of unique values (levels) produced by quantizing an analog signal into 3 bits?

A8
B32
C16
D6
Attempts:
2 left
💡 Hint

Recall that the number of levels is 2 raised to the number of bits.

❓ visualization
advanced
2:30remaining
Visualizing Analog vs Digital Signals

Which plot correctly shows an analog sine wave and its digital sampled version?

Signal Processing
import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 2 * np.pi, 1000)
analog = np.sin(x)
sample_x = np.linspace(0, 2 * np.pi, 20)
digital = np.sin(sample_x)

plt.figure(figsize=(8,4))
plt.plot(x, analog, label='Analog Signal')
plt.stem(sample_x, digital, linefmt='r-', markerfmt='ro', basefmt='k-', label='Digital Samples')
plt.legend()
plt.show()
AOnly red dots scattered randomly with no continuous curve.
BA jagged line connecting discrete points with no smooth curve.
CA smooth continuous curve with red dots and stems at discrete points along the curve.
DTwo overlapping smooth curves with no discrete points.
Attempts:
2 left
💡 Hint

Look for a smooth curve representing analog and discrete points for digital.

🚀 Application
expert
3:00remaining
Choosing Sampling Rate for Signal Reconstruction

You have an analog signal with a maximum frequency of 5 kHz. According to the Nyquist theorem, what is the minimum sampling rate required to reconstruct the signal without loss?

A10 kHz
B5 kHz
C2.5 kHz
D20 kHz
Attempts:
2 left
💡 Hint

The Nyquist theorem states the sampling rate must be at least twice the highest frequency.

Practice

(1/5)
1. Which of the following best describes an analog signal?
easy
A. A signal that changes smoothly and continuously over time
B. A signal that only has two fixed levels, 0 and 1
C. A signal that is always digital
D. A signal that cannot be measured

Solution

  1. Step 1: Understand the nature of analog signals

    Analog signals vary smoothly and continuously, representing information in a flowing manner.
  2. Step 2: Compare with digital signals

    Digital signals use fixed steps, usually two levels (0 and 1), unlike analog signals.
  3. Final Answer:

    A signal that changes smoothly and continuously over time -> Option A
  4. Quick Check:

    Analog = continuous signal [OK]
Hint: Analog means continuous change, not fixed steps [OK]
Common Mistakes:
  • Confusing analog with digital signals
  • Thinking analog signals have only two levels
  • Assuming analog signals cannot be measured
2. Which of the following is the correct way to represent a digital signal?
easy
A. A smooth curve that varies continuously
B. A signal that changes randomly without pattern
C. A signal that cannot be converted to numbers
D. A signal with only two levels, such as 0 and 1

Solution

  1. Step 1: Identify digital signal characteristics

    Digital signals use fixed levels, typically two: 0 and 1, representing discrete steps.
  2. Step 2: Eliminate incorrect options

    Smooth curves describe analog signals, not digital. Digital signals can be converted to numbers and are not random.
  3. Final Answer:

    A signal with only two levels, such as 0 and 1 -> Option D
  4. Quick Check:

    Digital = two-level signal [OK]
Hint: Digital signals have two fixed levels: 0 and 1 [OK]
Common Mistakes:
  • Choosing smooth continuous signals for digital
  • Thinking digital signals cannot be numeric
  • Confusing randomness with digital signals
3. Consider this Python code simulating signal values:
import numpy as np

# Analog signal: sine wave
analog_signal = np.sin(np.linspace(0, np.pi, 5))

# Digital signal: threshold at 0

digital_signal = (analog_signal > 0).astype(int)

print(digital_signal)

What is the output of print(digital_signal)?
medium
A. [0 1 1 1 0]
B. [1 1 1 1 1]
C. [0 0 0 0 0]
D. [1 0 0 0 1]

Solution

  1. Step 1: Calculate analog signal values

    Using np.linspace(0, π, 5), the sine values are [0, ~0.707, 1, ~0.707, 0].
  2. Step 2: Apply threshold to create digital signal

    Values > 0 become 1, else 0. So digital_signal = [0, 1, 1, 1, 0].
  3. Final Answer:

    [0 1 1 1 0] -> Option A
  4. Quick Check:

    Threshold > 0 converts sine to binary [OK]
Hint: Threshold analog > 0 to get digital 0 or 1 [OK]
Common Mistakes:
  • Misunderstanding np.linspace endpoints
  • Confusing >0 with >=0 condition
  • Forgetting to convert boolean to int
4. The following code attempts to convert an analog signal to digital but has an error:
import numpy as np

analog = np.array([0.1, -0.5, 0.3, -0.2])
digital = analog > 0
print(digital)

What is the error and how to fix it?
medium
A. No error; code works correctly
B. digital is boolean, convert to int with digital = (analog > 0).astype(int)
C. Use analog >= 0 instead of > 0
D. Use np.sign(analog) instead of > 0

Solution

  1. Step 1: Identify output type of comparison

    analog > 0 returns a boolean array, not integers 0 or 1.
  2. Step 2: Convert boolean to integer

    Use .astype(int) to convert True/False to 1/0 for digital signal representation.
  3. Final Answer:

    digital is boolean, convert to int with digital = (analog > 0).astype(int) -> Option B
  4. Quick Check:

    Boolean to int conversion needed [OK]
Hint: Convert boolean array to int for digital signals [OK]
Common Mistakes:
  • Assuming boolean array is digital signal
  • Changing threshold condition unnecessarily
  • Using np.sign without reason
5. You have a noisy analog signal that fluctuates between -0.1 and 0.1 around zero. Which method best converts it to a stable digital signal?
hard
A. Use a simple threshold at 0 to convert to 0 or 1
B. Convert directly to integers without filtering
C. Apply a smoothing filter before thresholding at 0
D. Ignore noise and use raw analog values

Solution

  1. Step 1: Understand noise impact on thresholding

    Noise near zero causes unstable digital output if thresholded directly.
  2. Step 2: Apply smoothing filter before threshold

    Smoothing reduces noise fluctuations, producing stable digital signals after thresholding.
  3. Final Answer:

    Apply a smoothing filter before thresholding at 0 -> Option C
  4. Quick Check:

    Smoothing stabilizes noisy analog signals [OK]
Hint: Smooth noisy signals before thresholding [OK]
Common Mistakes:
  • Thresholding noisy signal directly
  • Ignoring noise effects
  • Using raw analog values as digital
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard