Show HN:构建 GPS 接收器
Show HN: Building a GPS receiver

原始链接: https://axleos.com/building-a-gps-receiver-part-1-hearing-whispers/

当作者意识到自己的地图应用程序可以在飞行中运行时,他开始着迷,这让他开始质疑 GPS 信号的工作原理。 大约 30 颗 GPS 卫星提供全球覆盖,他想知道该系统是否有多个“事实来源”。 他访问了 gps.gov,发现了这些卫星的复杂作用。 受到启发,他尝试解码这些信号以查明自己的确切位置。 与人们的认知相反,GPS 信号出奇地微弱,相当于卫星上住宅灯泡的功率,但仍然可以检测到。 尽管如此,它们仍然在全球范围内提供准确、实时的位置数据。 无需付费或许可,这些信号可以作为每个人都可以使用的基本基础设施,创建一个“安静的灯塔”网络。 为了收听,作者购买了软件定义的无线电,使他能够探索频谱并最终识别和解码 GPS 信号。 由于其弱点,GPS 信号要经历一个复杂的过程,涉及编码方案和频率操纵,以确保检测和准确性。 通过扩展频谱和码分多址等巧妙技术,GPS 成功识别特定卫星、它们的位置以及我们的精确位置。

标题:使用 SDR 技术从头开始创建国产 GPS 接收器 这位科技爱好者去年[2021 年 10 月]成功开发了 iOS 4 越狱,然后开始了一个新的爱好项目——使用软件定义无线电 (SDR) 技术构建 DIY 全球定位系统 (GPS) 接收器。 他利用通用 SDR 以及 Python 标准库和 NumPy,设计了一个复杂的信号处理系统,能够在几分钟内定位和跟踪 GPS 卫星。 这项创新不仅可以识别和捕获卫星出现和消失的情况,还可以在 59 秒内计算出准确的位置坐标和时钟校正。 他的博客记录了他的冒险经历,发现了检测和捕获以前人耳无法检测到的微弱卫星信号背后的复杂性。 在完成这一壮举后,他对 GPS 技术背后的天才表示了深深的赞赏,然后由于即将到来的就业承诺而完成了他的公共项目。 有关更多详细信息,请参阅提供的链接。 [2021 年 10 月:https://news.ycombinator.com/item?id=37736318]
相关文章

原文

Introduction

Have you ever noticed that your Maps app still works during a flight? It can feel illicit, like someone just forgot to turn off the signal, and that watching yourself crawl along the earth should be done without drawing undue attention.

A few months ago I learned that there were only around 30 GPS satellites serving the entire planet. This piqued my interest, because it reminded me of the 13 root DNS servers from which all resolution flows. Perhaps GPS has a similar design in which the ‘source of truth’ is diluted by several layers of signal repeaters?

I navigated to gps.gov, and was presented with this delightful image. I became even more excited to learn about what these satellites do!

I decided to try my hand at decoding these GPS signals, guided by the vague end-goal of plucking out my position from peanuts.

I learned that the GPS signals that facilitate our mapping apps are ever-present, around us at any altitude, in any weather conditions, at all times.

This sounds cool in the abstract, but the tangible reality is staggering. These signals are all around me as I write this. They’re all around you as you read it. The world is soaked in these whispers, repeating themselves endlessly for anyone willing to listen.

You can find out exactly where you are, from thin air, anywhere at any time, by learning to speak the language of the electromagnetic waves flowing over your skin. These waves have been a constant and quiet companion for most people’s entire lives.

GPS is perhaps one of the most audacious geo-engineering feats ever undertaken, and its traces can be felt with just an antenna and a motive.

Quiet beacons

All that said, it’s not as though there’s a cacophony of navigation data swarming around you, deafening if you could just hear it. In reality, the GPS signals surrounding you are astoundingly weak. To take an analogy: imagine a normal light bulb, like the one that might be above you now. Pull it twenty thousand kilometers away from the room you’re in, and have it flash, on, off, on, off, a million times a second. Imagine straining your eye to watch the shimmer of the bulb, two Earths away, and listen to what it’s telling you.

Big reveal: this is not hyperbole! The signal pumped out by GPS satellites actually has the same strength as a residential lightbulb at the satellite. By the time the flash gets to you, it’s unfathomably attenuated, and yet it can still be detected, decoded, understood and made useful. It’s really incredible, and hard to believe without wrangling the data yourself.

These quiet lighthouses give rise to one of the interesting characteristics of GPS: there’s no way for anyone to charge for access to it. No one even knows you’re listening. From the satellite’s perspective, GPS is send-and-forget.

Similarly, your GPS location could never be served up to you by a web service. The key idea with server-side computing is that compute might need to be served in one place (such as on a user’s machine), but it’s really no problem if it’s computed in another (such as a data center). GPS, by contrast, is fundamentally incompatible with this optimization: GPS only tells you about the radio waves hitting where you are, and you need to listen to what’s in the field around you. No datacenter can listen on your behalf.

Listening closely

OK, you’ve got me, I’m pumped! How do we, uh, listen?

I understand that GPS is transmitted over EM waves, but I don’t know much about the analog domain – is this the same thing as radio?

Great! I know that frequency is important, where does that come in?

Cool. I know I’m going to write some software to receive these signals, post-process them, and make a snazzy demo for my pitch deck. I figure this means I’ll need to buy a receiver that can tune to the GPS frequency. After searching around for a tunable RF receiver, I learn that I’m looking for a ‘software defined radio’. This sounds reasonable!

I hastily research SDRs and purchase one just before my flight takes off.

I set up SDR++ and start poking around. For a while, I can’t find much of anything, but after speedrunning terms such as bias tee, AGC, and IQ correction, I’m ready to go to town exploring the spectrum.

Locking on

By the time it’s received by terrestrial antennas, the GPS signal is so weak that it has 100,000 times less power than the ambient energy and signals just floating around the place. In other words, the GPS signals can sit up to 50db below the thermal noise floor.

联系我们 contact @ memedata.com