@@ -17,18 +17,19 @@ analyzer can be realized on this board by simply changing the FPGA image and the
...
@@ -17,18 +17,19 @@ analyzer can be realized on this board by simply changing the FPGA image and the
{width=800px}
{width=800px}
The MCPHA application for the RedPitaya by Pavel Demin provides a multi-channel pulse-height analyzer as
The MCPHA application by Pavel Demin provides a multi-channel pulse-height analyzer as
well as an oscilloscope application capable of transferring large data reates reaching the theoretical
well as an oscilloscope capable of transferring large data rates reaching the theoretical
limit of the 1Gb port. The package consists of an FPGA image and a server process running on the
limit of the Gbit ethernet port. The package consists of an FPGA image and a server process
RedPitaya board. A client script controls the server and pulls the data to the client computer.
running on the RedPitaya board. A client script controls the server and pulls the data
to the client computer.
This package extends the original one by a possibility to record or export waveform data and
The package provided here extends the original one by a possibility to record or export
provides helper scripts to analyze recorded spectra or to read exported waveform data. An
waveform data and provides helper scripts to analyze recorded spectra or to read exported
interface to the buffer manager *mimoCoRB* for buffering and parallel processing of large
waveform data. An interface to the buffer manager *mimoCoRB* for buffering and parallel
date volumes is also provided.
processing of large date volumes is also provided.
This package is in use for gamma-ray spectrography experiments in physics laboratory courses at
This package is in use for gamma-ray spectrography experiments in physics laboratory
the faculty of physics at Karlsruhe Institute of Technology.
courses at the Faculty of Physics at Karlsruhe Institute of Technology.
### Files:
### Files:
...
@@ -58,41 +59,53 @@ the faculty of physics at Karlsruhe Institute of Technology.
...
@@ -58,41 +59,53 @@ the faculty of physics at Karlsruhe Institute of Technology.
## Credit:
## Credit:
*mcpha.py* is a fork of the sub-directory *projects/mcpha* in a project by
*mcpha.py* is a fork of the sub-directory *projects/mcpha* in a project by
Pavel Demin, [red-pitaya-notes](https://pavel-demin.github.io/red-pitaya-notes),
Pavel Demin, [red-pitaya-notes](https://pavel-demin.github.io/red-pitaya-notes).
*redPaq.py*represents an extension of the oscilloscope class enabling fast restart
*redPdaq.py*is an extension of the oscilloscope class enabling fast restart
and data export.
and data export.
# Users' Guide
## Multi-Channel Pulse-Height Analyzer for the RedPitaya FPGA board
## Multi-Channel Pulse-Height Analyzer for the RedPitaya FPGA board
A multi-channel pulse-height analyzer produces a histogram of the heights of pulses present in a signal supplied to the input. The MCPHA project uses the FPGA on the RedPitaya board to process the digitized input signal at very high rates. A server process on the ARM processor of the RedPitaya communicates with a client process via network. The client communicates with the server, starts and stops data recording and receives and displays the data. The client is also responsible for saving data to files.
A multi-channel pulse-height analyzer produces a histogram of the heights of pulses present
in a signal supplied to the input. The MCPHA project uses the FPGA on the RedPitaya board
to process the digitized input signal at very high rates. A server process on the ARM
processor of the RedPitaya communicates with a client process via network. The client
communicates with the server, starts and stops data recording and receives and displays
the data. The client is also responsible for saving data to files.
The original version by Pavel Demin has been modified to better meet the usual standards for graphics
The original version by Pavel Demin has been modified to better meet the usual standards
displays in physics. A command line interface has also been added to allow easy control of important
for graphics displays in physics. A command line interface has also been added to allow
parameters at program start.
easy control of important parameters at program start.
A special version of the original oscilloscope display, *redPdaq.py*, with fast transfer of data to the client for data acquisition applications is also contained in this extended package.
A special version of the original oscilloscope display, *redPdaq.py*, with fast transfer
of data to the client for data acquisition applications is also contained in this extended
package.
### Basic functionality
### Basic functionality
The *mcpha* application uses a rather simple, but straight-forward algorithm to determine the
The *mcpha* application uses a rather simple, but straight-forward algorithm to determine
height of pulses. When the signal voltage of a supplied input signal starts rising, the corresponding
the height of pulses. When the signal voltage of a supplied input signal starts rising,
ADC count is stored. A second ADC value is stored when the signal level starts falling again, and the difference of these two ADC values is histogrammed. The histogram is transferred to the client upon request.
the corresponding ADC count is stored. A second ADC value is stored when the signal level
starts falling again, and the difference of these two ADC values is histogrammed. The
The *mcpha* application also contains a signal generator that runs independently and parallel to the
histogram is transferred to the client upon request.
pulse-height analyzer. It provides configurable signal shapes and signal rates at the *out1* connector
of the RedPitaya board. Connecting *out1* with a (short) cable to one of the inputs *in1* or *in2*
The *mcpha* application also contains a signal generator that runs independently and parallel
provides input signals that can be be used to familiarize with the functionality and to benchmark
to the pulse-height analyzer. It provides configurable signal shapes and signal rates at the
the performance.
*out1* connector of the RedPitaya board. Connecting *out1* with a (short) cable to one or both
of the inputs *in1* or *in2* provides input signals that can be be used to familiarize with
An oscilloscope with very basic functionality to set the trigger level and direction is also provided.
the functionality and to benchmark the performance.
The timing is controlled by the so-called decimation factor that can be adjusted using the control
in the upper right corner of the graphical window. The RedPitaya samples data at a constant rate
An oscilloscope with very basic functionality to set the trigger level and direction is also
of 125 MHz, and the decimation factor determines how many samples are averaged over and stored
provided. The rate of samples transferred to the client is controlled by the so-called decimation
in the internal ring buffer. This reduces the effective sampling rate accordingly. Only decimation
factor that can be adjusted using the control in the upper right corner of the graphical window.
factors corresponding to powers of two are allowed. An example of randomly occurring exponential
The RedPitaya board samples data at a constant rate of 125 MHz, and the decimation factor determines
signal pulses at an average rate of 10 kHz with a fall time of 10 µs is shown below; there is significant
how many samples are averaged over and stored in the internal ring buffer. This reduces the e
ffective sampling rate accordingly. Only decimation factors corresponding to powers of two are
allowed. An example of randomly occurring exponential signal pulses at an average rate of 10 kHz
with a fall time of 10 µs is shown below; there is significant
signal overlap in this case, making pulse-height detection more complex.
signal overlap in this case, making pulse-height detection more complex.
{width=800px}
{width=800px}
...
@@ -125,13 +138,13 @@ An examples of call-back functions callable from within redPdaq is provided with
...
@@ -125,13 +138,13 @@ An examples of call-back functions callable from within redPdaq is provided with
calculates and displays statistics on trigger rate and data volume
calculates and displays statistics on trigger rate and data volume
*redP_mimocorb.py* is script containing code to be started from the command line and
*redP_mimocorb.py* is a script containing code to be started from the command line and
a function, *redP_to_rb* called as sub-process within the*mimiCoRB* frame-work
a function defined in the script, *redP_to_rb*, is called as sub-process within the
for more advanced data analysis tasks requiring multiple processes running in parallel.
*mimiCoRB* buffer manager frame-work for more advanced data analysis tasks requiring
A *mimoCoRB* setup-file is also provided and can be started by running
multiple processes running in parallel. A *mimoCoRB* setup-file is also provided and can
typing `redP_mimoCoRB.py setup.yaml` on the command line. Modules and configuration
be started by running typing `redP_mimoCoRB.py setup.yaml` on the command line. Modules
files for a pulse-height analysis of recorded signals are contained as exampless
and configuration files for a pulse-height analysis of recorded signals are contained
in the sub-directories *modules/* and *config/*, respectively.
as exampless in the sub-directories *modules/* and *config/*, respectively.