complex_midi.h

00001 /**********************************************************
00002 ***********************************************************
00003 *               European Southern Observatory
00004 *            VLTI MIDI Data Reduction Software
00005 *
00006 * Module name:  complex.h
00007 * Description:  
00008 *
00009 *
00010 * History:      
00011 * 03-Feb-03     (jmeisner) Created
00012 * 03-Mar-03     (csabet) Added title, directives and included in the MIDI pipeline
00013 ***********************************************************
00014 **********************************************************/
00015 #ifndef _COMPLEX_H_MIDI
00016 #define _COMPLEX_H_MIDI
00017 
00018 /**********************************************************
00019 *   Include files
00020 **********************************************************/
00021 
00022 /**********************************************************
00023 *   Constant definitions
00024 **********************************************************/
00025 
00026 /**********************************************************
00027 *   Global Variables 
00028 **********************************************************/
00029 
00030 /**********************************************************
00031 *   Type definitions 
00032 **********************************************************/
00033 struct Complex
00034 {
00035     float   r, i;
00036 };
00037 
00038 extern struct Complex   Czero;  //  CONSTANT for use by apps. DO NOT CHANGE IT, EVER!!!
00039 
00040 /**********************************************************
00041 *   Macro Definitions
00042 **********************************************************/
00043 #define MAKEC(real, imag, result)  {result.r = real; result.i = imag;}
00044 #define SETTOCONJ(dest, source) {dest.r = source.r;  dest.i = -source.i;}
00045 
00046 /**********************************************************
00047 *   Function Prototypes
00048 **********************************************************/
00049 struct Complex Addc(struct Complex, struct Complex);
00050 struct Complex Subtractc(struct Complex, struct Complex);
00051 struct Complex Multiplyc(struct Complex z1, struct Complex z2);
00052 struct Complex Dividec(struct Complex z1, struct Complex z2);
00053 
00054 //  Same as above but use pointers:
00055 void AddCptr(struct Complex *result, struct Complex *z1, struct Complex *z2);
00056 void SubtractCptr(struct Complex *result, struct Complex *z1, struct Complex *z2);
00057 void MultiplyCptr(struct Complex *result, struct Complex *z1, struct Complex *z2);
00058 void MultiplyConjPtr(struct Complex *result, struct Complex *z1, struct Complex *z2);
00059 
00060 struct Complex Scalec(struct Complex z, float scale);
00061 struct Complex Unitc(struct Complex z);
00062 float  Cmag(struct Complex);
00063 float Cmag2(struct Complex);
00064 void GetEtoJtimes(float, struct Complex *);
00065 void GetScaledEtoJtimes(float Angle, struct Complex *Result, float scale);
00066 void RotateBy(float, struct Complex *);
00067 
00068 //  New Nov 9, 1999:
00069 //  Returns a positive real part, if 0 then returns neg imag part.
00070 struct Complex Csqrt(struct Complex);
00071 void GetExpc(struct Complex *Result, struct Complex z);
00072 struct Complex jtimes(struct Complex z);
00073 
00074 //  Richard added on these
00075 void printC(struct Complex z);
00076 float Arg(struct Complex z);
00077 
00078 /*********************************************************/
00079 #endif
00080 /*********************************************************/

Generated on 11 Feb 2011 for MIDI Pipeline Reference Manual by  doxygen 1.6.1