Category Archives: DSP Lessons

DSP Lessons

Understanding of discrete signals

Discrete signals can be generated by software or obtained from real world through ADC. Discrete signals are sampled from analog signals. So you get samples in fixed time intervals. Discrete signal is as sequence of numbers. The element number n of sequence is marked as x(n). The most common number rows:

Unit sample sequence

d[n] = 1, if n=0
d[n] = 0, otherwise

You can describe it in Matlab like

% Plot an unit impulse signal
n = -5:5;
x = 0*n;
index=find(n==0);
x(index)=1;
% plot
stem(n, x);
axis([-inf, inf, -0.2, 1.2]);
xlabel('n');
ylabel('x');
title('Unit Impulse Signal delta[n]');

impulse.jpg

Unit Step Sequence

u[n] = 1, if n>=0
u[n] = 0, otherwise

You can describe it in Matlab like:

% Plot an unit impulse signal
n = -5:5;
x = 0*n;
index=find(n>=0);
x(index)=1;
% plot
stem(n, x);
axis([-inf, inf, -0.2, 1.2]);
xlabel('n');
ylabel('x');
title('Unit Step Signal u[n]');
unitstep.jpg
As you can see step is nothing more than set of impulses. And impulse
can be expressed as d[n]=u(n)-u(n-1); Thus any sequence of numbers can
be expressed asset of impulses like this:
anyset.jpg

For example sin() sequence can be written like this:
sinusoid.jpg
Matlab script would look like this:

% Plot a sinusoidal signal
n = 0:40;
omega=0.3;
x = sin(omega*n);
% plot
stem(n, x);
axis([-inf, inf, -1.2, 1.2]);
xlabel('n');
ylabel('x');
title('sin[\omega n]');

And it would look like:

sinusoidg.jpg

So it is nothing more than multiplication of queues.

New on WinAVR Tutorial New on WinARM Tutorial