【Hacker News搬运】展示HN:构建GPS接收器
-
Title: Show HN: Building a GPS receiver
展示HN:构建GPS接收器
Text: Hi everyone!<p>Shortly after publishing my iOS 4 jailbreak last October[1], I got to work on my next hobby project: a from-scratch homebrew GPS receiver, which can solve the user’s location solely from billions of radio antenna samples.<p>I took a commodity SDR (alongside the Python standard library and numpy) and built a signal processing pipeline that can detect and track GPS satellites over many minutes, drop and pick up satellites as they come in and out of view, and precisely determine the user’s position and clock inaccuracy.<p>All told, gypsum can go from a cold start to a fix on the user’s position, and the precise time, in less than a minute of listening to the antenna. I went on a journey of learning how to detect and track satellite signals that are literally too quiet to hear, and I hope that some of the magic comes through in the posts!<p>After implementing this myself and walking the long road of getting it working, I’m left completely stunned by the brilliance of GPS, across so many axes. I hope you enjoy the read!<p>On a more personal note, I’ll be starting a new job next week which isn’t as amenable to publishing side projects, and therefore this will be my last publicly-published project for some time. I’ve had great experiences making and sharing projects on here, and I’m really grateful for the positive feedback that’s been shared!<p>[1]: <a href="https://news.ycombinator.com/item?id=37736318">https://news.ycombinator.com/item?id=37736318</a>
大家好<p> 去年10月,在发布了我的iOS 4越狱后不久[1],我开始着手我的下一个爱好项目:一个从头开始的自制GPS接收器,它可以仅从数十亿个无线电天线样本中解决用户的位置问题<p> 我拿了一个商品SDR(与Python标准库和numpy一起),构建了一个信号处理管道,可以在几分钟内检测和跟踪GPS卫星,在卫星进出视野时放下和捡起卫星,并精确确定用户的位置和时钟不准确度<p> 总而言之,石膏可以在不到一分钟的时间内从冷启动到固定用户的位置和准确的时间。我开始了一段学习如何检测和跟踪安静得听不见的卫星信号的旅程,我希望这些帖子能带来一些魔力<p> 在我自己实现了这一点,并走上了让它发挥作用的漫长道路后,我被GPS跨越这么多轴线的辉煌惊呆了。我希望你喜欢阅读<p> 就我个人而言,我下周将开始一份新工作,这份工作不太适合发表副业项目,因此这将是我一段时间以来最后一个公开发表的项目。我在这里制作和分享项目有着丰富的经验,我非常感谢大家的积极反馈<p> [1]:<a href=“https://;/;news.ycombinator.com/!item?id=37736318”>https:///;news.ycombinator.com/;项目id=37736318</a>
Url: https://axleos.com/building-a-gps-receiver-part-1-hearing-whispers/
概述:本文介绍了GPS接收器的工作原理,以及作者尝试解析GPS信号的过程。文章首先提到,尽管在飞行中,GPS信号依然能够被接收,这让人感到惊讶。作者接着解释了GPS卫星的数量,并提出了自己对于GPS系统设计的疑问。作者访问了gps.gov网站,并对此感到兴奋。他决定尝试解析GPS信号,以了解其工作原理。 作者了解到,GPS信号具有非常强的穿透力,可以在任何高度、任何天气条件下被接收。这一现实令人震惊。这些信号始终存在,就像是一个持续的、安静的伴侣。GPS是一项大胆的地缘工程壮举,其痕迹可以通过简单的天线和动机就能感受到。 尽管GPS信号非常微弱,但它们可以被检测、解码,并变得有用。这些信号的强度与家庭灯泡相当,但在到达接收器时,它们已经非常微弱了。作者使用软件定义的无线电(SDR)接收器尝试接收这些信号,并对其进行后处理,以制作演示文稿。 在接收GPS信号时,接收器需要知道卫星的PRN代码,这是一种额外的信号,卫星会重复发送以供接收器识别。通过这种方式,GPS确保了PRN代码是一个可靠的信标,可以在几秒钟内锁定,同时确保数据流可以被可靠地恢复。 作者还解释了如何生成PRN代码,以及如何在接收器中使用它们来检测卫星信号。在搜索卫星信号的过程中,接收器需要生成每个卫星的PRN代码副本,然后在接收的数据中搜索这些PRN代码。如果发现强烈的相关性,接收器就知道有一颗卫星在其上方。 最后,作者提到,他已经完成了GPS定位管道的第一个主要步骤,即确定哪些GPS卫星在用户上方,以及它们的相位(或时间延迟)和多普勒移位(或相对速度)。他将在下一部分中继续讲述如何跟踪这些卫星。 翻译成中文后的内容概述:本文介绍了GPS接收器的工作原理,以及作者尝试分析GPS信号的过程。文章首先提到,尽管在飞行中,GPS信号依然能够被接收,这让人感到惊讶。作者接着解释了GPS卫星的数量,并提出了自己对于GPS系统设计的疑问。作者访问了gps.gov网站,并对此感到兴奋。他决定尝试分析GPS信号,以了解其工作原理。 作者了解到,GPS信号具有非常强的穿透力,可以在任何高度、任何天气条件下被接收。这一现实令人震惊。这些信号始终存在,就像是一个持续的、安静的伴侣。GPS是一项大胆的地缘工程壮举,其痕迹可以通过简单的天线和动机就能感受到。 尽管GPS信号非常微弱,但它们可以被检测、解码,并变得有用。这些信号的强度与家庭灯泡相当,但在到达接收器时,它们已经非常微弱了。作者使用软件定义的无线电(SDR)接收器尝试接收这些信号,并对其进行后处理,以制作演示文稿。 在接收GPS信号时,接收器需要知道卫星的PRN代码,这是一种额外的信号,卫星会重复发送以供接收器识别。通过这种方式,GPS确保了PRN代码是一个可靠的信标,可以在几秒钟内锁定,同时确保数据流可以被可靠地恢复。 作者还解释了如何生成PRN代码,以及如何在接收器中使用它们来检测卫星信号。在搜索卫星信号的过程中,接收器需要生成每个卫星的PRN代码副本,然后在接收的数据中搜索这些PRN代码。如果发现强烈的相关性,接收器就知道有一颗卫星在其上方。 最后,作者提到,他已经完成了GPS定位管道的第一个主要步骤,即确定哪些GPS卫星在用户上方,以及它们的相位(或时间延迟)和多普勒移位(或相对速度)。他将在下一部分中继续讲述如何跟踪这些卫星。
Post by: codyd51
Comments:
amluto: > Just one problem: you won’t find any SDR on the market that will claim to be able to sample a wave oscillating over a billion times a second.<p>This was true, but not any more. You can get truly impressive “direct RF sampling” or “direct RF conversion” receivers that are more than fast enough for GPS. For example:<p>Xilinx RFSoc: <a href="https://www.mouser.com/datasheet/2/903/ds889_zynq_usp_rfsoc_overview-1670395.pdf" rel="nofollow">https://www.mouser.com/datasheet/2/903/ds889_zynq_usp_rfsoc_...</a><p>A nice National Instruments article: <a href="https://www.ni.com/en/solutions/aerospace-defense/radar-electronic-warfare-sigint/advantages-of-direct-rf-sampling-architectures.html" rel="nofollow">https://www.ni.com/en/solutions/aerospace-defense/radar-elec...</a><p>And their referenced off-the-shelf hardware: <a href="https://www.ni.com/en-us/shop/category/flexrio-custom-instruments-and-processing.html?productId=230187" rel="nofollow">https://www.ni.com/en-us/shop/category/flexrio-custom-instru...</a><p>One might be forgiven for being a bit puzzled as to why NI thinks that direct RF conversion is cost-effective but nonetheless sells the device for $30k That being said, if I were prototyping a system that wanted phase-coherent wideband reception around 3 GHz and I had a proper lab and budget, I’d buy a few of these. If I were to go to production, I’d either wait for costs of a homemade board to come down a bit or see whether a traditional heterodyne receiver could do the trick.<p>Hmm. For military applications, if I were concerned about really advanced RF-seeking weapons pointed at me, a direct conversion receiver is probably great — there won’t be any leakage of the LO that an enemy device could try to detect.
amluto: >;只有一个问题:你在市场上找不到任何声称能够对每秒振荡超过10亿次的波动进行采样的SDR<p> 这是真的,但现在已经不是了。您可以获得真正令人印象深刻的“直接射频采样”或“直接射频转换”接收器,这些接收器的速度对于GPS来说足够快。例如:<p>Xilinx RFSoc:<a href=“https://;/;www.mouser.com//:数据表/,2/!903/&ds889_zynq_usp_RFSoc_overview-1670395.pdf”rel=“nofollow”>https:///;www.mouser.com/x2F;数据表;2;903;ds889_zynq_usp_rfsoc_</a> <p>一篇很好的美国国家仪器公司文章:<a href=“https://;/;www.ni.com/,en/:解决方案/航空航天防御/雷达电子战信号/直接射频采样架构的优势.html”rel=“nofollow”>https:///;www.ni.com/;en;解决方案;航空航天防御;radar-elec.…</a><p>及其参考的现成硬件:<a href=“https://;/;www.ni.com/:en-us/,shop/。category/!flexrio custom instruments And processing.html?productId=230187”rel=“nofollow”>https:///;www.ni.com/;en-us;shop/;类别;flexrio定制仪表</a> <p>人们可能会有点困惑,为什么NI认为直接射频转换具有成本效益,但该设备的售价却高达3万美元:)也就是说,如果我正在制作一个想要3 GHz左右相位相干宽带接收的系统的原型,并且我有适当的实验室和预算,我会买一些。如果我要去生产,我要么等待自制电路板的成本下降一点,要么看看传统的外差接收器是否能做到这一点<p> 嗯。对于军事应用,如果我担心指向我的真正先进的射频搜索武器,直接转换接收器可能很棒——不会有任何敌方设备试图检测到的LO泄漏。
AdamJacobMuller: Cool article.<p>Whenever I see "from scratch," I'm always curious to see how from scratch the author actually means so I'll admit I was a bit disappointed to see that the hardware was just RTL-SDR. Still, the protocol decoding was very interesting and the result is great.<p>> GPS was launched in 1978, which was 45 years ago at time of writing. Five billion people are currently under 40 years old, so well over half the world’s population has never existed in an environment but this.<p>A note based on this. While GPS was around since 1978 the signal was intentionally degraded with a process known as "selective availability" until 2000. This largely rendered GPS unusable for many many purposes, definitely useless for road navigation, it had some limited utility in areas like backcountry navigation and was definitely useful for marine navigation.<p>> gypsum can go from a cold start to a fix on the user’s position, and the precise time, in less than a minute of listening to the antenna<p>This is very impressive and outclasses what I see even commercial receivers doing today, do you have any idea how? I remember on road trips in the early 2000s I would have to sit on the side of the road and wait for the GPS receiver to get a fix (a 15-20 minute process, when it worked) before we could leave. Or, more likely, my mother would just start driving with paper maps.
AdamJacobMuller: 很酷的文章<p> 每当我看到“;从头开始;I-;我总是好奇地想从头开始看看作者的实际意思,所以我;我承认,看到硬件只是RTL-SDR,我有点失望。尽管如此,协议解码还是很有趣,结果也很棒<p> >;全球定位系统于1978年推出,在撰写本文时已经是45年前的事了。目前有50亿人年龄在40岁以下,因此世界上一半以上的人口从未生活在这样的环境中<p> 基于此的注释。当GPS自1978年以来一直存在时,信号被有意地用称为“GPS”的过程降级;选择性可用性”;直到2000年。这在很大程度上使GPS无法用于许多目的,对道路导航毫无用处,它在野外导航等领域的实用性有限,对海洋导航毫无用处<p> >;石膏可以在不到一分钟的时间内从冷启动到固定用户的位置和准确的时间,收听天线<p>这非常令人印象深刻,甚至超过了我今天看到的商用接收器的性能,你知道怎么做吗?我记得在21世纪初的公路旅行中,我必须坐在路边,等待GPS接收器得到修复(当它起作用时,需要15-20分钟的过程),然后我们才能离开。或者,更有可能的是,我妈妈刚开始用纸质地图开车。
magnat: Note that GPS receiver capable (i.e. not artificially limited) of providing navigation data while moving 600 m/s or higher used to be considered munition by ITAR. The amount of legalese at updated ruling [1] is well beyond what I can make sense of, to the point I don't even know if it still applies.<p>While we're at SDRs, ITAR is also responsible for takedown of passive radar GNU Radio module made by Kraken RF team.<p>[1] <a href="https://www.space.commerce.gov/itar-controls-on-gps-gnss-receivers-updated/" rel="nofollow">https://www.space.commerce.gov/itar-controls-on-gps-gnss-rec...</a>
magnat: 注意,GPS接收器能够(即,不受人为限制)在移动600mF的同时提供导航数据;s或更高版本曾被ITAR视为弹药。在更新的裁决[1]中,法律术语的数量远远超出了我的理解范围,以至于我无法理解;我甚至不知道它是否仍然适用<p> 而我们;在SDR,ITAR还负责拆除由Kraken RF团队制造的无源雷达GNU无线电模块<p> [1]<a href=“https:/;&x2F;www.space.camerce.gov/,itar controls on gps gnss receivers updated/”rel=“nofollow”>https:ȏ/;www.space.commerce.gov/;itar-controlls-on-gps-gnss-rec</a>
blobcode: A good, decently detailed look at signal processing required. I also like <a href="https://ciechanow.ski/gps/" rel="nofollow">https://ciechanow.ski/gps/</a>, which has some fantastic visuals to go along with this explanation.
blobcode: 对所需的信号处理有一个很好的、相当详细的了解。我还喜欢<a href=“https://;/;ciechanow.ski#xx2F;gps#xx2F”rel=“nofollow”>https:///;ciechanow.ski;gps</a> ,它有一些奇妙的视觉效果来配合这个解释。
AlexanderTheGr8: "Interestingly, the only thing stopping civilians from using the P code is the knowledge of the value of its chipping sequence. If the formula to generate the P code was publicly known, there’d be nothing stopping civilian GPS receivers from locking on to it, with the exact same techniques as are used for the C/A code."<p>I didn't finish reading the whole thing but was curious. Is there any way of brute forcing it or some other trick to get the chipping sequence to get the P code for more precise GPS?
AlexanderTheGr8: ";有趣的是,唯一能阻止平民使用P码的是知道其码片序列的价值。如果生成P码的公式是公开的,那么没有什么可以阻止民用GPS接收机锁定到它,使用与用于C-F的技术完全相同的技术;一个代码"<p> 我没有;我没有读完整件事,只是很好奇。有没有办法强行使用它或其他技巧来获得芯片序列,从而获得更精确的GPS的P代码?