feb 20, 2002soumya mohanty, aei1 geo++ a general purpose c++ dsp library plan of presentation soumya...

11
Feb 20, 2002 Soumya Mohanty, AEI 1 GEO++ A general purpose C++ DSP library Plan of presentation 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++

Upload: ferdinand-hensley

Post on 31-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 1

GEO++A general purpose C++ DSP library

Plan of presentation 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++

Page 2: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 2

GEO++: What is it? Digital Signal Processing (DSP) library in C++

Also included: MPI Shell, Frame reader, Database IO Designed for analysis of a large volume of continuous data

Uses: Implement the DCR algorithm (original motivation) Implement simple data monitors Support Burst and Inspiral searches (mainly IO)

Some facts: 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

Page 3: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 3

OOPObject Oriented Programming: Some terminology

Consider the implementation of a filter

Input : fixed length sequences state information has to be stored to make the

output sequences continuous Options for a procedural code:

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

1

0

)(

Mm

m

mkkk xwy

Page 4: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 4

OOP (II) 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

Page 5: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 5

Design Choices (I) DSP consists of mapping one matrix into

another. A lot of DSP is about designing the right map for a given purpose Discrete Fourier Transform maps one vector to another while

preserving size Spectrogram maps a vector to a matrix

GEO++ design reflects this notion: Data container class Matrix Map classes with Matrices as input/output Map Design classes such as filter design

Page 6: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 6

Design Choices (II)GEO++ Data Containers

Essentially one class: Matrix Intuitive to use Actual code: A=B+C; A=B*C; A=0.0; A(5,2)=10.0;

Auxiliary classes : IndexSet, MViewer 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 Advantage: Memory management already taken care of in

STL. we did not write a single line of code for this task.

Page 7: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 7

Design Choices (II)Templates and STL

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. 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

Page 8: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 8

Design Choices (III)Maps (I)

Maps: Filter, FFTFilt, FastFT, PSD (Welch & AR), Demod, Modulate,

ShiftSamples, RngMedian, Resampling, SortMatrix

STL already has functions which simply need to be wrapped in a class SortMatrix is an example SortMatrix also finds original indices of sorted elements: not

in STL sort

Interface: common names for public members SetInput, SetOutput, SetParameters, Run, Reset Convenient from the user’s point of view

Page 9: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 9

Design Choices (III)Maps (II)

All maps preserve state Meant for analyzing data from interferometers continuously

All maps have default constructors STL vector of maps: elegant way to implement a filter bank

Uniformly named private members AllocInternals, GetState, StoreState, ... Supports code maintenance

To do: 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

Page 10: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 10

Other GEO++ components Map Design

Window FirWin: Window based FIR filter design Both are template classes FirWin takes Window type as a type argument

Frame IO, Database IO, MPI Shell Following presentations

Page 11: Feb 20, 2002Soumya Mohanty, AEI1 GEO++ A general purpose C++ DSP library Plan of presentation Soumya Mohanty: Overview R. Balasubramanian: MPI Shell, Frame

Feb 20, 2002 Soumya Mohanty, AEI 11

Summary GEO++ design choices have proven to be elegant

and efficient Great environment for rapid development of C++

DSP codes Future:

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