Hacker News new | ask | show | jobs
by matrix2003 616 days ago
Someone gave me an analogy some time ago that made a lot of sense.

If you shine a flashlight through a tree blowing in the wind and vary the brightness to convey information, the signal can get distorted pretty easily.

However, if you have a constant brightness source and vary the color, it’s a lot easier to figure out what the source is trying to convey.

10 comments

It's not merely an analogy, just the same EM waves scaled up in frequency by a few orders of magnitude.
Except that color isn’t the same thing as wavelength when it comes to humans perceiving light, because our eyes only deal with the total energy within each of three overlapping bands. An FM receiver knows the difference between a single carrier varying in frequency, and two carriers of different frequencies varying in proportion. Our eyes don’t, hence the banner above appearing orange, even though it’s actually made of different proportions of red and green.
Right, but let’s just consider the visual spectrum a single carrier/station
But that’s not how FM receivers generally work. They don’t just take a chunk of the spectrum and measure relative amplitudes within that window. Some very quick and dirty FM demodulators do something like that, but they have poor noise rejection, so the analogy fails.

Proper receivers use a phase-locked loop to “lock on” to a carrier, rejecting any weaker interference on nearby frequencies.

In the analogy, suppose you’re decoding a signal from a flashlight over the entire color spectrum, but sunlight shines through the leaves of the tree, adding a slight green noise component to what you see, while the flashlight is actually red. You’ll erroneously interpret the signal as slightly yellow.

We don’t have anything like the PLL in our eyes, so the analogy breaks down here. In the equivalent scenario with an actual FM signal, that slight “green” component would not affect the received signal (or it would affect it to a much lesser extent).

This makes a lot of sense so long as your source of noise is something like a tree swaying in the wind, ie something that interferes with the amplitude. If instead the source of noise is uhhh a piece of stained glass swaying in the wind then blinking the flashlight is the better bet. I guess it just turns out radio interference is more like the tree. But why?
Stained glass won’t (I think) shift any frequencies. It will attenuate different frequencies differently, but it won’t make up new ones.

So when the signal frequency changes, you’ll still see that change, but the light might get brighter or dimmer at the same time due to the stained glass. But you don’t care about the brightness to begin with.

In the stained glass case, maybe you need to go digital where brightness and color don't matter, but only on-off state.
You'd be surprised by the amount of brightness and color produced if you are turning things on-off sufficiently fast.
Related: lots of optical illusions.
In this analogy, the AM and FM signals you receive aren't usually experiencing interference, they are experiencing multipath effects which includes things like path loss, attenuation, reflections, and so on. This is driven by geometry. You also have gaussian noise that the receiver has to deal with.

You model this by taking your signal and convolving it with the channel vector. Usually the channel vector is a finite number of dirac deltas. Each delta is a different reflection. They are like echos. They can cause the signal to constructively and desconstructively interfere with itself.

I haven't seen the math, but I am guessing this doesn't do as much to the frequency of the signal compared to the amplitude.

a better analogy for frequency domain interference would be something like the spinning flashing lights on a fire engine or utility truck occasionally shining colored light on your detector.
I think this is reasonable analogy, for FM interference, and it points out why FM is resilient to noise: the flashing lights have to be relatively bright (high amplitude) to interfere with your color based scheme.
The stained glass would change the amplitude of some light selectively. But because the FM radio works at different distances, I wonder if it must have some way of adjusting for different amplitudes anyway?
Yes, stained glass is like band filter, they let through a particular frequency range, while reducing those outside the range. Your FM receiver will still lock on the desired frequency as long as their is enough signal strength. It's kind of the same as listening to an emitter that is very far while being very close to another. Of course, it'll stop to work at some point depending on minimum signal-to-noise ratio.
I always shy away from analogies because more often than not they give the wrong "feel" for a concept. But this is one of those rare exceptions.
It _is_ the wrong feel for a concept. The analogy breaks down because the color changes are way too wide in frequency (and thus too robust to noise) compared to what happens in a radio broadcast. If you changed the color from RGB(127, 0, 0) to RGB(126.999999, 0.000001, 0), the movement of that tree would actually start to make your strategy difficult.

Going from red to orange is about 50 THz. Typical FM radio modulation width is 100 kHz.

The analogy isn't wrong, it's just that it is incomplete as given. You are bringing the sensitivity of the receiver into the equation. But it doesn't really break down the analogy, because the frequency shift in color is calibrated for the human eye's sensitivity. Calibrate it for a FM receiver and that tiny color shift becomes easily discernible. The tree leaves have no impact on frequency, just amplitude.

The reason the analogy is good is because it isn't even really an analogy, it is in fact a description of electromagnetic waves and a noise source.

> The tree leaves have no impact on frequency, just amplitude.

That's an oxymoron, really. Frequency and amplitude are closely interrelated concepts (e.g. see Heisenberg's uncertainty principle in the context of signal processing). Frequency-varying and amplitude-varying even more so!

It's not an analogy. This is precisely how it works.
Unless your car radio consists of a flashlight and a tree, this is an analogy.
The flashlight is the radio tower, the tree is the tree, and the radio in the car is your eyes. There is no analogy here, it is literally the same EM waves shifted up to where our eyes can see them.

It's like saying that the violins is merely an analogy for how a double base works.

> it is literally the same EM waves shifted up to where our eyes can see them

Rubber ducks aren't battleships because they both float. Visible light and radio attenutate in meaningfully-different ways. It's an analogy.

> Visible light and radio attenutate in meaningfully different ways. It's an analogy.

Lol news to me and my physics degree, Do tell because as far as I'm aware Maxwell's equations don't have an asterisk on them that say "doesn't work below 1 GHz".

You could make Bob Ross a new wig from all the hairs split in this subthread.
Both are examples of communication by means of frequency modulated and amplitude modulated electromagnetic waves with distortion from a moving three. Also a good example that a large change in quantity is a change in kind. Probably a legit analogy imho.
Rubber ducks and battleships both displace water in the same way.
But RC boats and battleships both have propellers and rudders.
It's not saying the violin IS "merely an analogy for how a double base works", just that a violin can be used as a simple analogy to somebody who understands how a violin works but doesn't know what a double bass is.

Comparing similar things is literally what an analogy is, the fact that in these two cases (radio/light and string instruments) the things being compared are very similar it doesn't make them the same thing, nor does it make it not an analogy.

It is not literally the same. The colors you perceive on the screen in front of you demonstrate why. That banner above is not orange; it’s red and green. You don’t actually have the ability to distinguish a varying frequency between red-orange and yellow-orange, and two amplitude modulated “carriers” at red and green.

That’s the hallmark of an analogy. It gives the general idea, but breaks down if we interrogate it in too much detail.

Essentially that is actually the case. Human-visible light and AM/FM radio waves are just different wavelengths along the EM spectrum.

A flashlight beams out waves that we can see; a radio transmitter beams out waves we can't. The brightness of the beam of light is related to its amplitude, just like the signal content in AM radio is related to its amplitude. And the color of the beam of light is related to its frequency, just like the signal content in FM radio is related to its frequency.

The explanation asks us to imagine shining a flashlight through a tree, first changing the flashlight brightness and then changing its color.

The flashlight is an analogy for a radio transmitter. We all get that they work on same principle but just on different wavelengths. But regardless I can't shine the flashlight in my kitchen drawer at my radio and pick up a signal.

Remove cover, locate LNA, modulate light correctly and voila... :-)
Well... It kind of does. The source of the radio station is a kind of flashlight, just on a different frequency. The tree is still a tree (and all the other objects)
More accurately a giant lightbulb, but emitting at 102.7 MHz (my favorite local radio station) rather than ~450 THz (my favorite color).

Put visible light over a really long waveguide and modulate the colors, you invented fiber optic telecommunication.

Both concepts are based on frequency and amplitude of waves (radio vs light).
That's what makes the analogy so clear.
Good analogy, however if you move back and forth the transmitter or the receiver at enough speed, frequency (color) will vary as well, and that analogy could be used to explain Doppler effect, and why civilian airplanes use AM.
Civilian airplanes aren't using AM because of the Doppler effect. You're not accelerating that rapidly to make the Doppler effect that pronounced on the kind of radio being used in airplanes to the point they wouldn't be useful. Even if you're going hundreds of miles an hour the shift is going to be a few dozen Hz in drift. A cheap FM discriminator will be able to handle that without any problem. Doppler shift starts to matter when dealing with satellites, but not airplanes unless you're taking a SR-71 on a civilian stroll.

Doing the math, if you're going 200mph away from a station transmitting at say 121MHz, the drift frequency would be ~36Hz. Not going to be a problem.

And even then, your AM transmission still gets affected by Doppler shift as well.

Airplanes use AM because when two SSB transmissions happen at the same time you can actually hear both at the same time. If you're using FM it's either an incoherent mess or one transmitter drowns out the other.

That's not the real story. The RF environment is noisy, with naturally occuring static "sparks", but also with manmade RF noise.

This static and RF noise is AM. It's impossible to filter it out from an AM signal, and so the background noise gets amplified with the signal.

Encoding the signal in a modulated frequency (FM) means we don't need to amplify the detected AM signal and it's associated background noise.

It's not that simple, though. The only way you can detect frequency is by measuring the amplitude (and then differentiate; except of course in an analog circuit, you don't do that exactly, you have some mechanism that tries to track the carrier wave smoothly instead), so amplitude noise will necessarily also become frequency noise. But generally white AM noise will be pushed upwards in the spectrum after FM demodulation, away from the area where you care. (You can also add a hard limiter, which amplifies this effect; even more noise high up, even less noise further down.)
That's exactly what the parent comment described in the beautiful example where the AM noise is due to moving tree leafs affecting the intensity of transmitted light, and you can fix it by varying color, which means varying the frequency spectrum of the light.
How does the radio follow the frequency modulations if the radio cannot "see" at a specific direction?
In the example, the amplitude of the flashlight signal is distorted by the movement of the trees. The signal is never completely hidden. Not sure if that answers your question...
This is the best explanation I have ever heard.
This seems great at first, but more so as an explanation of how AM and FM differ; one being by amplitude (brightness), and the other by frequency (color).

What I don't see is how it explains why one would work better than the other.

If the tree is blowing in the wind, and a leaf obstructs the entire signal, it doesn't matter whether it's a change in brightness, or a change in color. Either way, that information is lost by the blocked leaf. And if the entire signal is not lost, perhaps many leaves may have blocked the signal but some signal managed to get through, it doesn't matter whether the signal change was a change in brightness, or a change in color. Either way you're going to notice the change. So I don't see how this clarifies why FM is better. What am I missing?

I see from the article that "noise tends to be a an unwanted amplitude modulation, not a frequency modulation." In other words, the tree is providing an unwanted change in brightness. It never provides an unwanted change in color.

I guess the tree is able to dim the signal so much that it appears to be a deliberate signal change? Couldn't this be dealt with if you know the details of the tree's dimming ability?

The analogy is getting a bit tortured, so I'll try a more practical explanation.

An AM receiver is a machine that senses the amplitude at a specific em frequency. In this situation, noise and interference become random additions or subtractions to that amplitude. Draw a sine wave, then go over the line with vertical ticks or scribbles. Now imagine taking a random sampling of points and reconstructing the original wave perfectly (without a computer). Most of the information is just gone and you end up with a noisy output wave.

Now an FM receiver is one that measures frequency changes above and below a 'carrier' frequency. The amount of deviation away from center represents the amplitude of the sound signal being transmitted. In this setup, noise and interference are also random additions to the amplitude, but also at random frequencies. On average, interference happens evenly over the entire range of frequencies you're looking at. That means that the highest amplitude is still the same frequency away from center, it just has a slightly different amplitude.

Go back to that sine wave. You can't see the original signal behind all the noise, but you can still see how far apart the peaks are. You can still easily extract its frequency content.

FM uses the frequency dimension to transmit data because random noise can't really affect frequency. Noise mostly happens in the amplitude dimension across all frequencies at the same time.

FM is more robust because it uses two dimensions to encode information vs AM's single dimension. That's also why FM is in stereo!

> That's also why FM is in stereo!

Stereo FM is essentially two waves transmitted at the same time (it's common and difference instead of left and right, but that's math). Stereo AM would be possible, it was never done because two different AM transmissions have to be spaced further away than FM.

AM stereo does exist, however.

https://en.wikipedia.org/wiki/AM_stereo

There were a number of successful AM stereo broadcasting methods proposed and trialed. These were completely compatible with conventional AM transmissions.

The conceptually simplest of course whas where the LSB and USB are used as separate channels.

Although most of the systems did work, they were not ultimately successful simply because insufficient stereo receivers reached the market.

Go search in Wikipedia on "AM Stereo".

Of the methods listed on Wikipedia only ISB is a true AM. All the others use phase modulation for the difference signal, as an easy way to achieve compatibility with mono AM receivers; and PM is basically the integral of FM.

Wikipedia says that there was basically one station doing ISB stereo; which I guess is close enough to "nobody did it", but not quite "it was never done".

Could you make AM stereo by somehow using the two sidebands (on each side of the carrier) for left and right?
Yes, this is one of the proposed methods. It's known as "Independent Sideband".

It works, but it is a fairly expensive method to implement.

FM works better because it is easier to detect the change in frequency independently of any change in the amplitude.

I'm unsure of what the correct terminology would be, but (for my linear algebra brain) you could say something like, for FM the noise dimension is orthogonal to the signal dimension, while for AM the noise and signal dimensions are the same. Therefore for FM any change in amplitude in the noise dimension should be mostly isolated from the signal dimension, while it is essentially impossible to tell what is noise and what is signal for AM - you could probably do some radio equivalent of a differential pair in order to detect noise and remove it, but then why would you bother when FM has improved noise rejection anyway.

> What am I missing?

The tree blowing in the wind will introduce its own amplitude (brightness) fluctuations. It will be hard for you to tell which amplitude changes are signal from the source and which are noise from the tree.

Edit: Looks like you answered yourself while I typed that, where you added:

> Couldn't this be dealt with if you know the details of the tree's dimming ability?

If the tree is moving, and you’re far enough away to resolve individual leaves (which is not unreasonable) then its “dimming ability” is constantly changing.

A leaf blocking some light doesn't change the color of the light that passes through.
> leaf blocking some light doesn't change the color of the light that passes through

Of course it does. Real-life objects aren't perfectly opaque or transparent. Similarly, radio waves aren't blocked or received: they're mangled and self-interacted in complex ways.

I think the idea is that the leaves don't block the entire signal. They just partially obscure it sometimes.

And even if leaves do sometimes block the entire signal, you're still going to do better with varying the color than the brightness.

> Either way you're going to notice the change.

For this, it's better to stick to many leaves - the analogy holds up well here because when is the brightness change due to the number of leaves being in the way vs the source changing its brightness?

Let's switch the analogy to sound. Amplitude is loudness. Frequency is pitch. You are trying to discern two sources of sound. One is a constant pitch but variable volume. The other can always blast at max volume with variable pitch.
Also harder to discern and then quantify the loudness of a sound or brightness of a light as a human modem but we are better and more certain of the color. We have different names for the ranges and everything.
> harder to discern and then quantify the loudness of a sound or brightness of a light as a human modem but we are better and more certain of the color

Fair enough, this might be a sensory artefact. In this case, however, nature had a point. Energy scales proportionally with frequency but exponentially with amplitude. Increasing amplitude delivers more bang than increasing frequency.

if the leaves are blowing back and forth between the transmitter and the receiver, they would introduce a doppler shift into the signal

of course, you shouldnt be listening to radio during a tornado, but...

I read a similar explanation on slashdot a few decades ago that's stuck with me.
Wow, that is pretty clever.
I'm stealing this.