Calibrating a Seisberry

Note: the steps below are optional. Calibration is only useful if you intend to share your results with the scientific community at large and use the Seisberry for Seismology or a related field. Also the calibration step could be done during processing, it does not need to be done by the Seisberry itself.

Assuming you decide to calibrate the Seisberry, here are the fast steps for the geophysicist in a hurry. For a more complete explanation, you can opt to read on.

Your AD/DA card records volts. Your geophone, when moved, produces volts. Example: if your geophone is tapped and produces 60mV, and if the electronic gain in the parameter file is set to 1, your Seisberry will record 0.06 (Volts) in the raw file. You can certainly confirm this fact for yourself by removing a geophone and replacing it with a known calibrated Voltage source (needs to be less than 80 mV) and see what you record. The hardware gain is irrelevant to the discussion, as it is removed before writing to file.

So your Seisberry records volts. The geophysical community measures earth displacement in velocity, ie m/s, and they will expect results in m/s if you share data with them. Converting from V to m/s is actually very easy.

Find your geophone sensitivity as provided by the manufacturer on the geophone spec sheet (for example 23.4 V/m/s for the RTC 4.5Hz). On the Seisberry, edit the file called “param” and located in ~/Desktop/DIYSeis/C. Replace the numerical gain of 1 found in this text file by the value calculated as 1/sensitivity (for the RTC 4.5Hz example replace 1 with: 0.042735). That’s it you are calibrated in m/s! This will however make for very small recorded values, and you may loose some decimals. A gain of 42.735, calibrating to mm/s rather than m/s may be more appropriate. You can also choose to keep the gain to 1 or 1000 and apply the sensitivity correction when you process your raw files and have converted the samples to 32 bits or 64 bits floats -this is the way I do it and what I actually recommend. Anyways, after changing the gain in the param file, restart the seismograph deamon via GUI for the changes to take effect.

Discussion on calibration and instrument tests:

Note: all the steps below are optional. You may want do those tests for a rigorous benchmark of your instrument before deployment in the field.

We build a signal generator able to produce calibrated signals of known frequency, waveform and amplitude, then parallel connect the output of this generator to both an oscilloscope and the geophone input of a Seisberry.

The oscilloscope provides precise reference measurements of the input which can be compared to the Seisberry’s recording.

The first order of business it to get a signal generator. Some oscilloscopes already have one build in. Signal generators are also commercially available. The Seisberry AD/DA board also includes a programmable signal generator. Here I propose to use a very simple Python script able to generate any signal and record it to a wave file. Then any music player is used to play the wave file in loop. A cable with a stereo jack is then plugged in the output of the sound card of the computer generating the signal. The other end of the cable is plugged in the Seisberry, as a geophone input. You could even use the soundboard of the Seisberry itself for this calibration!

The frequency and waveform are controlled by the python script. The output amplitude by the volume on the audio player (the precise output value is in turn measured in mV on the oscilloscope). If you do not care about using the Python script, just download the wave file below (sinusoid, 40Hz). Warning: 40Hz may not be audible on your computer -or by your ears, as it is at the limit of the audible range. Your soundcard will play it OK though.

The Python script itself is very simple, and does not require any special module to install. It is below or on Github:

import wave, struct
import numpy as np
from scipy import signal as sg

sampling_rate = 44100                    ## Sampling Rate
freq = 400                             ## Frequency (in Hz)
samples = 441000                          ## Number of samples 

####### sine wave ###########
#y = amplitude*np.sin(2 * np.pi * freq * x / sampling_rate)

####### square wave ##########
#y = amplitude* sg.square(2 *np.pi * freq *x / sampling_rate)

####### square wave with Duty Cycle ##########
#y = amplitude* sg.square(2 *np.pi * freq *x / sampling_rate , duty = 0.8)

####### Sawtooth wave ########
y = amplitude* sg.sawtooth(2 *np.pi * freq *x / sampling_rate )

# Save to wave file, readable by any player
obj =,'w')
obj.setnchannels(1) #Set the number of channels. 1 for Mono 2 for stereo channels
obj.setsampwidth(2) #Set the sample width to n bytes.

for i in range(samples):
   value = y[i]
   data = struct.pack('<h', int(value))
   obj.writeframesraw( data )

Reading the output of the signal generator on an oscilloscope.

We are now setup to compare the signal recorded by the oscilloscope versus the signal recorded the Seisberry. Set the electronic gain to 1 in the parameter file and the hardware gain to the value suitable for your application, ie 64 for seismology.

Reminder 1: both gains can be setup in the “param” text file accessible in: /home/pi/Desktop/DIYSeis/C.

Reminder 2: the hardware gain is only used to optimize the 14bits of the AD/DA card. This gain is removed when the values are written to file. In other word, the hardware gain controls the precision and clipping of your recording (and must be customized to the signal strength), but it does not affect the actual amplitude written.

Reminder 3: Restart the Seisberry’s recording deamon after changing any value in param (stop then start with the GUI).

You need to adjust the amplitude of your generated signal so that the recording on the Seisberry is not clipped. This is simply done by changing the volume on the media player and controlling it on the oscilloscope. For example, if you are using the 64 hardware gain recommended for seismology, make sure your signal generator output reads below 80mV peak on the oscilloscope, otherwise the Seisberry will clip the recorded signal above 80mv and below -80mv.

Start recording on the Seisberry. After at least 10s, stop recording and download the record file. On Windows, Mac or linux, just type sftp pi@seisberry10hz in a terminal, then cd to your memory card and issue a get command on the file you need. Or use any sftp client.

Last open the recording file (in excel for example, or in python) and compare the peak to peak amplitude, frequency and waveform with what you recorded on your oscilloscope. Everything should match perfectly.

Seisberry recording of a 40Hz sinusoid.