Introduction: The Rosetta Stone
In Part 1, we introduced the "ghost in the machine"—an aliased signal created by the very act of measuring a stream of discrete events. We established that any time-bucketed analysis is a form of filtering. But to truly understand our measurements and build a trustworthy instrument, we need a more formal framework.
This article is that framework—a "Rosetta Stone" to connect the different concepts at play. Before we can analyze our system quantitatively in Part 3, we must first understand the precise relationship between our sample rate, the frequencies we want to observe, and the characteristics of the filter we are unknowingly using.
The Mechanism of Aliasing: How Frequencies Fold
The most confusing part of this topic is how a high-frequency signal can pretend to be a low-frequency one. The sinc
and sidelobe plots in the next section show how much of a high-frequency signal can leak through our filter, but they don't explain where that energy goes after it's sampled.
The "folding" happens in the frequency domain. Imagine the frequency spectrum of our signal is a piece of paper, with 0 Hz
on the left edge. The Nyquist frequency (for us, 500 Hz
) is a crease down the middle of the paper. Any signal component with a frequency higher than Nyquist—like a high-frequency noise component that gets through our filter's leaky sidelobe—is like a dot of ink on the right half of the paper.
Sampling folds the paper at the Nyquist crease. The ink dot from the right side presses against the left side, leaving a new, false mark—an alias.
As the diagram shows, a real signal component at 800 Hz
is 300 Hz above the 500 Hz
Nyquist frequency. When sampled, this energy "folds" over and appears at a frequency 300 Hz below the Nyquist frequency: 500 Hz - 300 Hz = 200 Hz
. This is the ghost in the machine. The sidelobe plot tells us the amplitude of the 800 Hz
signal that gets through our filter's gate; this diagram shows where it ends up after passing through that gate.
The Core Components and Their Relationship
Imagine you're trying to understand the pattern of rainfall by putting a bucket outside and measuring the water level once every hour.
-
The Sample Rate (Checking the Bucket): This is how often you look at your measurement. For Jittertrap, this is 1000 Hz (once every 1 millisecond). This is the fundamental constraint of your entire system. The highest frequency you can theoretically represent without ambiguity is half this rate—the Nyquist Limit, which for us is 500 Hz. Any real signal component above 500 Hz is a potential source of aliasing.
-
The Frequencies of Interest (The Rainfall Pattern You Care About): This is the phenomenon you actually want to observe. You don't care about individual raindrops (that's too fast). You care about slower patterns: "Is it drizzling or is it a downpour?" For Jittertrap, these are the "bursts and gaps" in traffic. A 10ms gap is a 100 Hz phenomenon (
1 / 0.01s
). Our "Signal Band"—the range of frequencies we want to measure accurately—is roughly 0 Hz to a few hundred Hz. -
The Boxcar Filter (The Shape of Your Bucket): This is how you measure. You aren't measuring an instant in time; you're collecting all the "rain" (packets) that fell over a
1ms
interval. This averaging process is the boxcar filter. It has a specific effect on different frequencies, which we can visualize with two types of plots:- The Amplitude Plot (
sinc
function): This shows the linear gain of the filter. It answers the question: "If a signal of frequencyf
goes in, what percentage of its amplitude comes out?" - The Decibel (dB) Plot (Sidelobes): This shows the same information on a logarithmic scale, which is much better for seeing how much the unwanted high frequencies are suppressed.
- The Amplitude Plot (
The Critical Values: A Blueprint of Our Filter
These are the specific frequencies where the behavior of our boxcar filter has a direct and important impact on Jittertrap's measurements. Think of the filter as a stained-glass window:
- The Passband is the large, clear pane in the middle. You can see through it pretty well.
- The Nulls are the lead frame between the panes. They completely block the view at that specific line.
- The Sidelobes are the small, colored pieces of glass. They block most of the light, but they let a specific, wrong color (frequency) through, tinting your view of the world outside.
The plots we've generated are the blueprints for this window.
Critical Value | Frequency (for Jittertrap) | Why It's Critical & How It Appears on Plots |
---|---|---|
Passband | ~0 - 400 Hz | Our target range. We want the filter to pass these frequencies with as little distortion as possible. On the sinc plot, the amplitude is close to 1.0 . |
Nyquist Freq. | 500 Hz | The theoretical limit of our sampler. Any signal above this will alias. The filter has already started to attenuate the signal here, which is a crude but helpful feature. |
First Null | 1000 Hz | The filter is completely blind at this frequency, a direct consequence of the 1ms integration time. On the sinc plot, the amplitude crosses zero. On the dB plot, it goes to -infinity. |
First Sidelobe Peak | ~1430 Hz | This is the "leakiest" point of the filter. It's the high frequency most likely to sneak past and masquerade as a low-frequency alias. On the sinc plot, this is the first bump after the null (amplitude -0.217 ). On the dB plot, this is the prominent lobe at -13.26 dB . |
Conclusion to Part 2
With this framework in place, we are now equipped to perform a meaningful analysis. We understand the components, the critical frequencies, and the inherent limitations of our measurement approach. We have the blueprint for our "stained-glass window."
In Part 3, we will use this framework to analyze the impact of real-world imperfections like scheduler jitter, perform the final quantitative calculations, and arrive at a conclusion about what we can and cannot trust from our instrument.
Continue to Part 3: Building an Honest Instrument.