Keysight E4428C ESG RF Programming Manual page 158

Signal generators
Table of Contents

Advertisement

Programming Examples
LAN Programming Interface Examples
Example 2: Reading a VSA Trace and Setting up the Equalization Filter Using Matlab
This example reads a VSA trace of "Eq Ch Freq Resp" or "Eq Impls Resp" and creates an equalization
filter compatible with the MXG.
The following program Matlab example is available on the signal generator Documentation CD- ROM
as loadVsaEQFilterFreq.m.
function [corrFilter] = loadVsaEqFilter(filename, destRate)
% [corrFilter] = loadVsaFilter(filename[, destRate])
% filename must reference an 89600 Equalization filter saved as .mat file with the header included.
% destRate is assumed to be 125e6 if missing
% output of corrFilter is in time domain.
% Typically followed with:
%
writeMxgFir('a-n5182a-00211', 'cft', corrFilter);
if (nargin<1 || nargin>2)
error('[corrFilter] = loadVsaEqFilter(filename[, destRate]) -- destRate is assumed to be 125e6 if
missing');
end
if (nargin<2)
destRate=125e6;
end
% load filter struct from .mat file
filterStruct=load(filename);
coeffs = double(filterStruct.Y);
if (filterStruct.XDomain==1) % frequency
rate = filterStruct.XDelta*length(coeffs); % frequency range is also rate
% VSA software supplies centered frequency domain
else % time domain is 2
rate = 1/filterStruct.XDelta; % inverse of time step is frequency
% convert to frequency domain
% must center frequency domain (to match what comes from the VSA
% software)
coeffs = fftshift(fft(coeffs));
end
% invert
invertedFreqDomain = 1./coeffs;
% convert to time domain (first placing the 0 frequency at the left edge)
timeDomain=ifft(ifftshift(invertedFreqDomain));
if (filterStruct.XDomain==1) % frequency
% put time domain 0 time in center
len=length(timeDomain);
if (mod(length(timeDomain), 2)==1) % odd
center=ceil(len/2);
centeredTime(1:(center-1)) = timeDomain(center+1:end);
150
Keysight Signal Generators Programming Guide

Advertisement

Table of Contents
loading

Table of Contents