Using MATLAB Simulated Signals for Source Playback

MATLAB ".mat" simulated signal files can be used for signal source playback. This topic describes how to create and edit compatible MATLAB ".mat" simulated signal source playback files. You use the MATLAB developers environment to create a new complex IQ signal file, import and modify existing signal files, or process a signal with your own algorithm.

This procedure applies to using MATLAB simulated signal files for source playback, to learn about using VSA recorded signal files, see Using Source Playback Procedure.

Creating a New MATLAB Signal Recording

You use the MATLAB Developers Environment and supplied VSA MATLAB Tool to create a VSA compatible MATLAB simulated signal file. Signal files that can be used for source signal playback must be described with complex (I+jQ) time data.

This procedure makes the assumption that you are familiar with using the MATLAB Developers Environment.

A.  Getting Started

The VSA software includes a MATLAB Tool "MATLAB script function savevsarecording.m" that will be used within the MATLAB Developers Environment to help create VSA compatible signal source playback recording. The MATLAB tool adds the necessary header information to the signal complex time data and saves as a compatible VSA source playback signal recording file "filename.mat".

MATLAB Tool: savevsarecording.m
Default Folder: %PROGRAMFILES%\Keysight\89600 Software <ReleaseVersion>\89600 VSA Software\Help\Signals
  1. Integrate the VSA MATLAB Tool with the MATLAB Developers Environment.
    To integrate the VSA MATLAB Tool into the MATLAB Developers Environment, copy the savevsarecording.m file into your MATLAB current folder location. The savevsarecording.m file will now show in the MATLAB Current Folder window. To access the savevsarecording.m function help, from the MATLAB command prompt >>, type help savevsarecording.

B.  Create a MATLAB simulated source playback recorded signal file.

  1. Create a variable containing the complex signal data.
    The signal data must be complex (I+jQ) baseband time data. not real data.
  2. Execute the savevsarecording.m script function:
    To view the savevsarecording() function help, type "help savevsarecording".
    1. savevsarecording(fileName, data, sampleFreq, centerFreq)
      You will need to supply the following variable information.
      1. fileName;  the signal recording file name.
      2. data;  the variable containing the signal complex time data.
      3. sampleFreq; the signal sample frequency.
      4. centerFreq:  the signal center frequency.
    2. By default, the signal file will be saved to the MATLAB Current Folder location.
  3. Downloading the signal for source Playback.
    The signal recording is now ready for source playback. You can Recall the signal file and use the Source menu to download and playback the signal through a Source, see Using Source Playback.

Editing non-MATLAB signal recordings in MATLAB

You can use the MATLAB Developers Environment to edit and modify existing VSA non-MATLAB compatible signal recordings, such as, ".sdf", ".csv", ".bin", ".txt", or ".dat" file formatted recordings. In MATLAB you do any of the following signal edits; limit analysis data by modifying the recording to only contain the data of interest, make a composite signal, process the signal with your own algorithms, or increase the recording by adding new user-created data.

Max Download File Size: The data block size to be downloaded to a source must be < 250 Mpts.

For many types of signal recording edits, it is simpler to use the VSA recording and measurement settings to modify a signal recording.

A.  Creating a MATLAB ".mat" signal recording

To use an existing non-MATLAB signal recording in MATLAB, you use the VSA "Save Recording" feature to convert the non-MATLAB compatible file format to a compatible MATLAB ".mat" file format. To do this, you load the existing complex signal recording into the VSA and re-save as a recording using the ".mat" file format.

  1. Convert existing VSA recording to a MATLAB compatible file format
    You can create a source playback compatible MATLAB "*.mat" formatted signal file from any existing VSA "zoom" complex measurement signal recording using one of the following file formats; ".sdf", ".csv", ".bin", ".txt", or ".dat" file formats..
    1. Recall an existing source playback compatible ("zoom" time data) VSA signal recording:
      1. File > Recall > Recall Recording.. and follow prompts.
    2. Then re-save the recording "Save Recording" as a ".mat" formatted file that includes the measurement header information:
      1. specify the "*.mat" file format.
      2. specify the "Save header with data" Save Option.
  2. Load the MATLAB recording into MATLAB Development Environment, the MATLAB Workspace window will show the pertinent signal recording information.
    1. Select and right click the recording.mat file in the MATLAB Current Folder window
                                                                or
      Type >> load 'c:\MyRecordingFolder\MyRecording.mat in the Command Window

B.  Source Download and Playback

  1. Specify the necessary recording download and playback parameters.

    The signal recording parameters listed in the following table are the only "necessary" parameters that are included in the source download information. All other parameters are not used and ignored for source signal playback. Make sure to correctly specify the parameter settings.

    Necessary Recording Parameter Necessary Recording Parameter Information
    XDelta XDelta is the sample period. The sample rate is the reciprocal of XDelta and must be within the maximum arb sample rate of the Vector Signal Generator.
    Y "Y" holds the data. This must be a complex single array.
    InputZoom When InputZoom is included, it must have a value of 1.
    XDomain When "XDomain" is included, it must have a value of 2.
    Notes:

    1) This Table contains only the parameters necessary for source download and playback. all other recording parameters are ignored.
    2) The recording signal parameters are shown in the MATLAB Workspace window.
    3) All parameters are case sensitive.

  1. Now you can use MATLAB to make edits and modifications to the signal recording parameters and data.
    1. Make sure that the parameter names and data types are correct.

    2. Remember to set XDelta to the desired sample period.

  2. Save your Workspace and signal recording
  3. Downloading the signal for source Playback.
    The signal recording is now ready for source playback. You can Recall the signal file and use the Source menu to download and playback the signal through a Source, see Using Source Playback.

See Also

Connecting to a Source

Source Error Messages

Overview