Signals Lab 1: Basic Signals
Background Theory
Signals describe how a physical quantity changes with an independent variable, often time.
They can be continuous-time (defined at every moment) or discrete-time (defined only at
specific intervals, usually by sampling a continuous signal). These two forms are fundamental in
analyzing analog and digital systems.
Basic signal types such as sinusoidal, ramp, exponential, and impulse are building blocks for
more complex signals. Sinusoids model periodic phenomena, ramps describe linear growth,
exponentials represent growth/decay, and impulses model instantaneous events. Together, they
form the basis for studying signal behavior and system response.
Matlab Implementation
1. Sinusoidal Signal
Continuous: Discrete
t = -pi : 0.01 : pi n = -pi:1:pi
y = sin ( t ) y = sin(n)
z = cos ( t ) z = cos(n)
hold on hold on
plot ( t , y , ' k--') stem(n,y,'k--')
plot ( t , z , ' k ' ) stem(n,z,'k')
hold off hold off
2. Ramp Input
Continuous: Discrete
m = input('m= '); n = -5:5;
c = input('c= '); m = input('m= ');
t = -5 : 0.1 : 5; c = input('c= ');
plot(t, m*t + c) y = m*n + c;
stem(n, y)
3. Exponential Input
Continuous: Discrete
t = -5 : 0.01 : 5; n = -5:5;
a = input('a= '); a = input('a= ');
c = input('c= '); c = input('c= ');
y = c*exp(a*t); y = c*exp(a*n);
plot(t, y) stem(n, y)
4. Unit Impulse
Continuous: Discrete
t = -5 : 0.01 : 5; n = -5:5;
plot(t, t>=0) y = (n >= 0);
stem(n, y)
Discussion and Conclusion
The experiment highlighted the visual and mathematical differences between continuous and
discrete signals. MATLAB plots confirmed how sampling affects accuracy: fine sampling
produces smoother, more faithful discrete signals, while coarse sampling loses detail.
Overall, the lab reinforced that continuous signals represent ideal analog behavior, while
discrete signals illustrate the transition into digital processing. The results validated theoretical
concepts and provided a foundation for advanced topics in signal processing.
Signals Lab 2: Convolution
Background Theory
Convolution is a key tool for analyzing Linear Time-Invariant (LTI) systems. It mathematically
describes how an input signal interacts with a system’s impulse response to produce an output.
In discrete-time, convolution is computed as a summation of shifted, weighted values. In
continuous-time, it is expressed as an integral, reflecting system memory and overlap between
signals. This operation fully characterizes how systems filter, delay, or modify signals, making it
central to signal processing.
Matlab Implementation
1. Continuous Convolution
t = 0 : 0.01 : 10;
dt = 0.01;
x = 0.5.^t;
h = ones(1, length(t));
y = conv(x, h)*dt;
ty = 0 : dt : (2*10);
subplot(311)
plot(t, x)
subplot(312)
plot(t, h)
subplot(313)
plot(ty, y)
2. Discrete Convolution
x = [1, 2, -1, 1];
h = [1, 0, 1, 1];
y = conv(x, h);
subplot(311)
stem(x)
subplot(312)
stem(h)
subplot(313)
stem(y)
3. Graphical Discrete Convolution
n = 0:10;
x = 0.5.^n;
h = ones(1, 11);
y = conv(x, h);
subplot(311)
stem(x)
subplot(312)
stem(h)
subplot(313)
stem(y)
4. Find x(t) * h(t)
t = -3 : 0.01 : 3;
a = input('a= ');
x = exp(-a*t);
h = exp(a*t);
y = conv(x, h)*0.01;
ty = 2*t(1) : 0.01 : 2*t(end);
subplot(311)
plot(t, x)
subplot(312)
plot(t, h)
subplot(313)
plot(ty, y)
Discussion and Conclusion
The convolution experiments demonstrated how signals combine in both discrete and
continuous domains. In discrete-time, the summation illustrates how overlapping segments build
the output. In continuous-time, numerical approximation revealed smoothing and shaping
effects.
The MATLAB implementation showed that convolution directly matches theoretical predictions.
The results confirmed convolution’s role as a practical tool for analyzing LTI system behavior,
laying groundwork for understanding filters and system dynamics.
Signals Lab 3: Fourier Transform
Background Theory
The Fourier Transform decomposes a signal into frequency components, showing what
frequencies exist and their amplitudes/phases. This is essential in communication, filtering, and
spectrum analysis.
For digital signals, the Discrete Fourier Transform (DFT) is used, but it can be computationally
heavy. The Fast Fourier Transform (FFT) algorithm makes it efficient, enabling real-time
frequency analysis. The Inverse Fourier Transform reconstructs the original signal, showing that
the time and frequency domains are equivalent descriptions of the same signal.
Matlab Implementation
1. Continuous Fourier Transform
N = 1000;
t = linspace(0, 2, N);
a1 = 0.7; f1 = 5;
a2 = 1.0; f2 = 10;
x1 = a1*sin(2*pi*f1*t);
x2 = a2*cos(2*pi*f2*t);
x = x1 + x2;
subplot(311)
plot(t, x)
title('Sum of two sinusoids')
xlabel('Time(s)')
ylabel('Amplitude')
grid on
X = fft(x);
P = abs(X)*2/N;
phase = angle(X);
n = 0 : N-1;
subplot(312)
plot(n, P, 'b')
title('Magnitude Spectrum')
xlabel('Frequency Bin')
ylabel('Amplitude')
xlim([0, 20])
grid on
subplot(313)
plot(n, phase, 'r')
title('Phase Spectrum')
xlabel('Frequency Bin')
ylabel('Phase (radians)')
xlim([0, 20])
grid on
2. Discrete Fourier Transform
x = [0, 1, 2, 3];
y = fft(x, 4);
subplot(411)
stem(real(y))
subplot(412)
stem(imag(y))
subplot(413)
stem(abs(y))
subplot(414)
stem(angle(y))
3. Inverse Fourier Transform
y = [6+0i, -2+2i, -2+0i, -2-2i];
x = ifft(y);
subplot(411)
stem(real(x))
subplot(412)
stem(imag(x))
subplot(413)
stem(abs(x))
subplot(414)
stem(angle(x))
Discussion and Conclusion
The Fourier experiments demonstrated how time-domain signals can be represented in the
frequency domain. MATLAB FFT outputs revealed magnitude and phase spectra, while the
inverse transform successfully recovered the original signals.
These results confirmed the theoretical link between time and frequency domains. The lab
emphasized the importance of Fourier analysis in identifying frequency content, validating that
digital tools like FFT provide accurate and efficient analysis.
Signals Lab 4: Frequency Response
Background Theory
The Z-Transform is a powerful method for analyzing discrete-time signals and systems. It
generalizes the Fourier transform by considering the complex plane, allowing study of stability,
causality, and transient behavior.
The frequency response of a system is obtained by evaluating its system function H(z)
on the unit circle z = ejw. The magnitude response shows how different frequencies are amplified
or attenuated, while the phase response indicates shifts in timing. Together, they reveal how a
system processes sinusoidal signals.
Matlab Implementation
1. Y(N) - 0.67 y(N-1) = 2 X(N) + 1.67 X(N-1) + 2.03 X(N-2)
num = [2.03, 1.67, 2];
den = [-0.67, 1];
w = 20;
x = freqz(num, den, w);
subplot(211)
plot(abs(x))
subplot(212)
plot(angle(x))
2. H(z) = 1 / 1 - 0.8 z-1
num = [1];
den = [-0.8, 1];
w = 20;
x = freqz(num, den, w);
subplot(211)
plot(abs(x))
title('Magnitude Plot')
subplot(212)
plot(angle(x))
title('Phase Plot')
`
Discussion and Conclusion
The lab applied the Z-transform to a difference equation, deriving the system function H(z)
H(z) and analyzing poles and zeros. MATLAB’s freqz plots of magnitude and phase confirmed
theoretical results, showing how the system modifies input frequencies.
This experiment emphasized how algebraic manipulation in the Z-domain connects directly to
observable system behavior in the frequency domain. The study reinforced the Z-transform as
an essential tool in digital signal processing, with applications in filter design and stability
analysis.