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”

Don’t Fear the Filter: Lowpass Edition

There comes a time in every electronic designer’s life when, whether they know it or not, they need an analog filter in their design. If you’re coming from a digital background, where everything is nice and numeric, the harsh reality of continuous voltages can be a bit of a shock. But if you’re taking input from, or sending output to the big analog world out there, it pays to at least think about the frequency-domain properties of the signal, and maybe even do something about them.

Designing an analog filter to fit your needs can be a bit of a daunting task: there are many factors that you’re going to need to consider, and they all interact. It’s easy to get lost. We’re going to simplify this as much as possible by instead focusing on a few common applications and building up the simplest possible filters that work well for them.

Today, we’re going to consider the lowpass filter, and specifically a Sallen-Key filter with Butterworth characteristics and a second-order rolloff. Sound like word salad? We’ll fix that up right away, because this is probably the single most important filter to have in your analog toolbox for two very common use cases: pulse-width modulated (PWM) output and analog-to-digital conversion (ADC) input.

Continue reading “Don’t Fear the Filter: Lowpass Edition”

Tales Of A Cheap Chinese Laser Cutter

The star turn of most hackspaces and other community workshops is usually a laser cutter. An expensive and fiddly device that it makes much more sense to own collectively than to buy yourself.

This isn’t to say that laser cutters are outside the budget of the experimenter though, we’re all familiar with the inexpensive table-top machines from China. Blue and white boxes that can be yours for a few hundred dollars, and hold the promise of a real laser cutter on your table.

Owning one of these machines is not always smooth sailing though, because their construction and choice of components are often highly variable. A thorough check and often a session of fixing the non-functional parts is a must before first power-on.

[Extreme Electronics] bought one, and in a series of posts documented the process from unboxing to cutting. Starting with a full description of the machine and what to watch for out of the box, then a look at the software. A plugin for Corel Draw was supplied, along with a dubious copy of Corel Draw itself. Finally we see the machine in operation, and the process of finding the proper height for beam focus by cutting an inclined plane of acrylic.

The series rounds off with a list of useful links, and should make interesting reading for anyone, whether they are in the market for a cutter or not.

These cutters/engravers have featured here before many times. Among many others we’ve seen one working with the Mach3 CNC software, or another driven by a SmoothieBoard.

Networked Solar Birdhouses Deep in the Woods

[Oitzu] in Germany wrote in to let us know about a series of short but very informative blog posts in which he describes building a series of solar-powered, networked birdhouses with the purpose of spying on the life that goes on within them. He made just one at first, then expanded to a small network of them. They work wonderfully, and [Oitzu]’s documentation will be a big help to anyone looking to implement any of the same elements – which include a Raspberry Pi in one unit as a main gateway, multiple remote units in other birdhouses taking pictures and sending those to the Pi over an nRF24L01+ based radio network, and having the Pi manage uploading those images using access to the mobile network. All with solar power.

Continue reading “Networked Solar Birdhouses Deep in the Woods”

How-To: Web server on a business card (Part 2)

This mini web server is slightly smaller than a business card. There are a lot of tiny one-board servers out there, but this is probably the smallest you can etch and solder at home. Unlike many embedded web servers, files are stored on a PC-readable SD card, not in a difficult-to-write EEPROM. Read on for the web server design, or catch up on PIC 24F basics in the previous article: Web server on a business card (part 1).

Continue reading “How-To: Web server on a business card (Part 2)”

How-to: Windows Media Center on a Leopard network

We’ve been using Microsoft’s Media Center for a few years now and have grown to like it a lot. We’ve also noticed that more and more Apple computers have shown up on our home network and decided it was time to get everything working together smoothly. Follow along as we walk you through the hoops we jumped through to get everything cooperating. Continue reading “How-to: Windows Media Center on a Leopard network”