ENGLISH 简体中文 日本語 한국어  


애플리케이션 노트  3557

"스티치(Stitch)"로 로직 분석기 메모리 한계를 뛰어 넘으십시오

개요: MATLAB?은 ADC 출력에서 획득한 데이터를 신속하게 분석하기 위해 사용될 수 있는 강력한 툴이다. 이 애플리케이션 노트는 로직 분석기의 메모리 깊이의 한계를 벗어나기 위해 MATLAB를 사용하는 방법에 대해 기술하고자 한다. 세 가지의 코드 스위칭 방법(베이직, 어드밴스트, 리버스: basic, advanced, reverse)을 소개하고 비교해 보고자 한다. 세가지 방법에 대한 결과도 제시된다.

서론

고속 ADC를 특성화시키는 작업은 디지털 출력 코드를 포착해 분석하는 것을 요구한다. 로직 분석기의 메모리 깊이에 대한 한계는 고해상도 FFT 또는 정확한 INL/DNL 그래프의 표시를 만들기 위한 충분한 데이터 포인트 포착을 방해한다. 이런 문제를 해결하는 손쉬운 방법은 MATLAB과 같은 수학적 도구로 여러 개의 데이터를 연결시키는 것이다 (그림 1). 데이터를 연결시키는 데 있어 방해가 되는 한 가지 요소는 대량의 불연속성이 발생한다는 것이다. 이것은 종종 두 데이터 세트 사이의 한 지점에서 발생한다. 불연속성이 INL/DNL 그래프에 대해 별 차이점을 만들지 않는 반면, 고해상도 FFT에는 엄청난 피해를 입힐 것이다 (그림 2).

그림 1. 연결된 데이터는 두 데이터 세트 간의 불연속성을 나타낸다.
그림 1. 연결된 데이터는 두 데이터 세트 간의 불연속성을 나타낸다.

그림 2. a) 캡처되어 분석된 하나의 16384포인트 데이터 세트; b) 2개의 8192포인트 데이터 셋트가 캡처되어 연결 및 분석됨. 스티칭 기법
그림 2. a) 캡처되어 분석된 하나의 16384포인트 데이터 세트; b) 2개의 8192포인트 데이터 셋트가 캡처되어 연결 및 분석됨. 스티칭 기법

각 데이터 세트에 있는 동일 그룹의 점들을 찾아 (일반적으로 3개 또는 4개) 이러한 점들에서 2개의 데이터 세트를 같이 '스티칭'하게 되면 불연속성을 제거할 수 있다 (그림 3). 스티칭을 수행하는 가장 쉬운 방법은 1차 데이터 세트에서 마지막 4개 점을 기록한 다음 2차 데이터 세트에 있는 동일한 세트의 점들을 찾는 것이다. 2차 데이터 세트에서 이 지점들은 '스티치 포인트'로 불린다. 스티치 포인트들의 앞에 위치하는 2차 데이터 세트의 다른 데이터는 버려진다: 2차 데이터 세트의 남아있는 부분들은 최초의 것과 붙인다. 이 기법을 베이직 코드 스티칭(Basic Code Stitching)이라 하고, 구현하기에 매우 단순하며 MATLAB에서 빠르게 실행된다.

그림 3. 베이직 코드 스티칭을 통한 최종
그림 3. 베이직 코드 스티칭을 통한 최종 "스티치" 매트릭스의 결과.

베이직 코드 스티칭을 통해, 때때로 2차 데이터 세트의 최고 절반은 1차 데이터 세트의 마지막 4개의 점을 매치시키는 포인트 세트를 찾기 위해 버려져야 한다. 양자 택일로, 1차 데이터 세트의 말단 부분에 있는 몇 개의 샘플을 버리는 것은 2차 데이터 세트의 처음에서 스티치 포인트를 찾는데 도움이 된다 (그림 4). 그러나 1차 데이터 세트의 말단 부분과 2차 데이터 세트의 앞 부분에서 매치되어 버려지는 샘플을 찾는 작업은 실현하기 어려울 수 있다. 이 과정을 어드밴스트 코드 스티칭(Advanced Code Stitching)이라고 한다. 대량의 데이터 세트를 생산하는 이상적인 스티칭 포인트를 찾는 것은 신중한 계획과 프로그래밍 기술이 필요하다. 그러나 적절하게 실현된다면 어드밴스트 코드 스티칭은 일반적으로 최종 데이터 세트를 생산해 낼 때 2개의 소형 데이터 세트 합계의 적어도 90%를 달성한다.

그림 4. 어드밴스트 코드 스티칭은 최종
그림 4. 어드밴스트 코드 스티칭은 최종 "스티치" 매트릭의 결과를 가져오는 이상적인 스티치 포인트를 찾는다.

1차 데이터 세트 (매트릭스 A)의 앞 부분에 2차 데이터 세트 (매트릭스 B)를 스티칭 하는 것을 리버스 코드 스티칭(Reverse Code Stitching)이라 하고 대용량 데이터 세트의 결과를 가져 올 수 있다 (그림 5). 그러나 이 기법은 프로세싱 시간을 두 배로 만든다. 그 이유는 데이터 세트 A가 데이터 세트 B를 선행할 때와 데이터 세트 A가 데이터 세트 B를 뒤따를 때 스티치 포인트를 찾아야만 하기 때문이다. 또한 리버스 코드 스티칭은 일반적으로 다른 스티칭 기법과 결합되었을 때 최소의 이득을 생산한다. 결과적으로, 리버스 코드 스티칭을 위해 필요한 처리 시간이 실질적으로 증가하고 있기 때문에, 추가적인 코드 이득은 더 느린 PC 상에서는 정당화 될 수 없을 수 있다. 표 1은 3가지의 코드 스티칭 방법을 자세하게 비교한 내용이다.

그림 5. 리버스 코드 스티칭은 처리 시간이 2배이고, 종종 최소의 코드 이득을 실현시킨다.
그림 5. 리버스 코드 스티칭은 처리 시간이 2배이고, 종종 최소의 코드 이득을 실현시킨다.

표 1. 스티치 기법 비교 표*
Stitch Technique Size of Final Data Set Description
Data Set Numbers # of codes
(averaged)
% of two data sets
(averaged)
1 + 2 3 + 4 1 + 4
Concatenate† N/A 16384 100% Will produce erroneous FFT; however, INL/DNL can be extracted from this data.
Basic 11060 8192‡ 14384 11212 68.4% FFT is useable for calculating figures of merit.
Reverse 11060 8192‡ 14384 11212 68.4%
Advanced 13790 16046 16022 15286 93.3%
Advanced
+
Reverse
15427 16176 16022 15875 96.9%

* 2개의 8K (8192 코드) 데이터 세트는 위에서 설명된 기법을 사용해 스티치되었다. 정확도를 보장하기 위해, 이 테스트는 8192포인트 데이터 세트 4개를 사용해 3번 반복되었다 (1에서 4로 불림). 각 테스트에서 합성 데이터는 평균값이며 테스트 데이터의 오른쪽에 표시된다.
† 연결은 100%의 이용 가능한 데이터를 항상 생산한다.
‡ 데이터 세트를 함께 스티치 할 수 없다.

MATLAB 기능 설명

첨부된 MATLAB 코드(부록 A와 B에 각각 소개된 StitchMatrices 및 FindStitchPoint)는 위의 주제들을 한 가지의 사용하기 쉬운 기능으로 결합시켰다. 이러한 기능은 어드밴스드/리버스 코드 스티칭 특징을 가능하게 하는 2개의 데이터 세트(MATLAB의 단일 컬럼 매트릭스)와 여러 입력 변수를 수용한다. FindStitchPoint 루틴은 데이터 세트 A와 B의 오프셋을 설정한다. StitchMatrices 루틴은 FindStitchPoint 루틴에서의 오프셋을 이용해 데이터 세트 A와 B를 함께 결합시킨다. 게다가, 최종 데이터 세트의 스티치 포인트는 포스트 프로세싱을 위해 PrevStitchBins 매트릭스로 기록된다. 복수 데이터 세트로 함께 스티치 되었을 때, PrevStitchBins는 이전의 스티치 포인트의 위치를 보존한다.

결론

2개의 데이터 세트를 스티치하는 것은 만족스러운 결과를 생산해 낼 수 있다. 그림 6은 위에서 기술된 스티칭 기법을 이용해 스티치된 3개의 8192포인트 데이터 세트(5개의 스티치 포인트가 사용됨)의 FFT 구성을 보여준다. 그 결과 FFT는 위의 그림 2a에서 보이는 16384포인트 연속 데이터 세트와 거의 동일하다.

그림 6. 스티칭 코드가 정확한 FFT 구성을 만든다.
그림 6. 스티칭 코드가 정확한 FFT 구성을 만든다.

부록 A: StitchMatrices 루틴 (StitchMatrices.m)

function [StitchedMatrix, StitchBins] = StitchMatrices(MatrixA, ...
   				MatrixB, StitchNumber, PrevStitchBins, ...
				AdvCodeStitchEnabled, ReverseStitchEnabled);
%Stitch Matrices Function
%Revision 1.0
%
%By Donald Schelle, May 2005
%Maxim Integrated Products
%120 San Gabriel Drive
%Sunnyvale, CA, 94086
%
%This function will take two matrices (MatrixA and MatrixB), find a 
%given number (StitchNumber) of identical points in each and 
%concatenate the two matrices into one.
%
%Inputs = MatrixA, MatrixB (Data Matrices)
%		    StitchNumber (Number of points to match)
%			 PrevStitchBins (Bins of Previous Stitches in MatrixA)
%			 AdvStitchEnabled (0 = NO, 1 = YES)
%			 ReverseStitchEnabled (0 = NO, 1 = YES)
%Output = StitchedMatrix (MatrixA + MatrixB)
%			 StitchBins (bins of StitchedMatrix where the two 
%						    matrices were joined.)
%
%If the matrices can not be joined the function will output a NaN
%for both the StitchedMatrix variable and the StitchBins variable
%--------------------------------------------------------------------------

%Check to see that there are at least TWO StitchNumber Points
if StitchNumber < 2,
   %Requested less than 2 stitch points
   StitchedMatrix = NaN;
   StitchBins = NaN;
   return;
end;

%Calculate Size of MatrixA and MatrixB
[SizeA, Junk] = size(MatrixA);
[SizeB, Junk] = size(MatrixB);

%Find the Stitch Points in MatrixB
[NormalA, NormalB] = FindStitchPoint(MatrixA, MatrixB, ...
   					StitchNumber, AdvCodeStitchEnabled);
%Calculate the size of the NormalStitched Matrix
NormalStitchedSize = NormalA + SizeB - NormalB + 1;
                            
%Check to see if the reverse function is enabled
if ReverseStitchEnabled == 1,
   %Find Stitch Points for Reverse Matrices
   [ReverseB, ReverseA] = FindStitchPoint(MatrixB, MatrixA, ...
      					StitchNumber, AdvCodeStitchEnabled);
   %Calculate the size of the Revered Stitched Matrix
   ReverseStitchedSize = ReverseB + SizeA - ReverseA + 1;
else
   %Set Values to defaults
   ReverseStitchedSize = NaN;		%MatrixB/A Stitch Size
   ReverseA = NaN;
   ReverseB = NaN;
end;

%Check to if it's possible to stitch two matrices
if isnan(NormalStitchedSize) & isnan(ReverseStitchedSize) == 1,
   %The two matrices could not be stitched
   StitchedMatrix = NaN;
   StitchBins = NaN;
   return;
end;

%--------------------- Normal Matrix Stitching Routine ---------------
if (NormalStitchedSize >= ReverseStitchedSize)| ...
   			isnan(ReverseStitchedSize) == 1,
   %Stitch MatrixB to the end of MatrixA
   StitchedMatrix = cat(1, MatrixA(1:NormalA), MatrixB(NormalB:SizeB));
   
   %Update Stitch Bins
   if isnan(PrevStitchBins) == 1,
      %There are no previous stitch bins
      StitchBins = [NormalA, NormalA + StitchNumber - 1];
   else
      %There are previous stitch bins
      %Check for Snipped Stitches
      [SizeStitchBins, Junk] = size(PrevStitchBins);
      
      while (PrevStitchBins(SizeStitchBins, 2) > (NormalA - 1)),
         %Second Bin is snipped from matrix. Check if first bin is snipped.
         if (PrevStitchBins(SizeStitchBins, 1) > (NormalA - 1)),
            %First Bin is snipped too. Delete Bin Pair
            PrevStitchBins = PrevStitchBins(1:(SizeStitchBins-1),:);
         else
            %First Bin is not snipped but second bin is snipped
            %Shrink Stitch Size
            PrevStitchBins(SizeStitchBins, 2) = NormalA - 1;
         end;
         
         %Calculate size of new PrevStitchBin Matrix
         [SizeStitchBins, Junk] = size(PrevStitchBins);
      end;
               
      %Insert New StitchBins      
      [SizeStitchBins, Junk] = size(PrevStitchBins);
      StitchBins = PrevStitchBins;
      StitchBins(SizeStitchBins + 1, :) = ...
      [NormalA, NormalA + StitchNumber - 1];
      
      %Check to see if the last two stitches need to be combined
      [SizeStitchBins, Junk] = size(StitchBins);
      if StitchBins(SizeStitchBins,1) == ...
            (StitchBins((SizeStitchBins - 1),2) + 1),
         %Combine Stitches
         StitchBins((SizeStitchBins - 1),2) = StitchBins((SizeStitchBins),2);
         %Shorten StitchBin Matrix
         StitchBins = StitchBins(1:(SizeStitchBins - 1),:);
      end;
      
   end;   
end;


%--------------------- Reverse Matrix Stitching Routine ---------------
if (ReverseStitchedSize >= NormalStitchedSize)| ...
   			isnan(NormalStitchedSize) == 1,
   %Stitch MatrixA to the end of MatrixB
   StitchedMatrix = cat(1,MatrixB(1:ReverseB), MatrixA(ReverseA:SizeA));
   
   %Update Stitch Bins
   if isnan(PrevStitchBins) == 1,
      %There are no previous stitch bins
      StitchBins = [ReverseB, ReverseB + StitchNumber - 1];
   else
      %There are previous stitch bins
      %Check for Snipped Stitches            
      while (PrevStitchBins(1,1) < (ReverseA + StitchNumber - 1)),
         %First Bin is snipped from matrix. Check if second is snipped
         if (PrevStitchBins(1,2) < (ReverseA + StitchNumber - 1)),
            %Second Bin is snipped too. Delete Bad Pair
            [SizeStitchBins, Junk] = size(PrevStitchBins);
      	     PrevStitchBins = PrevStitchBins(2:SizeStitchBins, :);
         else
            %Second Bin is not snipped, but first bin is snipped
            %Shrink Old Stitch Size
            PrevStitchBins(1,1) = ReverseA + StitchNumber - 1;
         end;
      end;
      
      %Offset Stitch Bins by inserted amount
      StitchBins = PrevStitchBins + ReverseB - ReverseA + 1; 
      %Make Room for new StitchBins
      [SizeStitchBins, Junk] = size(PrevStitchBins);
      StitchBins(2:SizeStitchBins+1, :) = StitchBins;
      %Insert New Stitch Bins
      StitchBins(1,:) = [ReverseB, ReverseB + StitchNumber - 1];
                  
      %Combine close stitches
      if StitchBins(1,2) == StitchBins(2,1) - 1,
         %Combine Stitches
         StitchBins(2,1) = StitchBins(1,1);
         %Shrink Stitch Bins Matrix
	 [SizeStitchBins, Junk] = size(StitchBins);
         StitchBins = StitchBins(2:SizeStitchBins,:);   
      end;
      
   end;
end;
부록 B: FindStitchPoint 루틴 (FindStitchPoint.m)
function [OutputBinA, OutputBinB]=FindStitchPoint(MatrixA, MatrixB, ...
   				MatchNumber, AdvancedStitchFindEnabled)
%Find Stitch Points Function
%Revision 1.0
%
%By Donald Schelle, May 2005
%Maxim Integrated Products
%120 San Gabriel Drive
%Sunnyvale, CA, 94086
%
%This function will find the IDEAL stitch point in Matrix B given
%the number of data points to match
%
%Inputs = MatrixA
%			 MatrixB
%			 Number of Records to Match
%			 Advanced Stitch Find Enabled (0 = NO, 1 = YES)
%Output = (OutputBinA) End Bin of MatrixA to stitch data
%			 (OutputBinB) Start Bin of Matrix B to stitch data
%
%If no bins are found, the function will output a NaN
%--------------------------------------------------------------------------

%Do argument error checking to see if there is enough arguments
if nargin < 2,
   %The user has not supplied enough arguments
   disp('Function requires TWO Matrices');
   OutputBinA = NaN;
   OutputBinB = NaN;
   return;
elseif nargin < 3,
   disp('Select a number of points to match');
   OutputBinA = NaN;
   OutputBinB = NaN;
   return;
elseif nargin == 3,
   %Advanced code stitching is NOT enabled
   OutputBinA = NaN;
   AdvancedStitchFindEnabled=0;
end;

%Ensure that Matrix A and B are single ROW matrices
[row col] = size(MatrixA);
if row > col, MatrixA = MatrixA'; end;
[row col] = size(MatrixB);
if row > col, MatrixB = MatrixB'; end;

%Determine Size of Matrices
[Junk, SizeA] = size(MatrixA);
[Junk, SizeB] = size(MatrixB);

%Initialize OutputBinB to NaN (which means that NO stitch points are found)
OutputBinB = NaN;
%Set initial size of BinA
BinA = SizeA - MatchNumber + 1;
%Initialize BinStop Variable
BinStop = SizeA-100;

%Loop to search through Matrix B numerous times.  This loop is only
%excuted once if Advanced Stitch Find is disabled.  The loop will stop when
%the 'ideal' stitch point is found
while BinA > BinStop, 
   %Stuff the Match Numbers into a separate Matrix
	MatchMatrix = MatrixA(BinA:BinA+MatchNumber - 1);
   
   %Find all bins in MatrixB that match the first number of the Match Matrix
	MatchedBins = find(MatrixB == MatchMatrix(1));
   
   %Compare the 2nd through nth number of the Match Matrix with the
   %prospective series of numbers in MatrixB
   
   %Calculate the size of the Matched Bins Matrix
   [Junk, SizeMatchedBins] = size(MatchedBins);
   
   %The advanced stitch mode optimizes search time by eliminating
   %bad stitch points that would result in the final concatenated
   %matrix being smaller than the last set of stitch points
   if isnan(OutputBinB) == 0,
      %A Stitch Point exists from a previous run.  Elimiate bad stitch points
      %Calculate critical Stitch Point
      MatrixSize = OutputBinA + (SizeB-OutputBinB) + 1;
      CriticalBin = BinA + SizeB - MatrixSize - 1;
      %Find maximum number in the MatchMatrix
      BadBin = find(MatchedBins > CriticalBin);
      %Eliminate Bad Bins (if there are any)
      if isempty(BadBin) == 0,
         MatchedBins = MatchedBins(1:BadBin(1) - 1);
      end;
      %Calculate size of new Matched Bins Matrix
      [Junk, SizeMatchedBins] = size(MatchedBins);       
   end;
   
   %loop to cycle through initial matched bins
   for i=1:SizeMatchedBins,
      %Check to make sure that there isn't a MatrixB overrun
      if (MatchedBins(i) + MatchNumber - 1) > SizeB,
         break;
      end;
      
      %Assume that next few codes will match and set StitchBinGood = true
      StitchBinGood = 1;	   
      %Initialize MatchMatrixCounter
      Count = 1;
      %Cycle through MatrixB and compare Numbers with the MatchMatrix
      for j=MatchedBins(i):(MatchedBins(i) + MatchNumber - 1),
         if MatchMatrix(Count)==MatrixB(j),
            %Number is good, continue and check next number
	     Count = Count + 1;
	 else
            %Number is bad, break loop and try next sequence
            StitchBinGood = 0;
	     break;
	 end;
      end;
	   
      if StitchBinGood == 1,
         %The optimal (first) stitch has been found
         %Record the End bin of MatrixA
         %Record the Start bin of MatrixB
         OutputBinA = BinA;
         OutputBinB = MatchedBins(i) + 1;
         %Calculate the size of the joined Matrix and a new BinStop#
         BinStop = OutputBinA-OutputBinB+1;
         break;
      end;  
   end;
   
   if AdvancedStitchFindEnabled == 1,
      %Advanced Stitch Find is enabled and we should make a new match
      %matrix and search for these numbers
      BinA = BinA - 1;
   else
      %Advanced Stitch Find is disabled and we should end the loop
      break;
   end;
end;

%Check to see if NO Bins Matched
if isnan(OutputBinB) == 1,
   %NO Bins matched
   OutputBinA = NaN;
end;


의견을 보내주세요!
위 내용이 도움이 되셨나요?
여러분의 의견을 기다립니다 — Maxim은 보내주신 정정이나 제안사항을 반영하고 있습니다. 이 페이지를 평가하고 의견을 보내주십시오.


자동 업데이트
관심있는 분야의 애플리케이션 노트가 나올 때 자동으로 업데이트 받고 싶으세요? 그렇다면 EE-Mail™을 신청하십시오.



추가 정보  APP 3557: Apr 18, 2006
MAX1121 광대역 애플리케이션을 위한 LVDS 출력을 갖춘 1.8V, 8비트, 250Msps ADC 전체 데이터 시트
(PDF, 440kB)
MAX1122 1.8V, 10비트, 광대역 애플리케이션을 위한 LVDS 출력을 갖춘 170Msps ADC 전체 데이터 시트
(PDF, 448kB)
MAX1123 1.8V, 10비트, 광대역 애플리케이션을 위한 LVDS 출력을 갖춘 210Msps ADC 전체 데이터 시트
(PDF, 448kB)
MAX1124 1.8V, 10비트, 광대역 애플리케이션을 위한 LVDS 출력을 갖춘 250Msps ADC 전체 데이터 시트
(PDF, 448kB)
MAX1213 광대역 애플리케이션용 1.8V, 12비트, 170Msps ADC 전체 데이터 시트
(PDF, 324kB)
MAX1214 광대역 애플리케이션용 1.8V, 12비트, 210Msps ADC 전체 데이터 시트
(PDF, 324kB)
MAX1215 광대역 애플리케이션용 1.8V, 12비트, 250Msps ADC 전체 데이터 시트
(PDF, 332kB)
MAX19541 CMOS 출력을 갖는 광대역 애플리케이션용 12비트, 125Msps ADC 전체 데이터 시트
(PDF, 296kB)
MAX19542 CMOS 출력을 갖는 광대역 애플리케이션용 12비트, 170Msps ADC 전체 데이터 시트
(PDF, 520kB)
 

다운로드, PDF 형식다운로드, PDF 형식 (186kB)
 AN3557, AN 3557, APP3557, Appnote3557, Appnote 3557



         


      개인정보보호 정책    법적 고지

      Copyright © 2008 by Maxim Integrated Products, Dallas Semiconductor