Skip to content
Snippets Groups Projects
Commit ff892af1 authored by Günter Quast's avatar Günter Quast
Browse files

added oscilloscope and spectrum displays

parent b4815bee
No related branches found
No related tags found
No related merge requests found
......@@ -46,16 +46,10 @@ This project essentially is a fork of the sub-directory *mcpha* in a project by
## 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 an 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 an 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
displays in physics. A command line interface has also been added to allow control of important
parameters at program start.
The original version by Pavel Demin has been modified to better meet the usual
standards for graphics displays in physics. A command line interface has also been added to allow control of important parameters at program start.
### Basic functionality
......@@ -73,7 +67,16 @@ The timing is controlled with the so-called decimation factor that can be adjust
in the upper right corner of the graphical window. The RedPitaya samples data at a constant rate
of 125 MHz, and the decimation factor determines how many samples are averaged over and stored
in the internal ring buffer. This reduces the effective sampling rate accordingly. Only decimation
factors corresponding to powers of two are allowed.
factors corresponding to powers of two are allowed. An example randomly occuring exponential signal pulses at an average rate of 10 kHz with a fall time of 10µs is
shown below; there is significant overlap making pulse-height detection more complex.
![Oscilloscope display of signals with a fall time of 10µs at an average rate of 10 kHz](images/oscilloscope_10mus10kHz.png)
A spectrum of such pulses is shown below for input pulses at multiples of 62.5 mV
betwenn 62.5 mV and 500 mV. The overlap of signal pusles leads to wrong pulse-height assignments below the acutal voltage and to entries above 500 mV.
![Spectrum signals with a fall time of 10µs at an average rate of 10 kHz](images/spectrum_10mus10kHz.png)
## Installation
......@@ -81,31 +84,39 @@ factors corresponding to powers of two are allowed.
The sub-directory *RP-image* contains files to be transferred to a SD card for the RedPitaya board.
To get started, proceed as follows:
- copy the contents of the directory *RP-image* to an SD card
- insert in in the RedPitaya and connect the power.
- copy the contents of the directory *RP-image* to an empt SD card formatted as FAT32.
- insert the SD card in in the RedPitaya and connect the power.
The RepPitaya directly starts the *mcpha* application and waits for the client
program to connect via a network.
The RepPitaya directly starts the *mcpha* application, requests an IP address via DHCP and waits for the client program to connect via network.
On the client side, the Python *program* *mcpha.py* takes care of data transfer from the
RedPitaya board to the client computer and provides several tabs to visualize data, generate
test data and to store the acquired spectra.
On the client side, the Python *program* *mcpha.py* takes care of data transfer from
the RedPitaya board to the client computer and provides several tabs to visualize
data, generate test data and to store the acquired spectra.
## Usage
First, boot the RedPitaya with the proper SD card inserted. This starts the FPGA code and the server
process on the RedPitaya board.
First, boot the RedPitaya with the proper SD card inserted. This starts the FPGA code
and the server process on the RedPitaya board.
On the client:
- start the client program via `python3 mcpha.py`
- in the graphical interface, enter the network address of the RedPitaya and click *connect*;
watch out for connection errors in the *Messages* tab ! The message "*IO started*" is displayed if everything is ok.
- click the *oscilloscope* tab, check the parameters and start the oscilloscope to see whether signals are arriving at one or both of the RedPitaya inputs. Adjust the *decimation factor* in the top-right corner of th main display to ensure that the sampling rate is hich enough for about 50 samples over the pulse duration.
- if no signal source is available, you may click the *generator* tab, set desired signal parameters and start the generator; connect *out1* of the RedPitaya to the input *in1* with a (shorg) cable and then check for the presence of signals in the *oscilloscpe* tab
- now click the tab *spectrum histogram 1*; adjust the amplitude threshold and time of exposure, then click the *Start* button and watch the spectrum building up.
- in the graphical interface, enter the network address of the RedPitaya and click
connect*; watch out for connection errors in the *Messages* tab ! The message
"*IO started*" is displayed if everything is ok.
- click the *oscilloscope* tab, check the parameters and start the oscilloscope to
see whether signals are arriving at one or both of the RedPitaya inputs. Adjust
the *decimation factor* in the top-right corner of th main display to ensure that
the sampling rate is hich enough for about 50 samples over the pulse duration.
- if no signal source is available, you may click the *generator* tab, set desired
signal parameters and start the generator; connect *out1* of the RedPitaya to the
input *in1* with a (shorg) cable and then check for the presence of signals in
the *oscilloscpe* tab
- now click the tab *spectrum histogram 1*; adjust the amplitude threshold and time
of exposure, then click the *Start* button and watch the spectrum building up.
- when finished, use the *Save* button to save the spectrum to a file.
## Helper scripts
The directory *helpers/* contains helper scripts to read and visualize data from
......
images/oscilloscope_10mus10kHz.png

198 KiB

images/spectrum_10mus10kHz.png

216 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment