Discrete Signal Processing (DSP):
Discrete Signals
Table of Contents
A signal $x[n]$ is a function that maps an independent variable to a dependent variable.
In this course, we will focus on discrete-time signals $x[n]$:
plot
for continuous signals in MATLAB
stem
for discrete signals in MATLAB
%plot -s 560,200
t = 0:0.01:2;
x = sin(2*pi*t);
plot(t, x, 'linewidth', 2);
ylim([-1.1 1.1]);
xlabel('t [sec]');
ylabel('x(t)');
%plot -s 560,400
N = 20;
n = 0:N-1;
x = sin(2*pi/N*n);
subplot(2,1,1)
plot(n,x,'o'), axis tight, ylim([-1.2, 1.2])
subplot(2,1,2)
stem(n,x,'filled'), axis tight, ylim([-1.2, 1.2])
$$x[n+mN] = x[n], \qquad \forall m \in \mathbb{Z}$$
%plot -s 560,100
N = 8;
n = 0:N-1;
x = [0 1 2 3 4 3 2 1];
stem(n,x,'filled');
xlabel('n'), ylabel('x[n]')
xlim([-16,23]),
yticks([0,4])
box('off')
%plot -s 560,100
%% periodic using mod
y = [];
n = -16:23;
for i = 1:length(n)
y(i) = x(mod(n(i),N)+1);
end
stem(n,y,'filled'), axis tight
xlabel('n'), ylabel('y[n]')
yticks([0,4])
box('off')