TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Writing a Phase-locked Loop in Straight C

59 点作者 blueintegral超过 10 年前

4 条评论

phunge超过 10 年前
PLLs are fascinating. Software PLLs are less fun than messing with the hardware, in my experience!<p>I started working on a software PLL recently -- not analog like this one, digital. Specifically, I was trying to work out the math on a fully event driven type-II PLL -- i.e. instead of updating at a fixed sampling rate, it&#x27;d wake only when an edge happened on the input or VCO. I was starting to get curious whether there&#x27;s a solution for that somewhere on the web.<p>This is a good intro to (hardware) PLLs in general: <a href="https://www.youtube.com/watch?v=0jzLDe950AY" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=0jzLDe950AY</a> followed by <a href="http://www.ece.tamu.edu/~spalermo/ecen620.html" rel="nofollow">http:&#x2F;&#x2F;www.ece.tamu.edu&#x2F;~spalermo&#x2F;ecen620.html</a>
评论 #8734660 未加载
rasz_pl超过 10 年前
Warning: You need ~three semesters of EE under your belt to grok the math used in this blog post. Incidentally at that point you dont need that blog post because this stuff is trivial and self explanatory. This makes me very confused. It almost reads like a solution to an assignment you would get in DSP class.
评论 #8734217 未加载
quarterwave超过 10 年前
For anyone interested, here&#x27;s the essence of a phase-locked loop:<p>Say you&#x27;re climbing up a long staircase and the step height increases suddenly - then you&#x27;ll bump into the next step. If the height were to go the other way i.e; decrease, then you&#x27;ll put your foot down hard trying to place the next step. That change in step height is in fact a change in <i>frequency</i>, and you&#x27;re forced to adjust your pace abruptly by adjusting the timing (phase) of your subsequent steps.<p>Is there a &#x27;gentler&#x27; way to adjust the phase? Now say you&#x27;re wearing some kind of spongy sandals that can take up the slack, so at every step you <i>increasingly</i> sense that the frequency has changed. This accumulation indicates that phase is mathematically the <i>integral</i> of instantaneous frequency with respect to time.<p>We now put this integral in a feedback loop. Then, if the staircase step height changes suddenly we use the <i>slow</i> accumulated phase to produce an error signal that gradually drives the frequency generator (in this case, our brain) to adjust the pace of our step till we get in <i>lock</i>-step.<p>The actual dynamics is more complicated, involving a non-linear frequency capture (which linearizes the system) and then the <i>slower</i> phase lock. You can see this in the waveforms in the original post.
th0ma5超过 10 年前
Lot of great things happening in SDR, especially since the RTL-SDR devices opened the field to more exploration, even in spite of their limitations. Examples like this are exposing more and more people to DSP as well, and that gives me hope for the future of learning.