|
| 1 | +/* |
| 2 | + * Copyright (C) 2025 Linux Studio Plugins Project <https://lsp-plug.in/> |
| 3 | + * (C) 2025 Vladimir Sadovnikov <[email protected]> |
| 4 | + * |
| 5 | + * This file is part of lsp-dsp-lib |
| 6 | + * Created on: 10 апр. 2025 г. |
| 7 | + * |
| 8 | + * lsp-dsp-lib is free software: you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU Lesser General Public License as published by |
| 10 | + * the Free Software Foundation, either version 3 of the License, or |
| 11 | + * any later version. |
| 12 | + * |
| 13 | + * lsp-dsp-lib is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU Lesser General Public License for more details. |
| 17 | + * |
| 18 | + * You should have received a copy of the GNU Lesser General Public License |
| 19 | + * along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>. |
| 20 | + */ |
| 21 | + |
| 22 | +#ifndef LSP_PLUG_IN_DSP_COMMON_PMATH_COS_H_ |
| 23 | +#define LSP_PLUG_IN_DSP_COMMON_PMATH_COS_H_ |
| 24 | + |
| 25 | +/** |
| 26 | + * Calculate cosine function: dst[i] = cos(dst[i]) |
| 27 | + * |
| 28 | + * @param dst destination vector |
| 29 | + * @param count number of elements |
| 30 | + */ |
| 31 | +LSP_DSP_LIB_SYMBOL(void, cosf1, float *dst, size_t count); |
| 32 | + |
| 33 | +/** |
| 34 | + * Calculate cosine function: dst[i] = cos(src[i]) |
| 35 | + * |
| 36 | + * @param dst destination vector |
| 37 | + * @param src source vector |
| 38 | + * @param count number of elements |
| 39 | + */ |
| 40 | +LSP_DSP_LIB_SYMBOL(void, cosf2, float *dst, const float *src, size_t count); |
| 41 | + |
| 42 | +/** |
| 43 | + * Calculate cosine function with generated argument: dst[i] = cos(k*i + p) |
| 44 | + * |
| 45 | + * @param dst destination vector |
| 46 | + * @param k phase step |
| 47 | + * @param p initial phase |
| 48 | + * @param count number of elements |
| 49 | + */ |
| 50 | +LSP_DSP_LIB_SYMBOL(void, cosf_kp1, float *dst, float k, float p, size_t count); |
| 51 | + |
| 52 | + |
| 53 | +#endif /* LSP_PLUG_IN_DSP_COMMON_PMATH_COS_H_ */ |
0 commit comments