Instrument Neutral Distributed Interface INDI  1.9.5
Classes | Macros | Typedefs | Functions
dsp.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <sys/types.h>
#include <time.h>
#include <assert.h>
#include <pthread.h>

Go to the source code of this file.

Classes

struct  dsp_point_t
 Indicates a dot or line inside a dsp_stream. More...
 
struct  dsp_offset_t
 Indicates an offset. More...
 
struct  dsp_align_info_t
 Alignment informations needed. More...
 
struct  dsp_complex_t
 Complex number, used in Fourier Transform functions. More...
 
struct  dsp_region_t
 Delimits a region in a single dimension of a buffer. More...
 
struct  dsp_star_t
 A star or object contained into a buffer. More...
 
struct  dsp_stream_t
 Contains a set of informations and data relative to a buffer and how to use it. More...
 

Macros

#define DLL_EXPORT   extern
 
#define DSP_MAX_STARS   200
 
#define dsp_t   double
 
#define dsp_t_max   pow(2, sizeof(dsp_t)*4)
 
#define dsp_t_min   -dsp_t_max
 
#define DSP_MAX_THREADS   4
 
#define Min(a, b)
 if min() is not present you can use this one More...
 
#define Max(a, b)
 if max() is not present you can use this one More...
 
#define Log(a, b)   ( log(a) / log(b) )
 Logarithm of a with arbitrary base b. More...
 
#define dsp_stats_min(buf, len)
 Gets the minimum value of the input stream. More...
 
#define dsp_stats_max(buf, len)
 Gets the maximum value of the input stream. More...
 
#define dsp_stats_mid(buf, len)
 Gets the middle value of the input stream. More...
 
#define dsp_stats_minimum_index(buf, len)
 Gets minimum value's position into the buffer. More...
 
#define dsp_stats_maximum_index(buf, len)
 Gets maximum value's position into the buffer. More...
 
#define dsp_stats_mean(buf, len)
 A mean calculator. More...
 
#define dsp_stats_val_count(buf, len, val)
 Counts value occurrences into stream. More...
 
#define dsp_stats_range_count(buf, len, lo, hi)
 Counts value occurrences into stream. More...
 
#define dsp_stats_compare(in1, in2, len)
 Compare two streams. More...
 
#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)
 Place the given value on each element of the buffer. 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)
 
#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...
 

Typedefs

typedef struct dsp_point_t dsp_point
 Indicates a dot or line inside a dsp_stream. More...
 
typedef struct dsp_offset_t dsp_offset
 Indicates an offset. More...
 
typedef struct dsp_align_info_t dsp_align_info
 Alignment informations needed. More...
 
typedef struct dsp_complex_t dsp_complex
 Complex number, used in Fourier Transform functions. More...
 
typedef struct dsp_region_t dsp_region
 Delimits a region in a single dimension of a buffer. More...
 
typedef struct dsp_star_t dsp_star
 A star or object contained into a buffer. More...
 
typedef void *(* dsp_func_t) (void *,...)
 Multi-dimensional processing delegate function. More...
 
typedef struct dsp_stream_t dsp_stream
 Contains a set of informations and data relative to a buffer and how to use it. More...
 
typedef struct dsp_stream_tdsp_stream_p
 

Functions

DLL_EXPORT dsp_complexdsp_fourier_dft (dsp_stream_p stream)
 Perform a discrete Fourier Transform of a dsp_stream. More...
 
DLL_EXPORT dsp_tdsp_fourier_idft (dsp_stream_p stream)
 Perform an inverse discrete Fourier Transform of a dsp_stream. More...
 
DLL_EXPORT void dsp_fourier_fft (dsp_stream_p stream)
 Perform a fast Fourier Transform of a dsp_stream. More...
 
DLL_EXPORT void dsp_fourier_ifft (dsp_stream_p stream)
 Perform an inverse fast Fourier Transform of a dsp_stream. More...
 
DLL_EXPORT double dsp_fourier_complex_get_magnitude (dsp_complex n)
 Obtain a complex number's magnitude. More...
 
DLL_EXPORT double dsp_fourier_complex_get_phase (dsp_complex n)
 Obtain a complex number's phase. More...
 
DLL_EXPORT double * dsp_fourier_complex_array_get_magnitude (dsp_complex *in, int len)
 Obtain a complex number's array magnitudes. More...
 
DLL_EXPORT double * dsp_fourier_complex_array_get_phase (dsp_complex *in, int len)
 Obtain a complex number's array phases. More...
 
DLL_EXPORT void dsp_fourier_dft_magnitude (dsp_stream_p stream)
 Perform a discrete Fourier Transform of a dsp_stream and obtain the complex magnitudes. More...
 
DLL_EXPORT void dsp_fourier_dft_phase (dsp_stream_p stream)
 Perform a discrete Fourier Transform of a dsp_stream and obtain the complex phases. More...
 
DLL_EXPORT void dsp_fourier_idft_magnitude (dsp_stream_p stream)
 Perform an inverse discrete Fourier Transform of a dsp_stream and obtain the complex magnitudes. More...
 
DLL_EXPORT void dsp_fourier_idft_phase (dsp_stream_p stream)
 Perform an inverse discrete Fourier Transform of a dsp_stream and obtain the complex phases. More...
 
DLL_EXPORT void dsp_filter_squarelaw (dsp_stream_p stream)
 A square law filter. More...
 
DLL_EXPORT void dsp_filter_lowpass (dsp_stream_p stream, double samplingfrequency, double frequency)
 A low pass filter. More...
 
DLL_EXPORT void dsp_filter_highpass (dsp_stream_p stream, double samplingfrequency, double frequency)
 A high pass filter. More...
 
DLL_EXPORT void dsp_filter_bandpass (dsp_stream_p stream, double samplingfrequency, double LowFrequency, double HighFrequency)
 A band pass filter. More...
 
DLL_EXPORT void dsp_filter_bandreject (dsp_stream_p stream, double samplingfrequency, double LowFrequency, double HighFrequency)
 A band reject filter. More...
 
DLL_EXPORT dsp_stream_p dsp_convolution_convolution (dsp_stream_p stream1, dsp_stream_p stream2)
 A cross-convolution processor. More...
 
DLL_EXPORT double * dsp_stats_histogram (dsp_stream_p stream, int size)
 Histogram of the inut stream. More...
 
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, double val)
 Subtract a value from elements of the input stream. More...
 
DLL_EXPORT void dsp_buffer_1sub (dsp_stream_p stream, double val)
 Subtract each element of the input stream a value. More...
 
DLL_EXPORT void dsp_buffer_sum1 (dsp_stream_p stream, double 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 inut stream. 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...
 
DLL_EXPORT void dsp_stream_alloc_buffer (dsp_stream_p stream, int len)
 Allocate a buffer with length len on the stream passed as argument. More...
 
DLL_EXPORT void dsp_stream_set_buffer (dsp_stream_p stream, void *buffer, int len)
 Set the buffer of the stream passed as argument to a specific memory location. More...
 
DLL_EXPORT dsp_tdsp_stream_get_buffer (dsp_stream_p stream)
 Return the buffer of the stream passed as argument. More...
 
DLL_EXPORT void dsp_stream_free_buffer (dsp_stream_p stream)
 Free the buffer of the DSP Stream passed as argument. More...
 
DLL_EXPORT dsp_stream_p dsp_stream_new ()
 Allocate a new DSP stream type. More...
 
DLL_EXPORT void dsp_stream_free (dsp_stream_p stream)
 Free the DSP stream passed as argument. More...
 
DLL_EXPORT dsp_stream_p dsp_stream_copy (dsp_stream_p stream)
 Create a copy of the DSP stream passed as argument. More...
 
DLL_EXPORT void dsp_stream_add_star (dsp_stream_p stream, dsp_star star)
 Add a star into the stream struct. More...
 
DLL_EXPORT void dsp_stream_add_child (dsp_stream_p stream, dsp_stream_p child)
 Add a child to the DSP Stream passed as argument. More...
 
DLL_EXPORT void dsp_stream_del_child (dsp_stream_p stream, int n)
 Remove the child with index n to a DSP stream. More...
 
DLL_EXPORT void dsp_stream_del_star (dsp_stream_p stream, int n)
 Remove the star with index n to a DSP stream. More...
 
DLL_EXPORT void dsp_stream_add_dim (dsp_stream_p stream, int len)
 Add a dimension with length len to a DSP stream. More...
 
DLL_EXPORT void dsp_stream_del_dim (dsp_stream_p stream, int n)
 Remove the dimension with index n to a DSP stream. More...
 
DLL_EXPORT int dsp_stream_set_position (dsp_stream_p stream, int *pos)
 Obtain the position the DSP stream by parsing multidimensional indexes. More...
 
DLL_EXPORT int * dsp_stream_get_position (dsp_stream_p stream, int index)
 Return the multidimensional positional indexes of a DSP stream by specify a linear index. More...
 
DLL_EXPORT void * dsp_stream_exec (dsp_stream_p stream, void *args,...)
 Execute the function callback pointed by the func field of the passed stream. More...
 
DLL_EXPORT void dsp_stream_crop (dsp_stream_p stream)
 Crop the buffers of the stream passed as argument by reading the ROI field. More...
 
DLL_EXPORT void dsp_signals_whitenoise (dsp_stream_p stream)
 Generate white noise. More...
 
DLL_EXPORT void dsp_signals_sinewave (dsp_stream_p stream, double samplefreq, double freq)
 Generate a sinusoidal wave. More...
 
DLL_EXPORT void dsp_signals_sawtoothwave (dsp_stream_p stream, double samplefreq, double freq)
 Generate a sawtooth wave. More...
 
DLL_EXPORT void dsp_signals_triwave (dsp_stream_p stream, double samplefreq, double freq)
 Generate a triangular wave. More...
 
DLL_EXPORT void dsp_modulation_frequency (dsp_stream_p stream, double samplefreq, double freq, double bandwidth)
 Generate a frequency modulated wave. More...
 
DLL_EXPORT void dsp_modulation_amplitude (dsp_stream_p stream, double samplefreq, double freq)
 Generate an amplitude modulated wave. More...
 
DLL_EXPORT int dsp_align_find_stars (dsp_stream_p stream, int levels, int min_size, float threshold, dsp_stream_p matrix)
 Find stars into the stream. More...
 
DLL_EXPORT int dsp_align_crop_limit (dsp_stream_p reference, dsp_stream_p to_align, int n, int radius)
 Limit search area to the radius around the first n stars and store those streams as children of the stream to be aligned. More...
 
DLL_EXPORT int dsp_align_get_offset (dsp_stream_p stream1, dsp_stream_p stream, int max_stars, int decimals)
 Find offsets between 2 streams and extract align informations. More...
 
DLL_EXPORT void dsp_stream_rotate (dsp_stream_p stream)
 Rotate a stream around an axis and offset. More...
 
DLL_EXPORT void dsp_stream_traslate (dsp_stream_p stream)
 Traslate a stream. More...
 
DLL_EXPORT void dsp_stream_scale (dsp_stream_p stream)
 Scale a stream. More...
 
DLL_EXPORT dsp_stream_pdsp_file_read_fits (char *filename, int *channels, int stretch)
 Read a FITS file and fill a dsp_stream_p with its content. More...
 
DLL_EXPORT void * dsp_file_write_fits (int bpp, size_t *memsize, dsp_stream_p stream)
 Write the components dsp_stream_p array into a FITS file,. More...
 
DLL_EXPORT dsp_stream_pdsp_file_read_jpeg (char *filename, int *channels, int stretch)
 Read a JPEG file and fill a array of dsp_stream_p with its content, each color channel has its own stream in this array and an additional grayscale at end will be added. More...
 
DLL_EXPORT void dsp_file_write_jpeg_composite (char *filename, int components, int quality, dsp_stream_p *stream)
 Write the components dsp_stream_p array into a JPEG file,. More...
 
DLL_EXPORT dsp_stream_pdsp_stream_from_components (dsp_t *buf, int dims, int *sizes, int components)
 
DLL_EXPORT dsp_stream_pdsp_buffer_rgb_to_components (void *buf, int dims, int *sizes, int components, int bpp, int stretch)
 
DLL_EXPORT void dsp_buffer_components_to_rgb (dsp_stream_p *stream, void *rgb, int components, int bpp)
 

Macro Definition Documentation

◆ DLL_EXPORT

#define DLL_EXPORT   extern

Definition at line 27 of file dsp.h.

◆ 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]; \
} \
})

Fill the output buffer with the values of the elements of the input stream by casting them to the output buffer element type.

Parameters
inthe input stream.
outthe output stream.
lenthe length of the first input stream.

Definition at line 791 of file dsp.h.

◆ 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]; \
} \
})

Fill the output buffer with the values of the elements of the input stream by casting them to the output buffer element type.

Parameters
inthe input stream.
outthe output stream.
lenthe length of the first input 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.

Definition at line 811 of file dsp.h.

◆ 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]));\
}\
})

Normalize the input stream to the minimum and maximum values.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
minthe clamping minimum value.
maxthe clamping maximum value.

Definition at line 594 of file dsp.h.

◆ 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++; \
} \
})

Reverse the order of the buffer elements.

Parameters
bufthe input stream.
lenthe length of the first input stream.

Definition at line 745 of file dsp.h.

◆ 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);\
}\
})

Place the given value on each element of the buffer.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
valthe desired value.

Definition at line 579 of file dsp.h.

◆ 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;\
}\
})

Stretch minimum and maximum values of the input stream.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
minthe desired minimum value.
maxthe desired maximum value.

Definition at line 557 of file dsp.h.

◆ 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; \
case 4: \
for(k = 0; k < len; k++) \
((__typeof__ (in[0])*)in)[k] = __bswap_64(((__typeof__ (in[0])*)in)[k]); \
break; \
} \
})

Definition at line 762 of file dsp.h.

◆ DSP_MAX_STARS

#define DSP_MAX_STARS   200

Definition at line 56 of file dsp.h.

◆ DSP_MAX_THREADS

#define DSP_MAX_THREADS   4

Definition at line 61 of file dsp.h.

◆ dsp_stats_compare

#define dsp_stats_compare (   in1,
  in2,
  len 
)
Value:
({\
__typeof__(in1[0]) out = 0;\
for(int i = 0; i < len; i++) {\
out += in1[i] - (__typeof__(in1[0]))in2[i];\
}\
out;\
})

Compare two streams.

Parameters
in1the first input buffer
in2the second input buffer
lenthe length in elements of the buffer.
Returns
the sum of the subtraction of each element of both streams

Definition at line 513 of file dsp.h.

◆ dsp_stats_max

#define dsp_stats_max (   buf,
  len 
)
Value:
({\
int i;\
__typeof__(buf[0]) max = (__typeof__(buf[0]))buf[0];\
for(i = 0; i < len; i++) {\
max = Max(buf[i], max);\
}\
max;\
})

Gets the maximum value of the input stream.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
Returns
the maximum value.

Definition at line 398 of file dsp.h.

◆ dsp_stats_maximum_index

#define dsp_stats_maximum_index (   buf,
  len 
)
Value:
({\
int i;\
__typeof__(buf[0]) max = dsp_stats_max(buf, len);\
for(i = 0; i < len; i++) {\
if(buf[i] == max) break;\
}\
i;\
})

Gets maximum value's position into the buffer.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
Returns
the position index of the maximum value.

Definition at line 443 of file dsp.h.

◆ dsp_stats_mean

#define dsp_stats_mean (   buf,
  len 
)
Value:
({\
int i;\
__typeof__(buf[0]) mean = 0;\
for(i = 0; i < len; i++) {\
mean += buf[i];\
}\
mean /= len;\
mean;\
})

A mean calculator.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
Returns
the mean value of the stream.

Definition at line 459 of file dsp.h.

◆ dsp_stats_mid

#define dsp_stats_mid (   buf,
  len 
)
Value:
({\
int i;\
__typeof__(buf[0]) min = dsp_stats_min(buf, len);\
(__typeof__(buf[0]))(min - dsp_stats_max(buf, len)) / 2.0 + min;\
})

Gets the middle value of the input stream.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
Returns
the middle value.

Definition at line 414 of file dsp.h.

◆ dsp_stats_min

#define dsp_stats_min (   buf,
  len 
)
Value:
({\
int i;\
__typeof__(buf[0]) min = (__typeof__(buf[0]))buf[0];\
for(i = 0; i < len; i++) {\
min = Min(buf[i], min);\
}\
min;\
})

Gets the minimum value of the input stream.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
Returns
the minimum value.

Definition at line 382 of file dsp.h.

◆ dsp_stats_minimum_index

#define dsp_stats_minimum_index (   buf,
  len 
)
Value:
({\
int i;\
__typeof__(buf[0]) min = dsp_stats_min(buf, len);\
for(i = 0; i < len; i++) {\
if(buf[i] == min) break;\
}\
i;\
})

Gets minimum value's position into the buffer.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
Returns
the position index of the minimum value.

Definition at line 427 of file dsp.h.

◆ dsp_stats_range_count

#define dsp_stats_range_count (   buf,
  len,
  lo,
  hi 
)
Value:
({\
int x;\
int count = 0;\
for(x = 0; x < len; x++) {\
if(buf[x] < hi && buf[x] >= lo)\
count ++;\
}\
count;\
})

Counts value occurrences into stream.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
valthe value to count.
Returns
the count of the value of the stream.

Definition at line 495 of file dsp.h.

◆ dsp_stats_val_count

#define dsp_stats_val_count (   buf,
  len,
  val 
)
Value:
({\
int x;\
int count = 0;\
for(x = 0; x < len; x++) {\
if(buf[x] == val)\
count ++;\
}\
count;\
})

Counts value occurrences into stream.

Parameters
bufthe input buffer
lenthe length in elements of the buffer.
valthe value to count.
Returns
the count of the value of the stream.

Definition at line 477 of file dsp.h.

◆ dsp_t

#define dsp_t   double

Definition at line 57 of file dsp.h.

◆ dsp_t_max

#define dsp_t_max   pow(2, sizeof(dsp_t)*4)

Definition at line 58 of file dsp.h.

◆ dsp_t_min

#define dsp_t_min   -dsp_t_max

Definition at line 59 of file dsp.h.

◆ Log

#define Log (   a,
 
)    ( log(a) / log(b) )

Logarithm of a with arbitrary base b.

Definition at line 79 of file dsp.h.

◆ Max

#define Max (   a,
 
)
Value:
({ __typeof__ (a) _a = (a); \
__typeof__ (a) _b = (b); \
_a > _b ? _a : _b; })

if max() is not present you can use this one

Definition at line 72 of file dsp.h.

◆ Min

#define Min (   a,
 
)
Value:
({ __typeof__ (a) _a = (a); \
__typeof__ (a) _b = (b); \
_a < _b ? _a : _b; })

if min() is not present you can use this one

Definition at line 65 of file dsp.h.

Typedef Documentation

◆ dsp_align_info

Alignment informations needed.

◆ dsp_complex

typedef struct dsp_complex_t dsp_complex

Complex number, used in Fourier Transform functions.

See also
dsp_fourier_dft
dsp_fourier_complex_to_magnitude

◆ dsp_func_t

typedef void*(* dsp_func_t) (void *,...)

Multi-dimensional processing delegate function.

Definition at line 166 of file dsp.h.

◆ dsp_offset

typedef struct dsp_offset_t dsp_offset

Indicates an offset.

◆ dsp_point

typedef struct dsp_point_t dsp_point

Indicates a dot or line inside a dsp_stream.

See also
dsp_stream

◆ dsp_region

typedef struct dsp_region_t dsp_region

Delimits a region in a single dimension of a buffer.

◆ dsp_star

typedef struct dsp_star_t dsp_star

A star or object contained into a buffer.

◆ dsp_stream

typedef struct dsp_stream_t dsp_stream

Contains a set of informations and data relative to a buffer and how to use it.

See also
dsp_stream_new
dsp_stream_free
dsp_stream_add_dim
dsp_stream_del_dim

◆ dsp_stream_p

typedef struct dsp_stream_t * dsp_stream_p

Function Documentation

◆ dsp_align_crop_limit()

DLL_EXPORT int dsp_align_crop_limit ( dsp_stream_p  reference,
dsp_stream_p  to_align,
int  n,
int  radius 
)

Limit search area to the radius around the first n stars and store those streams as children of the stream to be aligned.

Parameters
referenceThe reference solved stream
to_alignThe stream to be aligned
nStars count limit
radiusThe search area
Returns
The number of streams cropped and added

◆ dsp_align_find_stars()

DLL_EXPORT int dsp_align_find_stars ( dsp_stream_p  stream,
int  levels,
int  min_size,
float  threshold,
dsp_stream_p  matrix 
)

Find stars into the stream.

Parameters
streamThe stream containing stars
levelsThe level of thresholding
min_sizeMinimum stellar size
thresholdIntensity treshold
matrixThe star shape
Returns
The new dsp_stream_p structure pointer

◆ dsp_align_get_offset()

DLL_EXPORT int dsp_align_get_offset ( dsp_stream_p  stream1,
dsp_stream_p  stream,
int  max_stars,
int  decimals 
)

Find offsets between 2 streams and extract align informations.

Parameters
stream1The first stream
stream2The second stream
max_starsThe maximum stars count allowed
precisionThe precision used for comparison
start_starStart compare from the start_star brigher star
Returns
The new dsp_align_info structure pointer

◆ dsp_buffer_1div()

DLL_EXPORT void dsp_buffer_1div ( dsp_stream_p  stream,
double  val 
)

Divide a value to each element of the input stream.

Parameters
streamthe stream on which execute
valthe nominator.

Definition at line 150 of file buffer.c.

◆ dsp_buffer_1sub()

DLL_EXPORT void dsp_buffer_1sub ( dsp_stream_p  stream,
double  val 
)

Subtract each element of the input stream a value.

Parameters
streamthe stream on which execute
valthe value to be subtracted.

Definition at line 120 of file buffer.c.

◆ dsp_buffer_components_to_rgb()

DLL_EXPORT void dsp_buffer_components_to_rgb ( dsp_stream_p stream,
void *  rgb,
int  components,
int  bpp 
)

Definition at line 436 of file file.c.

◆ dsp_buffer_deviate()

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.

Parameters
streamthe stream on which execute
deviationthe stream containing the deviation buffer
mindeviationthe deviation at 0.
maxdeviationthe deviation at 1.

Definition at line 223 of file buffer.c.

◆ dsp_buffer_div()

DLL_EXPORT void dsp_buffer_div ( dsp_stream_p  stream,
dsp_t in,
int  len 
)

Divide elements of one stream to another's.

Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

Definition at line 76 of file buffer.c.

◆ dsp_buffer_div1()

DLL_EXPORT void dsp_buffer_div1 ( dsp_stream_p  stream,
double  val 
)

Divide elements of the input stream to a value.

Parameters
streamthe stream on which execute
valthe denominator.

Definition at line 160 of file buffer.c.

◆ dsp_buffer_log()

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.

Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

Definition at line 109 of file buffer.c.

◆ dsp_buffer_log1()

DLL_EXPORT void dsp_buffer_log1 ( dsp_stream_p  stream,
double  val 
)

Logarithm elements of the input stream using the given base.

Parameters
streamthe stream on which execute
valthe logarithmic base.

Definition at line 190 of file buffer.c.

◆ dsp_buffer_max()

DLL_EXPORT void dsp_buffer_max ( dsp_stream_p  stream,
dsp_t in,
int  len 
)

Subtract elements of one stream from another's.

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 
)

Median elements of the inut stream.

Parameters
streamthe stream on which execute
sizethe length of the median.
medianthe location of the median value.

Definition at line 210 of file buffer.c.

◆ dsp_buffer_min()

DLL_EXPORT void dsp_buffer_min ( dsp_stream_p  stream,
dsp_t in,
int  len 
)

Sum elements of one stream to another's.

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 
)

Multiply elements of one stream to another's.

Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

Definition at line 87 of file buffer.c.

◆ dsp_buffer_mul1()

DLL_EXPORT void dsp_buffer_mul1 ( dsp_stream_p  stream,
double  val 
)

Multiply elements of the input stream to a value.

Parameters
streamthe stream on which execute
valthe value used for this operation.

Definition at line 170 of file buffer.c.

◆ dsp_buffer_pow()

DLL_EXPORT void dsp_buffer_pow ( dsp_stream_p  stream,
dsp_t in,
int  len 
)

Expose elements of one stream to another's.

Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

Definition at line 98 of file buffer.c.

◆ dsp_buffer_pow1()

DLL_EXPORT void dsp_buffer_pow1 ( dsp_stream_p  stream,
double  val 
)

Expose elements of the input stream to the given power.

Parameters
streamthe stream on which execute
valthe nth power to expose each element.

Definition at line 180 of file buffer.c.

◆ dsp_buffer_removemean()

DLL_EXPORT void dsp_buffer_removemean ( dsp_stream_p  stream)

Subtract mean from stream.

Parameters
streamthe stream on which execute

Definition at line 44 of file buffer.c.

◆ dsp_buffer_rgb_to_components()

DLL_EXPORT dsp_stream_p* dsp_buffer_rgb_to_components ( void *  buf,
int  dims,
int *  sizes,
int  components,
int  bpp,
int  stretch 
)

Definition at line 364 of file file.c.

◆ dsp_buffer_shift()

DLL_EXPORT void dsp_buffer_shift ( dsp_stream_p  stream)

Shift a stream on each dimension.

Parameters
streamthe input stream.

Definition at line 21 of file buffer.c.

◆ dsp_buffer_sub()

DLL_EXPORT void dsp_buffer_sub ( dsp_stream_p  stream,
dsp_t in,
int  len 
)

Subtract elements of one stream from another's.

Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

Definition at line 54 of file buffer.c.

◆ dsp_buffer_sub1()

DLL_EXPORT void dsp_buffer_sub1 ( dsp_stream_p  stream,
double  val 
)

Subtract a value from elements of the input stream.

Parameters
streamthe stream on which execute
valthe value to be subtracted.

Definition at line 130 of file buffer.c.

◆ dsp_buffer_sum()

DLL_EXPORT void dsp_buffer_sum ( dsp_stream_p  stream,
dsp_t in,
int  len 
)

Sum elements of one stream to another's.

Parameters
streamthe stream on which execute
inthe buffer operand.
lenthe length of the buffer

Definition at line 65 of file buffer.c.

◆ dsp_buffer_sum1()

DLL_EXPORT void dsp_buffer_sum1 ( dsp_stream_p  stream,
double  val 
)

Sum elements of the input stream to a value.

Parameters
streamthe stream on which execute
valthe value used for this operation.

Definition at line 140 of file buffer.c.

◆ dsp_convolution_convolution()

DLL_EXPORT dsp_stream_p dsp_convolution_convolution ( dsp_stream_p  stream1,
dsp_stream_p  stream2 
)

A cross-convolution processor.

Parameters
stream1the first input stream.
stream2the second input stream.

Definition at line 45 of file convolution.c.

◆ dsp_file_read_fits()

DLL_EXPORT dsp_stream_p* dsp_file_read_fits ( char *  filename,
int *  channels,
int  stretch 
)

Read a FITS file and fill a dsp_stream_p with its content.

Parameters
filenamethe file name.
stretch1 if the buffer intensities have to be stretched
Returns
The new dsp_stream_p structure pointer

Definition at line 26 of file file.c.

◆ dsp_file_read_jpeg()

DLL_EXPORT dsp_stream_p* dsp_file_read_jpeg ( char *  filename,
int *  channels,
int  stretch 
)

Read a JPEG file and fill a array of dsp_stream_p with its content, each color channel has its own stream in this array and an additional grayscale at end will be added.

Parameters
filenamethe file name.
channelsthis value will be updated with the channel quantity into the picture.
stretch1 if the buffer intensities have to be stretched
Returns
The new dsp_stream_p structure pointers array

Definition at line 256 of file file.c.

◆ dsp_file_write_fits()

DLL_EXPORT void* dsp_file_write_fits ( int  bpp,
size_t *  memsize,
dsp_stream_p  stream 
)

Write the components dsp_stream_p array into a FITS file,.

Parameters
filenamethe file name.
componentsthe number of streams in the array to be used as components 1 or 3.
bppthe bit depth of the output JPEG file [8,16,32,64,-32,-64].
streamthe input stream to be saved

Definition at line 147 of file file.c.

◆ dsp_file_write_jpeg_composite()

DLL_EXPORT void dsp_file_write_jpeg_composite ( char *  filename,
int  components,
int  quality,
dsp_stream_p stream 
)

Write the components dsp_stream_p array into a JPEG file,.

Parameters
filenamethe file name.
componentsthe number of streams in the array to be used as components 1 or 3.
qualitythe quality of the output JPEG file 0-100.
streamthe input stream to be saved

Definition at line 294 of file file.c.

◆ dsp_filter_bandpass()

DLL_EXPORT void dsp_filter_bandpass ( dsp_stream_p  stream,
double  samplingfrequency,
double  LowFrequency,
double  HighFrequency 
)

A band pass filter.

Parameters
streamthe input stream.
samplingfrequencythe sampling frequency of the input stream.
LowFrequencythe high-pass cutoff frequency of the filter.
HighFrequencythe low-pass cutoff frequency of the filter.

Definition at line 107 of file filters.c.

◆ dsp_filter_bandreject()

DLL_EXPORT void dsp_filter_bandreject ( dsp_stream_p  stream,
double  samplingfrequency,
double  LowFrequency,
double  HighFrequency 
)

A band reject filter.

Parameters
streamthe input stream.
samplingfrequencythe sampling frequency of the input stream.
LowFrequencythe high-pass cutoff frequency of the filter.
HighFrequencythe low-pass cutoff frequency of the filter.

Definition at line 77 of file filters.c.

◆ dsp_filter_highpass()

DLL_EXPORT void dsp_filter_highpass ( dsp_stream_p  stream,
double  samplingfrequency,
double  frequency 
)

A high pass filter.

Parameters
streamthe input stream.
samplingfrequencythe sampling frequency of the input stream.
frequencythe cutoff frequency of the filter.

Definition at line 61 of file filters.c.

◆ dsp_filter_lowpass()

DLL_EXPORT void dsp_filter_lowpass ( dsp_stream_p  stream,
double  samplingfrequency,
double  frequency 
)

A low pass filter.

Parameters
streamthe input stream.
samplingfrequencythe sampling frequency of the input stream.
frequencythe cutoff frequency of the filter.

Definition at line 45 of file filters.c.

◆ dsp_filter_squarelaw()

DLL_EXPORT void dsp_filter_squarelaw ( dsp_stream_p  stream)

A square law filter.

Parameters
streamthe input stream.

Definition at line 21 of file filters.c.

◆ dsp_fourier_complex_array_get_magnitude()

DLL_EXPORT double* dsp_fourier_complex_array_get_magnitude ( dsp_complex in,
int  len 
)

Obtain a complex number's array magnitudes.

Parameters
inthe input complex number array.
lenthe input array length.
Returns
the array filled with the magnitudes

Definition at line 36 of file fft.c.

◆ dsp_fourier_complex_array_get_phase()

DLL_EXPORT double* dsp_fourier_complex_array_get_phase ( dsp_complex in,
int  len 
)

Obtain a complex number's array phases.

Parameters
inthe input complex number array.
lenthe input array length.
Returns
the array filled with the phases

Definition at line 46 of file fft.c.

◆ dsp_fourier_complex_get_magnitude()

DLL_EXPORT double dsp_fourier_complex_get_magnitude ( dsp_complex  n)

Obtain a complex number's magnitude.

Parameters
nthe input complex.
Returns
the magnitude of the given number

Definition at line 22 of file fft.c.

◆ dsp_fourier_complex_get_phase()

DLL_EXPORT double dsp_fourier_complex_get_phase ( dsp_complex  n)

Obtain a complex number's phase.

Parameters
nthe input complex.
Returns
the phase of the given number

Definition at line 27 of file fft.c.

◆ dsp_fourier_dft()

DLL_EXPORT dsp_complex* dsp_fourier_dft ( dsp_stream_p  stream)

Perform a discrete Fourier Transform of a dsp_stream.

Parameters
streamthe inout stream.

Definition at line 56 of file fft.c.

◆ dsp_fourier_dft_magnitude()

DLL_EXPORT void dsp_fourier_dft_magnitude ( dsp_stream_p  stream)

Perform a discrete Fourier Transform of a dsp_stream and obtain the complex magnitudes.

Parameters
streamthe input stream.

◆ dsp_fourier_dft_phase()

DLL_EXPORT void dsp_fourier_dft_phase ( dsp_stream_p  stream)

Perform a discrete Fourier Transform of a dsp_stream and obtain the complex phases.

Parameters
streamthe input stream.

◆ dsp_fourier_fft()

DLL_EXPORT void dsp_fourier_fft ( dsp_stream_p  stream)

Perform a fast Fourier Transform of a dsp_stream.

Parameters
streamthe inout stream.

◆ dsp_fourier_idft()

DLL_EXPORT dsp_t* dsp_fourier_idft ( dsp_stream_p  stream)

Perform an inverse discrete Fourier Transform of a dsp_stream.

Parameters
streamthe inout stream.

Definition at line 71 of file fft.c.

◆ dsp_fourier_idft_magnitude()

DLL_EXPORT void dsp_fourier_idft_magnitude ( dsp_stream_p  stream)

Perform an inverse discrete Fourier Transform of a dsp_stream and obtain the complex magnitudes.

Parameters
streamthe input stream.

◆ dsp_fourier_idft_phase()

DLL_EXPORT void dsp_fourier_idft_phase ( dsp_stream_p  stream)

Perform an inverse discrete Fourier Transform of a dsp_stream and obtain the complex phases.

Parameters
streamthe input stream.

◆ dsp_fourier_ifft()

DLL_EXPORT void dsp_fourier_ifft ( dsp_stream_p  stream)

Perform an inverse fast Fourier Transform of a dsp_stream.

Parameters
streamthe inout stream.

◆ dsp_modulation_amplitude()

DLL_EXPORT void dsp_modulation_amplitude ( dsp_stream_p  stream,
double  samplefreq,
double  freq 
)

Generate an amplitude modulated wave.

Parameters
streamthe target DSP stream.
samplefreqthe sampling reference frequency
freqthe carrier wave frequency

Definition at line 97 of file signals.c.

◆ dsp_modulation_frequency()

DLL_EXPORT void dsp_modulation_frequency ( dsp_stream_p  stream,
double  samplefreq,
double  freq,
double  bandwidth 
)

Generate a frequency modulated wave.

Parameters
streamthe target DSP stream.
samplefreqthe sampling reference frequency
freqthe carrier wave frequency
bandwidththe bandwidth of the frequency modulation

Definition at line 81 of file signals.c.

◆ dsp_signals_sawtoothwave()

DLL_EXPORT void dsp_signals_sawtoothwave ( dsp_stream_p  stream,
double  samplefreq,
double  freq 
)

Generate a sawtooth wave.

Parameters
streamthe target DSP stream.
samplefreqthe sampling reference frequency
freqthe sawtooth wave frequency

Definition at line 47 of file signals.c.

◆ dsp_signals_sinewave()

DLL_EXPORT void dsp_signals_sinewave ( dsp_stream_p  stream,
double  samplefreq,
double  freq 
)

Generate a sinusoidal wave.

Parameters
streamthe target DSP stream.
samplefreqthe sampling reference frequency
freqthe sine wave frequency

Definition at line 30 of file signals.c.

◆ dsp_signals_triwave()

DLL_EXPORT void dsp_signals_triwave ( dsp_stream_p  stream,
double  samplefreq,
double  freq 
)

Generate a triangular wave.

Parameters
streamthe target DSP stream.
samplefreqthe sampling reference frequency
freqthe triangular wave frequency

Definition at line 63 of file signals.c.

◆ dsp_signals_whitenoise()

DLL_EXPORT void dsp_signals_whitenoise ( dsp_stream_p  stream)

Generate white noise.

Parameters
streamthe target DSP stream.

Definition at line 21 of file signals.c.

◆ dsp_stats_histogram()

DLL_EXPORT double* dsp_stats_histogram ( dsp_stream_p  stream,
int  size 
)

Histogram of the inut stream.

Parameters
streamthe stream on which execute
sizethe length of the median.
Returns
the output stream if successfull elaboration. NULL if an error is encountered.

Definition at line 21 of file stats.c.

◆ dsp_stream_add_child()

DLL_EXPORT void dsp_stream_add_child ( dsp_stream_p  stream,
dsp_stream_p  child 
)

Add a child to the DSP Stream passed as argument.

Parameters
streamthe target DSP stream.
childthe child to add to DSP stream.
See also
dsp_stream_new
dsp_stream_del_child

Definition at line 141 of file stream.c.

◆ dsp_stream_add_dim()

DLL_EXPORT void dsp_stream_add_dim ( dsp_stream_p  stream,
int  len 
)

Add a dimension with length len to a DSP stream.

Parameters
streamthe target DSP stream.
lenthe size of the dimension to add
See also
dsp_stream_new
dsp_stream_del_dim

Definition at line 111 of file stream.c.

◆ dsp_stream_add_star()

DLL_EXPORT void dsp_stream_add_star ( dsp_stream_p  stream,
dsp_star  star 
)

Add a star into the stream struct.

Add a star to the DSP Stream passed as argument.

Parameters
streamthe target DSP stream.
starthe star to add to the stream.
streamthe target DSP stream.
childthe star to add to DSP stream.
See also
dsp_stream_new
dsp_stream_del_star

Definition at line 164 of file stream.c.

◆ dsp_stream_alloc_buffer()

DLL_EXPORT void dsp_stream_alloc_buffer ( dsp_stream_p  stream,
int  len 
)

Allocate a buffer with length len on the stream passed as argument.

Parameters
streamthe target DSP stream.
lenthe new length of the buffer.

Definition at line 21 of file stream.c.

◆ dsp_stream_copy()

DLL_EXPORT dsp_stream_p dsp_stream_copy ( dsp_stream_p  stream)

Create a copy of the DSP stream passed as argument.

Parameters
streamthe DSP stream to copy.
Returns
the copy of the DSP stream
See also
dsp_stream_new

Definition at line 89 of file stream.c.

◆ dsp_stream_crop()

DLL_EXPORT void dsp_stream_crop ( dsp_stream_p  stream)

Crop the buffers of the stream passed as argument by reading the ROI field.

Parameters
streamthe target DSP stream.
Returns
the cropped DSP stream.
See also
dsp_stream_new

Definition at line 213 of file stream.c.

◆ dsp_stream_del_child()

DLL_EXPORT void dsp_stream_del_child ( dsp_stream_p  stream,
int  n 
)

Remove the child with index n to a DSP stream.

Parameters
streamthe target DSP stream.
nthe index of the child to remove
See also
dsp_stream_new
dsp_stream_add_child

Definition at line 149 of file stream.c.

◆ dsp_stream_del_dim()

DLL_EXPORT void dsp_stream_del_dim ( dsp_stream_p  stream,
int  n 
)

Remove the dimension with index n to a DSP stream.

Parameters
streamthe target DSP stream.
nthe index of the dimension to remove
See also
dsp_stream_new
dsp_stream_add_dim

Definition at line 126 of file stream.c.

◆ dsp_stream_del_star()

DLL_EXPORT void dsp_stream_del_star ( dsp_stream_p  stream,
int  n 
)

Remove the star with index n to a DSP stream.

Parameters
streamthe target DSP stream.
nthe index of the star to remove
See also
dsp_stream_new
dsp_stream_add_star

Definition at line 173 of file stream.c.

◆ dsp_stream_exec()

DLL_EXPORT void* dsp_stream_exec ( dsp_stream_p  stream,
void *  args,
  ... 
)

Execute the function callback pointed by the func field of the passed stream.

Parameters
streamthe target DSP stream.
Returns
callback return value
See also
dsp_stream_new
dsp_stream_get_position
dsp_stream_set_position

◆ dsp_stream_free()

DLL_EXPORT void dsp_stream_free ( dsp_stream_p  stream)

Free the DSP stream passed as argument.

Parameters
streamthe target DSP stream.
See also
dsp_stream_new

Definition at line 76 of file stream.c.

◆ dsp_stream_free_buffer()

DLL_EXPORT void dsp_stream_free_buffer ( dsp_stream_p  stream)

Free the buffer of the DSP Stream passed as argument.

Parameters
streamthe target DSP stream.

Definition at line 41 of file stream.c.

◆ dsp_stream_from_components()

DLL_EXPORT dsp_stream_p* dsp_stream_from_components ( dsp_t buf,
int  dims,
int *  sizes,
int  components 
)

Definition at line 339 of file file.c.

◆ dsp_stream_get_buffer()

DLL_EXPORT dsp_t* dsp_stream_get_buffer ( dsp_stream_p  stream)

Return the buffer of the stream passed as argument.

Parameters
streamthe target DSP stream.
Returns
the buffer

Definition at line 36 of file stream.c.

◆ dsp_stream_get_position()

DLL_EXPORT int* dsp_stream_get_position ( dsp_stream_p  stream,
int  index 
)

Return the multidimensional positional indexes of a DSP stream by specify a linear index.

Parameters
streamthe target DSP stream.
indexthe position of the index on a single dimension.
Returns
the the position of the index on each dimension.
See also
dsp_stream_new
dsp_stream_set_position
dsp_stream_exec
dsp_stream_exec_multidim

Definition at line 188 of file stream.c.

◆ dsp_stream_new()

DLL_EXPORT dsp_stream_p dsp_stream_new ( )

Allocate a new DSP stream type.

Returns
the newly created DSP stream type
See also
dsp_stream_free

Definition at line 48 of file stream.c.

◆ dsp_stream_rotate()

DLL_EXPORT void dsp_stream_rotate ( dsp_stream_p  stream)

Rotate a stream around an axis and offset.

Parameters
streamThe stream that need rotation
infoThe dsp_align_info structure pointer containing the rotation informations
Returns
The new dsp_stream_p structure pointer

Definition at line 364 of file stream.c.

◆ dsp_stream_scale()

DLL_EXPORT void dsp_stream_scale ( dsp_stream_p  stream)

Scale a stream.

Parameters
streamThe stream that need scaling
infoThe dsp_align_info structure pointer containing the scaling informations
Returns
The new dsp_stream_p structure pointer

Definition at line 300 of file stream.c.

◆ dsp_stream_set_buffer()

DLL_EXPORT void dsp_stream_set_buffer ( dsp_stream_p  stream,
void *  buffer,
int  len 
)

Set the buffer of the stream passed as argument to a specific memory location.

Parameters
streamthe target DSP stream.
bufferthe new location of the buffer.
lenthe new length of the buffer.

Definition at line 30 of file stream.c.

◆ dsp_stream_set_position()

DLL_EXPORT int dsp_stream_set_position ( dsp_stream_p  stream,
int *  pos 
)

Obtain the position the DSP stream by parsing multidimensional indexes.

Parameters
streamthe target DSP stream.
posthe position of the index on each dimension.
Returns
the position of the index on a single dimension.
See also
dsp_stream_new
dsp_stream_get_position
dsp_stream_exec
dsp_stream_exec_multidim

Definition at line 202 of file stream.c.

◆ dsp_stream_traslate()

DLL_EXPORT void dsp_stream_traslate ( dsp_stream_p  stream)

Traslate a stream.

Parameters
streamThe stream that need traslation
infoThe dsp_align_info structure pointer containing the traslation informations
Returns
The new dsp_stream_p structure pointer

Definition at line 252 of file stream.c.

min
double min(void)
Max
#define Max(a, b)
if max() is not present you can use this one
Definition: dsp.h:72
max
double max(void)
dsp_stats_min
#define dsp_stats_min(buf, len)
Gets the minimum value of the input stream.
Definition: dsp.h:382
Min
#define Min(a, b)
if min() is not present you can use this one
Definition: dsp.h:65
dsp_stats_max
#define dsp_stats_max(buf, len)
Gets the maximum value of the input stream.
Definition: dsp.h:398