SonixDAQ Software

Main Window
The SonixDAQ software is separated from the Exam software. This section will only focus on the DAQ software which is used to:
 * Program the DAQ by pressing "Create Sequence ..."
 * Adjust the DAQ parameters and capture channel data the by pressing "Start Sequencing"
 * Transfer the DAQ data back to PC by pressing "Download Data"
 * Load the collected data from the Sonix system (PC) and display the results by pressing "...".

The following figure shows the main user interface of the SonixDAQ software. The menu section of this window contains:
 * Directory : is the path of the collected data and can be used to load acquired channel data
 * Sequence (the same as the Create Sequence push button): programs the DAQ and opens another window "Sequence Control" which provides data acquisition options to the user. More detail is given below.
 * View: to show/hide the frame control in the main window
 * Help: shows the information about the software version.
 * Sampling: to select the 80MHz bitstream to be loaded.



This window enables the user to view:
 * The channel-by-channel waveform of the collected data (e.g. decrease/increase the time scale),
 * The FFT or FFT average of the data (In case decimation is used during data collection, the same value needs to be set in this window for the frequency spectrum to show the correct frequencies),
 * One or more channels (up to 32) on the screen (by adjusting "Channel Scale"), and
 * Different acquisition frames (by pressing "<<" and ">>").

A sample screen shot of the window when displaying the results is shown below:



Note: By default when clicking on "Create Sequence ..." the 40MHz bitstream will be loaded into the DAQ FPGA. As a result only sampling frequency of 40MHz and lower can be used for data collection. To load the 80MHz bitstream, you need to first click on 80MHz in the Sampling tab prior to clicking on the "Create Sequence ...". If you do this correctly, a tick should appear beside 80MHz. You can double check this by clicking on the 'Sampling' tap and seeing the status of the 80MHz. After this step, if you click on the "Create Sequence ..." the 80MHz bitstream will be loaded into DAQ FPGA. Once programming is finished you should be able to select the 80MHz sampling in the next window.

Note: If you program the DAQ with one bitstream e.g. 40MHz and want to switch to the other bitstream i.e. 80MHz you need to turn off the DAQ and turn it back on. If you skip this step, the DAQ will always respond as already being initialized and will not load the new bitstream.

Sequence Control
After pressing the "Create Sequence" button, the DAQ software will program the DAQ hardware. Once the DAQ is programmed, the "Sequence Control" window will appear. The Sequence Control window, which is shown below, allows the user to adjust the parameters for data acquisition, start/stop the sequencing, and download/transfer the captured data to PC.



The flowchart of the supported sequence control is depicted in a figure below and will be explained in detail in the following sections.



Choose the TGC Curve
The user can obtain the desired TGC curve in the top section of the window. Both adjustable TGC (as a function of depth) and fixed TGC can be programmed.

Imaging Parameters
This window allows the user to adjust the imaging parameters such as The effects of these parameters on data acquisition are depicted in a figure below. Further explanations are provided in the next subsections.
 * Number of Samples: number of samples that will be acquired regardless of the sampling frequency,
 * Receive Delay: the delay (in micro seconds) after the sync signal and before start of data collection,
 * Line Duration: duration of each acquisition in micro seconds,
 * Gain Delay, delay after the transmit before the TGC is applied in micro seconds,
 * Gain Offset, shifts the TGC curve up based on the Gain offset value, the value is in micro volts and it ranges from 0 to 1600 (1.6 Volt maximum gain),



The parameters either has to be entered manually, or loaded from a file. Note that some combination of the parameters are not supported by the DAQ. In case "Load From File" option is selected. The first three parameters will be loaded from the file (D:\daq-b.prm). It should be noted that for this option to work properly, the Sonix system has to write these information to the same file. For this purpose, the "writeDAQparams" has to be set to 1 on the mouse over menu in the Exam software. For further information refer to Sonix system setup.

In case the "external" synchronization pulse is selected, the Line Duration is determined by the input sync/trigger coming from the Sonix system or another external triggering system. Also, it is up to the user to ensure that Number of Samples is short enough to fit in between the sync pulses. Otherwise, the DAQ will miss some of the triggers and unwanted transmits will occur during data acquisition. This is due to the fact that the DAQ will not look for the trigger signal during data collection. Once predefined number of samples are acquired, the DAQ will wait for the next trigger.

If "internal" synchronization pulse is selected, the DAQ software checks the feasibility of the selected combination of Number of samples, Line Duration and Receive Delay.

Clock Configuration
The DAQ has its own internal clock that runs at 40MHz. This clock is different from the Sonix clock. In this section you set the DAQ to use its own internal clock or to use the external clock provided to the DAQ through a BNC cable. This will make sure that both the DAQ and the Sonix system are using the same clock. It is important to note that this clock always has to be 40MHz regardless of the sampling frequency. The DAQ uses this 40MHz clock to generate the sampling frequency (i.e. 40MHz, 60MHz, or 80MHz).

Note: This option is only available on the Sonix systems with the new PCI card (i.e. SonixTouch, SonixMDP, and modified SonixRP). On the old SonixRP system only the internal clock should be used.

Start Configuration
In this section you select synchronization pulse source: internal or external. The synchronization pulse is a pulse which indicates the beginning of each acquisition. The user can choose the source of this pulse based on the purpose of the data collection. If the purpose is to test the DAQ, it is not required to connect the synchronization BNC to the Sonix system’s BNC. The DAQ is capable of generating this pulse internally.

In this scenario, the source of the synchronization pulse must be selected as internal. Also, it is not required to connect the DAQ to the probe slot. Instead, the DAQ's probe connector can be connected to a signal generator, which generates a wave form with a frequency less than 20MHz and amplitude less than 50mV.

However, if the goal is to capture synchronized ultrasound data from the Sonix system, the DAQ has to be connected to the Sonix system's probe connector and DAQ's BNC input signal has to be connected to Sonix's BNC output signal. In this scenario, the source of the synchronization pulse must be selected as external.

Channel Mapping
There are four separate boards inside the DAQ. Each board acquires data from 32 channel.

Active channels can be any combination of channels from 1 to 128. Next figure shows the active channel selection window.



Select/Deselect HPF
This is a digital filter that performs as a DC canceler. The cut off frequency for this filter is 280kHz. The user can bypass this filter by selecting the Bypass HPF option.

Note: In addition to this digital HPF, the sonixDAQ has anti-aliasing filters as well. The AA filter is a combination of a low pass filter LPF and a high pass filter HPF. Currently the cut-off values for AA filter are set to be:
 * HPF cut-off = F_high = F_sampling/3 = 40MHz/3 = 13.3MHz and
 * LPF cut-off = F_low = F_high/20.7 = 650kHz.

In other words the pass band for AA filter is approximately from 0.6MHz to 13.3MHz for sampling frequency of F_sampling = 40MHz. Subsequently, the pass band for sampling frequency of F_sampling = 80MHz is approximately from 1.2MHz to 26.6MHz.

Operating Mode
The SonixDAQ can work in two different operating modes:
 * Normal mode: the data is written to the memory (i.e. DDR2) until it gets full. In this mode, the user can choose the max capacity of the memory.
 * Free-Run mode: the memory is treated as a ring buffer. In this mode, the user has to press the stop button in order to stop writing the data into memory before downloading the stored data.

Decimation/Sampling
The DAQ FPGA runs at 40MHz but the receive board (rx board) can generate higher clock frequencies (e.g. 80MHz) from the same 40MHz clock. This will allow the DAQ to sample the data at higher frequencies. Currently both 40MHz and 80MHz samplings are supported by the DAQ.

The decimation option allows the user to reduce the sampling frequency (i.e. down sampling). This option can be used to store more frames on the DAQ. Currently, this is the only parameter that allows the user to control the sampling frequency as follows:
 * 80MHz (decimation = 0) <<80MHz bitstream>>
 * 40MHz (decimation = 0) <<40MHz bitstream>>
 * 20MHz (decimation = 1) <<40MHz bitstream>>
 * 13MHz (decimation = 2) <<40MHz bitstream>>
 * 10MHz (decimation = 3) <<40MHz bitstream>>

Note: Decimation is not supported for the 80MHz sampling bitstream. If lower sampling frequencies are of interest 40MHz bitstream should be used instead. Also, at the moment, decimation only uses down-sampling with no anti-aliasing filter. Thus, setting the sampling frequency too low will result in aliasing.

File Size
The file size allows the user to set the maximum memory size for each board on the DAQ. Since there are four boards on the DAQ, setting the File Size to 4GB will result in capturing 16GB of channel data. Currently the following options are supported for the File Size:
 * 4GB (divisor = 0)
 * 2GB (divisor = 1, i.e. 4G/2^1 = 2G)
 * 1GB (divisor = 2, i.e. 4G/2^2 = 1G)
 * 128K (divisor = 15, i.e. 4G/2^15 = 128K)
 * 128K (divisor = 15, i.e. 4G/2^15 = 128K)

Note: due to limited bandwidth of the USB cable, increasing the memory size will result in longer transfer time. Thus, it is recommended to set the file size lower than the maximum value unless it is necessary.

Gain Adjustments
In this section LNA gain, PGA gain, and the Switch gain can be adjusted. For detailed description of these gains please refer to hardware block diagram.

Note: Setting the Switch gain to 0 will turn off the TR switch. Thus, you will not receive any echo. To acquire data, make sure this gain is set higher than 0.

Note: Maximizing all the gain may cause the TR switch to saturate. Thus, the values have to be adjusted depending on the application.

Download data
The write procedure to memory can be terminated by either pressing the stop button or when memory is filled to capacity (only in Normal mode). The user can download the captured data from DAQ. The following figure shows the download window.



Format of the stored data
In the output directory, the ultrasound data is stored in binary files CHZZZ-YYYY.daq, where ZZZ is the channel number from 0 to 127 and YYYY is the file number. For example, CH000-0000.daq is the first set of data for channel 0, while CH000-0001.daq is the second set of data for channel 0. At the beginning of each file is a header consisting of two unsigned integers (32 bits each) which contain the number of lines and the number of samples per line, respectively. The ultrasound samples are 16-bit signed integers, stored in lines after the header.

For example, if the integers are 10 and 1024, respectively, the file contains ten lines of 1024 samples per line, for a total of 10,240 samples. Since the ultrasound samples are stored in lines, to read the first line of samples one would simply read 1024 * (2 bytes/sample) = 2048 bytes from the file beyond the header. Each line would be the next 2048 bytes beyond that.

When using the latest version of the SDK (v6.0.1) data that is downloaded to disk from the SonixDAQ using an API function call has a slightly modified header structure. The header now consists of three 32-bit unsigned integers. The first represents the channel number (0 through 127), the second gives the number of lines and the third gives the number of samples per line. Moreover, the data file is saved as CHZZZ.daq where ZZZ is the channel number between 0 and 127.