Uploaded by Bunda Kambikambi

EEE 4221 Lab 1 manual 08-05-2023

advertisement
Part (A): Understanding the convolution Sum
1. What is a convolution sum? Give a description in detail of its theory, formulation and
describe how this formula works. Step by step, determine the convolution y[n] of an LTI
system h[n] ={2,3,5} and input signal x[n] = {1,2,3,4}.
Practical task in Matlab or Octave.
2. Imagine that you are measuring the temperature of an object using a Thermistor and
digitizing it using a microcontroller with an ADC.
- 100 data points (number of samples) are then sent to your PC via serialport (or USB).
- Temperature samples are given by the equation y(n) = 0.5n+25
- Random noise is added to the output signal y(n) to obtain the contaminated signal
x(n) = y(n) + 10 x noise
a) Generate a code to show the above data and plot the signal contaminated by the random
noise being added to it. (ensure to label all axisof your plot)
b) Given that the object being monitored is being heated, make a comment on the graph
that you have plotted; is it the result what we expect to see given that noisecontamination
is something that occurs in practical systems? Suggest 5 filters that could be used to filter
out some noise from the plotted signal.
In this lab, we are to use a running average to filter out some of the noise. The impulseresponse
of a running average that takes 3 samples at a time is given by:
111
h[n] =[3 3 3]
c) To calculate the effect this system has on our signal, use the convolution sum. (InOctave it
isconv(x,h) function (use command help conv to get details)).Plot the output using both
plot and stem commands. Again, label all axis. Comment on the difference between this
plot and the plot in 1(a).
d) Repeat part c) for 5 point and 10 point moving average systems.
I.
Compare the plots of the outputs for 3, 5 and 10 point moving average system.
II.
Compare plots for 10-point average to original signal plot. What do you observeat
the start and end of the output sequence? What is the cause of what isobserved at
the start and end of the filtered sequence (Hint: look at the stemplot and remember
convolution can be thought of as flip and slide operation)?
Part (B) : Using the 2D convolutional Sum and FIR Filters for image processing
Aim: Explore the use of FIR Filters on 2D convolutional Sum
Procedure of Laboratory Exercises
a) Make sure that the sample image is in the same folder as the script you are using. To load and
display the original image use:
clear
clc
I = imread ("vsat2.JPG"); %loads the image
imshow(I) % shows image
i)
Do you recognize the location where the image was taken? Is the image in
focus? Include the image in the report.
ii)
Write the code for Filtering an image using a spatial kennel filter by 2D convolution of
the filter and the image.Run the code and save the new image as “filtered.jpg” by using
the “imwrite” command.
Just as before, load and display the filtered image, include the image in your report. What do you
observe, what has the filteringdone to the original image, explain it also in terms of the filter
kennel? Is thisreversible?
b) The opposite operation can also be achieved using a sharpening filter kennel. Give an
example of such a kennel and apply it to the original and the currently filtered image.
Show the code and resulting images in each case. Explain how this works in terms of
the filter kennel.
Acknowledgement:
[1] Applied digital signal processing (THEORY AND PRACTICE) by D. Manolakis& V. Ingle
Download