File indexing completed on 2024-05-12 04:53:38
0001 /* 0002 SPDX-FileCopyrightText: 2003-2004 Mark Borgerding <Mark@Borgerding.net> 0003 SPDX-License-Identifier: BSD-3-Clause 0004 All rights reserved. 0005 0006 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 0007 0008 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 0009 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or 0010 other materials provided with the distribution. 0011 * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written 0012 permission. 0013 0014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 0015 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY 0016 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 0017 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 0018 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0019 */ 0020 0021 #pragma once 0022 0023 #include "../kiss_fft.h" 0024 #ifdef __cplusplus 0025 extern "C" { 0026 #endif 0027 0028 /* 0029 0030 Real optimized version can save about 45% cpu time vs. complex fft of a real seq. 0031 0032 0033 0034 */ 0035 0036 typedef struct kiss_fftr_state *kiss_fftr_cfg; 0037 0038 kiss_fftr_cfg kiss_fftr_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem); 0039 /* 0040 nfft must be even 0041 0042 If you don't care to allocate space, use mem = lenmem = NULL 0043 */ 0044 0045 void kiss_fftr(kiss_fftr_cfg cfg, const kiss_fft_scalar *timedata, kiss_fft_cpx *freqdata); 0046 /* 0047 input timedata has nfft scalar points 0048 output freqdata has nfft/2+1 complex points 0049 */ 0050 0051 void kiss_fftri(kiss_fftr_cfg cfg, const kiss_fft_cpx *freqdata, kiss_fft_scalar *timedata); 0052 /* 0053 input freqdata has nfft/2+1 complex points 0054 output timedata has nfft scalar points 0055 */ 0056 0057 #define kiss_fftr_free free 0058 0059 #ifdef __cplusplus 0060 } 0061 #endif