$30
ECE/CS 434 | MP1: Visualizing Data
Objective
The goal of this MP is for you to become familiar with sensor data collected from mobile phones. We will work with accelerometer data, microphone recordings and Wi-Fi RSSI. All of the data provided to you will be used again in future MPs, so hopefully this will give you a head start. After completing this MP, you should be able to:
Quickly visualize readings from various mobile phone sensors.
Interpret various aspects of sensor data from plots.
Imports & Setup
The following code cell, when run, imports the libraries that you will require for the coding part of this MP. The use of other standard libraries is allowed but uneeded.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
Accelerometer
Three sets of accelerometer data are provided to you in accl/*.csv files. For each file, there are three columns, representing the accelerometer readings in three local axes x, y and z (in that order) (unit: m/s2 ). The orientations are consistent with what was covered in lecture. The accelerometer is sampled at 100 Hz .
Exercise 1
For each set of data (CSV file), plot the accelerometer readings over time. Clearly label the x and y axes of the plot, and create a legend indicating what local axes (x, y, or z) each line in your plot corresponds to. For each set of readings, you may instead use different subplots for different accelerometer axes, if you find that more readable.
Please enter your solution in the code cell below:
# Exercise 1 code here:
Exercise 2:
The accelerometer readings were collected under three circumstances:
walking with phone in pant pocket
walking with phone held in the hand statically as if the user is looking at it while walking
walking with phone in hand and the hand swinging
Carefully observe the graphs from Exercise 1 and identify which scenario each corresponds to.
Hint: When phone is held statically in the hand, the local y axis is relatively aligned with the walking direction. Acceleration in which direction is relatively small? When phone is in hand and the hand is swinging, the local z axis is perpendicular to your palm. Acceleration in which direction is relatively small?
Please enter your answer in the markdown cell below:
Exercise 2 Answer:
Data a.csv is for: __
Data b.csv is for: __
Data c.csv is for: __
Exercise 3
For the data accl/a.csv, what is the final velocity of the phone in the y direction? Assume that the initial velocity is 0 .
Hint: You will need to perform integration.
Please enter your solution in the code cell below.
# Exercise 3 code here:
# print("The final velocity of the phone in the y direction is: ", ____ )
Exercise 4
Typical walking speed is 1.5ms . What causes the discrepancy between this expected speed and your result in Exercise 3?
Please enter your answer in the markdown cell below:
Exercise 4 Answer: __
Microphone
You are given two microphone recordings from two different microphones on the same device. In microphone/1.csv, the first column corresponds to samples collected by the first microphone and the second column corresponds to the second microphone. The sampling rate of the microphones are 16 kHz .
Exercise 5
Plot the microphone recordings over time. Clearly label the x and y axes, and create a legend to indicate which microphone each line corresponds to. Note that it is okay if the lines look like they overlap.
Please enter your solution in the code cell below.
# Exercise 5 code here:
Exercise 6
Zoom in to your plot from Exercise 5. How many samples does mic 1 lag behind mic 2 by? You only need to provide a rough estimate.
You may use the optional code cell below if you need to plot again. Please enter your answer in the markdown cell below:
# (Optional) Exercise 6 code here:
Exercise 6 Answer: Mic 1 lags behind Mic 2 by _ samples.
Wi-Fi
Wi-Fi RSSI (Received Signal Strength Indicator) is a measurement of how well your device can receive signals from a given access point or router. A user walks around a room that has 3 Wi-Fi access points. You are given the RSSI reading from their smartphone in this format: (SSID,HH:MM:SS,RSSI) . SSID (Service Set Identifier) is a unique identifier that distinguishes between access points.
Exercise 7
For every unique access point, plot the RSSI over time. Clearly label the x and y axes, and create a legend to indicate which access point each line corresponds to. You may create separate graphs if you think that is more readable.
Please enter your solution in the code cell below.
# Exercise 7 code here:
Exercise 8
File wifi/room.png shows a layout of the room. The locations of the three Wi-Fi access points are annotated on the figure. Think of a possible straight-line path of how the user walked in the room. What are the starting and ending coordinates of this straight-line path? Reading your graph from Exercise 7 and eyeballing to give a rough estimate would suffice.
Please enter your answer in the markdown cell below:
Exercise 8 Answer:
Starting coordinates are: ( , )
Ending coordinates are: ( , )
Submission
This Jupyter notebook is the only thing you need to submit to Gradescope. Please make sure that:
All graphs and results are outputted and readable.
All short-answer markdown cells are filled in.
Rubric
Exercise Rubric Points
1 All 3 accelerometer plots are correct and clearly labeled 3×2
2 Answer is correct 3
3 Answer is correct 1
4 Answer is correct 1
5 Microphone plot is correct and clearly labeled 6
6 Answer is correct 4
7 Wi-Fi plot is correct and clearly labeled 6
8 Answer is correct 4