# Thread: Cell Phone Tracking Code in C

1. ## Cell Phone Tracking Code in C

Hello,
I really need help on how to approach the problem, any insight will be appreciated.

The problem: cellphone tracking

You are to develop a simulated cellphone tracking system which uses information from a number of celltowers to provide the path and current location of cellphone users in range of the towers. The customer is interested in seeing an end-to-end system demonstration and would like to get an idea of where the problems will lie for the real system, but is not too concerned that the system exactly mirrors reality, so you may make some simplifying assumptions on your design.

The model:
A number (10-20?) of celltowers are scattered in an irregular pattern with distances between them ranging from 400m to 3km. Our model of their placement is a number of disks of various sizes with the tower at the center, with no tower lying under the disk of another tower, but almost every spot covered by three or more disks.
Each tower has the MEID (Mobile equipment identifier) for each cellphone which is within its range (disk). The distance to each phone from the tower is continuously monitored by measuring the flight-time in nanoseconds of the signal between the phone and the tower. These measurements are made every 7 seconds for every phone, and are then timestamped, identified as to source (which tower), and then either (a) stored locally at the tower, or (b) sent over the internet to a central data collection facility for storage and processing.
A location query consists of finding the tracking data for a particular MEID and calculating its most recent position. A tracking query continuously calculates and reports location data for an MEID as it is received.

Prelab due Friday 11/15: computational math models of --
- regular array of towers with circular reception regions extending (just) to neighboring towers
- cellphones traveling through tower regions on straight lines at fixed velocity
- timestamps accurate to 1 nsec; flight time measurement error up to +/-3 nsec.
- individual MEID sampling every 7 sec but at different times at different towers.

2. Based on the assignment you posted, why do you believe any programming is required (let alone in C)?

(EDIT: Unless computational math is supposed to lead to some sort of probabilistic model that you want to simulate.)

3. The assignment is to write a c program but I am struggling on how to come up with the mathematical model (algorithm). Any ideas are welcome. Thanks

4. Originally Posted by mcn20031
The assignment is to write a c program but I am struggling on how to come up with the mathematical model (algorithm). Any ideas are welcome. Thanks
You posted the mathematical model in the first post: grid of towers with reception regions a circular disk equal to the distance between towers; cellphones moving through space (well, on the ground) with constant velocity. (You'll have to check with your instructor whether you are randomly generating these or coming from an outside source.) Each tower sends/receives a position signal every 7 sec (but not all at the same time, so presumably you can choose how you want to stagger them). I'm assuming you know how to calculate the distance between two points in space, which you'll need to calculate the flight times (for the simulation part) and also (going the other way) for the tracking. The model suggests that you should usually have three towers in range of a phone and therefore three distances (based on those three flight times). You will then use those three distances to triangulate the position of the phone.

5. Here is the rest to the assignment maybe it will shade some light. We are using trilateration and multilateration to measure the distance.
You are being very helpful and appreciate it very much.
Problem 1) network simulation program mockups of data collection/query methods --
a) for central data repository;
b) for distributed data repository.

You will be running a number of copies of the 'tower' program mockup and a single copy of the 'central' program.
For part a) each tower program is continuously sending location information for every phone it sees to the central
program.
For part b) the central program is broadcasting the MEID of interest to all towers, and those towers with information on that MEID are sending that data back to central.

For both a) and b) : Measure network congestion as a function of increasing the number of towers, phones, and phones being tracked.
For b) : Measure the delay for all data to be collected at central as a function of the above factors.

Problem 2) data generation/transmission/storage
Write a central data generator which creates timestamped (x,y) histories for all phones which is accessible to all tower programs. Use your computational models of the prelab and generate appropriate messages from each tower to central under part a)'s assumptions. Store all received data at central.

6. So start with something simple, like 1 tower and 1 mobile.

Tower is at 100,100
Mobile is at 500,700

Can you work out the signal return time (do you know the velocity of radio waves in air?)

X towers and Y mobiles is just arrays and loops after that.