Create YUV Color Sweep Insertion Test Signal

NI 5431 Composite Video Generator

NI 5431 Composite Video Generator
Create YUV Color Sweep Insertion Test Signal

This subVI example shows you how to create an ITS data file based on YQI/YUV data. Some test patterns are easier to create using the two chroma components (Q and I for NTSC, or U and V for PAL) than using an RGB approach. In other cases, the test signal simply cannot be created using RGB signals.

This VI example creates a color sweep test pattern and saves the data as a file called test create YUV ITS.its. The file can then be recalled using the Insert Test Signals in Your Video Signal example.

You can access this VI example in the LabVIEW palette by selecting Functions»Video Generation»Generator Examples»Create YUV color sweep Insertion Test Signal.

To generate and save a color sweep test pattern, follow these steps:

  1. After selecting the example VI in the LabVIEW palette, click the LabVIEW diagram to place the icon there. Double-click the VI example icon to open it in LabVIEW.
  2. Note  You can also access this VI from the installation drive by double-clicking the Composite Video Generator Examples.llb library. The File Dialog box appears. Click Create YUV color sweep Insertion Test Signal.vi, then click OK. The VI opens in LabVIEW.
  3. Make sure theDevice ID control value matches device number assigned in MAX during device configuration. Refer to the NI Signal Sources Getting Started Guide for more information about device configuration.
  4. Note  This VI has predefined parameters for demonstration purposes. If you have not installed your software in your C: drive root directory, correct the file path of the ITS signal to be saved on the VI front panel so it matches your installation.
  5. On the front panel of the VI, using the LabVIEW palette operator tool and the up and down arrows on the Video format control, select the appropriate video format.
  6. Run the VI. The YUV Insertion Test Signal appears in the VI front panel and the ITS data are saved on your disk.

A YQI/YUV ITS is defined as three data arrays (Y, Q, and I for NTSC; Y, U, and V for PAL; and Y, Db, and Dr for SECAM) of 16-bit data. The luma Y signal is represented by a 16-bit unsigned array (U16) while the chroma components (Q and I or U and V) are represented by 16-bit signed arrays (I16). The size of the arrays depends on the selected video format and the specified active video duration, which can be modified using the attribute Image duration (µs). The default value for an NTSC signal is 52.2 µs, corresponding to approximately 1,044 samples at the nominal sampling frequency of 20.013 MHz. For B-PAL or SECAM, the default active video duration is 52.0 µs, corresponding to 1,040 samples at the nominal sampling frequency of 20.000 MHz. Refer to the NI-Video Attribute List topic for more information.

Therefore, the default size of the array is 1,044 for M-NTSC and 1,040 for 50 Hz-type PAL or SECAM. For the luma signal Y, the data are scaled so that 0 corresponds to black or 0 IRE (if no setup is applied) and 65,535 (the maximum value for unsigned 16-bit data) corresponds to white or 100 IRE. For the chroma component signals, the data are scaled so ± 50 IRE corresponds to ± 32,767 (the maximum and minimum values for signed 16-bit data).

Note  For SECAM users, the terminology used in this LabVIEW example is based on the PAL chroma components U and V. However, these components are internally scaled so they correspond to the usual Db and Dr components when a SECAM image generates.

The scaling factors used internally are as follows:

Db = 1.505 * (Eb - Ey) = +3.0527 * U

Dr = -1.902 * (Er - Ey) = -2.1688 * V

Also, because a modulation is always present in SECAM, even if the U and V components are set to zeros, an option for generation of the Y component only (without the FM subcarrier) is available on the front panel of the VI. Enable the Kill Chroma Modulation control if you do not want the FM subcarrier signal to be generated on your test signal.