The Infra20 Alternative Software Web Site

The Infra20 detects infrasound and reports it to a computer. It presently costs $295 and is sold by a Infiltec, a small company based in Virginia. You can get more details about it here.

The computer software that collects and presents the data is Amaseis, which was originally designed to work with other seismographic equipment and has been adapted for the Infra20. It's not a bad piece of software, but it doesn't meet the needs of someone who wants to get an idea of the average infrasound levels on an hour-by-hour basis. Plus it tends to crash too often for unattended use, especially if Amaseis' window has been minimized.

So, I decided to write some perl code to replace Amaseis' data collection, plus writing two scripts to average each hour's results. I am making these three scripts freely available to anyone who wants them. These are NOT professionally written scripts. Obviously there's no warranties, no license, no payment, no support, no attribution needed. The installation is pretty easy but there would be a learning curve for, say, my parents. Getting someone a little conversant with Windows would probably be a good thing.

What the Scripts Do

The data collection script collects the 50 samples/sec from the Infra20, buffers them up and writes them out to a file. Each hour the file is closed and a new one is started. The file names reflect the date and hour of the collection. Once started the script runs "forever" with no further intervention needed, even if the Infra20 is disconnected. By default the files reside in the same directory as the script is running. Below is a screenshot of what it looks like as it is running. Note that it runs in a DOS window, in this case under XP. I use a simple bat file (the "pl3") to start it up, as I don't like to type any more than I have to. Also note that the top part of the screen shows me stopping the script (with a ctrl-c) and then starting it up again.

The analysis scripts read through the samples in a file and calculate the number of records (typically around 175,000), their average value (in both the native Pascals and the equivalent dB), and finds the largest value for that hour.

The first of these is for individual files, where you have to manually enter the filename to be analysed. Below is a screenshot of how the script runs. Note that it, like the collector script, runs in a DOS window, and can be run at the same time as the collector's DOS window. Also note how the file is named, although the "test1" prefix will likely change before I ship the software to anyone else (current just an "a").

The second of these is a batch analysis script. First it finds all the sample files in its folder (presumably c:\perl\site\bin\). Then it analyzes each one in turn (except the one currently being created), creating a csv output file with: file name, average in Pa, average in dB, max sample and # of samples in that order. It then copies the files to an archive (presently in folder c:\infra-archive\). Finally it deletes the files from the original folder. The csv file can be easily imported into a spreadsheet. I've set it up as a scheduled task that runs after midnight and thus gathers up the previous day's numbers.


WINDOWS. I tested it on an old XP SP3 system, but there's no reason it shouldn't work on something newer. It will not work on any UNIX variant. The port probably wouldn't be that difficult, but I have no easy way to test it.

PERL. You have to have a Perl interpreter installed, as what I have are perl scripts. I used ActiveState's activeperl, the free "community" version. I also used the Win32-serialport extension, which is most easily installed using activeperl's ppm function. Activeperl requires about 70 MB of disk space.

HARDWARE. I'm testing on an old (honestly, I found it on a sidewalk, luckily before it rained!) Dell 2400 with 512 mb and 80 gig hard drive. I am using the old 9-pin serial port, which is what the Infra20 uses. Newer computers (and laptops) may not have a serial port, so Infiltec will sell you a usb/serial converter and I assume that would work as well, although I haven't tested it. Any more, it is probably easier and cheaper to get an old machine and dedicate it to this function. E-Bay and Craigslist come to mind.

OPTIONAL STUFF. Each hour's file is about 175,000 records at 8 bytes each, for a size of 1.5 MB. Below is a screenshot of what my directory partially looks like. That adds up pretty quickly, about 35 MB per day, or 1 gig per month.

Internet access is almost a requirement, unless you want to carry all the software over on a CD or a thumb drive. I don't run an anti-virus script, as this computer isn't often used for surfing and never for email. I do have a number of utilities that I always install, like registry cleaners and defragmenters. I do have Office 2003 installed so I can collect the results in a spreadsheet. I've run just about everything I have concurrently with the data collection and so far I've seen no problems. For unattended access I use Teamviewer. The perl scripts are regular text files, so if you want to change them (i.e. use a different com port) you'll need a text editor. Windows includes Notepad, but I like Notepad++ far better.


WINDOWS. I'm going to assume you have a reasonably clean Windows/XP/whatever installation to start with. There's nothing you should have to do to Windows to continue.

PERL. If you don't already have a perl interpreter installed you might as well use activeperl. At the bottom of their screen you'll find a link to their download page. Click on the x86 version of whatever is the latest (currently 5.16.3, which is what I tested on) and you'll download an msi file. After the download completes you execute that file (usually a double-click) and accept the defaults. By default it installs into the c:\perl folder and changes Windows' path statement so scripts have automatic access to it.

Once you've installed perl you can then write and execute perl scripts. Scripts are executed from the DOS window. To get to the DOS window, click on the Start button, then the "run" button. That opens up a box that is asking what you want to run. Type in "cmd" and then ok. Initially you'll be in your "documents and settings" folder and you want to be in the C:\perl\site\bin folder. This folder will contain the scripts and eventually the infra20's data files (unless you change things around, which isn't that hard to do, it just takes a little thought). To get to that folder, type "cd c:\perl\site\bin" at the > prompt. Look at the pictures above to get an idea. You can then do a "dir" and see what's already in there (same as using Windows Explorer). At this point you could create some perl code with a text editor (like notepad++). There's lots of examples on the web, like " print "hello world"; " and execute it by typing "perl yourfile.pl" at the prompt.

WIN32-SERIALPORT. I'll assume you've got perl running and you're in the perl/site/bin folder. One of the nice functions activeperl includes is ppm, the perl package manager. At the prompt you can type "ppm" in and it will give you a display of all perl's installed packages. Assuming you are connected to the internet, you can type in "ppm install Win32-SerialPort" (note the CAPS) and it will go out and find it and install it for you. If you don't have internet access, you'd have to go find it, probably on cpan, download it, carry it over, unzip it, etc. I'd think getting internet access would be easier.

MY SCRIPTS. Once the Win32 package is installed you are ready to run my scripts. Copy both the "serial" and the "analyzer" scripts into the c:\perl\site\bin folder. Plug the Infra-20 into the serial port. Normally this defaults to "COM1". It is possible you're already using COM1 for something else (like internet dial-in, ugh) so you'll have to do some tinkering which is above this tutorial. Same if you're using the usb converter. In any case, once you figure out which Com port you're using, you'll have to change it in my "serial" script, about line 40.

RUN IT! While still in the c:\perl\site\bin folder in the DOS window, type "perl serial-work-3.pl" at the prompt (note the numbers could change). You should see the "now writing file" message. The DOS window can be minimized or left open, your choice. The script will run until you stop it by pressing ctrl-c. You exit the DOS window by closing it, or by "exit" at the prompt. After an hour you should start to see your folder listing grow with new data files.

In a like manner, you run the analyzers by typing "perl analyzer-work-2.pl, or "perl analyzer-batch-1.pl". A bat file can save lots of typing errors. A typical file takes maybe 5 seconds to analyze. I don't think I'd run an analysis on the file currently being collected (the batch script won't let you).

Operational Notes

PERFORMANCE. Once started, the serial script runs the processor at 100%. The Infra20 produces 50 8-byte samples each second, while my old computer samples at maybe 10 times that speed. So missing an incoming sample is unlikely. Sometimes, I guess, I get partial samples. If the bytes aren't all there, or if the sample is all zeros, it gets discarded. I suppose some all-zero samples could be legitimate, but far more often they involve starting the Infra20. The script uses about 1.3 MB of memory, and I haven't noticed it creeping upward. I buffer 1024 samples then write them out to the hard drive. You can watch the file size grow during the hour, ultimately reaching a size of about 1.5 MB. There is some variation in the # of samples and thus the file size, but normally they are within 1% of each other.

If the serial script has been running for a while new programs sometimes are very slow to start. If I get impatient I stop the script, do my thing, then restart the script.

OPERATIONAL DETAILS. You can unplug and plug the Inra20 in the serial port while the script is running with no ill effects. You can stop and then restart the script whenever you want with no ill effects. You can close the dos window with no ill effects. Obviously this stops the current data capture, but nothing else bad seems to happen. You can run the other scripts (I've even done a disk defrag) with seemingly no ill effects (except maybe some lost samples).

Sometimes a sample is corrupted (so far about 1 per million) in the file. The analyzers will complain about it, discard it and continue on.

I'm not sure what happens when daylight savings switches to standard time and back again. I'll try to remember to look at it when it happens and report back. 2AM - it may not happen... I think the worst case is that it corrupts one or two files at the time of the switch, then continues as usual.

How to Obtain

Send me an email (infra20 at sundrysites dot com) and I'll send you the scripts as attachments. They're quite small, about 5 KB total.