Red Pitaya Notes
Source Issues

Pulsed NMR system

This is a work in progress...

Some interesting links on pulsed nuclear magnetic resonance:

Short description

The system consists of one in-phase/quadrature (I/Q) digital down-converter (DDC) and of one pulse generator.

The tunable frequency range covers from 0 Hz to 60 MHz.

The I/Q data rate is configurable and seven settings are available: 20, 40, 80, 160, 320, 640, 1280 kSPS.

Hardware

The basic blocks of the system are shown in the following diagram:

Pulsed NMR

The projects/pulsed_nmr_122_88 directory contains three Tcl files: block_design.tcl, rx.tcl, tx.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/pulsed_nmr_122_88/filters/fir_0.r.

RF and GPIO connections

Software

The projects/pulsed_nmr_122_88/server directory contains the source code of the TCP server (pulsed-nmr.c) that receives control commands and transmits the I/Q data streams (up to 4 x 32 bit x 1280 kSPS = 156 Mbit/s) to the control program running on a remote PC.

The projects/pulsed_nmr_122_88/client directory contains the source code of the control program (pulsed_nmr.py).

Pulsed NMR client

.NET library

The .NET library provides a minimalist set of commands for controlling all parameters of the signal processing modules and programming the pulse generator. The commands can be classified into five groups:

Commands to manage the connection with the TCP server:

Commands to set the frequencies and decimation rate:

Commands to program a pulse sequence:

Command to start pulse sequence and receive data:

Various commands to control output RF signal level, GPIO pins and an external DAC:

The source code of the .NET library can be found in projects/pulsed_nmr/client/PulsedNMR.cs.

Getting started with GNU/Linux

sudo apt-get install python3-numpy python3-matplotlib python3-pyqt6
git clone https://github.com/pavel-demin/red-pitaya-notes
cd red-pitaya-notes/projects/pulsed_nmr_122_88/client
python3 pulsed_nmr.py

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 Vitis and Vivado environment:

source /opt/Xilinx/2025.1/Vitis/settings64.sh

Cloning the source code repository:

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

Building pulsed_nmr_122_88.bit:

make NAME=pulsed_nmr_122_88 PART=xc7z020clg400-1 bit

Building SD card image zip file:

source helpers/build-all.sh