Say It With Me: Aliasing

Suppose you take a few measurements of a time-varying signal. Let’s say for concreteness that you have a microcontroller that reads some voltage 100 times per second. Collecting a bunch of data points together, you plot them out — this must surely have come from a sine wave at 35 Hz, you say. Just connect up the dots with a sine wave! It’s as plain as the nose on your face.

And then some spoil-sport comes along and draws in a version of your sine wave at -65 Hz, and then another at 135 Hz. And then more at -165 Hz and 235 Hz or -265 Hz and 335 Hz. And then an arbitrary number of potential sine waves that fit the very same data, all spaced apart at positive and negative integer multiples of your 100 Hz sampling frequency. Soon, your very pretty picture is looking a bit more complicated than you’d bargained for, and you have no idea which of these frequencies generated your data. It seems hopeless! You go home in tears.

But then you realize that this phenomenon gives you super powers — the power to resolve frequencies that are significantly higher than your sampling frequency. Just as the 235 Hz wave leaves an apparent 35 Hz waveform in the data when sampled at 100 Hz, a 237 Hz signal will look like 37 Hz. You can tell them apart even though they’re well beyond your ability to sample that fast. You’re pulling in information from beyond the Nyquist limit!

This essential ambiguity in sampling — that all frequencies offset by an integer multiple of the sampling frequency produce the same data — is called “aliasing”. And understanding aliasing is the first step toward really understanding sampling, and that’s the first step into the big wide world of digital signal processing.

Whether aliasing corrupts your pristine data or provides you with super powers hinges on your understanding of the effect, and maybe some judicious pre-sampling filtering, so let’s get some knowledge.

Continue reading “Say It With Me: Aliasing”

The Hard Way of Cassette Tape Auto-Reverse

The audio cassette is an audio format that presented a variety of engineering challenges during its tenure. One of the biggest at the time was that listeners had to physically remove the cassette and flip it over to listen to the full recording. Over the years, manufacturers developed a variety of “auto-reverse” systems that allowed a cassette deck to play a full tape without user intervention. This video covers how Akai did it – the hard way.

Towards the end of the cassette era, most manufacturers had decided on a relatively simple system of having the head assembly rotate while reversing the motor direction. Many years prior to this, however, Akai’s system involved a shuttle which carried the tape up to a rotating arm that flipped the cassette, before shuttling it back down and reinserting it into the deck.

Even a regular cassette player has an astounding level of complexity using simple electromechanical components — the humble cassette precedes the widespread introduction of integrated circuits, so things were done with motors, cams, levers, and switches instead. This device takes it to another level, and [Techmoan] does a great job of showing it in close-up detail. This is certainly a formidable design from an era that’s beginning to fade into history.

The video (found after the break) also does a great job of showing glimpses of other creative auto-reverse solutions — including one from Phillips that appears to rely on bouncing tapes through something vaguely resembling a playground slide. We’d love to see that one in action, too.

One thing you should never do with a cassette deck like this is use it with a cassette audio adapter like this one.

Continue reading “The Hard Way of Cassette Tape Auto-Reverse”

How Does a Voltage Multiplier Work?

If you need a high voltage, a voltage multiplier is one of the easiest ways to obtain it. A voltage multiplier is a specialized type of rectifier circuit that converts an AC voltage to a higher DC voltage. Invented by Heinrich Greinacher in 1919, they were used in the design of a particle accelerator that performed the first artificial nuclear disintegration, so you know they mean business.

Theoretically the output of the multiplier is an integer times the AC peak input voltage, and while they can work with any input voltage, the principal use for voltage multipliers is when very high voltages, in the order of tens of thousands or even millions of volts, are needed. They have the advantage of being relatively easy to build, and are cheaper than an equivalent high voltage transformer of the same output rating. If you need sparks for your mad science, perhaps a voltage multiplier can provide them for you.

Continue reading “How Does a Voltage Multiplier Work?”

Dartboard Watches Your Throw; Catches Perfect Bullseyes

Some people really put a lot of effort into rigging the system. Why spend years practicing a skill and honing your technique to hit a perfect bullseye in darts when you can spend the time building an incredibly complicated auto-bullseye dartboard that’ll do it for you?

In fairness, what [Mark Rober] started three years ago seemed like a pretty simple task. He wanted to build a rig to move the dartboard’s bullseye to meet the predicted impact of any throw. Seems simple, but it turns out to be rather difficult, especially when you choose to roll your own motion capture system.

That system, built around the Nvidia Jetson TX1, never quite gelled, a fact which unfortunately burned through the first two years of the project. [Mark] eventually turned to the not inexpensive Vicon Vantage motion capture system with six IR cameras. A retroreflector on the non-regulation dart is tracked by the system and the resulting XY data is fed into MATLAB to calculate the parabolic path of the dart. An XY-gantry using six steppers quickly shifts the board so the bullseye is in the right place to catch the incoming dart.

It’s a huge amount of work and a lot of money to spend, but the group down at the local bar seemed to enjoy it. We wonder if it can be simplified, though. Perhaps tracking just the thrower’s motions with an IMU-based motion capture system and extrapolating the impact point would work.

Continue reading “Dartboard Watches Your Throw; Catches Perfect Bullseyes”

Saturday Clock: An 0.000011574Hz ATtiny85 clock

In these times when we try to squeeze out extra clock cycles by adding more cores to our CPUs and by enlisting the aid of GPUs, [Ido Gendel] thought it would be fun to go in the exact opposite direction, supply a clock to the ATtiny85 that cycles only once per day, or at 0.000011574Hz. What application could this have? Well, if he could do it in seven instructions or less, how about turning on an LED at sunset Friday evening, to indicate the start of the Jewish Shabbat (Saturday), and turn it off again at sunset Saturday evening.

Notice the subtlety. A clock that cycles once per day means you can execute at most one instruction per day. Luckily on AVR microcontrollers, the instructions he needed can execute in just one cycle. That of course meant diving down into assembly code. [Ido] wasn’t an assembly wizard, so to find the instructions, he compiled C code and examined the resulting assembly until he found what he needed. One instruction turns on the LED and the instruction immediately following turns it off again, which normally would make it happen too fast for the human eye to register. But the instruction to turn it on runs on Friday evening and the very next instruction, the one that turns it off, doesn’t run until Saturday evening. Do you feel like you’re in a science fiction story watching time slowed down? Freaky. A few NOPs and the jump for the loop take up the remaining five cycles for the week.

For the source of the clock he chose to use an LDR to detect when the light level dropped at the end of the day. The problem he immediately ran into was that clouds, bird shadows, and so on, also cause drops in the light level. The solution he found was to widen the light and dark range by adding a TLV3702 push-pull output comparator and some resistors. [Ido] gives a detailed explanation of the circuit in the video after the break.

Continue reading “Saturday Clock: An 0.000011574Hz ATtiny85 clock”

Negative Resistance: It Shouldn’t Make Sense!

When you leaf through a basic electronics textbook, you’ll find chapters describing in detail the operation of the various components. Resistors, capacitors, inductors, and semiconductors. The latter chapter will talk about P and N type regions, introduce us to the diode, and then deal with the transistor: its basic operation, how to bias it, and the like.

A tunnel diode amplifier circuit. Chetvorno [CC0]
Particularly if your textbook is a little older, you may find a short section talking about the tunnel diode. There will be an odd-looking circuit that seems to make no sense at all, an amplifier formed from just a forward-biased diode and a couple of resistors. This logic-defying circuit you are told works due to the tunnel diode being of a class of devices having a negative resistance, though in the absence of readily available devices for experimentation it can be difficult to wrap your head around.

We’re all used to conventional resistors, devices that follow Ohm’s Law. When you apply a voltage to a resistor, a current flows through it, and when the voltage is increased, so does the current. Thus if you use a positive resistance device, say a normal resistor, in both the top and the bottom halves of a potential divider, varying the voltage fed into the top of the divider results in the resistor behaving as you’d expect, and the voltage across it increases.

In a negative resistance device the opposite is the case: increasing the voltage across it results in decreasing current flowing through it. When a large enough negative resistance device is used in the lower half of a resistive divider, it reduces the overall current flowing through the divider when the input voltage increases. With less current flowing across the top resistor, more voltage is present at the output. This makes the negative resistor divider into an amplifier.

The tunnel diodes we mentioned above are probably the best known devices that exhibit negative resistance, and there was a time in the early 1960s before transistors gained extra performance that they seemed to represent the future in electronics. But they aren’t the only devices with a negative resistance curve, indeed aside from other semiconductors such as Gunn diodes you can find negative resistance in some surprising places. Electrical arcs, for example, or fluorescent lighting tubes.

A typical negative resistance I-V curve. Chetvorno [CC0]
The negative resistance property of electric arcs in particular produced a fascinating device from the early twentieth century. The first radio transmitters used an electric arc to generate their RF, but were extremely inefficient and wideband, causing interference. A refinement treated the spark not as the source of the RF but as the negative resistance element alongside a tuned circuit in an oscillator, These devices could generate single frequencies at extremely high power, and thus became popular as high-powered transmitters alongside those using high-frequency alternators until the advent of higher powered tube-based transmitters around the First World War.

It’s unlikely that you will encounter a tunnel diode or other similar electronic component outside the realm of very specialist surplus parts suppliers. We’ve featured them only rarely, and then they are usually surplus devices from the 1960s. But understanding something of how they operate in a circuit should be part of the general knowledge of anyone with an interest in electronics, and is thus worth taking a moment to look at.

1N3716 tunnel diode header image: Caliston [Public domain].

Fix-a-Brick: Fighting the Nexus 5X Bootloop

Oh Nexus 5X, how could you? I found my beloved device was holding my files hostage having succumbed to the dreaded bootloop. But hey, we’re hackers, right? I’ve got this.

It was a long, quiet Friday afternoon when I noticed my Nexus 5X was asking to install yet another update. Usually I leave these things for a few days before eventually giving in, but at some point I must have accidentally clicked to accept the update. Later that day I found my phone mid-way through the update and figured I’d just wait it out. No dice — an hour later, my phone was off. Powering up led to it repeatedly falling back to the “Google” screen; the dreaded bootloop.

Stages of Grief

I kept my phone on me for the rest of the night’s jubilant activities, playing with it from time to time, but alas, nothing would make it budge. The problem was, my Nexus still had a full day’s video shoot locked away on its internal flash that I needed rather badly. I had to fix the phone, at least long enough to recover my files. This is the story of my attempt to debrick my Nexus 5X.

Continue reading “Fix-a-Brick: Fighting the Nexus 5X Bootloop”