Bird
Raised Fist0
Signal Processingdata~10 mins

Continuous-time vs discrete-time signals in Signal Processing - Visual Side-by-Side Comparison

Choose your learning style10 modes available
Concept Flow - Continuous-time vs discrete-time signals
Start: Signal Defined
↓
Is signal continuous?
Yes→Continuous-time signal
No↓
Discrete-time signal
↓
Sampled values at discrete times
↓
End
The flow shows deciding if a signal is continuous or discrete, then processing accordingly.
Execution Sample
Signal Processing
import numpy as np
import matplotlib.pyplot as plt

t = np.linspace(0, 1, 1000)  # continuous time
x_cont = np.sin(2 * np.pi * 5 * t)

n = np.arange(0, 11)  # discrete time
x_disc = np.sin(2 * np.pi * 5 * n / 10)
This code creates a continuous-time sine wave and a discrete-time sine wave sampled at 11 points.
Execution Table
StepVariableValueDescription
1tarray of 1000 points from 0 to 1Continuous time vector created
2x_contsin(2π5t) values for each tContinuous-time sine wave computed
3narray [0,1,...,10]Discrete time indices created
4x_discsin(2π5n/10) values for each nDiscrete-time sine wave computed
5PlotContinuous and discrete signalsVisual comparison of signals
6End-Execution complete
💡 All steps executed to create and compare continuous and discrete signals
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
tundefinedarray of 1000 points from 0 to 1samesamesamesame
x_contundefinedundefinedarray of sine valuessamesamesame
nundefinedundefinedundefinedarray [0..10]samesame
x_discundefinedundefinedundefinedundefinedarray of sine valuessame
Key Moments - 3 Insights
Why does the continuous-time signal have 1000 points but the discrete-time signal only 11?
The continuous-time signal is sampled very finely to simulate continuity (step 1), while the discrete-time signal uses specific integer time points (step 3). This difference is shown in the execution_table rows 1 and 3.
Why do both signals use the sine function but look different?
The continuous signal uses many points to form a smooth curve (step 2), while the discrete signal uses fewer points sampled at intervals (step 4). This causes the discrete signal to appear as dots or steps.
Can discrete-time signals represent continuous signals perfectly?
No, discrete signals approximate continuous signals by sampling at intervals. The finer the sampling (more points), the closer the approximation, but some information is always lost.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 3, what does variable 'n' represent?
AContinuous time points
BDiscrete time indices
CSignal amplitude values
DFrequency of the sine wave
💡 Hint
Check execution_table row 3 description for 'n'
At which step is the continuous-time sine wave calculated?
AStep 3
BStep 1
CStep 2
DStep 4
💡 Hint
Look at execution_table row 2 for 'x_cont'
If we increase the number of points in 'n' from 11 to 1000, what happens to the discrete signal?
AIt becomes more like the continuous signal
BIt becomes less smooth
CIt disappears
DFrequency changes
💡 Hint
Refer to variable_tracker for how sample points affect signal shape
Concept Snapshot
Continuous-time signals are defined for every instant (smooth curve).
Discrete-time signals are defined only at specific time points (samples).
Discrete signals approximate continuous signals by sampling.
More samples mean better approximation.
Use numpy linspace for continuous and arange for discrete time vectors.
Full Transcript
This visual execution shows how continuous-time and discrete-time signals are created and compared. First, a continuous time vector 't' with 1000 points is made, then a sine wave 'x_cont' is computed for all these points, forming a smooth curve. Next, a discrete time vector 'n' with 11 integer points is created, and a discrete sine wave 'x_disc' is computed only at these points, appearing as separate dots. The key difference is that continuous signals have values at every instant, while discrete signals have values only at specific times. Sampling more points in discrete signals makes them closer to continuous signals. This step-by-step trace helps understand how signals differ and relate.

Practice

(1/5)
1. Which of the following best describes a continuous-time signal?
easy
A. A signal defined only at specific time points
B. A signal that is always zero
C. A signal that only takes integer values
D. A signal defined for every instant of time

Solution

  1. Step 1: Understand continuous-time signal definition

    A continuous-time signal is defined for every instant in time, meaning it varies smoothly without gaps.
  2. Step 2: Compare with discrete-time signals

    Discrete-time signals are defined only at specific time points, not continuously.
  3. Final Answer:

    A signal defined for every instant of time -> Option D
  4. Quick Check:

    Continuous-time = defined at all times [OK]
Hint: Continuous means all time points included [OK]
Common Mistakes:
  • Confusing continuous with discrete signals
  • Thinking discrete signals are continuous
  • Assuming continuous signals only take integer values
2. Which syntax correctly represents a discrete-time signal sampled from a continuous signal x(t) at integer times n?
easy
A. x[n] = integral of x(t)
B. x(n) = x(t) for all t
C. x[n] = x(t) at t = n
D. x(t) = x[n] for n in integers

Solution

  1. Step 1: Identify discrete-time signal notation

    Discrete-time signals use square brackets [n] to denote samples at integer times.
  2. Step 2: Match sampling definition

    Sampling means taking values of x(t) at specific times t = n, so x[n] = x(t) at t = n is correct.
  3. Final Answer:

    x[n] = x(t) at t = n -> Option C
  4. Quick Check:

    Discrete-time uses square brackets and samples at integers [OK]
Hint: Discrete signals use square brackets for indexing [OK]
Common Mistakes:
  • Using parentheses instead of square brackets for discrete signals
  • Confusing continuous and discrete notation
  • Thinking sampling is an integral operation
3. Given the continuous-time signal x(t) = 2t, what is the discrete-time signal x[n] sampled at integer times?
medium
A. x[n] = 2n
B. x[n] = 2t
C. x[n] = n/2
D. x[n] = 2

Solution

  1. Step 1: Understand sampling at integer times

    Sampling means replacing t by integer n in x(t).
  2. Step 2: Substitute t = n in x(t) = 2t

    We get x[n] = 2n.
  3. Final Answer:

    x[n] = 2n -> Option A
  4. Quick Check:

    Replace t with n in formula [OK]
Hint: Replace t with n for discrete samples [OK]
Common Mistakes:
  • Leaving t as variable in discrete signal
  • Dividing instead of multiplying by 2
  • Confusing n and t variables
4. Identify the error in this discrete-time signal definition: x[n] = x(t) at t = n + 0.5
medium
A. The notation x[n] is incorrect
B. Sampling at non-integer times is invalid for discrete-time signals
C. The signal should be continuous, not discrete
D. There is no error; this is a valid discrete-time signal

Solution

  1. Step 1: Understand discrete-time signal sampling points

    Discrete-time signals are defined at integer time points n.
  2. Step 2: Check sampling time t = n + 0.5

    Sampling at half-integers is not standard discrete-time sampling; it breaks the integer indexing rule.
  3. Final Answer:

    Sampling at non-integer times is invalid for discrete-time signals -> Option B
  4. Quick Check:

    Discrete-time = integer time samples only [OK]
Hint: Discrete-time signals sample only integer times [OK]
Common Mistakes:
  • Thinking discrete signals can sample at any time
  • Confusing notation with error
  • Assuming half-integers are valid discrete points
5. You have a continuous-time signal x(t) = sin(2πt). You sample it at 1 Hz (once per second). Which discrete-time signal x[n] do you get, and what is a potential problem?
hard
A. x[n] = sin(2πn); signal appears constant at zero
B. x[n] = sin(2πn); signal is perfectly captured
C. x[n] = sin(πn); signal is undersampled
D. x[n] = sin(4πn); signal is oversampled

Solution

  1. Step 1: Write discrete-time signal from sampling

    Sampling at 1 Hz means t = n seconds, so x[n] = sin(2πn).
  2. Step 2: Evaluate sin(2πn) for integer n

    Since sin(2πn) = 0 for all integers n, the sampled signal is always zero.
  3. Step 3: Identify the problem

    This is an example of aliasing where the sampled signal loses information and appears constant.
  4. Final Answer:

    x[n] = sin(2πn); signal appears constant at zero -> Option A
  5. Quick Check:

    Sampling frequency equals signal frequency causes zero samples [OK]
Hint: Sampling at signal period causes zero values [OK]
Common Mistakes:
  • Assuming sampling always captures signal perfectly
  • Ignoring aliasing effects
  • Confusing frequency and sampling rate
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