UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TraceInterp.h
1 /* $Id: TraceInterp.h,v 1.3 2005/03/02 17:34:35 vlad Exp $ */
2 /*
3  Trace interpolation class.
4 */
5 
6 #ifndef __TraceInterp_h
7 
8 #define __TraceInterp_h
9 
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif /* __cplusplus */
14 
15 /* class TraceInterp
16  data are followed;
17 
18  methods:
19  int OpenTrInterp(TraceInterp* pTrI, float Tb, float Te, float dt);
20  -- opens trace interpolator for float trace (Tb; Te; dt);
21  void CloseTraceInterp(TraceInterp TrI);
22  -- closes trace interpolator;
23 
24  void AssignTrForInterp(TraceInterp TrI, float* data);
25  -- reads trace from trace buffer to own buffer and prepares
26  -- trace for interpolation;
27  float GetAmpl(TraceInterp TrI, float t);
28  -- general interpolation function; t {ms};
29  float GetExtremalAmplTI (TraceInterp TrI, ExtremalAmplType eat);
30  -- returns value of amplitude's maximum among absolute, positive
31  -- and negative values;
32 */
33 
34 
35 typedef struct
36 {
37  unsigned int amplCnt;
38  float Tb, Te, dt;
39  float *trData;
42 
44 
45 
46 typedef enum
47 {
48  eatAbsolute,
49  eatPositive,
50  eatNegative
51 
52 } ExtremalAmplType;
53 
54 /* Returns:
55  0 - OK;
56  -1 - bad parameters;
57  -2 - memory allocation fault;
58 */
59 int OpenTraceInterp (TraceInterp* pTrI, float Tb, float Te, float dt);
60 void CloseTraceInterp (TraceInterp TrI);
61 
62 /* Assigns float amplitudes array of fixed size */
63 void AssignTI (TraceInterp TrI, float* data);
64 
65 /* Returns interpolated amplitude value on t time of assigned trace */
66 float GetAmplTI (TraceInterp TrI, float t);
67 
68 /* Returns value of amplitude's maximum among absolute, positive
69  and negative values */
70 float GetExtremalAmplTI (TraceInterp TrI, ExtremalAmplType eat);
71 
72 
73 #ifdef __cplusplus
74 };
75 #endif /* __cplusplus */
76 
77 #endif /* TraceInterp.h */
unsigned int amplCnt
Definition: TraceInterp.h:37
float dt
Definition: TraceInterp.h:38
Definition: TraceInterp.h:35
float * trData
Definition: TraceInterp.h:39