Method of playing nuclear magnetic resonance pulse data, transceiver and nuclear magnetic resonance spectrometer

By employing periodic delayed trigger signals and fixed-length framing methods in the nuclear magnetic resonance spectrometer, synchronous calibration and stable playback of multiple boards were achieved, improving the signal-to-noise ratio and spectral resolution, reducing the analytical complexity of the FPGA, and ensuring the stability of the system and the accurate execution of pulse data.

CN122172087APending Publication Date: 2026-06-09CHINAINSTRU & QUANTUMTECH (HEFEI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINAINSTRU & QUANTUMTECH (HEFEI) CO LTD
Filing Date
2026-05-09
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In the existing technology, the multi-board synchronization of nuclear magnetic resonance spectrometers suffers from jitter of ±1 clock cycle, and the variable-length frame encoding results in high FPGA resolution complexity and poor system stability.

Method used

Synchronization calibration is performed using periodic delayed trigger signals, and fixed-length framing is used to ensure that the length of each event frame is consistent. The parsed data is stored in the FPGA's sequence FIFO and shaping FIFO respectively, and all transceivers are triggered to play the data in a unified manner.

Benefits of technology

The jitter problem of multi-board synchronization was solved, the signal-to-noise ratio and spectral resolution of nuclear magnetic resonance signals were improved, the analytical complexity of FPGA was reduced, and the stability of the system and the accurate execution of pulse data were ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122172087A_ABST
    Figure CN122172087A_ABST
Patent Text Reader

Abstract

This invention discloses a method for playing back nuclear magnetic resonance (NMR) pulse data, a transceiver, and an NMR spectrometer, relating to the field of NMR technology. The method includes: outputting periodic delayed trigger signals to each non-target transceiver, enabling each non-target transceiver to determine a target delay amount based on the delayed trigger signals and to perform signal acquisition based on the target delay amount; reading event frames from a first buffer and parsing each read event frame, storing the parsed event parameters in a sequence FIFO within an FPGA chip, where each event frame has a preset length; and, after all transceivers are ready, outputting playback trigger signals to each non-target transceiver, enabling all transceivers to synchronously play the event frame sequence in their respective sequence FIFOs. Thus, the clock jitter problem in multi-transceiver synchronization is solved through delay calibration, the use of fixed-length frames reduces parsing complexity, high-precision synchronous playback of multiple transceivers is achieved, and the signal-to-noise ratio and stability of NMR detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of nuclear magnetic resonance technology, and in particular to a method for playing nuclear magnetic resonance pulse data, a transceiver, and a nuclear magnetic resonance spectrometer. Background Technology

[0002] The pulse data control function of a nuclear magnetic resonance (NMR) spectrometer refers to a series of operations performed by the spectrometer in a precise timing sequence, including radio frequency transmission, data acquisition, delay, and gating switching. To realize the pulse data control function, FPGA (Field-Programmable Gate Array) has become the commonly used main controller in NMR spectrometers due to its parallel processing characteristics and absolute timing determinism.

[0003] Currently, the implementation of pulse data control functions for nuclear magnetic resonance spectrometers using FPGAs mainly involves the following aspects: First, absolute synchronization between multiple FPGAs, which generally adopts a clock source and unified triggering method. By providing all FPGAs with the same reference clock and sending a unified start trigger signal from the main control board, the playback of all pulse data is synchronized. Second, pulse data encoding, decoding, and playback are handled by PCs (Personal Computers), DSPs (Digital Signal Processors), or ARMs (Advanced RISC Machines) as frame encoders. The pulse data set by the user is parsed into frame data that the FPGA can recognize in real time. The FPGA acquires the frame data in real time, decodes it, and executes it according to the preset timing sequence.

[0004] However, while the aforementioned existing technical solutions can achieve basic pulse data control functions, they still have the following inherent drawbacks: First, multi-synchronization inherently exhibits jitter of ±1 clock cycle. Even if all FPGAs use the same source clock and have trigger signal routing of equal length, the rising edge of the unified trigger signal may still fall within the setup / hold time window of a local master clock due to slight differences in routing delay and internal I / O delay. This causes different FPGAs to latch the trigger signal in different clock cycles, ultimately resulting in a synchronization acquisition jitter of ±1 clock cycle. This jitter disrupts the phase coherence of multi-channel RF pulses, reducing the signal-to-noise ratio and spectral resolution of the NMR signal.

[0005] Secondly, variable-length framing leads to high FPGA processing complexity and poor system stability. Currently, variable-length framing is commonly used. In pulse data control, events such as reception, delay, and non-selective transmission have relatively short frame lengths, while selective transmission events, including modulation envelopes, are typically encoded together with transmission control commands to form a very long frame. Due to the inconsistent byte lengths of data frames, variable-length framing significantly increases the memory processing complexity of the onboard FPGA, making it prone to parsing errors and timing deviations. Simultaneously, the existence of very long frames puts a heavy burden on the frame editor, making data flow interaction prone to errors, thus limiting the execution efficiency and system stability of complex pulse data. Summary of the Invention

[0006] The purpose of this invention is to propose a method for playing nuclear magnetic resonance pulse data, a transceiver, and a nuclear magnetic resonance spectrometer to solve the problem of ±1 clock cycle jitter in multi-board synchronization in the prior art, as well as the technical problems of high FPGA parsing complexity and poor system stability caused by variable-length frame encoding.

[0007] In a first aspect, embodiments of the present invention propose a method for playing nuclear magnetic resonance pulse data, used as a target transceiver among multiple transceivers, each of which has a first buffer and an FPGA. The method includes: outputting a periodic delay trigger signal to each non-target transceiver, so that each non-target transceiver determines its own target delay amount based on the delay trigger signal and performs signal acquisition based on the target delay amount; reading event frames from its own first buffer, parsing each read event frame, and storing the parsed event parameters into a sequence FIFO within its own FPGA chip, wherein each event frame is obtained by framing pulse sequence data, and the length of each event frame is a preset length, and the event frame includes at least one of a transmit event frame, a receive event frame, and a delay event frame; and after all transceivers are ready, outputting a playback trigger signal to each non-target transceiver, so that all transceivers synchronously play the event frame sequence in their respective sequence FIFOs.

[0008] In some embodiments, each transceiver further has a second buffer, and the first buffer and the second buffer are independent and separate from each other in address space; the method further includes: reading shaped envelope data frames from its own second buffer, parsing each read shaped envelope data frame, and storing the parsed envelope amplitude point data into the shaped FIFO in its own FPGA chip, wherein the length of each shaped envelope data frame is the preset length.

[0009] In some embodiments, the method further includes: before storing the parsed data into the FIFO within its own FPGA chip, verifying the frame header, function code, and checksum of each read frame; if the verification passes, storing the parsed data into the corresponding FIFO within its own FPGA chip; if the verification fails, discarding the current frame and reporting an error.

[0010] In some embodiments, the condition for the target transceiver to be ready is: the depth of its own FPGA-on-chip sequence FIFO is higher than a preset threshold; the condition for each non-target transceiver to be ready is: receiving a ready signal sent by each of the non-target transceivers; the condition for all transceivers to be ready is: the target transceiver itself is ready and has received ready signals from all non-target transceivers.

[0011] In some embodiments, playing a sequence of event frames in a sequence FIFO includes: performing flow control on the time axis according to the duration of each event frame in the event frame sequence; wherein, for a transmit event frame, a basic waveform is generated based on the transmit frequency, transmit phase, and transmit amplitude in the transmit event frame; and when the transmit event frame does not have a shaped envelope, the basic waveform is directly output; when the transmit event frame has a shaped envelope, the corresponding envelope amplitude point data is read from the on-chip shaped FIFO of the FPGA according to the shaped index in the transmit event frame, and the envelope amplitude point data and the basic waveform are reprocessed and then output; for a receive event frame, digital domain processing is performed based on the receive phase and receive frequency in the receive event frame, the processed data is collected and uploaded; for a delay event frame, the output power of the transmit channel of the transceiver is set according to the transmit power parameters in the delay event frame.

[0012] Secondly, embodiments of the present invention propose another method for playing nuclear magnetic resonance pulse data, for non-target transceivers among multiple transceivers, each of which has a first buffer and an FPGA. The method includes: in response to acquiring a periodic delay trigger signal output by a target transceiver, determining a target delay amount based on the delay trigger signal, and acquiring a signal based on the target delay amount; reading event frames from its own first buffer, parsing each read event frame, and storing the parsed event parameters into a sequence FIFO within its own FPGA chip, wherein each event frame is obtained by framing pulse sequence data, and the length of each event frame is a preset length, and the event frame includes at least one of a transmit event frame, a receive event frame, and a delay event frame; in response to the sequence FIFO depth being higher than a preset threshold, sending a ready signal to the target transceiver, so that the target transceiver outputs a playback trigger signal to each of the non-target transceivers after all transceivers are ready; and in response to acquiring the playback trigger signal, playing the event frame sequence in the sequence FIFO.

[0013] In some embodiments, determining the target delay amount based on the delay trigger signal includes: performing a picosecond-level delay scan on the delay trigger signal and acquiring the delayed signal at each delay value; comparing the acquisition result with the original state of the delay trigger signal to determine the range of delay values ​​when the acquisition result is consistent with the original state, as the consistency zone of the delay value; and taking the delay value corresponding to the midpoint of the consistency zone as the target delay amount.

[0014] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the method for playing nuclear magnetic resonance pulse data as described in the first and / or second aspect embodiments.

[0015] Fourthly, embodiments of the present invention provide a transceiver for performing the method for playing nuclear magnetic resonance pulse data as described in the first and / or second aspect embodiments.

[0016] Fifthly, embodiments of the present invention provide a nuclear magnetic resonance spectrometer, including the transceiver described in the fourth aspect of the embodiments.

[0017] The present invention discloses a method for playing nuclear magnetic resonance pulse data, a transceiver, and a nuclear magnetic resonance spectrometer. When the method is used as a target transceiver among multiple transceivers, it first outputs a periodic delay trigger signal to each non-target transceiver, enabling each non-target transceiver to determine its own target delay based on the delay trigger signal and to acquire signals based on the target delay. Then, it reads event frames from its own first buffer and parses each event frame, storing the parsed event parameters into a sequence FIFO within its FPGA chip. Each event frame is obtained by framing pulse sequence data, and each event frame has a preset length. Event frames include at least one of transmit event frames, receive event frames, and delay event frames. After all transceivers are ready, a playback trigger signal is output to each non-target transceiver, enabling all transceivers to synchronously play the event frame sequence in their respective sequence FIFOs. Therefore, by outputting a periodically delayed trigger signal for delay calibration by non-target transceivers, the ±1 clock cycle jitter problem in multi-board synchronization in existing technologies is effectively solved, ensuring the phase coherence of multi-channel RF pulses and improving the signal-to-noise ratio and spectral resolution of nuclear magnetic resonance signals. By adopting a fixed-length framing method, the length of each event frame is preset, eliminating the need for the FPGA to dynamically determine frame boundaries, significantly reducing the complexity of frame resolution and avoiding parsing errors and timing deviations caused by inconsistent frame lengths. By triggering playback uniformly after all transceivers are ready, the time consistency of the pulse sequence is guaranteed when multiple transceivers work together, providing a reliable guarantee for the accurate execution of complex pulse data.

[0018] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0019] Figure 1 This is a flowchart of a method for framing nuclear magnetic resonance pulse data according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of an event frame according to an example of the present invention; Figure 3 This is a schematic diagram of the structure of an example of a shaped envelope data frame according to the present invention; Figure 4 This is a schematic diagram of the partitioning of the transceiver memory according to an example of the present invention; Figure 5 This is a flowchart of a method for playing nuclear magnetic resonance pulse data according to an embodiment of the present invention; Figure 6 This is a schematic diagram of synchronous trigger jitter calibration according to an embodiment of the present invention; Figure 7This is a flowchart of a method for playing nuclear magnetic resonance pulse data according to a specific embodiment of the present invention; Figure 8 This is a flowchart of a method for playing nuclear magnetic resonance pulse data according to another embodiment of the present invention. Detailed Implementation

[0020] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0021] The following description, with reference to the accompanying drawings, describes a method for framing nuclear magnetic resonance pulse data, a framer, and a nuclear magnetic resonance spectrometer, as well as a method for playing nuclear magnetic resonance pulse data, a transceiver, and a nuclear magnetic resonance spectrometer.

[0022] Figure 1 This is a flowchart of a method for framing nuclear magnetic resonance pulse data according to an embodiment of the present invention. This framing method can be executed by a framer in a nuclear magnetic resonance spectrometer, such as a PC (Personal Computer), DSP (Digital Signal Processor), or ARM (Advanced Reduced Instruction Set Machine).

[0023] like Figure 1 As shown, the framing method for nuclear magnetic resonance pulse data includes: S11, acquire the nuclear magnetic resonance pulse data to be framed.

[0024] The nuclear magnetic resonance pulse data to be framed refers to the raw pulse data that needs to be framed, which can be obtained in the following ways: Users can use the pulse editor on the NMR spectrometer software to graphically draw pulse sequence time diagrams or edit the envelope parameters of shaped pulses. The editor converts the user's input into an intermediate description file in a preset format (such as XML, JSON, or a custom binary format). The NMR spectrometer's built-in CPU or microprocessor reads the intermediate description file, parses it, and generates NMR pulse data to be framed.

[0025] S12, using a fixed-length encoding method, according to the data type of the nuclear magnetic resonance pulse data to be framed, the nuclear magnetic resonance pulse data to be framed is framed into an independent event frame, or framed into an shaped envelope data frame with a different structure from the event frame. The event frame includes at least one of a transmit event frame, a receive event frame, and a delay event frame.

[0026] The data types of the NMR pulse data to be framed can include pulse sequence data and pulse envelope data. Pulse sequence data is used to define the timing control commands in NMR experiments, including operation sequences such as radio frequency transmission, signal acquisition, delay waiting, and gating switching; each operation corresponds to one or more event units. Pulse envelope data is used to define the amplitude envelope shape of selective pulses (i.e., shaped pulses), including amplitude point sequences of arbitrary waveform envelopes such as Gaussian, sinusoidal, trapezoidal, and Sinc shapes, used for envelope shaping of the transmitted pulses to improve excitation characteristics and signal-to-noise ratio.

[0027] Specifically, if the NMR pulse data to be framed is pulse sequence data, then the NMR pulse data to be framed is framed into an independent event frame, and the frame length of the event frame is a preset length (e.g., 32 bytes); if the NMR pulse data to be framed is pulse envelope data, then the NMR pulse data to be framed is framed into an independent shaped envelope data frame, and the frame length of the shaped envelope data frame is also a preset length.

[0028] The preset length can be determined based on the transceiver's memory read boundary conditions and hardware parameters. For example, when the transceiver uses DDR (Double Data Rate Synchronous Dynamic Random Access Memory) memory with a burst read bit width of 64 bytes, the preset length can be set to 32 bytes, allowing two complete event frames to be read per DDR read clock cycle, fully utilizing memory bandwidth and improving read efficiency. Similarly, when the transceiver's transmit channel uses a DDS (Direct Digital Synthesizer) bit width of 32 bits, the total length of the entire transmit event frame can be set to 32 bytes; when the DDS bit width is 48 bits, the total event frame length can be extended to 48 bytes to meet different precision requirements. Regardless of the specific value of the preset length, the length of all event frames and shaped envelope data frames remains consistent.

[0029] Therefore, by employing fixed-length encoding, the byte length of each event frame and the integer envelope data frame is consistent, enabling the transceiver to perform streaming parsing with a fixed step size. This eliminates the need for dynamic frame boundary determination, significantly reducing parsing complexity and avoiding timing deviations caused by inconsistent frame lengths. Furthermore, separating the integer envelope data frame from the event frame during encoding allows the same integer envelope data to be repeatedly accessed in multiple event frames, reducing data redundancy, simplifying the debugging process, and improving the detection flexibility and stability of the nuclear magnetic resonance spectrometer.

[0030] In some embodiments of the present invention, the data type of the nuclear magnetic resonance pulse data to be framed can be identified in the following ways: by distinguishing based on the data source or data identifier. Specifically, if the data originates from the timing diagram drawing area in the pulse sequence editor, it is identified as pulse sequence data; if the data originates from the envelope parameter setting area (such as Gaussian shape, sine shape, etc.) in the shape pulse editor, it is identified as pulse envelope data. Alternatively, a type identifier field can be set for different types of data in the intermediate description file, and the CPU or microprocessor can determine the data type by reading the identifier field. For example, a type identifier of 0x01 indicates pulse sequence data, and a type identifier of 0x02 indicates pulse envelope data. In addition, identification can also be performed based on the characteristics of the data structure: pulse sequence data usually contains a description of the timing relationship of multiple actions such as transmission, reception, and delay, while pulse envelope data only contains a sequence of amplitude points arranged in order and does not contain timing control information.

[0031] It should be noted that the NMR pulse data to be framed in a single acquisition can simultaneously include pulse sequence data and pulse envelope data. For example, a user may simultaneously edit a complete pulse sequence and multiple shaped pulse envelopes (such as Gaussian and sine) in the pulse editor and submit these data for framing. In this case, the framer needs to differentiate between the mixed data types.

[0032] Specifically, in some implementations, the framer first parses the acquired NMR pulse data to be framed, and classifies the data into a pulse sequence data subset and a pulse envelope data subset based on the type identifier field or data structure characteristics in the data. For example, each data record in the intermediate description file contains a type identifier field; when the type identifier is 0x01, it represents pulse sequence data, and when it is 0x02, it represents pulse envelope data. The framer traverses all data records and extracts the two types of data subsets respectively.

[0033] Then, the framer frames the two types of data subsets respectively: for the pulse sequence data subset, it is framed into independent event frames using a fixed-length encoding method, and the frame length of the event frames is a preset length; for the pulse envelope data subset, it is framed into independent shaped envelope data frames using a fixed-length encoding method, and the frame length of the shaped envelope data frames is also a preset length.

[0034] In other implementations, the framer can perform streaming processing on mixed-type data. That is, it reads the data sequentially according to the order in the intermediate description file. For each data record read, its type identifier is determined in real time: if it is pulse sequence data, it is framed into the corresponding event frame; if it is pulse envelope data, it is framed into the corresponding shaped envelope data frame. The framed frames are then output or stored sequentially according to the processing order. This method eliminates the need for pre-classification and results in lower processing latency.

[0035] In this way, even if the nuclear magnetic resonance pulse data to be framed at one time contains multiple types of data, the framer can correctly distinguish and frame them into the corresponding types of frames, thus ensuring the flexibility and integrity of the framing method.

[0036] In some embodiments of the present invention, a fixed-length encoding method is adopted. Depending on the type of the NMR pulse data to be framed, the NMR pulse data is framed into independent event frames, or into shaped envelope data frames with a structure different from that of the event frames. This may include: if the NMR pulse data to be framed is pulse sequence data, then the NMR pulse data to be framed is framed into a group of independent event frames, with each event frame having a preset length; if the NMR pulse data to be framed is pulse envelope data, then the NMR pulse data to be framed is framed into one or more independent shaped envelope data frames, with each shaped envelope data frame having a preset length.

[0037] A set of event frames can contain one or more of the following: transmit event frames, receive event frames, and delay event frames. For example, a simple NMR pulse sequence can be framed as follows: transmit event frame (1st) → delay event frame (2nd) → receive event frame (3rd), and these three event frames together constitute a "set" of event frames. "One or more independent shaped envelope data frames" means that when framing pulse envelope data, the amplitude data of each envelope shape is framed into independent shaped envelope data frames according to the number of envelope shape types. Each shaped envelope data frame corresponds to the envelope shape of a pulse shape (such as Gaussian, sinusoidal, trapezoidal, Sinc, etc.), and different shaped envelope data frames are independent of each other in storage space and can be called by the event frames individually. The meaning of "one or more" is as follows: when there is only one envelope shape, it is framed into a single integer envelope data frame; when there are multiple envelope shapes (for example, the user edits both Gaussian and sine envelopes simultaneously), each envelope is framed into an independent integer envelope data frame, resulting in multiple integer envelope data frames. All event frames and integer envelope data frames have the same length, which is a preset length, facilitating unified storage management and retrieval operations by the transceiver.

[0038] In some examples, the NMR pulse data to be framed is framed into a set of independent event frames, including: dividing the NMR pulse data to be framed into multiple consecutive event units according to the pulse action and timing relationship contained in the NMR pulse data to be framed; and framing each event unit into a corresponding event frame according to the event type of each event unit, wherein the event type includes at least one of transmission event, reception event and delay event.

[0039] A pulse action refers to a single operation performed by the nuclear magnetic resonance spectrometer at a specific point in time or within a time period. These operations include, but are not limited to: activating radio frequency transmission, deactivating radio frequency transmission, activating signal acquisition, deactivating signal acquisition, performing a delay, switching gating states, and configuring transmission power. Each pulse action corresponds to a single, indivisible operational instruction.

[0040] Timing relationships refer to the temporal sequence and relative time intervals between various pulse actions. Specifically, timing relationships include: action A is executed before action B, the time interval between action A and action B (e.g., the next action is executed after a 10μs delay), action A and action B are executed simultaneously (e.g., transmission and gating switching are performed in parallel), and the duration of action A (e.g., transmission lasts 20μs). The overall behavior of the pulse sequence is defined by these timing relationships.

[0041] In some implementations, dividing multiple consecutive event units may include: sequentially traversing each pulse action in the NMR pulse data to be framed; when multiple consecutive pulse actions belong to the same event type (e.g., all actions related to a transmission event), these actions are combined into one event unit; when a change in the event type of a pulse action is detected, the current event unit ends and the next event unit is divided. For example, consecutive actions such as "setting transmission frequency," "setting transmission amplitude," and "starting radio frequency transmission" all belong to transmission events, so they are divided into the same transmission event unit; when subsequent actions of different event types, such as "stopping radio frequency transmission" or "starting signal acquisition," occur, the event unit is divided at this point.

[0042] In other implementations, dividing multiple consecutive event units may include: acquiring the time position of each pulse action in the pulse sequence (i.e., the time offset relative to the start of the sequence), and calculating the time interval between two adjacent pulse actions. When the time interval is less than or equal to a preset time threshold (e.g., 1 μs), the two actions are grouped into the same event unit, indicating that they belong to the same continuous operation; when the time interval is greater than the preset time threshold, the actions are divided at that position, assigning the preceding and following actions to different event units. This method can automatically determine the event unit boundaries based on the closeness between actions, and is particularly suitable for pulse sequences with clear delay boundaries.

[0043] In this example, the event type can be identified as follows: the event type of the current event unit is determined based on the attributes of the pulse action or the identification information in the action sequence. Specifically, if the event unit contains actions related to radio frequency transmission (such as starting radio frequency transmission, setting the transmission frequency, etc.), it is identified as a transmission event; if the event unit contains actions related to signal acquisition (such as starting signal acquisition, setting the receive phase, etc.), it is identified as a receive event; if the event unit contains actions related to delay waiting or power configuration (such as idle waiting, setting the transmit power, etc.), it is identified as a delay event.

[0044] Furthermore, event types can also be identified through user-specified action labels in the pulse editor. For example, when editing a pulse sequence, the user can specify a type identifier for each action or combination of actions (such as "TX" for transmission, "RX" for reception, and "DELAY" for delay). The frame editor can then read this identifier to determine the event type. Additionally, intelligent identification can be achieved by analyzing the combined characteristics of action parameters: for example, action combinations that simultaneously include frequency, phase, and amplitude parameters are typically transmission events; actions that only include acquisition duration parameters are typically reception events; and actions that only include time parameters are typically delay events.

[0045] In some embodiments of the present invention, such as Figure 2 As shown, a transmit event frame includes a frame header, transmit function code, duration, transmit frequency, transmit phase, transmit amplitude, integer index, reserved field (RESERVED), and check field. The integer index points to an integer envelope data frame. A receive event frame includes a frame header, receive function code, duration, receive phase, receive gating, reserved field, and check field. A delay event frame includes a frame header, delay function code, duration, transmit power, end flag, reserved field, and check field. Figure 3 As shown, the shaped envelope data frame includes a frame header, a shaped function code, envelope amplitude point data arranged in sequence (i.e., the first point, the second point, ..., the last point), and a check field.

[0046] The frame header is used to identify the beginning of a frame. The frame header usually contains a fixed synchronization word (such as 0xAA55 or 0x5A5A). The transceiver detects the frame header during parsing to achieve frame synchronization and determine the start position of each frame.

[0047] Reserved fields are unused byte regions reserved for future feature expansion. Reserved fields do not carry feature information for the current version, but their position and length are predefined in the frame structure. When new features need to be added in the future (such as adding transmit attenuation parameters or receive gain control), the reserved fields can be used directly for expansion without changing the entire frame structure, offering greater flexibility and maintaining backward compatibility.

[0048] The check field can be a CRC (Cyclic Redundancy Check) check field. During frame assembly, a CRC checksum can be calculated based on at least some of the fields in the frame other than the check field (such as the frame header and function code), and stored in the check field. When parsing, the transceiver recalculates the checksum and compares it with the checksum in the frame. If they do not match, it indicates that an error has occurred during data storage or transmission (such as DDR bit flipping). The transceiver can then trigger an error handling process (such as stopping playback and reporting the error). Thus, a memory bit flipping error can be detected immediately, allowing the transceiver to quickly switch to protection mode and issue an alarm.

[0049] For transmit event frames, the transmit function code indicates that the current frame is a transmit event type, the duration controls the duration of RF transmission, the transmit frequency, transmit phase, and transmit amplitude configure the DDS to generate the basic waveform, and the shaping index indexes the shaped envelope data frame (if no shaped envelope is needed, the shaping index is set to 0). For receive event frames, the receive function code indicates that the current frame is a receive event type, the duration controls the duration of signal acquisition, the receive phase configures the demodulation phase of the receive channel, and the receive gating controls the opening and closing of the receive channel. For delay event frames, the delay function code indicates that the current frame is a delay event type, the duration controls the delay waiting time, the transmit power configures the output power of the transceiver transmit channel, and the end flag indicates whether the pulse sequence has ended.

[0050] All event frames use a fixed-length encoding method, with each event frame having the same byte length, which is a preset length. The fields within the frame are arranged in a predetermined order, allowing the transceiver to read each event frame sequentially with a fixed step size during parsing, without needing to dynamically determine frame boundaries.

[0051] In addition, for shaped envelope data frames, the shaping function code is used to identify the current frame as a shaped envelope data frame. Sequentially arranged envelope amplitude points (i.e., the first point, the second point, ..., the last point) are used to define the amplitude envelope shape of the selective pulse (i.e., the shaped pulse). Each amplitude point represents a normalized amplitude value (usually a value between 0 and 1 or the corresponding digital quantization value) at the corresponding time position. All amplitude points are arranged sequentially in time to form a complete envelope waveform. When the shaping index in the transmit event frame points to this shaped envelope data frame, the transceiver reads these amplitude points sequentially in time and reprocesses them with the base waveform generated by the DDS (e.g., multiplication) to achieve envelope shaping of the transmitted pulse, giving the output pulse a preset shape (e.g., Gaussian, sinusoidal, trapezoidal, Sinc, etc.) to improve the excitation characteristics and signal-to-noise ratio of nuclear magnetic resonance experiments. Therefore, by independently framing the integer envelope data frame and the transmission event frame, and using the integer index in the transmission event frame for precise addressing and calling, independent management and reuse of integer data are achieved, thereby reducing design complexity.

[0052] It should be noted that the field contents in the aforementioned transmit event frame, receive event frame, delay event frame, and shaped envelope data frame are exemplary and not limited to these. Fields can be added, deleted, or adjusted according to actual application requirements. For example, transmit event frames can also include transmit attenuation and transmit channel selection fields; receive event frames can also include sampling point number and sampling frequency fields; delay event frames can also include gating output control fields; and shaped envelope data frames can also include envelope data compression identifier and data scaling factor fields.

[0053] Furthermore, the byte length of each instruction field in each event frame can be adjusted according to the hardware configuration. For example, when the DDS bit width used in the transmission channel is 32 bits, fields such as transmission frequency and transmission phase can be set to 4 bytes; when the DDS bit width is 48 bits, the corresponding fields can be set to 6 bytes. Accordingly, the total length of each event frame can also be changed, for example, it can be set to 32 bytes, 48 ​​bytes, or other lengths, but it must meet the read boundary conditions of DDR memory (e.g., when the DDR burst read bit width is 64 bytes, the frame length can be set to 32 bytes, so that two complete event frames can be read per clock cycle) to improve memory access efficiency. Specifically, it can be flexibly configured and expanded according to the hardware configuration of the NMR spectrometer, the complexity of the pulse sequence, and the detection accuracy requirements, and this invention does not impose any limitations on this.

[0054] In some embodiments of the present invention, the method for framing nuclear magnetic resonance pulse data includes: storing the event frame obtained after framing into a first buffer, and storing the shaped envelope data frame obtained after framing into a second buffer, wherein the first buffer and the second buffer are independent and separate from each other in address space.

[0055] The first buffer can be a circular buffer, and the total number of event frames is greater than the depth of the first buffer.

[0056] Specifically, such as Figure 4 As shown, a large circular buffer is allocated in the transceiver's memory as the first buffer area. This circular buffer is specifically used to store the framed pulse sequence data (i.e., event frames). The framing process uses a fixed-length encoding method to ensure the uniformity of the structure of each event frame (e.g., each event frame is 32 bytes long), facilitating fast reading and parsing by the transceiver and providing reliable support for the efficient execution of the pulse sequence. The byte length of each instruction item in each event frame can be fixed to different numbers of bytes according to application requirements (e.g., the transmit frequency field is set to 4 bytes, 6 bytes, etc.), but the total length of all event frames remains consistent.

[0057] A frame editor (such as the CPU) writes event frames to the first buffer, from which the transceiver reads and executes them. When the first buffer is full, the frame editor pauses writing; when the buffer is not full, the frame editor can continue to add new event frames. In this way, an empty / full handshake mechanism is established between the frame editor and the transceiver, realizing a pipelined operation of executing and adding frames simultaneously.

[0058] Also see Figure 4 Furthermore, a separate buffer area can be allocated in the transceiver's memory as a second buffer. This buffer is specifically used to store multiple sets of selective pulse envelope data (i.e., shaped envelope data frames), achieving complete separation of shaped data from pulse sequence data. Multiple sets of shaped data are independently stored in this buffer and can be flexibly retrieved and reused by the shaped index in the transmitted event frame, ensuring accurate transmission of selective pulses.

[0059] Therefore, by setting up a circular buffer, event frames with a total number far exceeding the buffer depth can be played continuously without allocating a huge buffer at once, reducing storage resource requirements; the fixed-length encoding method ensures that the data structure of each frame is uniform, which facilitates fast parsing by the transceiver; the empty-full handshake mechanism ensures the continuity of the data stream and avoids playback stuttering or data overflow; the separate storage of integer data and pulse sequence data enables independent management and reuse of integer data, reduces design complexity, and improves the stability and efficiency of NMR pulse sequence playback.

[0060] It should be noted that multiple shaped envelopes may exist in the same MRI detection experiment. When there is only one envelope shape, it is framed into a single shaped envelope data frame. When there are multiple envelope shapes (e.g., the user simultaneously edits Gaussian, sine, trapezoidal, etc. envelopes), each envelope is framed into an independent shaped envelope data frame, and stored sequentially in the second buffer, resulting in multiple shaped envelope data frames. All event frames and shaped envelope data frames have the same length, which is a preset length, facilitating unified storage management and retrieval operations by the transceiver. During subsequent pulse sequence playback, the transmitted event frame can accurately locate and retrieve the required shaped envelope data through its "shaped index" field, enabling flexible retrieval and reuse of shaped data.

[0061] Additionally, see Figure 4 The transceiver's memory can also include a data acquisition storage area for temporarily storing NMR echo data acquired during received events. Specifically, when a receive event frame is executed, the transceiver performs digital domain processing on the NMR signal (such as quadrature demodulation and filtering), and temporarily stores the processed data in this data acquisition storage area. After a segment of acquisition is completed or the entire pulse sequence is executed, the transceiver then uploads the data in the storage area in batches to a host computer (such as a PC) for subsequent image reconstruction or spectral analysis. By setting up a separate data acquisition storage area, physical isolation between the acquired data and event frames and shaped envelope data can be achieved, avoiding mutual data interference, while also supporting batch uploads to improve data transmission efficiency.

[0062] In some embodiments of the present invention, both the first buffer and the second buffer are located in the transceiver's memory (such as DDR); before storing the framed event frame into the first buffer, the method further includes: receiving a write permission signal sent by the transceiver, wherein the write permission signal indicates that the first buffer is currently not full and the transceiver is ready to read and play the event frame from the first buffer.

[0063] Specifically, before writing event frames to the first buffer, the frame editor first waits for a write permission signal from the transceiver. The transceiver internally maintains the empty / full state of the first buffer: when the buffer is not full and the transceiver has completed initialization and is in a playable state, the transceiver sets the write permission signal; when the buffer is full, the transceiver clears the signal. The frame editor only begins writing after detecting that the signal is valid. With each frame written, it automatically updates the buffer state and adjusts the signal accordingly. If the signal fails, the frame editor pauses writing and enters a waiting state until the signal becomes valid again.

[0064] The write-allow signal enables a handshake mechanism between the frame editor and the transceiver, ensuring that the buffer has free space and is ready before writing, thus avoiding data overflow and invalid write operations, and guaranteeing the continuity of event frame playback and system stability.

[0065] Based on the framing method for nuclear magnetic resonance pulse data in the above embodiments, the present invention also proposes a computer-readable storage medium and a framer.

[0066] The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the nuclear magnetic resonance pulse data framing method of the above embodiments; the framer is used to execute the nuclear magnetic resonance pulse data framing method of the above embodiments.

[0067] The present invention also proposes a nuclear magnetic resonance spectrometer, including the frame editor of the above embodiments.

[0068] In this embodiment, the nuclear magnetic resonance spectrometer may further include a transceiver. The transceiver is communicatively connected to the frame editor and is used to receive event frames and shaped envelope data frames framed by the frame editor, and to perform a pulse sequence playback operation, the specific implementation of which will be described later.

[0069] In summary, the nuclear magnetic resonance pulse data framing method, framer, and nuclear magnetic resonance spectrometer of the present invention can achieve the following beneficial effects: 1) A fixed-length encoding method is used to encode all event frames and integer envelope data frames. The length of each frame is a preset length, so that the transceiver does not need to dynamically judge the frame boundary or parse the variable-length field during parsing. It can simply read the data sequentially with a fixed step size, which reduces the parsing complexity, avoids timing deviations and parsing errors caused by inconsistent frame lengths, and improves the stability and real-time performance of nuclear magnetic resonance detection.

[0070] 2) Separate the integer envelope data frame and the event frame and store them independently in different buffers. The integer index in the transmitted event frame is used for precise addressing and calling, so that the same integer envelope data can be repeatedly called by multiple transmitted event frames without repeated storage. This reduces data redundancy, simplifies the debugging process, and enhances the flexibility of pulse sequence editing.

[0071] 3) By setting the first buffer as a circular buffer and using the empty-full handshake mechanism between the frame editor and the transceiver, event frames with a total number far exceeding the buffer depth can be played continuously without allocating a huge buffer at once, reducing storage resource requirements and avoiding playback stuttering or data overflow.

[0072] 4) The preset length can be flexibly adjusted according to the hardware configuration (such as DDS bit width, DDR burst read bit width) so that the frame length is aligned with the DDR memory read boundary conditions (for example, when the DDR burst read bit width is 64 bytes, the frame length is set to 32 bytes, and two complete event frames can be read in each clock cycle), thereby making full use of memory bandwidth and improving data reading efficiency.

[0073] 5) A checksum field is included in each event frame and shaped envelope data frame, enabling the transceiver to verify data integrity in real time during parsing. If errors such as memory bit flips are detected, the transceiver can be immediately switched to protection mode and an alarm can be issued, preventing erroneous data from being executed and causing equipment damage or experimental failure, thus improving the safety and reliability of MRI detection.

[0074] Figure 5 This is a flowchart of a method for playing back nuclear magnetic resonance pulse data according to an embodiment of the present invention. The method uses a target transceiver among multiple transceivers, each transceiver having a first buffer and an FPGA (Field-Programmable Gate Array). The target transceiver is designated as the master node among the multiple transceivers, used to output a trigger signal to coordinate the synchronous playback of all transceivers in the system. The remaining transceivers act as non-target transceivers (slave transceivers), responding to the trigger signal output by the target transceiver for delay calibration and synchronous playback.

[0075] like Figure 5 As shown, the methods for playing back nuclear magnetic resonance pulse data include: S21, output periodic delay trigger signals to each non-target transceiver, so that each non-target transceiver can determine its own target delay based on the delay trigger signals, and perform signal acquisition based on the target delay.

[0076] Specifically, such as Figure 6 As shown, even if all transceiver clocks are processed from the same source, differences in hardware routing and FPGA internal wiring can still cause external trigger edges to ( Figure 6 The actual position of the trigger (in the data) and the position of the trigger receiver master clock edge (in the data). Figure 6 The acquisition positions are extremely close, and even picosecond-level jitter in the trigger signal can cause a deviation of one clock cycle (i.e., a deviation of 1 CLK). To address this, this invention uses an FPGA to perform delay calibration to obtain the optimal t value (i.e., the target delay amount), and then delays the external trigger by t before signal acquisition.

[0077] Specifically, during each power-on initialization phase of the transceiver, optimal acquisition position calibration is performed internally within the FPGA to avoid a one-clock-cycle jitter issue that may occur during multi-transceiver synchronization. Synchronization position calibration is implemented using the "input delay source (IDELAYE3)," and the specific process is as follows: First, the target transceiver outputs a periodic delayed trigger signal to all non-target transceivers in the system (i.e., the multi-transceiver cluster). Each non-target transceiver connects this delayed trigger signal to its own IDELAYE3 module within its FPGA. Then, each non-target transceiver controls the tap coefficients of the IDELAYE3 module through the FPGA to perform a picosecond-level delay scan on the input delayed trigger signal (starting from a preset minimum delay value and gradually increasing the delay amount). At each delay value, the delayed trigger signal after the delay is acquired in real time, and the acquired result is compared with the original state of the delayed trigger signal to determine the range of delay values ​​(i.e., the range of all feasible delay values) where the acquired result matches the original state (e.g., both are high level or both are low level; if they do not match, it means the acquired signal may have fallen on the edge of a level transition, which is prone to error). This range is taken as the consistency zone of the delay value. Next, the delay value corresponding to any point in the consistency zone (e.g., the midpoint; the advantage of using the midpoint is that even if subsequent environmental factors such as temperature and voltage change and cause slight signal drift, the acquisition position will still fall within the safe window and will not fall to the edge or outside the window) is taken as its own target delay amount. The location corresponding to this target delay is the optimal sampling position for synchronizing the non-target transceiver with the target transceiver board. Finally, each non-target transceiver loads the acquired target delay into the IDELAYE3 module to fix the delay of subsequent trigger signals and performs signal acquisition based on this target delay.

[0078] Through the above calibration process, the synchronization accuracy between transceivers can be ensured to be at the picosecond level, avoiding the common one-clock-cycle jitter problem when synchronizing multiple transceivers, and ensuring the time consistency of the pulse sequence when multiple transceivers work together.

[0079] S22, read event frames from its own first buffer, and parse each read event frame. Store the parsed event parameters into the sequence FIFO in its own FPGA chip. Each event frame is obtained by framing pulse sequence data. The length of each event frame is a preset length. The event frame includes at least one of transmit event frame, receive event frame and delay event frame.

[0080] Specifically, the frame editor executes the framing method for nuclear magnetic resonance pulse data described in the above embodiment to generate event frames and writes the event frames into a first buffer, which can be located on the DDR of the transceiver board. During playback control, the FPGA first reads the event frames from the DDR. The DDR can read 64 bytes of data per clock cycle, and each event frame has a preset length (e.g., 32 bytes). Therefore, two complete event frames can be acquired per clock cycle, greatly simplifying the FPGA's operation. After reading the event frames from the DDR, the FPGA parses each event frame and stores the parsed event parameters in 32-byte units into its own on-chip FIFO (First In First Out).

[0081] The above methods enable efficient reading, parsing, and caching of event frames, providing reliable data support for the synchronous playback of subsequent pulse sequences.

[0082] S23, after all transceivers are ready, output a playback trigger signal to each non-target transceiver so that all transceivers can synchronously play the event frame sequence in their respective sequence FIFO.

[0083] Specifically, the readiness conditions for each transceiver are as follows: The target transceiver is ready when the depth of its on-chip FPGA sequence FIFO is higher than a preset threshold. This indicates that the target transceiver has read a sufficient number of event frames, there is enough data in the sequence FIFO waiting to be played, and there will be no data interruption during playback.

[0084] The conditions for each non-target transceiver to be ready are as follows: the target transceiver receives the ready signal sent by each non-target transceiver. After each non-target transceiver completes its own delay position calibration (i.e., determines the target delay amount) and its FPGA on-chip sequence FIFO depth is higher than a preset threshold, it sends a ready signal to the target transceiver, indicating that it is ready to perform synchronous playback.

[0085] All transceiver boards are ready, meaning that the target transceiver itself is ready (sequence FIFO depth meets the requirements) and has received ready signals from all non-target transceivers.

[0086] When the above conditions are met, the FPGA of the target transceiver outputs a playback trigger signal to each non-target transceiver. After being processed by the optimal delay position determined in step S21, the playback trigger signal is received by each non-target transceiver with a precise delay (ensuring that the playback trigger signal arrives at each board at the same time), and then all transceivers simultaneously start synchronous playback.

[0087] During synchronous playback, each transceiver's FPGA performs flow control on the time axis according to the event frame sequence in its respective sequence FIFO, based on the duration field in each event frame. It also outputs corresponding control signals to the corresponding event execution modules according to the function codes in the event frames. These modules include the transmitting module for generating RF waveforms and outputting them to the DAC (Digital-to-Analog Converter) on its own board, the receiving module for digital demodulating and acquiring MRI echo signals, and the delay control module for performing delay waiting and power configuration. This ensures that each operation in the pulse sequence is executed precisely.

[0088] Through the aforementioned synchronization mechanism between transceivers, all transceivers are precisely aligned on the time axis, avoiding playback asynchrony issues caused by clock deviations or signal propagation delays, and ensuring the time consistency and detection accuracy of the nuclear magnetic resonance pulse sequence playback.

[0089] The method for playing back nuclear magnetic resonance pulse data, through the steps S21 to S23 above, uses the target transceiver as the master control node to coordinate the synchronous playback of all transceivers in the system, ensuring the time consistency of the pulse sequence when multiple transceivers work together, and improving the accuracy and reliability of nuclear magnetic resonance detection.

[0090] In some embodiments of the present invention, each transceiver also has a second buffer, and the first buffer and the second buffer are independent and separate from each other in address space; the method for playing nuclear magnetic resonance pulse data further includes: reading shaped envelope data frames from its own second buffer, parsing each read shaped envelope data frame, and storing the parsed envelope amplitude point data into the shaped FIFO in its own FPGA chip, wherein the length of each shaped envelope data frame is a preset length.

[0091] Specifically, the first buffer is used to store event frames (control flow), and the second buffer is used to store shaped envelope data frames (data flow). It can also be located on DDR. The two are completely separate in physical addressing and do not interfere with each other. During the playback preparation phase or during playback, the FPGA reads the shaped envelope data frames from the second buffer, parses out the envelope amplitude point data, and stores it in a dedicated shaped FIFO within the FPGA chip, awaiting the call of the transmitted event frames.

[0092] Because the DDR read clock (e.g., 300MHz) is greater than the sequence playback master clock (e.g., 250MHz), this clock frequency difference ensures that even in the worst-case scenario, the DDR data read speed can exceed the FPGA's playback consumption speed. Simultaneously, since both event frames and shaped envelope data frames use fixed-length encoding (e.g., 32 bytes), and DDR can read 64 bytes per clock cycle (i.e., two complete frames), even considering the overhead of reading shaped envelope data, the problem of the sequence read speed lagging behind the sequence playback speed can be effectively avoided, ensuring a continuous supply of data.

[0093] Furthermore, when reading event frames, the FPGA filters out transmission event frames containing integer envelopes (i.e., transmission event frames with non-zero integer indices) and pre-reads the corresponding integer envelope data from the second buffer and sends it to the shaping processing module. The advantage of pre-reading this data to the shaping processing module is that it leverages the delay characteristics of the FPGA's on-chip sequence FIFO (the inherent delay caused by event parameters queuing in the sequence FIFO for playback) to offset the non-real-time impact of DDR reads (such as read latency and refresh overhead). Specifically, when transmission event frames are queued in the sequence FIFO, the FPGA uses this queuing time to pre-read the required integer envelope data from the second buffer and store it in the shaping FIFO. This ensures that the required integer envelope data is ready in advance when the transmission event frame actually begins playback, thus avoiding playback stuttering or timing deviations caused by waiting for the integer data.

[0094] By storing event frames and shaped envelope data frames in separate buffers, the control flow and data flow are separated, reducing FPGA access complexity. The DDR read clock (300MHz) is higher than the playback master clock (250MHz), and combined with fixed-length encoding and bit-width matching (reading two event frames per cycle), the data read speed is always greater than the playback consumption speed. Simultaneously, by filtering transmit event frames containing shaped envelopes and utilizing the queuing delay of the sequence FIFO to prefetch the shaped data into the on-chip shaped FIFO, the non-real-time impact of DDR reads is offset. These mechanisms collectively ensure continuous and smooth playback of the pulse sequence, avoiding playback stutters and timing deviations, and improving the stability and reliability of MRI detection.

[0095] In some embodiments of the present invention, the method for playing nuclear magnetic resonance pulse data further includes: before storing the parsed data into the FIFO within its own FPGA chip, verifying the frame header, function code, and check code of each read frame; if the verification passes, storing the parsed data into the corresponding FIFO within its own FPGA chip; if the verification fails, discarding the current frame and reporting an error.

[0096] Specifically, see Figure 2 , Figure 3 Each event frame and shaped envelope data frame contains fields such as a frame header, function code, and checksum (e.g., CRC checksum). After the FPGA reads a complete frame consisting of 32 bytes from the DDR, it can first perform streaming parsing to determine the validity of the frame. The judgment criteria include: whether the frame header matches the preset synchronization word (e.g., 0xAA55) to confirm the correct frame start position; whether the function code is within the predefined valid range (e.g., transmit, receive, delay, or shaped envelope); and whether the checksum is consistent with the result calculated by the FPGA in real time based on the frame content.

[0097] If the verification passes, it means that the frame data is complete and has not been corrupted. The FPGA will store the parsed valid data (event parameters for event frames and envelope amplitude point data for integer envelope data frames) into the corresponding FIFO on its own FPGA chip (event parameters are stored in the sequence FIFO, and envelope amplitude point data are stored in the integer FIFO).

[0098] If the verification fails, it indicates that an error occurred during data storage or transmission (e.g., bit flipping in DDR). The FPGA discards the current frame, does not store it in the FIFO, immediately terminates all playback operations, switches the transceiver to protection mode (e.g., shuts down RF transmission, disconnects the receiving channel), and reports the error information (including error type, location, etc.) to the host computer.

[0099] By setting a frame header, function code, and CRC check field in each frame and performing streaming verification before parsing, real-time detection of data integrity is achieved. Once a frame header mismatch, invalid function code, or CRC check failure is detected, a data error (such as a DDR bit flip) is determined. The FPGA immediately discards the erroneous frame, terminates playback, switches to protection mode, and reports the error. This mechanism can mitigate the harm caused by errors such as memory bit flips in the first instance, preventing the execution of erroneous instructions from burning out the RF power amplifier or damaging the probe, significantly improving the safety and reliability of the nuclear magnetic resonance spectrometer.

[0100] In some embodiments of the present invention, playing the event frame sequence in the sequence FIFO includes: performing flow control on the time axis according to the duration of each event frame in the event frame sequence; wherein, for a transmit event frame, a basic waveform is generated based on the transmit frequency, transmit phase, and transmit amplitude in the transmit event frame; and when the transmit event frame does not have a shaped envelope, the basic waveform is directly output; when the transmit event frame has a shaped envelope, the corresponding envelope amplitude point data is read from the on-chip shaped FIFO of the FPGA according to the shaped index in the transmit event frame, and the envelope amplitude point data is reprocessed with the basic waveform before being output; for a receive event frame, digital domain processing is performed based on the receive phase and receive frequency in the receive event frame, the processed data is collected and uploaded; for a delay event frame, the output power of the transmit channel of the transceiver is set according to the transmit power parameters in the delay event frame.

[0101] Specifically, such as Figure 7 As shown, the FPGA of each transceiver reads event frames from the DDR, parses them, and stores the parsed event parameters into the on-chip sequence FIFO. Simultaneously, when a transmit event frame with an shaped envelope is read (e.g., the shaped index is non-zero), the corresponding shaped envelope data frame is read from the DDR according to the shaped index, parsed, and the parsed envelope amplitude point data is stored into the on-chip shaped FIFO for shaping the transmit event.

[0102] For a transmission event frame: The FPGA first generates a basic waveform using a DDS (Direct Digital Synthesizer) based on the transmission frequency, phase, and amplitude parameters in the frame. If the shaping index is 0, it indicates that envelope shaping is not required, and the basic waveform is directly output to the DAC. If the shaping index is not 0, it indicates that envelope shaping of the transmitted pulse is required. The FPGA reads the corresponding envelope amplitude point data from the on-chip shaping FIFO according to the shaping index, multiplies the amplitude value of the envelope amplitude point with the amplitude value of the corresponding point in the basic waveform to achieve envelope modulation, and then outputs the modulated waveform to the DAC. The DAC converts the digital waveform into an analog signal and sends it to the power amplifier, ultimately driving the probe to generate an RF pulse.

[0103] For the received event frame: The FPGA performs digital domain processing (such as quadrature demodulation, digital filtering, and cumulative averaging) on ​​the nuclear magnetic resonance echo signal acquired from the ADC according to the received phase and received frequency parameters in the frame. The processed data is temporarily stored in the data acquisition storage area and uploaded to the host computer (such as PC) in batches after the sequence is completed for image reconstruction or spectral analysis.

[0104] For delayed event frames: The FPGA performs a delay wait based on the duration in the frame, and at the same time configures the output power of the transmit channel of the transceiver based on transmit power parameters (such as gain value) to control the intensity of the RF pulse.

[0105] It should be noted that since DDR can only respond to one read request at a time, an arbitration mechanism is needed for scheduling when event frame reads and shaped envelope data frame reads occur simultaneously or conflict with each other.

[0106] As one implementation method, an "event frame priority" arbitration strategy can be adopted. When the FPGA encounters a need to read an integer envelope data frame while reading an event frame, it prioritizes reading the current event frame. After the event frame is read, it then initiates a request to read the integer envelope data frame. If, during the reading of the integer envelope data frame, the depth of the event frame FIFO falls below a preset threshold (risk of becoming empty), the FPGA pauses the reading of the integer envelope data frame and prioritizes resuming the reading of the event frame to ensure that the main playback flow is not interrupted.

[0107] As another implementation method, an "emergency priority" arbitration strategy can be adopted. The reading priority is determined by monitoring the depth status of the on-chip sequence FIFO: when the sequence FIFO depth is higher than the safety threshold (e.g., more than half full), it indicates that the supply of event frames is sufficient, and the reading of shaped envelope data frames is prioritized; when the sequence FIFO depth is lower than the safety threshold, it indicates that there is a risk of event frame interruption, and the reading of event frames is prioritized to ensure playback continuity.

[0108] As another implementation method, an "advance prefetch" strategy can be used to avoid arbitration conflicts. When parsing event frames, once the FPGA identifies a transmit event frame with an integer envelope, it does not immediately initiate the reading of the integer envelope data frame. Instead, it records the integer index of the transmit event frame and its position in the sequence FIFO (i.e., the estimated playback time). Since event frames need a certain amount of time to queue in the sequence FIFO, the FPGA uses this queuing delay to initiate the prefetch of the integer envelope data frame during the idle intervals of event frame reading (such as the idle period between DDR read bursts). This distributes the read requests for the integer envelope data across the idle periods of event frame reading, avoiding simultaneous contention for the DDR bus. This prefetch strategy can effectively reduce arbitration conflicts and improve DDR bandwidth utilization.

[0109] Regardless of the arbitration strategy employed, the core objective is to ensure an uninterrupted continuous supply of event frames while guaranteeing that the shaped envelope data is ready before the transmitted event is played. Through a reasonable arbitration mechanism, the FPGA can achieve mixed reading of event frames and shaped envelope data within limited DDR bandwidth, ensuring smooth pulse sequence playback and precise timing.

[0110] This enables precise execution of pulse sequences, including radio frequency transmission (supporting envelope shaping), signal acquisition (supporting digital domain processing), and delay and power configuration, ensuring the timing accuracy and detection effect of nuclear magnetic resonance experiments.

[0111] Figure 8 This is a flowchart of a method for playing back nuclear magnetic resonance pulse data according to another embodiment of the present invention. This playback method is used for a non-target transceiver among multiple transceivers, each transceiver having a first buffer and an FPGA.

[0112] like Figure 8 As shown, the methods for playing back nuclear magnetic resonance pulse data include: S31, in response to the periodic delay trigger signal output by the target transceiver, determines its own target delay amount based on the delay trigger signal, and performs signal acquisition based on the target delay amount.

[0113] Specifically, determining the target delay amount based on the delayed trigger signal includes: performing a picosecond-level delay scan on the delayed trigger signal and acquiring the delayed signal at each delay value; comparing the acquisition results with the original state of the delayed trigger signal to determine the range of delay values ​​when the acquisition results are consistent with the original state, which is taken as the consistency zone of the delay values; and taking the delay value corresponding to the midpoint of the consistency zone as the target delay amount.

[0114] S32 reads event frames from its own first buffer and parses each read event frame. The parsed event parameters are stored in the sequence FIFO within its own FPGA chip. Each event frame is obtained by framing pulse sequence data. The length of each event frame is a preset length. The event frame includes at least one of transmit event frames, receive event frames, and delay event frames.

[0115] S33, in response to the sequence FIFO depth being higher than a preset threshold, sends a ready signal to the target transceiver so that the target transceiver outputs a playback trigger signal to each non-target transceiver after all transceivers are ready.

[0116] S34, in response to the acquisition of the playback trigger signal, plays the event frame sequence in the sequence FIFO.

[0117] It should be noted that other specific embodiments of the method for playing nuclear magnetic resonance pulse data for non-target transceivers according to the present invention, including frame reading, playback control, etc., can be found in the specific embodiments of the method for playing nuclear magnetic resonance pulse data for target transceivers described above.

[0118] Based on the method for playing nuclear magnetic resonance pulse data in the above embodiments, the present invention also proposes a computer-readable storage medium and a transceiver.

[0119] The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method for playing nuclear magnetic resonance pulse data according to the above embodiments; the transceiver is used to execute the method for framing nuclear magnetic resonance pulse data according to the above embodiments.

[0120] The present invention also proposes a nuclear magnetic resonance spectrometer, including the transceiver of the above embodiments.

[0121] In this embodiment, the nuclear magnetic resonance spectrometer may further include a framer. The framer is communicatively connected to a transceiver and is used to execute the nuclear magnetic resonance pulse data framing method described in the above embodiment.

[0122] In summary, the method for playing back nuclear magnetic resonance pulse data, the transceiver, and the nuclear magnetic resonance spectrometer of the present invention can achieve the following beneficial effects: 1) Synchronization position calibration is performed using FPGA (using the IDELAYE3 module for picosecond-level delay scanning, taking the midpoint of the consistency region as the target delay), which solves the problem of one clock cycle jitter that may exist when multiple transceivers are synchronously triggered, and ensures the timing consistency of multiple transceivers working together.

[0123] 2) The fixed-length (e.g., 32-byte) frame encoding and decoding design conforms to the physical characteristics of DDR read and write (e.g., DDR burst read bit width is 64 bytes, and two complete frames can be read per cycle), which reduces the complexity of FPGA reading memory and decoding frames, while also ensuring the robustness of FPGA program design.

[0124] 3) The envelope data of the shaping pulse is framed and stored independently of the transmit event frame, and can be precisely indicated and retrieved through the shaping index in the transmit event frame. Combined with the shaping prefetch operation inside the FPGA, the queuing delay of the sequence FIFO is used to read the shaping data in advance, effectively avoiding the non-real-time impact of DDR reads. This mechanism greatly reduces the amount of data interaction, while ensuring the feasibility of modular design on the FPGA side, improving both code readability and maintainability.

[0125] 4) Each event frame and shaped envelope data frame has an independent frame verification mechanism (frame header, function code, CRC check). The FPGA can detect frame errors in real time during sequence playback. Once an error is detected, playback is stopped immediately and the error is reported, effectively avoiding the risk of equipment damage that may be caused by errors such as DDR bit flips, and improving the safety and reliability of MRI detection.

[0126] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0127] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0128] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0129] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for playing back nuclear magnetic resonance pulse data, characterized in that, For a target transceiver among multiple transceivers, each of the transceivers having a first buffer and an FPGA, the method includes: A periodic delay trigger signal is output to each non-target transceiver, so that each non-target transceiver determines its own target delay amount based on the delay trigger signal and performs signal acquisition based on the target delay amount; The event frame is read from its own first buffer and each read event frame is parsed. The parsed event parameters are stored in the sequence FIFO in its own FPGA chip. Each event frame is obtained by framing pulse sequence data. The length of each event frame is a preset length. The event frame includes at least one of transmit event frame, receive event frame and delay event frame. Once all transceivers are ready, a playback trigger signal is output to each of the non-target transceivers to enable all transceivers to synchronously play the event frame sequence in their respective sequence FIFOs.

2. The method for playing back nuclear magnetic resonance pulse data according to claim 1, characterized in that, Each of the transceivers also has a second buffer, and the first buffer and the second buffer are independent and separate from each other in address space; The method further includes: The FPGA reads shaped envelope data frames from its second buffer and parses each shaped envelope data frame. The parsed envelope amplitude point data is then stored in the shaped FIFO within the FPGA chip. The length of each shaped envelope data frame is the preset length.

3. The method for playing back nuclear magnetic resonance pulse data according to claim 1 or 2, characterized in that, The method further includes: Before storing the parsed data into the FIFO on the FPGA chip, the frame header, function code and check code of each read frame are verified. If the verification passes, the parsed data will be stored in the corresponding FIFO within the FPGA chip. If the verification fails, the current frame is discarded and an error is reported.

4. The method for playing back nuclear magnetic resonance pulse data according to claim 1, characterized in that, The condition for the target transceiver to be ready is that the depth of the sequence FIFO within its own FPGA chip is higher than a preset threshold. The condition for each of the non-target transceivers to be ready is: receiving a ready signal sent by each of the non-target transceivers; The phrase "all transceivers are ready" means that the target transceiver itself is ready and has received ready signals from all non-target transceivers.

5. The method for playing back nuclear magnetic resonance pulse data according to claim 1, characterized in that, The sequence of event frames in the playback sequence FIFO includes: Flow control on the time axis is performed according to the duration of each event frame in the event frame sequence; wherein... For a transmission event frame, a basic waveform is generated based on the transmission frequency, transmission phase, and transmission amplitude in the transmission event frame; and when there is no shaped envelope in the transmission event frame, the basic waveform is directly output; when there is a shaped envelope in the transmission event frame, the corresponding envelope amplitude point data is read from the on-chip shaped FIFO of the FPGA according to the shaped index in the transmission event frame, and the envelope amplitude point data and the basic waveform are further processed and output. For a received event frame, digital domain processing is performed based on the received phase and received frequency in the received event frame, and the processed data is collected and uploaded. For delayed event frames, the output power of the transmit channel of the transceiver is set according to the transmit power parameters in the delayed event frame.

6. A method for playing back nuclear magnetic resonance pulse data, characterized in that, For a non-target transceiver among multiple transceivers, each of the transceivers having a first buffer and an FPGA, the method includes: In response to the acquisition of a periodic delay trigger signal output by the target transceiver, the system determines its own target delay amount based on the delay trigger signal and performs signal acquisition based on the target delay amount. The event frame is read from its own first buffer and each read event frame is parsed. The parsed event parameters are stored in the sequence FIFO in its own FPGA chip. Each event frame is obtained by framing pulse sequence data. The length of each event frame is a preset length. The event frame includes at least one of transmit event frame, receive event frame and delay event frame. In response to the sequence FIFO depth being higher than a preset threshold, a ready signal is sent to the target transceiver, so that the target transceiver outputs a playback trigger signal to each of the non-target transceivers after all transceivers are ready; In response to the acquisition of the playback trigger signal, the sequence of event frames in the sequence FIFO is played.

7. The method for playing back nuclear magnetic resonance pulse data according to claim 6, characterized in that, Determining its target delay based on the delayed trigger signal includes: The delayed trigger signal is scanned at a picosecond delay level, and the delayed signal is acquired at each delay value; The acquisition results are compared with the original state of the delayed trigger signal to determine the range of delay values ​​when the acquisition results are consistent with the original state, which is taken as the consistency zone of the delay values. The delay value corresponding to the midpoint of the consistent region is taken as the target delay.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for playing nuclear magnetic resonance pulse data as described in any one of claims 1 to 7.

9. A transceiver, characterized in that, A method for playing back nuclear magnetic resonance pulse data as described in any one of claims 1 to 7.

10. A nuclear magnetic resonance spectrometer, characterized in that, Includes the transceiver as described in claim 9.