AMATH 482 Assignment 3 PCA and a Spring-Mass System solved

$24.99

Category:

Description

5/5 - (2 votes)

Included with this assignment are movie files (turned into MATLAB files) created from three different cameras.
The experiments are an attempt to illustrate various aspects of the PCA, its practical usefulness, and the effects
of noise on the PCA algorithms. In all four cases we will consider video of a spring-mass system, as was described
at the end of Lecture 13. The cases are as follows:
1. Test 1: Ideal Case. Consider a small displacement of the mass in the z direction and the ensuing
oscillations. In this case, the entire motion is in the z direction with simple harmonic motion being observed.
MATLAB files: camN 1.mat where N = 1, 2, 3.
2. Test 2: Noisy Case. Repeat the ideal case experiment, but this time introduce camera shakes into the
video recording. This should make it more difficult to extract the simple harmonic motion. But, if the shake
isn’t too bad, the dynamics will still be extracted with the PCA algorithms. MATLAB files: camN 2.mat
where N = 1, 2, 3.
3. Test 3: Horizontal Displacement. In this case the mass is released off-centre so as to produce motion
in the x − y plane as well as the z direction. See what the PCA tells us about the system. MATLAB files:
camN 3.mat where N = 1, 2, 3.
4. Test 4: Horizontal Displacement and Rotation. In this case the mass is released off-centre and rotates
so as to produce rotation in the x − y plane and motion in the z direction. See what the PCA tells us about
the system. MATLAB files: camN 4.mat where N = 1, 2, 3
In order to use PCA, you will have to extract the mass positions from the video frames. The following code
examples may be helpful to get you started.
To load the first video from test 1 and play the video using MATLAB’s built-in video player, you can use the
following commands:
1 load(‘cam1 1.mat’)
2 implay(vidFrames1 1)
You may also find it useful to view the video by creating a loop and displaying each frame. That can be done with
the following code:
1 numFrames = size(vidFrames1 1,4);
2 for j = 1:numFrames
3 X = vidFrames1 1(:,:,:,j);
4 imshow(X); drawnow
5 end
Goal: You are being asked to explore the PCA method on the different datasets you are provided and see what
you find. A complete report should compare and contrast the different cases.
1