Open source Very Long Baseline Interferometry
OpenVLBI
Macros | Functions

Macros

#define dsp_buffer_stretch(buf, len, _mn, _mx)
 Stretch minimum and maximum values of the input stream. More...
 
#define dsp_buffer_set(buf, len, _val)
 Fill the buffer with the passed value. More...
 
#define dsp_buffer_normalize(buf, len, mn, mx)
 Normalize the input stream to the minimum and maximum values. More...
 
#define dsp_buffer_reverse(buf, len)
 Reverse the order of the buffer elements. More...
 
#define dsp_buffer_swap(in, len)
 Change the in buffer elements endianness. More...
 
#define dsp_buffer_copy(in, out, len)
 Fill the output buffer with the values of the elements of the input stream by casting them to the output buffer element type. More...
 
#define dsp_buffer_copy_stepping(in, out, inlen, outlen, instep, outstep)
 Fill the output buffer with the values of the elements of the input stream by casting them to the output buffer element type. More...
 

Functions

DLL_EXPORT void dsp_buffer_shift (dsp_stream_p stream)
 Shift a stream on each dimension. More...
 
DLL_EXPORT void dsp_buffer_removemean (dsp_stream_p stream)
 Subtract mean from stream. More...
 
DLL_EXPORT void dsp_buffer_max (dsp_stream_p stream, dsp_t *in, int len)
 Subtract elements of one stream from another's. More...
 
DLL_EXPORT void dsp_buffer_min (dsp_stream_p stream, dsp_t *in, int len)
 Sum elements of one stream to another's. More...
 
DLL_EXPORT void dsp_buffer_sub (dsp_stream_p stream, dsp_t *in, int len)
 Subtract elements of one stream from another's. More...
 
DLL_EXPORT void dsp_buffer_sum (dsp_stream_p stream, dsp_t *in, int len)
 Sum elements of one stream to another's. More...
 
DLL_EXPORT void dsp_buffer_div (dsp_stream_p stream, dsp_t *in, int len)
 Divide elements of one stream to another's. More...
 
DLL_EXPORT void dsp_buffer_mul (dsp_stream_p stream, dsp_t *in, int len)
 Multiply elements of one stream to another's. More...
 
DLL_EXPORT void dsp_buffer_pow (dsp_stream_p stream, dsp_t *in, int len)
 Expose elements of one stream to another's. More...
 
DLL_EXPORT void dsp_buffer_log (dsp_stream_p stream, dsp_t *in, int len)
 Logarithm elements of one stream using another's as base. More...
 
DLL_EXPORT void dsp_buffer_sub1 (dsp_stream_p stream, dsp_t val)
 Subtract a value from elements of the input stream. More...
 
DLL_EXPORT void dsp_buffer_1sub (dsp_stream_p stream, dsp_t val)
 Subtract each element of the input stream a value. More...
 
DLL_EXPORT void dsp_buffer_sum1 (dsp_stream_p stream, dsp_t val)
 Sum elements of the input stream to a value. More...
 
DLL_EXPORT void dsp_buffer_div1 (dsp_stream_p stream, double val)
 Divide elements of the input stream to a value. More...
 
DLL_EXPORT void dsp_buffer_1div (dsp_stream_p stream, double val)
 Divide a value to each element of the input stream. More...
 
DLL_EXPORT void dsp_buffer_mul1 (dsp_stream_p stream, double val)
 Multiply elements of the input stream to a value. More...
 
DLL_EXPORT void dsp_buffer_pow1 (dsp_stream_p stream, double val)
 Expose elements of the input stream to the given power. More...
 
DLL_EXPORT void dsp_buffer_log1 (dsp_stream_p stream, double val)
 Logarithm elements of the input stream using the given base. More...
 
DLL_EXPORT void dsp_buffer_median (dsp_stream_p stream, int size, int median)
 Median elements of the input stream. More...
 
DLL_EXPORT void dsp_buffer_sigma (dsp_stream_p stream, int size)
 Standard deviation of each element of the input stream within the given size. More...
 
DLL_EXPORT void dsp_buffer_deviate (dsp_stream_p stream, dsp_t *deviation, dsp_t mindeviation, dsp_t maxdeviation)
 Deviate forward the first input stream using the second stream as indexing reference. More...
 

Detailed Description

Macro Definition Documentation

◆ dsp_buffer_copy

#define dsp_buffer_copy (   in,
  out,
  len 
)
Value:
({ \
int k; \
for(k = 0; k < len; k++) { \
((__typeof (out[0])*)out)[k] = (__typeof (out[0]))((__typeof (in[0])*)in)[k]; \
} \
})
Parameters
inthe input stream.
outthe output stream.
lenthe length of the first input stream.

◆ dsp_buffer_copy_stepping

#define dsp_buffer_copy_stepping (   in,
  out,
  inlen,
  outlen,
  instep,
  outstep 
)
Value:
({ \
int k; \
int t; \
for(k = 0, t = 0; k < inlen && t < outlen; k+=instep, t+=outstep) { \
((__typeof (out[0])*)out)[t] = (__typeof (out[0]))((__typeof (in[0])*)in)[k]; \
} \
})
Parameters
inthe input stream.
outthe output stream.
inlenthe length of the input stream.
outlenthe length of the output stream.
instepcopy each instep elements of in into each outstep elements of out.
outstepcopy each instep elements of in into each outstep elements of out.

◆ dsp_buffer_normalize

#define dsp_buffer_normalize (   buf,
  len,
  mn,
  mx 
)
Value:
({\
int k;\
for(k = 0; k < len; k++) {\
buf[k] = Max(mn, Min(mx, buf[k]));\
}\
})
Parameters
bufthe input buffer
lenthe length in elements of the buffer.
mnthe clamping bottom value.
mxthe clamping upper value.

◆ dsp_buffer_reverse

#define dsp_buffer_reverse (   buf,
  len 
)
Value:
({ \
int i = (len - 1) / 2; \
int j = i + 1; \
__typeof(buf[0]) _x; \
while(i >= 0) \
{ \
_x = buf[j]; \
buf[j] = buf[i]; \
buf[i] = _x; \
i--; \
j++; \
} \
})
Parameters
bufthe inout stream.
lenthe length of the input stream.

◆ dsp_buffer_set

#define dsp_buffer_set (   buf,
  len,
  _val 
)
Value:
({\
int k;\
for(k = 0; k < len; k++) {\
buf[k] = (__typeof(buf[0]))(_val);\
}\
})
Parameters
bufthe input buffer
lenthe length in elements of the buffer.
_valthe desired value.

◆ dsp_buffer_stretch

#define dsp_buffer_stretch (   buf,
  len,
  _mn,
  _mx 
)
Value:
({\
int k;\
__typeof(buf[0]) __mn = dsp_stats_min(buf, len);\
__typeof(buf[0]) __mx = dsp_stats_max(buf, len);\
double oratio = (_mx - _mn);\
double iratio = (__mx - __mn);\
if(iratio == 0) iratio = 1;\
for(k = 0; k < len; k++) {\
buf[k] -= __mn;\
buf[k] = (__typeof(buf[0]))((double)buf[k] * oratio / iratio);\
buf[k] += _mn;\
}\
})
Parameters
bufthe input buffer
lenthe length in elements of the buffer.
_mnthe desired minimum value.
_mxthe desired maximum value.

◆ dsp_buffer_swap

#define dsp_buffer_swap (   in,
  len 
)
Value:
({ \
int k; \
switch(sizeof(((__typeof (in[0])*)in)[0])) { \
case 2: \
for(k = 0; k < len; k++) \
((__typeof (in[0])*)in)[k] = __bswap_16(((__typeof (in[0])*)in)[k]); \
break; \
case 3: \
for(k = 0; k < len; k++) \
((__typeof (in[0])*)in)[k] = __bswap_32(((__typeof (in[0])*)in)[k]); \
break; \
} \
})
Parameters
inthe inout stream.
lenthe length of the input stream.

Function Documentation

◆ dsp_buffer_1div()

DLL_EXPORT void dsp_buffer_1div ( dsp_stream_p  stream,
double  val 
)
Parameters
streamthe stream on which execute
valthe nominator.

◆ dsp_buffer_1sub()

DLL_EXPORT void dsp_buffer_1sub ( dsp_stream_p  stream,
dsp_t  val 
)
Parameters
streamthe stream on which execute
valthe value to be subtracted.

◆ dsp_buffer_deviate()

DLL_EXPORT void dsp_buffer_deviate ( dsp_stream_p  stream,
dsp_t *  deviation,
dsp_t  mindeviation,
dsp_t  maxdeviation 
)
Parameters
streamthe stream on which execute
deviationthe stream containing the deviation buffer
mindeviationthe deviation at 0.
maxdeviationthe deviation at 1.

◆ dsp_buffer_div()

DLL_EXPORT void dsp_buffer_div ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_div1()

DLL_EXPORT void dsp_buffer_div1 ( dsp_stream_p  stream,
double  val 
)
Parameters
streamthe stream on which execute
valthe denominator.

◆ dsp_buffer_log()

DLL_EXPORT void dsp_buffer_log ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_log1()

DLL_EXPORT void dsp_buffer_log1 ( dsp_stream_p  stream,
double  val 
)
Parameters
streamthe stream on which execute
valthe logarithmic base.

◆ dsp_buffer_max()

DLL_EXPORT void dsp_buffer_max ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_median()

DLL_EXPORT void dsp_buffer_median ( dsp_stream_p  stream,
int  size,
int  median 
)
Parameters
streamthe stream on which execute
sizethe length of the median.
medianthe location of the median value.

◆ dsp_buffer_min()

DLL_EXPORT void dsp_buffer_min ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_mul()

DLL_EXPORT void dsp_buffer_mul ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_mul1()

DLL_EXPORT void dsp_buffer_mul1 ( dsp_stream_p  stream,
double  val 
)
Parameters
streamthe stream on which execute
valthe value used for this operation.

◆ dsp_buffer_pow()

DLL_EXPORT void dsp_buffer_pow ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_pow1()

DLL_EXPORT void dsp_buffer_pow1 ( dsp_stream_p  stream,
double  val 
)
Parameters
streamthe stream on which execute
valthe nth power to expose each element.

◆ dsp_buffer_removemean()

DLL_EXPORT void dsp_buffer_removemean ( dsp_stream_p  stream)
Parameters
streamthe stream on which execute

◆ dsp_buffer_shift()

DLL_EXPORT void dsp_buffer_shift ( dsp_stream_p  stream)
Parameters
streamthe input stream.

◆ dsp_buffer_sigma()

DLL_EXPORT void dsp_buffer_sigma ( dsp_stream_p  stream,
int  size 
)
Parameters
streamthe stream on which execute
sizethe reference size.

◆ dsp_buffer_sub()

DLL_EXPORT void dsp_buffer_sub ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_sub1()

DLL_EXPORT void dsp_buffer_sub1 ( dsp_stream_p  stream,
dsp_t  val 
)
Parameters
streamthe stream on which execute
valthe value to be subtracted.

◆ dsp_buffer_sum()

DLL_EXPORT void dsp_buffer_sum ( dsp_stream_p  stream,
dsp_t *  in,
int  len 
)
Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

◆ dsp_buffer_sum1()

DLL_EXPORT void dsp_buffer_sum1 ( dsp_stream_p  stream,
dsp_t  val 
)
Parameters
streamthe stream on which execute
valthe value used for this operation.
Max
#define Max(a, b)
if max() is not present you can use this one
Definition: dsp.h:184
dsp_stats_min
#define dsp_stats_min(buf, len)
Gets the minimum value of the input stream.
Definition: dsp.h:575
Min
#define Min(a, b)
if min() is not present you can use this one
Definition: dsp.h:177
dsp_stats_max
#define dsp_stats_max(buf, len)
Gets the maximum value of the input stream.
Definition: dsp.h:593