EasyManuals Logo

Keysight Technologies N5172B EXG Programming Guide

Keysight Technologies N5172B EXG
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #287 background imageLoading...
Page #287 background image
Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 287
Creating and Downloading Waveform Files
Programming Examples
% PRESERVE THE BIT PATTERN but convert the waveform to
% unsigned short integers so the bytes can be swapped.
% Note: Can't swap the bytes of signed short integers in MatLab.
waveform = uint16(mod(65536 + waveform,65536)); %
% If on a PC swap the bytes to Big Endian
if strcmp( computer, 'PCWIN' )
waveform = bitor(bitshift(waveform,-8),bitshift(waveform,8));
end
% Save the data to a file
% Note: The waveform is saved as unsigned short integers. However,
% the acual bit pattern is that of signed short integers and
% that is how the ESG/PSG interprets them.
filename = 'C:\Temp\EsgTestFile';
[FID, message] = fopen(filename,'w');% Open a file to write data
if FID == -1 error('Cannot Open File'); end
fwrite(FID,waveform,'unsigned short');% write to the file
fclose(FID); % close the file
% 3.) Load the internal Arb format file
*********************************
% This process is just the reverse of saving the waveform
% Read in waveform as unsigned short integers.
% Swap the bytes as necessary
% Convert to signed integers then normalize between +-1
% De-interleave the I/Q Data
% Open the file and load the internal format data
[FID, message] = fopen(filename,'r');% Open file to read data
if FID == -1 error('Cannot Open File'); end
[internalWave,n] = fread(FID, 'uint16');% read the IQ file

Table of Contents

Other manuals for Keysight Technologies N5172B EXG

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keysight Technologies N5172B EXG and is the answer not in the manual?

Keysight Technologies N5172B EXG Specifications

General IconGeneral
BrandKeysight Technologies
ModelN5172B EXG
CategoryPortable Generator
LanguageEnglish

Related product manuals