Which of the following signals is a discrete-time signal?
Discrete-time signals are defined only at separate points in time, not continuously.
Discrete-time signals have values only at specific time steps (integers), unlike continuous-time signals which have values at every instant.
What is the output array when sampling the continuous-time signal x(t) = t from t=0 to t=4 with a sampling interval of 1?
import numpy as np t = np.arange(0, 5, 1) x = t print(x)
Sampling with interval 1 means taking values at 0,1,2,3,4.
The continuous signal x(t) = t sampled at t=0,1,2,3,4 gives values equal to those time points.
Given a discrete-time signal x[n] of length 10, what is the length of the signal after downsampling by a factor of 3?
import numpy as np x = np.arange(10) y = x[::3] print(len(y))
Downsampling by 3 means taking every third sample starting at index 0.
From 10 samples, taking every 3rd gives indices 0,3,6,9 → 4 samples total.
Which plot correctly shows a continuous-time signal and its sampled discrete-time version?
import numpy as np import matplotlib.pyplot as plt t = np.linspace(0, 2*np.pi, 1000) x_cont = np.sin(t) n = np.arange(0, 2*np.pi, np.pi/4) x_disc = np.sin(n) plt.figure(figsize=(6,4)) plt.plot(t, x_cont, label='Continuous') plt.stem(n, x_disc, linefmt='r-', markerfmt='ro', basefmt='k-', label='Discrete') plt.legend() plt.xlabel('Time') plt.ylabel('Amplitude') plt.title('Continuous and Discrete Signals') plt.show()
Discrete signals are shown as dots with stems, continuous as smooth lines.
The continuous signal is a smooth sine wave; the discrete samples are red dots with vertical lines.
What error occurs when running this code to generate a discrete-time signal x[n] = n^2 for n=0 to 4?
n = range(5) x = [n**2 for n in n] print(x)
Check variable names and list comprehension syntax carefully.
The code correctly uses list comprehension and variable shadowing is allowed; output is squares of 0 to 4.
