diff options
Diffstat (limited to 'arch/all/ensigdsp-sh/include/ensigdsp.h')
-rw-r--r-- | arch/all/ensigdsp-sh/include/ensigdsp.h | 232 |
1 files changed, 0 insertions, 232 deletions
diff --git a/arch/all/ensigdsp-sh/include/ensigdsp.h b/arch/all/ensigdsp-sh/include/ensigdsp.h deleted file mode 100644 index 09146da..0000000 --- a/arch/all/ensigdsp-sh/include/ensigdsp.h +++ /dev/null @@ -1,232 +0,0 @@ -/* **************************************************************************** - * ensigdsp.h -- Ensigma DSP library. - * Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr> - * - * This file is part of the 'all/ensigdsp-sh' module in libcarrot, an - * experimental modular libc project. - * - * This file is governed by the CeCILL-C license under French law and abiding - * by the rules of distribution of free software. You can use, modify and or - * redistribute it under the terms of the CeCILL-C license as circulated by - * CEA, CNRS and INRIA at the following URL: http://www.cecill.info - * - * As a counterpart to the access to the source code and rights to copy, modify - * and redistribute granted by the license, users are provided only with a - * limited warranty and the software's author, the holder of the economic - * rights, and the successive licensors have only limited liability. - * - * In this respect, the user's attention is drawn to the risks associated with - * loading, using, modifying and/or developing and reproducing the software by - * the user in light of its specific status of free software, that may mean - * that it is complicated to manipulate, and that also therefore means that it - * is reserved for developers and experienced professionals having in-depth - * computer knowledge. Users are therefore encouraged to load and test the - * software's suitability as regards their requirements in conditions enabling - * the security of their systems and/or data to be ensured and, more generally, - * to use and operate it in the same conditions as regards security. - * - * The fact that you are presently reading this means you have had knowledge of - * the CeCILL-C license and that you accept its terms. - * ************************************************************************* */ -#include <fixed.h> -__BEGIN_DECLS -#ifdef _DSPC - -/* ************************************************************************* */ -/* Useful things */ -/* ************************************************************************* */ -/* Macros */ -# define BIQUAD_SIZE 6 /* no. coefficients in an IIR biquad */ -# define EDSP_OK 0 -# define EDSP_BAD_ARG 1 -# define EDSP_NO_HEAP 2 -# define EFFTALLSCALE (-1L) -# define EFFTMIDSCALE 0x55555555L -# define EFFTNOSCALE 0x00000000L - -/* Globals - * These variables are for the internal use of the FFT functions only. - * They should not be accessed by user programs. */ - -extern long max_fft_size; -extern short *twtble; -/* ************************************************************************* */ -/* Fourier transforms */ -/* ************************************************************************* */ -/* Complex */ -extern int FftComplex _OF((__X __fixed __op_x[], __Y __fixed __op_y[], - const __X __fixed __ip_x[], const __Y __fixed __ip_y[], - long __size, long __scale)) __THROW; -extern int FftInComplex _OF((__X __fixed __data_x[], __Y __fixed __data_y[], - long __size, long __scale)) __THROW; - -/* Real */ -extern int FftReal _OF((__X __fixed __op_x[], __Y __fixed __op_y[], - const __fixed __ip[], - long __size, long __scale)) __THROW; -extern int FftInReal _OF((__X __fixed __data_x[], __Y __fixed __data_y[], - long __size, long __scale, int __ip_all_x)) __THROW; - -/* Complex bis? */ -extern int IfftComplex _OF((__X __fixed __op_x[], __Y __fixed __op_y[], - const __X __fixed __ip_x[], const __Y __fixed __ip_y[], - long __size, long __scale)) __THROW; -extern int IfftInComplex _OF((__X __fixed __data_x[], __Y __fixed __data_y[], - long __size, long __scale)) __THROW; - -/* Real bis? */ -extern int IfftReal _OF((__X __fixed __op_x[], __Y __fixed __op_y[], - __X __fixed __ip_x[], __Y __fixed __ip_y[], - long __size, long __scale, int __op_all_x)) __THROW; -extern int IfftInReal _OF((__X __fixed __data_x[], __Y __fixed __data_y[], - long __size, long __scale, int __op_all_x)) __THROW; - -/* Initialize/deinitialize Fourier transformation? */ -extern int InitFft _OF((long __max_size)) __THROW; -extern void FreeFft _OF((void)) __THROW; - -/* ?? */ -extern int LogMagnitude _OF((__fixed __output[], - __X __fixed __ip_x[], __Y __fixed __ip_y[], - long __no_elements, float __fscale)) __THROW; -/* ************************************************************************* */ -/* Window functions */ -/* ************************************************************************* */ -extern int GenBlackman _OF((__fixed __output[], long __win_size)) __THROW; -extern int GenHamming _OF((__fixed __output[], long __win_size)) __THROW; -extern int GenHanning _OF((__fixed __output[], long __win_size)) __THROW; -extern int GenTriangle _OF((__fixed __output[], long __win_size)) __THROW; - -/* ************************************************************************* */ -/* Filters */ -/* ************************************************************************* */ -/* The coefficients must be supplied in X and the workspace in Y. - * If it is straightforward we can support the opposite, i.e. Xworkspace - * and Ycoeff. */ - -extern int InitFir _OF((__Y __fixed **__workspace, long __no_coeffs)) __THROW; -extern int FreeFir _OF((__Y __fixed **__workspace, long __no_coeffs)) __THROW; - -extern int InitIir _OF((__Y __fixed **__workspace, long __no_sections)) - __THROW; -extern int FreeIir _OF((__Y __fixed **__workspace, long __no_sections)) - __THROW; - -extern int InitDIir _OF((__Y long __fixed **__workspace, long __no_sections)) - __THROW; -extern int FreeDIir _OF((__Y long __fixed **__workspace, long __no_sections)) - __THROW; - -extern int InitLms _OF((__Y __fixed **__workspace, long __no_coeffs)) __THROW; -extern int FreeLms _OF((__Y __fixed **__workspace, long __no_coeffs)) __THROW; - -extern int Fir _OF((__fixed __output[], const __fixed __input[], - long __no_samples, - const __X __fixed __coeff[], long __no_coeffs, int __res_shift, - __Y __fixed *__workspace)) __THROW; -extern int Fir1 _OF((short *__output, short __input, - const short __coeff[], /* X memory */ - long __no_coeffs, int __res_shift, - short *__workspace /* Y memory */ - )) __THROW; - -extern int Iir _OF((__fixed __output[], const __fixed __input[], - long __no_samples, const __X __fixed __coeff[], long __no_sections, - __Y __fixed *__workspace)) __THROW; -extern int Iir1 _OF((short *__output, short __input, - const short __coeff[], /* X memory */ - long __no_sections, short *__workspace /* Y memory */ - )) __THROW; - -extern int DIir _OF((__fixed __output[], const __fixed __input[], - long __no_samples, - const __X long __fixed __coeff[], long __no_sections, - __Y long __fixed *__workspace)) __THROW; -extern int DIir1 _OF((short *__output, const short __input, - const long __coeff[], /* X memory */ - long __no_sections, - long *__workspace /* Y memory */ - )) __THROW; - -extern int Lms _OF((__fixed __output[], const __fixed __input[], - const __fixed __ref_output[], long __no_samples, - __X __fixed __coeff[], long __no_coeffs, int __res_shift, - short __conv_fact, __Y __fixed *__workspace)) __THROW; -extern int Lms1 _OF((short *__output, short __input, short __ref_output, - short __coeff[], /* X memory */ - long __no_coeffs, int __res_shift, - short __conv_fact, - short *__workspace /* Y memory */ - )) __THROW; -/* ************************************************************************* */ -/* Convolution and Correlation */ -/* ************************************************************************* */ -extern int ConvComplete _OF((__fixed __output[], - __X __fixed __ip_x[], __Y __fixed __ip_y[], - long __x_size, long __y_size, int __res_shift)) __THROW; -extern int ConvCyclic _OF((__fixed __output[], - __X __fixed __ip_x[], __Y __fixed __ip_y[], - long __size, int __res_shift)) __THROW; -extern int ConvPartial _OF((__fixed __output[], - const __X __fixed __ip_x[], const __Y __fixed __ip_y[], - long __x_size, long __y_size, int __res_shift)) __THROW; -extern int Correlate _OF((__fixed __output[], - const __X __fixed __ip_x[], const __Y __fixed __ip_y[], - long __x_size, long __y_size, long __no_corr, - int __x_is_larger, int __res_shift)) __THROW; -extern int CorrCyclic _OF((__fixed __output[], - const __X __fixed __ip_x[], const __Y __fixed __ip_y[], - long __size, int __reverse, int __res_shift)) __THROW; -/* ************************************************************************* */ -/* Miscallaneous */ -/* ************************************************************************* */ -/* Noise? */ -extern int GenGWnoise _OF((__fixed __output[], long __no_samples, - float __variance)) __THROW; - -/* Statistical things */ -extern int MinI _OF((__fixed **__min_ptr, __fixed __input[], - long __no_elements, int __src_is_x)) __THROW; -extern int MaxI _OF((__fixed **__max_ptr, __fixed __input[], - long __no_elements, int __src_is_x)) __THROW; -extern int PeakI _OF((__fixed **__peak_ptr, __fixed __input[], - long __no_elements, int __src_is_x)) __THROW; -extern int Mean _OF((__fixed *__mean, const __fixed __input[], - long __no_elements, int __src_is_x)) __THROW; -extern int Variance OF((long __fixed *__variance, __fixed *__mean, - const __fixed __input[], long __no_elements, int __src_is_x)) __THROW; - -/* Vector/matrix operations */ -extern int VectorMult _OF((__fixed __output[], - const __X __fixed __ip_x[], const __Y __fixed __ip_y[], - long __no_elements, int __res_shift)) __THROW; -extern int MatrixMult _OF((void *__op_matrix, - const __X void *__ip_x, const __Y void *__ip_y, - long __m, long __n, long __p, int __x_first, int __res_shift)) __THROW; - -/* Power? */ -extern int MsPower _OF((long __fixed *__output, const __fixed __input[], - long __no_elements, int __src_is_x)) __THROW; - -/* Limit */ -extern int Limit _OF((__fixed __data_xy[], long __no_elements, - int __data_is_x)) __THROW; - -/* Copies */ -extern int CopyXtoY _OF((__Y __fixed __op_y[], const __X __fixed __ip_x[], - long __n)) __THROW; -extern int CopyYtoX _OF((__X __fixed __op_x[], const __Y __fixed __ip_y[], - long __n)); - -extern int CopyToX _OF((__X __fixed __op_x[], const __fixed __input[], - long __n)) __THROW; -extern int CopyToY _OF((__Y __fixed __op_y[], const __fixed __input[], - long __n)) __THROW; - -extern int CopyFromX _OF((__fixed __output[], const __X __fixed __ip_x[], - long __n)) __THROW; -extern int CopyFromY _OF((__fixed __output[], const __Y __fixed __ip_y[], - long __n)) __THROW; - -#endif -__END_DECLS |