Lasers or WiFi?

July 30, 2025

The title sounds very misleading, but whenever someone says "indoor localization", I think of how in spy movies people drop down into a highly guarded museam room with laser lights all over the floor and if any one of them gets croseed, the alarms would go blaring off. To be fair, it is the same concept.

The problem of indoor localization is very simple, given an enclosed space, how do you find where people are. This is a problem that can have a multitude of solutions, as many solutions are there are problems in the world, one could say. But for my final year project, which I did over a year ago, but still very fresh in my mind because of the turmoil it made me go through, I tried to do this using WiFi signals. Why WiFi signals you ask? Good question, I don't know. I asked my supervisors for a research topic, and this was what I got, so we rolled with it. The exact problem we were trying to address was how we could solve this without any ML.

Jokes aside, let's dive into finding Waldo, or you, or whoever is in the room, I guess.

The Problem

How do we find where a person is in a room? You'd see the relevance of my laser security system comparison now. The easiest way to do this is to have beams that you can track, and whichever lines get crossed, find the intersection of these lines, and voila, there's Waldo.

Laser Security System Diagram

A (sort of) small explaination

This is the way that it had been done up until now. The area where the localization needed to be done was setup with devices to form a grid like pattern, and these devices would communicate with each other. The direct line of contact with every other device would be like a laser beam. The transmission of each device when nothing was obstructing their direct line of path would be monitored, so that we'd know what the signals would like when there was an uninterrupted line of sight. If there was an obstruction, the signals would change, sort of like tripping over a laser, and well, you know the rest, the alarms go blaring.

*If you want to delve more in depth, I highly encourage you to read this paper written by Neal Patwari and J. Wilson (my lord and saviors at that time) who describes how this works in detail and how they made a statistical model to predict the position of the person.

So many lines

If you wanted to cover the area well, you'd need a lot of lines. That's a lot of devices. It doesn't have to laptops, it could be Raspberry Pis, or ESP32s, but still that's a lot of devices, the larger the room, the larger the number of devices you'd need.
This is the problem that I wanted to solve. What if we had only one line, that's only two devices, could we still be able to locate a person? And could we still do it without any ML?

Took me a few days (eons), to think of it, but I thought, what if we divided the room into sections (which was done in the original method, the area would get divided into small units called voxels, very similar to pixels), large sections. Like, just a 3x3 grid. Sometimes the best way to solve a problem is to simplify it. So that's what I did.

I kept two devices, one at the bottom center of the room, and one at the top center, so that there would be an imaginary line dividing the room into two. There's only one line, no multiple lines being crossed, so no intersections.

A dim light at the end of the tunnel

See, the thing about WiFi signals (even though its being depicted as straight lines going directly from one device to another) its not transmitted in one straight line. It'll sort of mutliple emissions going everywhere. And these waves, just like every other type of wave, would reflect off of everything it hits. So if everything in a room was stagnant, then the received signal shouldn't change over time, atleast the average of it.
If there was a moving object, then the signal would change, but just knowing that the signal changed isn't enough in this case to know where the object is.

There is where the hypothesis of my thesis comes in. I made an assumption (a massive one, could be wrong, maybe wrong, possibly wrong, but I made it nonetheless because that is life) that the change in signal would have a pattern for every section.
So I went into an empty room, divided it into a 3x3 grid, and collected data while moving in each specific section of the grid.

The WiFi data I collected was the Channel State Information (CSI), which is a measure of the strength of the signal received from a device. It's a complex measure, but for our purposes, it's enough to know that it's a measure of the signal strength, divided into small chunks or channels, lets say 32 for an example. I made an average vector for each of the sections. Now, since we have 32 channels, each channel would have an average vector of values for each of the sections of what the data transmission would look like for that channel if there was a moving object in that specific section. Lets call this a comparison vector.

So how exactly do we now find the position of the object? Well, we make a vector of the real time data, so we have 32 real time vectors for each channel. Now, we take each vector and compare it to comparison vector for that channel. Remember, each channel has a comparison vector for each section. We'd take the vector difference of the real time data and the comparison vector for each of the section.

So for a specific channel, there would be a section with the lowest vector difference. So each channel would have a section that they think the object is in. For each channel, I made a 3x3 grid and colored in the section that the channel thinks the object is in. I'd have 32 different images, one for each channel, and I imposed them on top of each other, which would create a heatmap of the object's possible position. The more channels that color the same section, the more highlighted it would be on the final image.

The results were not greattt, but that was the whole point, to see if it was possible, and to see if it the results were accurate enough, which is why although there was light at the end of the tunnel, it was a dim one.

If you are interested in trying it out yourself and deep diving into the code, here is the project, along with all the data that you'd need.
If you are interested in reading the whole of the project, here is my thesis.