Functions

 Windows based Signal Analysis and Test System (WinSATS) is written in Visual C ++ and Visual C#. Functions that are native to WinSATS are dynamic link library (dll) files. The C++ ones can be called from other signal processing packages such as Matlab and in effect can provide new toolboxes. The C# dll files can be integrated into Labview each as a virtual instrument.

WinSATS dll command line formatting. < > is replaced by text and the angle brackets < > are removed. Each region of the command line is delimited by a space and flags are identified by a preceding minus sign -. Filenames must have the full path included in the name.
Flags precede filenames but do not need to be in any particular order. If filenames are not preceded by a flag then the order of the filenames is significant. Usually the first DIF file is an input and the second is an output.

Each dll sends the usage text into the buffer s_error if the command line text has errors and this must be handled by the .net interface

General format of text for a command line

<Dllname> -<flag1><flag1text> -<flag2><flag2text> <etc> <filename1> <filename2> <etc>

Example

fftfilt –r1000 -n5000 c:\test\inputdif.fft c:\test\outputdif.fft

reads data in the DIF FFT file inputdif.fft and generates a new DIF FFT file outputdif.fft with the component at 1000 Hz removed and also all components above 5000 Hz.

 

SATS can directly execute user defined and Windows and DOS shell commands . These commands and their operating modes must be included in the external commands text file. External commands are configurable by the user to include all the data processing commands

WinSATS functions are selected using drop down menus. Entering information in the boxes provides the details required to run a function macro file. These macro files can also be run without using the menus.   

 

Function macro examples

 

UPSAMPLE

upsample -n<x> <DIF input file> <DIF output file>
-n<x> upsample by x


SIMADC



simadc <-n> <DIF error file> <DIF input file> <DIF output file>
-n<nn> output to nn more bits than input
-d truncate output word with nn bit binary offsets after ADC
default is code values with float offsets
-o<n> offset INL error by n codes
-i ignore data type of DIF input file
-q<n> use n bits to requantise before modelling
-s add INL offsets
default is to subtract


PSRCORRECT

Power series correction using dB or linear coeffients

psrcorrect -n<x> <DIF input file> <DIF output file>
-d<offset> convert coefficients from dB and subtract dB offset from polynomial coefficient
-x<amp> amp is test signal amplitude as coefficient
-s(,t,f,F,S,v,e,n,T)<x> select second to tenth order coefficient

OSPROC

Time averaging interpolation of a DAC or AWG

osproc <-n> <DIF input file> <DIF output file>
-o<number> oversampling ratio in octaves/bits
-i<string> table ident string is the internal index in the look up table file
-n<bits> DAC output word length in bits
-g<file> DIF file for interpolation result
-d<file> Oversampling matrix data:look-up table file
-r keep original FSR
-s<number> Interpolation amplitude
default is 1.0 LSB


IFFT



ifft <flags> <DIF input names> <DIF output names>
NB first two files must be input (real) (imaginary)
next files are output real and imaginary
output files created are .ffr (real) and .ffi (imaginary) or .ffc(power spectrum)
-p output magnitude in Real file\n
-s< – Scale result to no bits\n


GENWAVE



genwave [flags] <DIF file>
-f<frequency> Waveform frequency kHz,
-q<frequency> Sampling frequency kHz
-w<wavetype number>
Wavetype number
0, sine,
1, triangle
2, square
3, DC
4, Ramp up
5, Ramp down
6, Pulse,
7 rand11,
8 rand12

-a<amplitude> Maximum amplitude
-l<units> Y units
-L<label> Y label
-U Unipolar wave
-P<degrees> Starting phase
-s<number> Total number of samples
-m<number> Number of MARK samples
-c<cycles> Number of cycles: valid with -q if -f not specified
with PRBS and -k sets base frequency to -q/cycles
-n<resolution> Resolution in bits of output
-r<fsr> Fix full scale range to fsr bits
-O<nn> oversampling factor
-e This allows the waveform to have a non-integer number of cycles(useful for adding ‘leakage’)
-d simulated ADC code output
-o<nn> offset in code value (integer)
-z<n> adjust amplitude by n dB N.B. default is -0.1dB
-k force odd number of cycles
also changes PRBS sampling frequency for synchronous ADC test
-u<n> update system default test frequency n
-1;

HISTGEN
histgen <-n> <DIF input file> <DIF output file>
number of ADC bits is in input file or use
-n<bits> – force number of ADC bits to this value
-s use max an min in data rather than header


HISTCON

histcon <-flag> <DIF input file> <DIF output file>
-v output table of results in output file.tbl
-a include histogram ends
-A<n> assume n : 1 resampling
-e use average of mid range codes to estimate inl confidence limits: default uses estimated pdf of all codes)
-m dnl relative to code centres (IEEE 746-1984)

-r assume ramp test signal: default is sine wave
-k assume locked histogram
-Snn report sampling frequency as nn kHz

HISTACC
histacc <-x> <DIF input file> <DIF output file>
-x – ignore missing number of bits
-R – reset accumulations to 1


PROCFFT

fftproc <-n> [DIF FFT input file]
-v provide results table
-b<n> + – bin range to use for power
default is 4 for Blackman-Harris and Rosen, 2 for Hann and Hamming and 7 for custom
-f<nn> use fundamental of nn kHz
-i<nn> do 3rd order intermod test with higher tone at nn kHz (-f must also be specified)
-I<nn> use second order difference frequency of nn Hz

-C assume complex FFT data
-e include effective bits in table
-r calculate new power values for DIF
-o<n> scale results by n dB
-w do not give aliasing warning
-d<n> zero first n bins in power calculation default is auto-zero of DC\n
-D<string> file description to use
-l<n> use up to the nth harmonic in THD
default is up to 10th harmonic\n
-c<n> ignore harmonics less than the nth one in finding THD
-s<n> ignore harmonics which are
-A<n> assume data is resampled by n:1 // also sets aliased flag for funamdntal
-H<n> n = 1 find even THD, n = 2 find odd THD
-S assume data is from a spectrum analyser more than n dB below FSR(default is 100 dB)
-x print difference between total power and fundamental power
-u<nn> limit calculations to DC to nn kHz
-U<nn> limit calculations to nn kHz to upper limit
-T<nn> remove tone at nn KHz from calculations
-p<nn> use nn dB as total power reference
-a<nn> set baseline of display to nn dB
-g give advice on noise level of ideal ADC

DOWNSAMPLE
downsample -n<x> <DIF input file> <DIF output file>

-n<x> downsample by x

DISIM
disim {Flags} {Input data} {Threshold data} {time output}
-i{DIF data file} DIF user supplied input
-t{DIF threshold file} User supplied ADC thresholds (sets -bn)
NB thresholds must have INL of less than 5 lsb
or will not be recognised correctly
default is to generate ideal thresholds
-b{quant_bits} Resolution in bits (Set automatically in -t flag
-o{n} OS ratio (in bits)
-v verbose Print all information
-f{step size in LSB}
-a{Amplitude db’s} Adjust input amplitude in db’s
-A Turn off auto-gain ranging of input data
NB system auto-scales input DIF so amplitude changes ignored
-w<file> output time data file
-z operate with no interpolation


DIFYSCAL
difyscal <-x> <DIF file>
-o don’t change max and min
-d report max and min
-l<n> scale by n
-s<n> scale by n dB
-i<n> scale by 1/n
-r<nn> rescale to data starting at sample nn
-e<nn> rescale ending at sample nn


DIFYOFFS

difyoffs <-x> <DIF file>
-o<nn> offset by nn

DIFXSCAL

difxscal <-x> <DIF file>
-s<n> scale sampling frequency by n
-l<n> scale x axis by n

DIFSUB

difsub <-x> <DIF input file> <DIF input file2><DIF output file>
-x – ignore missing number of bits
-y – ignore missing Ymax or Ymin
-t<dbmin> – threshold for FFT subtraction default -30


DIFQUAN
difquan <-n> <DIF input file> <DIF output file>
Default – number of ADC bits is in input file
-n<bits> – force number of ADC bits to this value
-t – force data to be code type

DIFPSR
difpsr -n<x> <DIF input file> <DIF output file>
-c use neg coefficients
-s<x> x is second order coefficient
-t(f,F,S,v,e,n,T)<x> select third to tenth order coefficent


DIFPOWER

difpower <-flags> <DIF input file>
(s_error, ” -x – ignore missing number of bits
-y – ignore missing Ymax or Ymin
-r<nn> set power reference level to -nn dB rel FSR
-o<nn> subtract offset nn from data in power calculation
-p calculate peak rel to FSR in dB
-f calculate crest factor in dB
-m calculate offset
-c subtract header offset from data in power calculation

DIFMUX
difmux <-x> <DIF input files> <DIF output file>
-c<n> n=2 or 4 channels to mux
default is n = 2
n DIF input files ending 1,2,3,4
-x ignore missing number of bits

DIFMULT
difmult <-x> <DIF input file> <DIF input file> <DIF result file>
-x – ignore missing number of bits
-y – ignore missing Ymax or Ymin
-s – scale to main file y range

DIFMETER
difmeter <-x> <DIF input file> <DIF output file>
-R<nn> use for 0dB
-r – rms result,default is ppm result

DIFMAV
difmav <-n> <DIF input file> <DIF output file>
-n<length> moving average length
-s<length> number of stages
-r rescale output data to input DIF

DIFMAP

difmap <-n> <DIF error file> <DIF input file with non-linear distortion> <DIF output corrected file>
-n<nn> map corrected output to nn more bits than input
-d truncate output word with nn bit binary offsets after mapping
default is code values with float offsets
-o<n> offset DIF input file by n LSB
-N<m> begin using DIF error file at code m
-i ignore data type of DIF input file
-t<n> add n to segement average ILE
before tracking. Default is 0.5 LSB
if -t0 is used: lin correction using INL instead of using segment mapping
-s add map offsets
default is to subtract
-S<n> corect using n segment model(default is 16)
-M (debug) output offsets in offsets.csv

DIFLNR
diflnr <-n> <DIF input file> <DIF output file>
-s<nn> scale offset by nn
-m generate error offset file

-t<nn> use nn as decision threshold

-l limit offset to one threshold

DIFJOIN

difjoin <-x> <DIF input file> <DIF output file>
-x – ignore missing number of bits
-y – ignore missing Ymax or Ymin
-h<nn> Set maximum value to nn
-l<nn> Set minimum value to nn

DIFIIR

difiir <-n> <DIF input file> <DIF output file>
-s<number> number of stages
-n<number> fir impulse response
-r rescale data
-c<file> 5 ceoffs in file per stage

DIFEDIT
difedit <-x> <DIF input file> <DIF output file>
-s<nn> Set start sample number to nn
-n<nn> Set number of samples to extract
-e<nn> Set end number of samples nn to delete
default is rest of file

DIFDEMUX
difdemux <-x> <DIF input file> <DIF output file>
-c<n> n=2 or 4 channels to demux
default is n = 2
creates n DIF output files ending 1,2,3,4
-x ignore missing number of bits
-h<name> use header file names with attributes
.ch1, .ch2 , .ch3, .ch4

DIFCOMB

difcomb <-n> <DIF input file> <DIF output file>
-n<length> comb delay length
-p pass DC

DIFBTOA
difbtoa -h -d <Binary DIF file> [ASCII DIF file]
-h Prints header only
-d Prints data only
-s Prints binary states also
-n Number data values
-W write a WAV file

DIFAV
difav <-x> <DIF input file> <DIF output file>
-x – ignore missing number of bits
-y – ignore missing Ymax or Ymin
-R – reset averages to 1

DIFATOB
difatob -h<head> <ASCII data file> <Binary DIF file>

flags -b Convert data from Unipolar to bipolar
-u Convert data from bipolar to Unipolar
-r<n> Shift data n bits towards LSB direction
-t<n> Ignore first n samples
-T<title> append to title

DIFADD

difadd <-x> <DIF input file>(<second DIF input file>) <DIF output file>
-x – ignore missing number of bits
-y – ignore missing Ymax or Ymin
-u set fundamentals from inputs
NB fund 2 not set in output if only TWO files defined
-Y set Ymax and Ymin from data
-a if two input files not equal,use shorter of two
default is to use first file

DASTODIF

DAStoDIF -h<head> <ASCII data file> <Binary DIF file>
flags -b Convert data from Unipolar to bipolar
-u Convert data from bipolar to Unipolar
-R<n> Shift data n bits towards LSB direction
-T<n> Ignore first n lines of ASCII file)
-C Convert to Complex two columns of ASCII file)
-K Convert to Complex second pair of three columns of ASCII file)
-A Convert Audio Precision .aam file)
-W Convert Microsoft .wav file)
-S Convert Microsoft .wav stereo format file)
-f<frequency> sampling frequency in KHz
-t<frequency> test frequency in kHz
-r<number> DUT serial number
-p<number> DUT part number
-w save changes to header file
-n<samples> number of samples to capture
-m<bits> number of data bits per sample
-P<nn> demultiplex bytes from 16 bit data
n= 1 : use MSB
n= 2 : use LSB
n= 3 : de-mux MSB followed by LSB
n= 4 : de-mux LSB followedby MSB
-B<nn> unpack 4 bit nibbles from byte data
NB only valid with -b option
n= 1: de-mux MS nibble followe by LS nibble
n= 2: de-mux MS nibble followed by LS nibble
-g Convert gray code to twos complement
-h<header file> DIF header file

DACPROC

dacproc <-n> <DIF input file> <DIF output file>
-s<number> DAC output level in dB rel to DAC FSR
-n<bits> DAC resolution in bits
-t<bits> min value of ADC LSB size
divided by DAC LSB size
NB default is 1.0
-r Quantise data to ADC resolution bits
default is to requantise to DAC resolution

CFFT
cfft <flags> <DIF input name> <DIF output name>
NB input files must be .tir(real) and .tii (imaginary)
or only one .tim file
output files created are .ffr (real) and .ffi (imaginary) or .ffc(power spectrum)
-w<n> – Window default is 0: no window with b=0
1 – Hanning
2 – Hamming
3 – Blackman-Harris
4 – Rosenfeld
5 – PTB
-b<n> – Number of bins either side of fundamental
to use in power computation
default is 6 for PTB
default is 4 for Blackman-Harris
3 for Rosenfeld and 1 for others
-p output power spectrum
-s<v> – Scale factor to apply to result
-n<nnn> Use first nnn samples of time file
-c adjust number of samples to a lower
value which is a multiple of 2
-C zero fill and adjust number of samples to a higher
value which is a multiple of 2
-f correct the fundament value if
Rosenfeld window in use

ADCSIM

adcsim {Flags} {Input data} {Threshold data} {Text output} {FFT output}
## Input data type ##
-s{sin_freq} Sinewave (default input)
-g{load} Gausian noise
-i{DIF data file} DIF user supplied input
## Threshold data ##
-t{DIF threshold file} User supplied ADC performance (sets -bn)
## Text output data ##
-1{Text outfile} File name of text output file
-x{DIF outfile} File name of DIF SNR output file
NB used for iterative simulations only
If osb1 = osb2, Contains SNR vs step data
else Contains SNR vs osb data
## FFT mode, output data file ##
-z{DIF spectrum file} DO FFT, file name of FFT output file
## Flags ##
-n{rec_lng} Number of samples
-b{quant_bits} Resolution in bits (Set automatically in -t flag

-p{st_points} Number of increments of P-P interpolation waveform
NB used for iterative simulations only
-d{stepinc} Starting P-P interpolation ramp amplitude in LSB’s
NB used for iterative simulations only
-o{osb1} Start OS ratio (in bits)
NB specify only -o option unless SNR vs osb is needed
-r{osb2} End OS ratio (in bits)
-S eliminate second harmonic from SNR results
-v verbose Print all information
-m monitor… use this all the time
-f{step size} Step size for single pass time or fft output
-a{Amplitude db’s} Amplitude in db’s
-l{Parameter file} Get parameters from file:<osbits p-p amp>
-w<file> put output time data here

ADCERR
adcerr <-r -d> <DIF input file> <DIF output file>
Default – Terminal based Integral non-linearity error (INL)
-a – Absolute INL using DIF header Ymax, Ymin
-l – LSB size fixed by DIF Ymax,Ymin and resolution,otherwise terminal based LSB
-d – Differential non-linearity error (DNL)
-m – use code mid points for DNL (IEEE 746-1984)N.B. the -m option is valid only when used with -d option
-n<nn> start at nn codes from start
-e<nn> finish at nn codes from nd

 

 

Scroll to Top