Calling Pink Floyd

[Corelatus] said recently that “someone” asked them to identify the phone signals in the 1982 film The Wall, based on the Pink Floyd song of the same name. We suspect that, like us, that someone might have been more just the hacker part of the brain asserting itself. Regardless, the detective work is fascinating, and you can learn a lot of gory details about phone network in-band signaling from the post.

The analysis is a bit more difficult because of the year the film was made. At that time, different countries used slightly different tone signaling standards. So after generating a spectrogram, the job was to match the tones with known standards to see which one best fit the data.

Continue reading “Calling Pink Floyd”

Faster Integer Division With Floating Point

Multiplication on a common microcontroller is easy. But division is much more difficult. Even with hardware assistance, a 32-bit division on a modern 64-bit x86 CPU can run between 9 and 15 cycles. Doing array processing with SIMD (single instruction multiple data)  instructions like AVX or NEON often don’t offer division at all (although the RISC-V vector extensions do). However, many processors support floating point division. Does it make sense to use floating point division to replace simpler division? According to [Wojciech Mula] in a recent post, the answer is yes.

The plan is simple: cast the 8-bit numbers into 32-bit integers and then to floating point numbers. These can be divided in bulk via the SIMD instructions and then converted in reverse to the 8-bit result. You can find several code examples on GitHub.

Continue reading “Faster Integer Division With Floating Point”

Optimizing Your Linux Shell Experience

Are you familiar with Huffman encoding? That’s where you pick shorter codes for more frequent letters. Morse code is the same way, in that the most-used letters are the shortest. [Matheus Richard] had the same idea for optimizing your workflow in the Linux shell. The idea is to measure what commands you use the most and make them shorter.

Continue reading “Optimizing Your Linux Shell Experience”

Inside A Diamond Plant

While you tend to think of diamonds as ornamental gemstones, diamonds also have many important industrial uses, and many of those diamonds are now synthetic polycrystalline diamonds. How are they made? [JerryRigEverything] takes us behind the scenes at a diamond manufacturing facility, something you don’t get to see every day. Check out the giant presses that exert about a million pounds of pressure in the video below.

The process starts with diamond powder, which is just what it sounds like. Although you can get real diamond powder, most uses today start with synthetic diamonds. The powder has many uses in cosmetics and as an abrasive. But the video will combine it with cobalt and table salt to form diamond shapes.

Continue reading “Inside A Diamond Plant”

It’s Official: The North Pole Is Moving

Every scout knows how to read a compass, and that there is a magnetic north and a true north. That’s because the Earth’s magnetic field isn’t exactly aligned with the North Pole. Every five years, the US National Oceanic and Atmospheric Administration (NOAA) and the British Geological Survey (BGS) get together to decide if magnetic north is still the same as it was before. This time, it isn’t.

The update is to the WMM — the World Magnetic Model. Magnetic north has shifted away from Canada and towards Siberia, a trend that has been ongoing for the last 20 years.

Continue reading “It’s Official: The North Pole Is Moving”

Better C Strings, Simply

If you program in C, strings are just in your imagination. What you really have is a character pointer, and we all agree that a string is every character from that point up until one of the characters is zero. While that’s simple and useful, it is also the source of many errors. For example, writing a 32-byte string to a 16-byte array or failing to terminal a string with a zero byte. [Thasso] has been experimenting with a different way to represent strings that is still fairly simple but helps keep things straight.

Like many other languages, this setup uses counted strings and string buffers. You can read and write to a string buffer, but strings are read-only. In either case, there is a length for the contents and, in the case of the buffer, a length for the entire buffer.

Continue reading “Better C Strings, Simply”

Push For On, Hold For Off, AC Edition

A common theme in modern consumer electronics is having a power button that can be tapped to turn the device on, but needs to be held down when it’s time to shut it off. [R. Jayapal] had noticed a circuit design for this setup when using DC and decided to create a version that could handle AC-powered loads.

The circuit relies on a classic optoisolated triac to switch the AC line, although [R. Jayapal] notes that a relay would also work. The switch circuit consists of two transistors, a comparator, a flip flop and a monostable. As you might expect, the button triggers the flip flops to turn the triac on. However, if you hold the switch for more than a few seconds, a capacitor charges and causes the comparator to trip the output flip flop.

The DC circuit that inspired this one is naturally a bit simpler, although we might have been tempted to simply use the output of that circuit to drive a relay or triac. On the other hand, the circuit is set up to allow you to adjust the time delay easily.

Given the collection of parts, though, we wonder if you couldn’t press some 555s into service for this to further reduce the part count. If relays are too old-fashioned for you, you can always use a solid-state relay or make your own.