You are on page 1of 4

ENB242 Assignment 1 (15%)

Released: Week 3 — Due: End Week 5

Our exploration rovers on Mars have scouted a number of potential locations for our team of
astronauts to land. As the Spaceship MARS-242 is orbiting Mars, its instruments and cameras
have been capturing coordinates and images of those locations and transmitting them to the
spaceship for human inspection. It is of utmost importance that our team lands in a safe
environment if they are to survive the harsh climate on the surface of Mars.
The obtained images, such as the example in Figure 1, have been corrupted by electromagnetic
interference. Our astronauts require your help and have transmitted a copy of the images back
to BASA headquaters for further analysis. Your mission at headquarters will be to use signal
analysis techniques to reconstruct a replica of the noise signal and then perform active noise
cancellation.

Figure 1: A corrupted image from the Mars exploration rover.

Images in MATLAB are stored as a 2D matricies. Each element in the matrix represents a pixel
of the image. The numeric value at each matrix index describes the colour intensity of each
pixel. Matrix elements for grayscale images are floating point numbers between 0 and 1; which
correspond to the colours black (zero intensity) and white (maximum intensity) resepctively.
You will be working with grayscale images in this assignment.

1
1 BASA Headquarters: Training Exercise (15 marks)

The engineering team at BASA wishes to reproduce the interference affecting the images ob-
tained by the spaceship. The streaks of light and dark pixels occur periodically across the
screen and thus formed the rationale for our engineers to consider periodic noise.

Fig. 2 illustrates the periodic signal s(t), to be used for testing purposes. This signal is periodic,
and is defined as s(t) = e−2t across a domain of 0 ≤ t < 5.

Test Signal

1.2

0.8
Amplitude

0.6

0.4

0.2

-0.2
.
0 2 4 6 8 10 12 14 16 18 20

Time (s)

Figure 2: Test Signal s(t)

(a) Find the period, T , and the fundamental frequency, f0 , of the test signal. (1 mark)
(b) Is the test signal s(t) even or odd? Justify your answer. (1 mark)
(c) Generate the test signal s(t) in MATLAB. It is to span 4 period cycles and have a total of
400 sample points. (1 mark)
(d) Derive by hand, the complex Fourier series of s(t). (4 marks)
(e) Compute the cn coefficients for −3 ≤ n ≤ 3. (1 marks)

2
(f) Calculate the equivalent trigonometric Fourier series coefficients a0 , an and bn using the
results of Section 1, Part (e). (2 marks)

(g) Generate an approximation of s(t) using the DC component and the first harmonic. You
may use coefficients from the complex exponential or trigonometric Fourier series. (1 mark)

(h) Generate a second approximation to s(t). This time use the first two harmonics, and the
DC component. (1 mark)

(i) Generate a third approximation to s(t). Use the first three harmonics, and the DC com-
ponent in this approximation. (1 mark)

(j) Plot the original test signal s(t) and overlay all three of the Fourier series approximations
in one figure using different colours. You are to label the axes appropriately and include a
legend. What can be said about the approxmiations when the number of harmonics used
increases? (1 mark)

(k) Generate a 400 × 400 square matrix, and fill each row of the matrix with the signal
approximation from Section 1, Part (i). View this matrix using the imshow command.
(1 mark)

2 Mars Mission: Denoising Images (30 Marks)

Senior analysts from the engineering team have determined that our received images from Mars
have been corrupted by an additive process. This model is illustrated in Fig. 3.

Image Capture Received Image

+.

Noise

Figure 3: Model of additive noise.

Your primary objective in this mission is to denoise the image and determine if the location
pictured in your photograph is a safe place to land the space craft. Follow the directives below
to help you complete your mission.

(a) Open template.m in MATLAB. Read all of the comments and instructions written in the
file. Enter your student numbers into the appropriate variables to set up your workspace
and generate the corrupted image. (0 marks)

(b) Obtain a sample waveform of your periodic noise by taking the average across all columns
from your corrupted image. You should end up with a row vector where each element
corresponds to the averaged value of its respective column. This row vector represents the
averaged pixel intensities across the columns of the image. (1 mark)

3
(c) Assume that data is received at a rate of 100 pixels/sec. Determine the number of data
points (N) across a single period, and the duration of a single period (T, in seconds).
(2 marks)

(d) Determine the maximum (A1), and minimum (A2) amplitudes. (2 marks)

(e) Determine the duty cycle (DCy) of the periodic noise signal. The duty cycle of a square
wave is defined as the percentage ON time of the signal across one period. Hint: use N and
the number of pixels in the ON state to calculate this. (1 mark)

(f) Find the actual duration of the ON state (tau) in seconds. (1 mark)

(g) Use A1, A2, T and DCy to generate your noise waveform st. It is to contain the same
number of periods as the noise waveform in the corrupted image. You are to generate an
appropriate time domain vector t for this waveform as well. (4 marks)

(h) Compute by hand the expression for the complex exponential Fourier series coefficients
(cn) for st as a function of n. (4 marks)

(i) Use MATLAB, to evaluate the coefficients for −10 ≤ n ≤ 10. (1 mark)

(j) Write your own code to generate the Fourier series approximation (FS) of the periodic noise.
(5 marks)

(k) Recover the corrupted image, by reversing the additive process illustrated in Fig.3. Store
the de-noised result in the variable dnImg. (3 marks)

(l) View your recovered image using imshow1 . (1 mark)

(m) Artefacts were marked into the image at the time each photograph was taken to help with
rangefinding. What are these numeric readings from the image? If the image quality
is unsatisfactory, what can you do to further reduce the effects from the periodic noise?
Demonstrate your answer. (4 marks)

(n) Use your de-noised image to decide if the location shown in the photograph will be a safe
place for the astronauts to land. (2 marks)

1
The colour map for imshow defaults to values between 0. . . 1, i.e. value 0 is solid black and value
1 is solid white. To specify the display range that corresponds to your image, use this line of code:
imshow(dnImg,[min(min(dnImg)),max(max(dnImg))])

You might also like