0% found this document useful (0 votes)
196 views11 pages

Lab1 PDF

This laboratory practical aims to identify characteristics of discrete-time signals in the time domain and frequency domain using MATLAB. The document provides instructions on analyzing synthetic and real-world signals from a data set to determine their time domain and frequency domain characteristics. Students are asked to complete pre-work by analyzing properties of three continuous-time periodic signals and their Fourier transforms. The lab work section then provides tasks analyzing signals from the data set in MATLAB to identify their time and frequency domain characteristics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views11 pages

Lab1 PDF

This laboratory practical aims to identify characteristics of discrete-time signals in the time domain and frequency domain using MATLAB. The document provides instructions on analyzing synthetic and real-world signals from a data set to determine their time domain and frequency domain characteristics. Students are asked to complete pre-work by analyzing properties of three continuous-time periodic signals and their Fourier transforms. The lab work section then provides tasks analyzing signals from the data set in MATLAB to identify their time and frequency domain characteristics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

300069 Digital Signal Processing: Lab 1

300069 Digital Signal Processing

Laboratory Practical 1

DISCRETE-TIME SIGNAL ANALYSIS


Report due: 23:59 on Saturday, 01/09/2018.
Submission: Submission details are given in Section IV of this document.

I. Aim

A major goal of processing a signal is to modify the signal for a particular purpose or extract information from
the signal. To achieve this goal, the signal should always be analysed beforehand so as to identify its
characteristics. For example, in order to recover a signal that has been contaminated by noise, the characteristics
of the noise and the signal should be identified so that appropriate filters can be designed to remove the noise
but preserve the signal of interest. This laboratory practical aims to identify characteristics of discrete-time
signals in the time domain and in the frequency domain. Synthetic signals and real-world signals are used for
this purpose. The major tool for signal analysis in this case is MATLAB Signal Processing Toolbox (SPTool).
Techniques developed in this practical will be used for two subsequent laboratory practicals, namely discrete-
time filter design and discrete-time filter applications.

II. Pre-work

NB: Your pre-work must be signed off by the lab supervisor in the lab time allocated.

A discrete-time signal is often obtained from a continuous-time signal by periodic sampling. If the continuous-
time signal is band-limited, its spectrum can be recovered from the spectrum of the corresponding discrete-time
signal, provided the sampling frequency is sufficiently high, according to the sampling theorem. Hence, the
evaluation of the spectrum of the continuous-time signal, which involves the tedious integral, is reduced to the
evaluation of the spectrum of the discrete-time signal, which involves only a finite number of samples.

In this section, we review the basic concepts for finding the spectrum of a continuous-time signal. In the next
section (Lab work), we will analyse the spectra of discrete-time signals using MATLAB SPTool.

The spectrum of a continuous-time signal x(t) can be obtained from the Fourier transform:

X ( j)   x(t )e  jt dt ,


where  is the angular frequency, measured in radians/second.

If x(t) is periodic with period T, it can also be expressed as a Fourier series:



x(t )  a e
k  
k
jk 0 t
,

2 1
where 0  and ak   x(t )e jk 0 t dt . It can be proven the Fourier transform of this periodic signal x(t) is
T T T

X ( j)   2a  ( k ),
k  
k 0 (1)

where  () is the continuous - variable impulse function, i.e.,


 0,   0, b 1, a  0  b,
 ( )  
,   0,
and   ()d  0,
a otherwise.

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 1
300069 Digital Signal Processing: Lab 1

Given below are some examples of continuous-time periodic signals.


1. A sinusoidal signal x(t )  cos(0t ) .
1 / 2, k  1 or  1
For this signal, it can be proven that ak    .
 0, k  1 or  1
Please complete the following and fill in Table 1 with your results.
a. Find X ( j) using Equation (1).
b. Sketch x(t ) with respect to t, indicating the maximum values and intercepts with the coordinate
axes.
c. Sketch X ( j) with respect to  , indicating the maximum values and intercepts with the
coordinate axes.
 T
1, | t |
2. A square wave x (t )   4 , repeating periodically with period T, i.e., x(t )  x(t  T ) .
T T
0, | t |
 4 2
sin(k / 2)
For this signal, it can be proven that ak  .
k
Please complete the following and fill in Table 1 with your results.
a. Find X ( j) using Equation (1).
b. Sketch x(t ) with respect to t, indicating the maximum values and intercepts with the coordinate
axes.
c. Sketch X ( j) with respect to  , indicating the maximum values and intercepts with the
coordinate axes.

3. An impulse train x(t )   (t  kT ) where  (t ) is the continuous-variable impulse function.
k  

1
For this signal, it can be proven that ak  .
T
Please complete the following and fill in Table 1 with your results.
a. Find X ( j) using Equation (1).
b. Sketch x(t ) with respect to t, indicating the maximum values and intercepts with the coordinate
axes.
c. Sketch X ( j) with respect to  , indicating the maximum values and intercepts with the
coordinate axes.

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 2
Student’s Full Name: ........................................
Student ID: ........................................................ 300069 Digital Signal Processing: Lab 1

Table 1: Three periodic continuous-time signals and their Fourier transforms.

Continuous-time X ( j) Sketch of x(t ) , indicating Sketch of X ( j) ,


signal x(t ) the maximum values and indicating the maximum
intercepts with the values and intercepts with
coordinate axes the coordinate axes
x(t )  cos(0t )

1, | t | T
 4
x (t )  
T T
0, | t | ,
 4 2
and x (t )  x (t  T ).


x (t )    (t  kT )
k 

Pre-work (Table 1)

Signed off by the lab supervisor: ..................................................... Date: .......................................

Raw mark awarded (out of 2): .....................................................................................................................

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 3
300069 Digital Signal Processing: Lab 1

III. Lab work

NB: Your lab work must be signed off by the lab supervisor in the lab time allocated.

Part A: Set tasks

Please download a compressed folder ‘Lab1Signal.zip’ from the unit’s vUWS site to your computer and then
extract all files from the compressed folder using WinZip (right-click on ‘Lab1Signal.zip’  Extract All …).
Now, you should see eight MATLAB files, namely, ‘sig_1a.mat’, ‘sig_1b.mat’, ‘sig_1c.mat’, ‘sig_1d.mat’,
‘sig_1e.mat’, ‘ECG_1a.mat’, ‘ECG_1b.mat’ and ‘Record_n_PlayAudio.m’. The first seven files store discrete-
time signals saved in MATLAB’s data format ‘.mat’. The eighth file can be used to record and play an audio
signal captured by the microphone of a computer.

1. Identify the characteristics of the signal, ‘sig_1a.mat’, in the time domain and the frequency domain
(i.e., its spectrum).

This is a synthetic signal. The sampling frequency of the signal is 1000 Hz. You can view the signal in
the time domain by the following steps.

 Start ‘MATLAB’ by, for example, the following sequence of clicks: Start  All Programs 
MATLAB  MATLAB R20xx. Then, you will see a window similar to the following.

 Run ‘SPTool’ by typing ‘sptool’ followed by ‘Enter’ in the MATLAB ‘Command Window’.
Then, you will see a window similar to the following.

 Import ‘sig_1a.mat’ from disk. In the ‘SPTool’ window, you can open an ‘Import to SPTool’
window by the following sequence of clicks: File  Import. Then, you will see a window
similar to the following.

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 4
300069 Digital Signal Processing: Lab 1

In the ‘Import to SPTool’ window, you can select ‘sig_1a.mat’ by the following clicks: From
Disk  Browse  select the file from disk. In the same window, select ‘sig_1a’ under ‘File
Contents’, and move it to the ‘Data’ section by clicking the upper arrow. Set the sampling
frequency to 1000 Hz. MATLAB gives a default name ‘sig1’ to the signal to be imported.
Change the name to ‘sig_1a’. Then you will see a window similar to the following.

Now press ‘OK’ to import the signal.

 In the ‘SPTool’ window, you should see ‘sig_1a[vector]’ in the ‘Signals’ column. Select this
signal and click ‘View’. Then, you will see a window similar to the following.

This is the signal in the time domain.

You can view the signal in the frequency domain, or its spectrum, by the following steps.

 In the ‘SPTool’ window, select ‘sig_1a[vector]’ in the ‘Signals’ column. Click ‘Create’ in the
‘Spectra’ column. Then, you will see a ‘Spectrum Viewer’ window similar to the following.

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 5
300069 Digital Signal Processing: Lab 1

 In the ‘Spectrum Viewer’ window, select ‘Method’ as ‘FFT’ (fast Fourier transform) and
‘Nfft’ (number of points in FFT) as ‘1024’, and press ‘Apply’. It is convenient to view a
spectrum if a linear magnitude scale is used. In the ‘Spectrum Viewer’ window, this can be
done by the following sequence of clicks: Options  Magnitude Scale  Linear. Then, you
will see a window similar to the following.

This is the signal in the frequency domain, or its spectrum. The unit of the frequency is Hertz
(Hz) and the unit of the FFT spectrum estimate (or the power spectral density, PSD) is power
units (e.g., Watts) per Hertz.

FFT is an efficient algorithm for evaluating the spectrum of a discrete-time signal. The
algorithm will be discussed in Lecture 10.

The MATLAB online ‘Help’ manual will be useful if further assistance is needed.

The requirements for this task are listed below.


i. Sketch the signal in the time domain and in the frequency domain. Fill in Table 2 with your
results.
ii. Save the figures showing the signal in the time domain and in the frequency domain and then
include the figures in your lab report. You may copy an active screen showing your results by
pressing ‘Alt-PrintScreen’ and then paste it onto your MS WORD document.
iii. Describe the signal in the time domain. What is the shape of the signal? Is it a periodic signal?
If it is periodic, what is its period and peak-to-peak amplitude?
iv. Describe the signal in the frequency domain. How many frequency components are there in the
signal? What are the frequencies and magnitudes of five most significant frequency
components?

2. Identify the characteristics of the signals, ‘sig_1b.mat’ and ‘sig_1c.mat’, in the time domain and the
frequency domain (i.e., their spectra). These are synthetic signals. The sampling frequency of the
signals is 1000 Hz.

The requirements for this task are listed below.


i. Sketch the signals in the time domain and in the frequency domain. Fill in Table 2 with your
results.
ii. Save the figures showing the signals in the time domain and in the frequency domain and then
include the figures in your lab report.
iii. Describe each signal in the time domain. What is the shape of the signal? Is it a periodic signal?
If it is periodic, what is its period and peak-to-peak amplitude?
iv. Describe each signal in the frequency domain. How many frequency components are there in
the signal? What are the frequencies and magnitudes of five most significant frequency
components?

3. Compare the spectra of ‘sig_1a.mat’, ‘sig_1b.mat’ and ‘sig_1c.mat’. This task may be completed when
you write your report after the lab class.

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 6
300069 Digital Signal Processing: Lab 1

The requirements for this task are listed below.


i. Describe the difference between ‘sig_1a.mat’ and ‘sig_1b.mat’ in the frequency domain.
ii. Describe the difference between ‘sig_1a.mat’ and ‘sig_1c.mat’ in the frequency domain.
iii. Describe the difference between ‘sig_1b.mat’ and ‘sig_1c.mat’ in the frequency domain.

4. Identify the characteristics of the signals, ‘sig_1d.mat’ and ‘sig_1e.mat’, in the time domain and the
frequency domain (i.e., their spectra). These are synthetic signals. The sampling frequency of the
signals is 1000 Hz.

The requirements for this task are listed below.


i. Sketch the signals in the time domain and in the frequency domain. Fill in Table 2 with your
results.
ii. Save the figures showing the signals in the time domain and in the frequency domain and then
include the figures in your lab report.
iii. Describe each signal in the time domain. What is the shape of the signal? Is it a periodic signal?
If it is periodic, what is its period and peak-to-peak amplitude?
iv. Describe each signal in the frequency domain. How many frequency components are there in
the signal? What are the frequencies and magnitudes of five most significant frequency
components?

5. Identify the characteristics of the signals, ‘ECG_1a.mat’ and ‘ECG_1b.mat’, in the time domain and the
frequency domain (i.e., their spectra). These are real-world signals (electrocardiogram signals). The
sampling frequency of the signals is 200 Hz.

The requirements for this task are listed below.


i. Sketch the signals in the time domain and in the frequency domain. Fill in Table 2 with your
results.
ii. Save the figures showing the signals in the time domain and in the frequency domain and then
include the figures in your lab report.
iii. Describe each signal in the time domain. What is the shape of the signal? Is it a periodic signal?
If it is periodic, what is its period and peak-to-peak amplitude?
iv. Describe each signal in the frequency domain. How many frequency components are there in
the signal? What are the frequencies and magnitudes of five most significant frequency
components?

6. In this task, you will record your speech signals when you pronounce ‘a’, ‘b’, ‘c’ and ‘d’ and then
analyse their spectra. The task is divided into the following steps.
 Record your sound ‘a’ using the MATLAB file ‘Record_n_PlayAudio.m’ included in the
compressed folder ‘Lab1Signal.zip’. The following procedure may be used for your recording.
o Open the MATLAB file ‘Record_n_PlayAudio.m’ by double-clicking it using the left-
button of the mouse. Then you will see a MATLAB Editor showing the program in
‘Record_n_PlayAudio.m’.
o Run the program by clicking the ‘Run’ button on the toolbar of the Editor.
o Change the folder if asked to do so. Then the program will run and the MATLAB’s
Command Window will show the sampling frequency in Hertz for the recording.
o When the Command Window shows ‘Start recording …’, repeat saying ‘a’ to the
microphone of the computer about four times. The recording will continue for three
seconds. At the end of the recording, the Command Window will show “End of
recording”. The program will save the first 8192 samples of your audio signal to the
current directory of the computer as a MATLAB file ‘audio.mat’, which can be opened
using MATLAB SPTool.
o Rename the file ‘audio.mat’ as ‘a.mat’ to indicate the recording of your sound ‘a’.
 Repeat the above procedure to record your sounds ‘b’, ‘c’ and ‘d’.

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 7
300069 Digital Signal Processing: Lab 1

 Identify the characteristics of the above four sound signals in the time domain and frequency
domain using MATLAB SPTool. Please note the number of samples for FFT (nfft) used to
obtain the spectrum of a signal is 8192, rather than 1024.

The requirements for this task are listed below.


i. Sketch the speech signals in the time domain and in the frequency domain. Fill in Table 2 with
your results.
ii. Save the figures showing the signals in the time domain and in the frequency domain and then
include the figures in your lab report.
iii. Describe each signal in the time domain. What is the shape of the signal? Is it a periodic signal?
If it is periodic, what is its period and peak-to-peak amplitude?
iv. Describe each signal in the frequency domain. How many frequency components are there in
the signal? What are the frequencies and magnitudes of five most significant frequency
components?
v. Describe the difference of these signals in the frequency domain.

Part B: Self-selected task

Perform a task of your choice, which can be used to distinguish you from others. This is a required task and it
must be directly related to this unit of study. If you are a student enrolled in the Bachelor of Engineering
(Advanced) course, your task must be related to two-dimensional discrete-time signals. A digital image is a
popular two-dimensional discrete-time signal.

This part (Part B) can be completed after the lab class.

Examples of the task are given below.

Example 1: You find a problem during this lab practical. You decide to solve the problem. You show results
to verify your solution.

Example 2: You find an interesting problem in the textbook, which has not been (and may not be) discussed
in this unit of study. You decide to solve the problem. You show results to verify your solution.

Example 3: You find an interesting problem in this subject area in an IEEE journal. You decide to solve the
problem. You show results to verify your solution.

The requirements for this task are listed below.


i. Please respond to the following questions in completing the task.
 What is the aim of the task? In other words, what do you want to do?
 Why do you want to do it?
 What are the challenges of this task when compared to the set tasks in Part A above?
 How do you do it? In other words, can you explain your method or implementation?
 What are your results? Can you explain them?
 What can you conclude from the results?
 Have you achieved your aim?
 Is your conclusion significant and why?

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 8
Student’s Full Name: ........................................
Student ID: ........................................................ 300069 Digital Signal Processing: Lab 1

Table 2: Discrete-time signals and their spectra

Discrete- Sketch of the signal in the time domain, Sketch of the signal in the frequency domain,
time signal indicating the maximum values and intercepts indicating the maximum values and intercepts
with the coordinate axes with the coordinate axes
sig_1a.mat

sig_1b.mat

sig_1c.mat

sig_1d.mat

sig_1e.mat

ecg_1a.mat

ecg_1b.mat

Sound ‘a’

Sound ‘b’

Sound ‘c’

Sound ‘d’

Lab work (Table 2)

Signed off by the lab supervisor: ..................................................... Date: .......................................

Raw mark awarded (out of 2): .....................................................................................................................

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 9
300069 Digital Signal Processing: Lab 1

IV. Lab report

You need to write a report for this lab practical. You may exchange ideas and techniques with others. However, you
must write your report independently. The requirements for your lab report are listed below.

i. Attach an assignment cover sheet that you have completed for this lab practical.
ii. State the aim of the lab practical.
iii. Include your pre-work (Table 1) signed off and dated by the lab supervisor.
iv. Include your lab work Part A, consisting of
a. Table 2 signed off and dated by the lab supervisor; and
b. Your response to the requirements for each task in Part A.
v. Include your response to the requirements for Part B of your lab work.
vi. Include the conclusion of this lab practical.

Details for report submission are given below.


i. Submit an electronic copy of your report through the ‘Lab Assignments’ section of the unit’s vUWS site
(Lab Assignments  Lab 1  ‘Browse My Computer’ to attach your report  Submit).

V. Marking criteria and standards

NB: The ‘pre-work’ and the ‘lab work’ are worth four raw marks. Your pre-work (Table 1) and lab work (Table
2) must be signed off by the lab supervisor to get the marks. It is the responsibility of the student to ensure
her/his pre-work and lab work are signed off in the lab time allocated. Work not signed off and dated will not
count towards the final grade of the unit. Your pre-work and lab work signed off and dated by the lab supervisor
form part of your lab report.

Criteria Standards
Pre-work Less than 70% of the pre-work is completed correctly before the lab class. 0 raw
(Maximum 2 mark
raw marks) At least 70% of the pre-work is completed correctly before the lab class. 1 raw
mark
100% of the pre-work is completed correctly before the lab class. 2 raw
marks
Lab work Less than 70% of the lab work (Part A) is completed correctly in the time 0 raw
(Part A only) allocated. mark
(Maximum 2 At least 70% of the lab work (Part A) is completed correctly in the time 1 raw
raw marks) allocated. mark
100% of the lab work (Part A) is completed correctly with limited help 2 raw
from the lab supervisor in the time allocated. marks
Lab report Less than 50% of the requirements specified in ‘Section IV. Lab report’ 0 raw
(excluding (excluding Requirement v for the self-selected task) are addressed with mark
Requirement correct answers.
v for the self- At least 50% of the requirements specified in ‘Section IV. Lab report’ 1 raw
selected task) (excluding Requirement v for the self-selected task) are addressed with mark
correct answers.
(Maximum 4
raw marks) At least 70% of the requirements specified in ‘Section IV. Lab report’ 2 raw
(excluding Requirement v for the self-selected task) are addressed with marks
correct answers.
At least 90% of the requirements specified in ‘Section IV. Lab report’ 3 raw
(excluding Requirement v for the self-selected task) are addressed with marks
correct answers.
100% of the requirements specified in ‘Section IV. Lab report’ (excluding 4 raw

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 10
300069 Digital Signal Processing: Lab 1

Requirement v for the self-selected task) are addressed with correct marks
answers.
Lab report The aim and rationale are not clearly stated. The task is not challenging 0 raw
(Only for when compared to the set tasks. The task may be challenging, but the mark
Requirement student has no or almost no idea on how to perform the task. No method is
v for the self- presented or the method is not clearly described. No implementation is
given or the implementation is not clearly described. A similar method has
selected task)
been used for the set tasks. There are no or very limited results. There is no
(Maximum 2 or very limited explanation/discussion of the results. No conclusion is
raw marks) stated or it is not clear what the conclusion is. The conclusion is not
supported by the results. The aim is not achieved. The conclusion is
insignificant.
The aim and rationale are stated. The task is challenging when compared to 1 raw
the set tasks. The method and implementation are described. Results are mark
presented and explained. The conclusion is stated. The student makes
observations and connections regarding the underlying task. The aim is
innovative and it is achieved.
The aim is innovative and significant. The task is very challenging. Extensive 2 raw
observations and connections are made. Extensive results are presented and marks
explained. The conclusion is significant and will be appreciated by practitioners
in the field.
Please note the following.
1. The maximum raw mark for this lab practical is 10.
2. The maximum raw mark is scaled to normalise its contribution to 6.67% of the final grade.

Dr. J.J. Zou, WSU School of Computing, Engineering and Mathematics Page 11

You might also like