Multichannel Pulse Height Analyzer

Some interesting links on radiation spectroscopy:

Hardware

This system is designed to analyze the height of Gaussian-shaped pulses and it expects a signal from a pulse-shaping amplifier. It is also known to work with non-overlapping exponentially rising and exponentially decaying pulses.

The position of the HV/LV jumpers of the fast analog inputs should be chosen depending on the amplitude range of the input signal. Ideally, the amplitude range of the input signal should closely match the chosen hardware input range.

The basic blocks of the system are shown on the following diagrams:

Multichannel Pulse Height Analyzer

Exponential Pulse Generator

The width of the pulse at the input of the pulse height analyzer module can be adjusted by varying the decimation factor of the CIC filter.

Two baseline subtraction modes are implemented:

The embedded oscilloscope can be used to check the shape of the pulse at the input of the pulse height analyzer module.

The exponential pulse generator can be used to generate signals with specified time and amplitude distributions. It consists of an impulse generator module and two IIR filters. The impulse generator module outputs a 8 ns (1 clock cycle at 125 MHz) impulse of a required amplitude and after a required time interval. The two IIR filters are used to emulate the exponentially rising and exponentially decaying edges of the generated pulses.

The projects/mcpha directory contains five Tcl files: block_design.tcl, pha.tcl, hst.tcl, osc.tcl, gen.tcl. The code in these files instantiates, configures and interconnects all the needed IP cores.

The source code of the R script used to calculate the coefficients of the FIR filter can be found in projects/mcpha/filters/fir_0.r.

Software

The projects/mcpha/server directory contains the source code of the TCP server (mcpha-server.c) that receives control commands and transmits the data to the control program running on a remote PC.

The projects/mcpha/client directory contains the source code of the control program (mcpha.tcl).

MCPHA client

Getting started with MS Windows

Getting started with GNU/Linux

sudo apt-get install tk8.6 tk8.6-blt2.5
git clone https://github.com/pavel-demin/red-pitaya-notes
cd red-pitaya-notes/projects/mcpha/client
wish8.6 mcpha.tcl

Building from source

The installation of the development machine is described at this link.

The structure of the source code and of the development chain is described at this link.

Setting up the Vivado environment:

source /opt/Xilinx/Vivado/2018.3/settings64.sh

Cloning the source code repository:

git clone https://github.com/pavel-demin/red-pitaya-notes
cd red-pitaya-notes

Building mcpha.bit:

make NAME=mcpha bit

Building mcpha-server and pha-server:

arm-linux-gnueabihf-gcc -static -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard projects/mcpha/server/mcpha-server.c -o mcpha-server -lm -lpthread
arm-linux-gnueabihf-gcc -static -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard projects/mcpha/server/pha-server.c -o pha-server -lpthread

Building SD card image zip file:

source helpers/build-all.sh