1 /* 2 This software is part of pffft/pfdsp, a set of simple DSP routines. 3 4 Copyright (c) 2014, Andras Retzler <randras@sdr.hu> 5 Copyright (c) 2020 Hayati Ayguen <h_ayguen@web.de> 6 All rights reserved. 7 8 Redistribution and use in source and binary forms, with or without 9 modification, are permitted provided that the following conditions are met: 10 * Redistributions of source code must retain the above copyright 11 notice, this list of conditions and the following disclaimer. 12 * Redistributions in binary form must reproduce the above copyright 13 notice, this list of conditions and the following disclaimer in the 14 documentation and/or other materials provided with the distribution. 15 * Neither the name of the copyright holder nor the 16 names of its contributors may be used to endorse or promote products 17 derived from this software without specific prior written permission. 18 19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 DISCLAIMED. IN NO EVENT SHALL ANDRAS RETZLER BE LIABLE FOR ANY 23 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 #pragma once 32 33 #include <stdio.h> 34 #include <stdint.h> 35 36 #ifdef __cplusplus 37 extern "C" { 38 #endif 39 40 41 /* 42 _____ _ 43 / ____| | | 44 | | ___ _ __ ___ _ __ | | _____ __ 45 | | / _ \| '_ ` _ \| '_ \| |/ _ \ \/ / 46 | |___| (_) | | | | | | |_) | | __/> < 47 \_____\___/|_| |_| |_| .__/|_|\___/_/\_\ 48 | | 49 |_| 50 */ 51 52 typedef struct complexf_s { float i; float q; } complexf; 53 54 55 /* generation functions */ 56 void generate_dc_f(float* output, int size); 57 void generate_dc_s16(short* output, int size); 58 void generate_pos_fs4_f(float* output, int size); 59 void generate_pos_fs4_s16(short* output, int size); 60 void generate_neg_fs4_f(float* output, int size); 61 void generate_neg_fs4_s16(short* output, int size); 62 63 void generate_dc_pos_fs4_s16(short* output, int size); 64 void generate_dc_neg_fs4_s16(short* output, int size); 65 void generate_pos_neg_fs4_s16(short* output, int size); 66 void generate_dc_pos_neg_fs4_s16(short* output, int size); 67 68 void generate_pos_neg_fs2_s16(short* output, int size); 69 void generate_dc_pos_neg_fs2_s16(short* output, int size); 70 71 72 #ifdef __cplusplus 73 } 74 #endif 75 76