Appendix W: The Raspberry Pi


Signal processing does not necessarily require expensive computer systems. The Raspberry Pi is a family of small but remarkably capable single-board computers that range in cost between $10 and $80. Most models are about the size of a deck of cards. Most have several USB ports, general-purpose input-output pins, HDMI port, Ethernet port, audio jack and composite video, interfaces for a video camera, micro-SD card slot for mass storage, a graphics core, Wireless LAN, and Bluetooth. You can get them with a bunch of installed software, including a version of the Linux operating system, a Web browser, the complete LibreOffice suite, Wolfram's Mathematica (screenshot), several programming languages and various utilities. All of these are installed by default on the Raspberry Pi's operating system installer. (The smallest and cheapest models are ideal in situations where they might be damaged or lost, as in rocket or balloon-borne experiments). There are many starter packs available that bundle all the required bits and pieces.

You can easily build a complete Windows 10 computer from a Raspberry Pi version 4 ($70) which comes built into a full keyboard; you need only a USB-C 5 volt power supply, a TV/monitor with an HDMI input, and a mouse (all of which you might find at a second-hand shop), and a mini SD card (8 to 16 Gbytes) for mass storage (which you can buy with all the software already installed, or use a blank one to which you can download the free software yourself). For educational purposes, the Pi has been used as a low-cost alternative for school computer labs, using its included software for both Office-type applications (Writer word processor, Calc spreadsheet, etc.), and for programming instruction (Python (page 434), C, C++, Java, Scratch, Ruby, etc).

Single-board versions are ideal for “headless” applications (meaning without a monitor, keyboard, or mouse) where, after being set up, is only accessed remotely via WiFi or Bluetooth, using Putty (for command-line UNIX-style access) or using a graphical desktop sharing system such as RealVNC (free for Windows, Mac, IOS, and Android), which reproduces the entire graphical desktop on your local device, complete with a pop-up virtual keyboard. Typical applications are as a network file server, weather station, media center or as a networked security camera. It can also share files with Windows.

For scientific data acquisition and signal processing applications, the Pi version of Linux has all the "usual" UNIX terminal commands for data gathering, searching, cleaning and summarizing. In addition, there are many add-on libraries for Python, including SciPi, NumPy, and Matplotlib, all of which are free downloads (page 434). Allen B. Downey's 153-page PDF book "Think DSP" has many examples of Python code in traditional engineering applications. Add-on hardware devices available at low cost, include video cameras and a piggyback sensor board that reads and displays sensor data from several built-in sensors: gyroscope, accelerometer, magnetometer, barometer, temperature, relative humidity. (It is based on the same hardware that at the time of this writing was in orbit on the International Space Station). My signal-processing spreadsheets (page 488) run just fine on the version of Calc that comes with the Pi, as do the calibration worksheets (page 446) and my analytical instrument models (page 350).
 For school applications, Element14 markets numerous educational kits and activities based on the Raspberry Pi.

There are many laboratory and field applications, especially in combination with an Arduino micro-controller. But if none of the available Raspberry Pi models are sufficiently fast for your signal-processing needs, then you use the Pi only for data acquisition and transfer the data to a faster computer. (For MATLAB users, there is a MATLAB Support Package for Raspberry Pi Hardware that supports this. Alternatively, you could simply have the Raspberry Pi save data or results in a shared folder that is accessed via Wi-Fi from another computer).

Python is the primary programming language that comes with the Raspberry Pi. This language is unlike the older languages traditionally used by scientists, such as Fortran or Pascal. Matlab programmers can use ChatGPT to convert their code to Python (page 442). As a comparison, here is a real-time example of data acquisition and plotting on a Raspberry Pi, measuring its own temperature as a function of time as it warms up, using the commercially available add-on Sense Hat board with a program written in Python (click for real-time animation). If you do not have a Sense Hat, here's a modification of the same Python program that plots the running average of a random number, using the same autoscaling graphic technique, showing a result that gradually settles down closer and closer to the average the longer you let it run. This Matlab/Octave script does the same thing at the same speed, but in this particular case the Matlab/Octave script length is substantially shorter. (For a more extensive comparison of Python to Matlab for several different signal processing tasks, see page 434).

Other competing systems include the BeagleBoard and the LattePanda, a tiny $130 Windows-10 computer board with 2 Gbytes RAM and 32 Gbytes flash storage. Many similar products are available.


This page is part of "A Pragmatic Introduction to Signal Processing", created and maintained by Prof. Tom O'Haver , Department of Chemistry and Biochemistry, The University of Maryland at College Park. Comments, suggestions and questions should be directed to Prof. O'Haver at toh@umd.edu. Updated July, 2024.