EEET2469-MATLAB代写
时间:2022-11-26
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
1










EEET2469 - Signals and Systems 1

Laboratory Exercise 3
Continuous-Time Systems
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
2
Laboratory Exercise 3: Continuous-Time
Systems

Learning Outcomes
Upon successful completion of this laboratory exercise you will
be able to:
• Explain how a system’s impulse response can be used to
predict its behaviour to different input signals.
• Use MATLAB to perform time-domain analysis on
continuous-time systems, including convolution.
• Use MATLAB to obtain frequency responses for
continuous-time systems.
• Explain the information that can be obtained from a
magnitude and phase response plot of a system.

Introduction to the laboratory
Continuous-time (or analogue) systems are used to process
analogue signals and together they make up the area known as
analogue signal processing (ASP). Analogue systems generally
consist of circuitry such as resistors, capacitors and inductors as
well as active components such as operational amplifiers (op
amps) to process an incoming signal in some way.
One of the main characteristics of analogue signals and systems
is their continuous-time nature; analogue signals are defined at
every time instant between when the signal ‘switches on’ and
when it ‘switches off,’ they also have continuous amplitude
characteristics meaning there are an infinite possible amplitude
levels the signal can have.
This lab will be examining these types of signals and systems
and will look at how MATLAB can be used to simulate and
extract information about their behaviour. This information
could then be used to aid in the design and implementation of
analogue systems for specific applications.
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
3
Part 1: Time-domain Analysis of Systems
Continuous-time systems that fulfil the Linear Time-Invariance (LTI)
property can be analysed in the time-domain using convolution.
Convolution is a mathematical process that allows us to find the output,
y(t) of an LTI system assuming we know what the input, x(t) to the
system is and the system’s impulse response, h(t).
This can be seen as in figure 1:

Figure 1: A block diagram of an LTI system and its output

Mathematically convolution is given as:




For part 1 of this lab we will be focusing on time-domain analysis of
systems with a particular emphasis on the way impulse responses can be
interpreted and used in predicting the behaviour of a system.

( ) ( ) ( ) ( )∫

∞−
−== τττ dthxtxthty *)(
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
4
Task 1 – Finding the Impulse Responses of Unknown Systems

Exercise:
Download from Blackboard the three MATLAB .p files located in the folder
’Mystery Systems’:
- blackbox1.p
- blackbox2.p
- blackbox3.p

.p files are MATLAB protected functions which, in this case, will act as
three unknown systems, or ‘black boxes’ as is often the term used. .p files can
be treated identically to normal user-defined function files.
In your script file these three blackbox functions can be called using the
following syntax:

y = blackbox1(t, x);

where t is your time array, e.g.:
t = -1:Ts:1-Ts; %Your time array
and x is a signal being input into your unknown system:
x = % an input signal w.r.t. t
This function will return y, which will be this particular system’s output for
your input signal.

You are required to design a MATLAB simulation that graphically displays
the impulse responses for these three systems. Use a time-step resolution
of Ts = 0.0001; for your simulation.
Label your x and y axes appropriately for these 3 graphs.

Hint:
- Read slides 6 – 8 and 29 – 34 of lecture 5, these slides should give you
some ideas on how you can use impulse approximations to estimate
the impulse response of an LTI system.

Reflection:
- What happens to the systems’ outputs when the width of your impulse
approximation increases? Why?
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
5
Task 2 –Performing Convolution using MATLAB

Exercise:
MATLAB has a function called conv() which can perform convolution on two
functions (see Table I for useful information and syntax for this function).

For this task you will be required to find and graphically present the output
from a system with the impulse response and input signal shown in figure
2:

h
(t
)
x
(t
)

Figure 2: Impulse response (left) and input signal (right)

( ) ( ) ( )( )
( )


 ≤≤
=


 ≤≤
=−−=
elsewhere ,0
20 ,


elsewhere ,0
10 ,2
12
tt
tx
t
tututh


School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
6
Begin by calculating manually the convolution of these functions; see the
notes for lecture/lectorial 5 for help on how to approach this.

Now write a MATLAB script using the conv() function to perform the same
operation. Set up your time variables as follows:

Ts = 0.0001; %Time step (resolution) of your simulation
t = 0:Ts:5-Ts; %Your time array (starting at 0 seconds)

Plot the output from this system.
Label your x and y axes appropriately for this graph.

Reflection:
- Describe the convolution method and how the output of a system can
be found using this mathematical process.
- Compare your hand-worked convolution to the output you obtained
using MATLAB. Are they matching?
- MATLAB’s conv() function produces an output that is longer than
both the original impulse response and input signals. We will look more
at this in the discrete-time signals and systems unit, but think about
why this might be happening and how to deal with this when plotting
your resultant output.
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
7
Part 2: Frequency-Domain Analysis of Systems
Part 2 of this lab will examine how we can use MATLAB to find and
interpret the frequency response of a system.
We can consider a system’s frequency response to be the Fourier
transform of that system’s impulse response:
( ) ( ){ } ( )∫

∞−

== dteththFfH ftj pi2

When analysing the behaviour of continuous-time systems in the
frequency-domain we typically take the frequency response and split it
into its magnitude and angle components to give the magnitude and
phase response of a system respectively. These are then plotted
separately on two figures or subplots to show how signal amplitude as
well as time-delay/phase will be changed by a system for different input
frequencies.
This information can be particularly useful when designing filters that
need to attenuate or amplify certain frequencies as this information is
very difficult to obtain from purely time-domain approaches.

Task 3 – The Frequency Response

Exercise:
In task 1 of this lab we found the impulse responses of three unknown
systems by inputting an impulse approximation into those systems and
observing their outputs.

Now use MATLAB to find the frequency responses of these three systems.
Plot their magnitude and phase responses on separate subplots (see
Table I: abs() and angle() for how to do this).
Label your x and y axes appropriately for these graphs.

Reflection:
- What do these graphs show you about the response of these systems
to different frequency inputs?
- If a 5Hz sinusoid is input into these systems what will happen to the
amplitudes and phases of the signal being output?
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
8
Table I: Some useful MATLAB functions
Function Description
Waveform functions
sin((wo*t)+phi); Generates a sinusoid from the time array t
wo is the radian frequency (wo=2*pi*fo)
phi is the phase shift
cos((wo*t)+phi); Generates a cosinusoid from the time array t
wo is the radian frequency (wo=2*pi*fo)
phi is the phase shift
heaviside(t) Generates a unit step-function defined as:
( )



<

=
0 ,0
0 ,1
t
t
tu
To generate a time-shifted step-function the
following syntax can be used:
ut = heaviside(t-To);
where To is the time-shift.
Plotting functions
plot(t,x) Plots a graph of x vs. t (t should be a
monotonically increasing array).
xlabel(‘text’) Adds the text in the single inverted commas as a
label for the x-axis.
ylabel(‘text’) Adds the text in the single inverted commas as a
label for the y-axis.
title(‘title’) Adds a heading to the top of a figure.
axis([xmin xmax ymin
ymax])
Sets the axis of a figure to the (x,y) values entered
in to xmin, xmax, ymin and ymax
subplot(n, m, k) Creates subplots within a figure window.
n is the number of rows of subplots
m is the number of columns of subplots
k is the current plot being referred to (from left to
right and/or from top to bottom)
Syntax example:
figure(1), subplot(2,1,1), plot(t,x)
subplot(2,1,2), plot(t,y)
School of Engineering


EEET2469 – Signals and Systems 1 (Laboratory 3)
9
Other useful functions
y = conv(x, h) Performs convolution on the functions x and h.
h is usually the impulse response of an LTI
system while x is the input signal to that system.
The result, y, is the output from the LTI system.
For continuous-time applications of conv() the
result will also need to be scaled by the time-step
of your simulation to obtain the correct
amplitudes:
Syntax example:
y = conv(x, h)*Ts; % Convolution
fft(x) Performs a Fast Fourier Transform (FFT) on the
variable x.
fftshift(X) Rearranges the FFT in array X so negative
frequency regions can be displayed correctly.
Syntax example:
X = fftshift(fft(x)); %shifted FFT
abs(x) Returns the magnitude of x (i.e. |x|). In Fourier
transforms abs() is often used to show the
magnitude spectrum of a signal:
Syntax example:
X=fftshift(fft(x)); %Returns the FFT
of x
figure(), plot(f, abs(X)) %Displays
the magnitude spectrum of x
angle(x) Returns the angle of x (i.e. ∠x). In Fourier
transforms angle() is often used to show the
phase spectrum of a signal:
Syntax example:
X=fftshift(fft(x)); %Returns the FFT
of x
figure(), plot(f, angle(X))
%Displays the phase spectrum of x

essay、essay代写