RF Toolbox 2.6
Modeling a High-Speed Backplane (Part 2: 4-Port S-Parameters to a Rational Function Model)
This demo shows how to use RF Toolbox™ to model a differential high-speed backplane channel using rational functions. This type of model is useful to signal integrity engineers, whose goal is to reliably connect high-speed semiconductor devices with, for example, multi-Gbps serial data streams across backplanes and printed circuit boards.
Compared to traditional techniques such as linear interpolation, rational function fitting provides more insight into the physical characteristics of a high-speed backplane. It provides a means, called model order reduction, of making a trade-off between complexity and accuracy. For a given accuracy, rational functions are less complex than other types of models such as FIR filters generated by IFFT techniques. In addition, rational function models inherently constrain the phase to be zero on extrapolation to DC. Less physically-based methods require elaborate constraint algorithms in order to force the extrapolated phase to zero at DC.
Figure 1: A differential high-speed backplane channel
Contents
- Read the Single-Ended 4-Port S-Parameters and Convert Them to Differential 2-Port S-Parameters
- Compute the Transfer Function and Its Rational Model Representation
- Validate the Differential-Mode Frequency Response
- Calculate and Plot the Differential Input and Output Signals of the High-Speed Backplane
- Compare the 2 Gbps Output of the Rational Model to the Output Obtained by IFFT
- Plot the Eye Diagram of the 2 Gbps Output Signal
- Calculate and Plot the Differential TDR and TDT Waveforms of the 2 Gbps Signal
Read the Single-Ended 4-Port S-Parameters and Convert Them to Differential 2-Port S-Parameters
Read a S4P Touchstone® data file into an RFDATA.DATA object using the object's READ method. The parameters in this data file are the 50-ohm S-parameters of the single-ended 4-port passive circuit shown in Figure 1, given at 1496 frequencies ranging from 50 MHz to 15 GHz. Then, get the single-ended 4-port S-parameters and use the matrix conversion function S2SDD to convert them to differential 2-port S-parameters. Finally, plot the differential S11 parameter on a Smith chart.
FileName = 'default.s4p'; SingleEndedData = read(rfdata.data, FileName); Freq = SingleEndedData.Freq; DifferentialSparams = s2sdd(SingleEndedData.S_Parameters); % By default, S2SDD expects ports 1 & 3 to be inputs and ports 2 & 4 to be % outputs. However if your data has ports 1 & 2 as inputs and ports 3 &a mp; 4 % as outputs, then use 2 as the second input argument to S2SDD to specify % this alternate port arrangement. For example, % DifferentialSparams = s2sdd(SingleEndedData.S_Parameters, 2); DifferentialCkt = rfckt.passive('NetworkData', ... rfdata.network('Data', DifferentialSparams, 'Freq', Freq)) S11 = DifferentialSparams(1,1,:); S21 = DifferentialSparams(2,1,:); fig = figure; smith(DifferentialCkt, 'S11'); legend show;
DifferentialCkt =
Name: 'Passive'
nPort: 2
AnalyzedResult: [1x1 rfdata.data]
IntpType: 'Linear'
NetworkData: [1x1 rfdata.network]
Compute the Transfer Function and Its Rational Model Representation
First, use the S2TF function to compute the differential transfer function. Then, use the RATIONALFIT function to compute the analytical form of the transfer function and store it in an RFMODEL.RATIONAL object. The RATIONALFIT function fits a rational function model to the specified data over the specified frequencies. The fourth argument of this function is an optional weight vector. The demo uses a weight vector that is proportional to the original 1496 frequencies from 50 MHz to 15 GHz. The run time depends on the computer, the fitting tolerance, the number of data points, etc.
DifferentialTransFunc = s2tf(DifferentialSparams); FittingTolerance = -33; % Rational fitting tolerance in dB Weight = 1:length(Freq); % Fitting weight DelayFactor = 0.98; % Delay factor. Set delay factor to zero if your % data does not have a well-defined principle de lay tic; RationalFuncModel = ... rationalfit(Freq, DifferentialTransFunc, FittingTolerance, Weight, Delay Factor) toc; nPoles = length(RationalFuncModel.A); fprintf('The derived rational function contains %d poles.', nPoles);
RationalFuncModel =
Name: 'Rational Function'
A: [26x1 double]
C: [26x1 double]
D: 0
Delay: 6.5521e-009
Elapsed time is 13.890964 seconds.
The derived rational function contains 26 poles.Validate the Differential-Mode Frequency Response
Use the FREQRESP method of the RFMODEL.RATIONAL object to get the frequency response of the rational function model. Then, create a plot to compare the frequency response of the rational function model and that of the original data. Note that detrended phase (i.e. phase after the principle delay is removed) is plotted in both cases.
PlotFreq = linspace(0, 20e9, 2000)'; RespAtPlotFrequency = freqresp(RationalFuncModel, PlotFreq); subplot(2,1,1); plot(Freq*1.e-9, 20*log10(abs(DifferentialTransFunc)), 'r', ... PlotFreq*1.e-9, 20*log10(abs(RespAtPlotFrequency)), 'b--', 'LineWidth', 2); title(['Rational Fitting with ', int2str(nPoles), ' poles'], 'fonts', 12); ylabel('Magnitude (decibels)'); xlabel('Frequency (GHz)'); legend('Original', 'Fitting result'); subplot(2,1,2); plot(Freq*1.e-9, unwrap(angle(DifferentialTransFunc))*180/pi + ... 360*Freq*RationalFuncModel.Delay, 'r', PlotFreq*1.e-9, ... unwrap(angle(RespAtPlotFrequency))*180/pi+360*PlotFreq*RationalFuncModel .Delay, ... 'b--', 'LineWidth', 2); ylabel('Detrended phase (deg.)'); xlabel('Frequency (GHz)'); legend('Original', 'Fitting result');
Calculate and Plot the Differential Input and Output Signals of the High-Speed Backplane
Generate a random 2 Gbps pulse signal. Then, use the TIMERESP method of the RFMODEL object to compute the response of the RFMODEL.RATIONAL object to the random pulse. Finally, plot the input and output signals of the rational function model that represents the differential circuit.
SampleTime = 5e-12; OverSamplingFactor = 100; TotalSampleNumber = 2^17; TotalPlotPoints = 10000; InputTime = double((1:TotalSampleNumber)')*SampleTime; InputSignal = sign(randn(1, ceil(TotalSampleNumber/OverSamplingFactor))); InputSignal = repmat(InputSignal, [OverSamplingFactor, 1]); InputSignal = InputSignal(:); [OutputSignal, OutputTime] = timeresp(RationalFuncModel,InputSignal,SampleTi me); subplot(2,1,1); plot(InputTime(1:TotalPlotPoints)*1e9, InputSignal(1:TotalPl otPoints), ... 'LineWidth', 2); title('2 Gbps Signal', 'fonts', 12); ylabel('Input signal'); xlabel('Time (ns)'); axis([-inf,inf,-1.5,1.5]); subplot(2,1,2); plot(OutputTime(1:TotalPlotPoints)*1e9, ... OutputSignal(1:TotalPlotPoints), 'LineWidth', 2); ylabel('Output signal'); xlabel('Time (ns)'); axis([-inf,inf,-1.5,1.5]);
Compare the 2 Gbps Output of the Rational Model to the Output Obtained by IFFT
Use the ANALYZE method of the RFCKT object and S2TF function to get the frequency response of the circuit at the frequencies in the IFFTFreq vector. By default, the ANALYZE method uses linear interpolation to compute the S-parameters at the frequencies that fall in the frequency range of the given S-parameters. For frequencies above the largest value specified by the object, the ANALYZE method uses the data at the largest specified frequency. For frequencies below the smallest specified frequency, the ANALYZE method uses the data at the smallest specified frequency. Use the IFFT function to compute the impulse response, and the FFTFILT function Signal Processing Toolbox™ to compute the 2 Gbps output signal of the differential circuit. Then, compare it to the output computed using the TIMERESP method for the rational model object that contains the fitting result.
if ~isempty(which('fftfilt')) % Signal Processing Toolbox is available IFFTFreq = ((1:(TotalSampleNumber/2 + 1)) - 1)*(1/SampleTime)/TotalSampl eNumber; analyze(DifferentialCkt, IFFTFreq); LinearInterpResp = s2tf(DifferentialCkt.AnalyzedResult.S_Parameters); TempResp((length(LinearInterpResp)-1):-1:1) = conj(LinearInterpResp(2:en d)); TempResp((length(LinearInterpResp)):1:(2*length(LinearInterpResp)-2)) = ... LinearInterpResp(1:end-1); IFFTImpulseResp = ifft(fftshift(TempResp(:)), 'symmetric')/SampleTime; IFFTOutputSignal = SampleTime * fftfilt(IFFTImpulseResp',InputSignal); plot(InputTime(1:TotalPlotPoints)*1e9, IFFTOutputSignal(1:TotalPlotPoint s), ... 'r', OutputTime(1:TotalPlotPoints)*1e9, OutputSignal(1:TotalPlotPoin ts), ... 'b--', 'LineWidth', 2); xlabel('Time (ns)'); ylabel('Signals'); legend('IFFT Result', 'Rational Fitting'); title('Differential Output', 'fonts', 12); ylabel('Output signal'); xlabel('Time (ns)'); axis([-inf,inf,-1.5,1.5]); end
Plot the Eye Diagram of the 2 Gbps Output Signal
Estimate and remove the delay from the output signal and create an eye diagram by using Communications Toolbox™ functions.
if ~isempty(which('commscope.eyediagram')) % Communications Toolbox is avail able if exist('eyedi', 'var'); close(eyedi); end; eyedi = commscope.eyediagram('SamplingFrequency', 1./SampleTime, ... 'SamplesPerSymbol', OverSamplingFactor, 'OperationMode', 'Real Signal'); % Update the eye diagram object with the transmitted signal EstimatedDelay = floor(RationalFuncModel.Delay/SampleTime); eyedi.update(OutputSignal(EstimatedDelay+1:end)); end
Calculate and Plot the Differential TDR and TDT Waveforms of the 2 Gbps Signal
The TDR waveform is the reflected wave as a function of time. The TDT waveform is the transmitted wave as a function of time. Compute these waveforms using the same process that was used to compute the output signal in the previous sections of the demo.
msgid = 'rf:rationalfit:ErrorToleranceNotMet'; warning('off', msgid); TDRRationalModel = rationalfit(Freq, S11, FittingTolerance); warning('on', m sgid); InputSignal = ones(1,TotalSampleNumber)'; [TDRSignal, OutputTime1] = timeresp(TDRRationalModel,InputSignal,SampleTime) ; fig2 = figure; subplot(2,1,1); plot(OutputTime1(1:TotalPlotPoints)*1e9, ... TDRSignal(1:TotalPlotPoints), 'LineWidth', 2); ylabel('TDR Waveform'); xlabel('Time (ns)'); TDTRationalModel = rationalfit(Freq, S21, FittingTolerance, Weight, DelayFac tor); [TDTSignal, OutputTime2] = timeresp(TDTRationalModel,InputSignal,SampleTime) ; TDTSignal = timeresp(TDTRationalModel,InputSignal,SampleTime); subplot(2,1,2); plot(OutputTime2(1:TotalPlotPoints)*1e9, ... TDTSignal(1:TotalPlotPoints), 'LineWidth', 2); ylabel('TDT Waveform'); xlabel('Time (ns)');
if exist('eyedi', 'var'); close(eyedi); end; close(fig); close (fig2);
Store