GEO A general purpose C DSP library n
GEO++ A general purpose C++ DSP library n Plan of presentation n n Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame IO, FFT David Churches: Database IO Stas Babak: PSD: GEO++ Code examples R. Balasubramanian: A simple data monitor using GEO++ Feb 20, 2002 Soumya Mohanty, AEI 1
GEO++: What is it? n Digital Signal Processing (DSP) library in C++ n n n Uses: n n Also included: MPI Shell, Frame reader, Database IO Designed for analysis of a large volume of continuous data Implement the DCR algorithm (original motivation) Implement simple data monitors Support Burst and Inspiral searches (mainly IO) Some facts: n n n About 6000 lines of code written & tested. Started Oct 2001 Under CVS control. Documented using DOC++ 4 programmers working part time (weekly teleconferences + a visit). Initially 1 experienced in C++ and C, 2 in C, 1 in Java & C Feb 20, 2002 Soumya Mohanty, AEI 2
OOP Object Oriented Programming: Some terminology Consider the implementation of a filter n n n Input : fixed length sequences state information has to be stored to make the output sequences continuous Options for a procedural code: n n Internal storage inside the function: use static variables several filters cannot be executed using one function external storage means calling code has to manage what should be a hidden detail Feb 20, 2002 Soumya Mohanty, AEI 3
OOP (II) n n n OOP solution : from function to object A filter object can store state info and implement a filter function Several objects of filter class can exist simultaneously each with its own state External code only knows the interface to this object: setting filter coefficients, setting input and output Data hiding more reliability for a client code Other important features in OOP: inheritance, polymorphism Feb 20, 2002 Soumya Mohanty, AEI 4
Design Choices (I) n DSP consists of mapping one matrix into another. A lot of DSP is about designing the right map for a given purpose n n n Discrete Fourier Transform maps one vector to another while preserving size Spectrogram maps a vector to a matrix GEO++ design reflects this notion: n Data container class Matrix n Map classes with Matrices as input/output n Map Design classes such as filter design Feb 20, 2002 Soumya Mohanty, AEI 5
Design Choices (II) GEO++ Data Containers n Essentially one class: Matrix n n n Auxiliary classes : Index. Set, MViewer n n n Intuitive to use Actual code: A=B+C; A=B*C; A=0. 0; A(5, 2)=10. 0; A(I, J)=10. 0; //Multiple rows and columns accessed MViewer object acts as a movable window on a bigger matrix Multiple views can be attached to the same matrix Mixed expressions allowed: C=A+B(I, J); Matrix class is derived from the C++ Standard Template Library (STL) vector class n Advantage: Memory management already taken care of in STL. we did not write a single line of code for this task. Feb 20, 2002 Soumya Mohanty, AEI 6
Design Choices (II) Templates and STL n n n Example: double and float arrays are usually used in the same way but require duplicate code Template class: code written with a placeholder for data type STL: Entirely template based library of fundamental data structures and algorithms. n n Part of ANSI C++ standard STL Algorithms: sort, find, Set operations etc. can be used on Matrix. Thus we already have a lot of basic Matlab functions. Other data containers such as linked lists, stacks, Sets etc. , exist Disadvantage: cannot make a shared object library. Provision exists in ANSI C++ standard. Wait for future compiler versions Feb 20, 2002 Soumya Mohanty, AEI 7
Design Choices (III) Maps (I) n Maps: n n STL already has functions which simply need to be wrapped in a class n n n Filter, FFTFilt, Fast. FT, PSD (Welch & AR), Demod, Modulate, Shift. Samples, Rng. Median, Resampling, Sort. Matrix is an example Sort. Matrix also finds original indices of sorted elements: not in STL sort Interface: common names for public members n n Set. Input, Set. Output, Set. Parameters, Run, Reset Convenient from the user’s point of view Feb 20, 2002 Soumya Mohanty, AEI 8
Design Choices (III) Maps (II) n All maps preserve state n n All maps have default constructors n n STL vector of maps: elegant way to implement a filter bank Uniformly named private members n n n Meant for analyzing data from interferometers continuously Alloc. Internals, Get. State, Store. State, . . . Supports code maintenance To do: n n n Maps should take Map Design objects as arguments FFTFilt could take a type argument that represents different design methods Create Abstract Base classes to derive sets of maps from Feb 20, 2002 Soumya Mohanty, AEI 9
Other GEO++ components n Map Design n n Window Fir. Win: Window based FIR filter design Both are template classes Fir. Win takes Window type as a type argument Frame IO, Database IO, MPI Shell n Following presentations Feb 20, 2002 Soumya Mohanty, AEI 10
Summary n n n GEO++ design choices have proven to be elegant and efficient Great environment for rapid development of C++ DSP codes Future: n n Polish Documentation Add Frame writing and database Input functionality More filter design tools and Integrate LAPACK++ GEO++ will soon be open to all interested users and developers Feb 20, 2002 Soumya Mohanty, AEI 11
- Slides: 11