This is data processing framework (python files/modules), built as semi-independent part of the SQDToolz stack. Internally it uses Numpy
and Scipy
for processing data on CPU and Cupy
based on NVIDIA-CUDA for gpu processing. The input data follows a particular format as defined in Data format guide.
Data processing follows pipeline processing fashion and overall processor is to used as follows:
Remainder of this Document has the following outline:
Quick Start Guide also contains steps to creating processor object and binding it to lab.
General syntax:
<proc_obj> = <pkg_obj>.ProcessorCPU('<proc_name>', <lab_obj>)
Example:
myProc = stz.ProcessorCPU('ddcInteg', lab)
It is a good idea to reset the processor object by using this function so it does not retain any previous processing stage from previous runs.
General Syntax
<proc_obj>.reset_pipeline()
Example:
myProc.reset_pipeline()
These stage are python modules located at : sqdtoolz/sqdtoolz/HAL/Processors/Processor-X
, where X is CPU or GPU depending on the device you would like to use. WARNING(!): These stage CANNOT be inter-mixed. CPU Processor, requires adding ONLY CPU processing stage, using it with a GPU processor might cause the notebook or system CRASH.
General Syntax
from sqdtoolz.HAL.Processors.<proc_type>.<proc_type>_<stage_name> import*
Example:
from sqdtoolz.HAL.Processors.CPU.CPU_DDC import*
from sqdtoolz.HAL.Processors.CPU.CPU_FIR import*
from sqdtoolz.HAL.Processors.CPU.CPU_Mean import*
General Syntax:
<proc_obj>.add_stage( <pkg_obj>.<proc_type>_<stage_name>( <stage_params> ) )
Example:
myProc.add_stage(stz.CPU_DDC([25e6]))
myProc.add_stage(stz.CPU_FIR([{'Type' : 'low', 'Taps' : 128, 'fc' : 5e6, 'Win' : 'hamming'}]*2))
myProc.add_stage(stz.CPU_Mean('sample'))
myProc.add_stage(stz.CPU_Mean('segment'))
This is nothing special ,but demarkates the end of processing pipeline, hence is added via a different function as follows:
General Syntax:
<proc_obj>.add_stage_end( <pkg_obj>.<proc_type>_<stage_name>( <stage_params> ) )
Example:
myProc.add_stage_end(stz.CPU_Mean('repetition'))
The acqusition hal object, needs this processor object for processing the raw data coming from acqusition device. This object is passed as follows:
General syntax
<lab_obj>.HAL('<acq_hal_name>')..set_data_processor(<proc_obj>)
Example:
lab.HAL("DigiC").set_data_processor(myProc)
List of frequencies, corresponding to each channel of the acqusition device.
stz.CPU_DDC([25e6])
Tuple of IQ indices.
stz.CPU_ESD((0,1))
Tuple of IQ indices.
stz.CPU_FFT((0,1))
#### FIR Following are the optionals that are to passed as dictionary per channel (might have to create 2 list each belonging one sepeart channel:
stz.CPU_FIR([{'Type' : 'low', 'Taps' : 128, 'fc' : 5e6, 'Win' : 'hamming'}]*2)
Name of parameter accross which it sums:
stz.CPU_Integrate("segments")
Name of parameter accross which it find the max element:
stz.CPU_Max("segments")
Name of parameter accross which to calculate the mean:
CPU_Mean('segment')
This completed the Processor object documentation.