File indexing completed on 2024-06-23 04:49:28

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 #include "kiss_fftnd.h"
0025 #include "kiss_fftr.h"
0026 
0027 #ifdef __cplusplus
0028 extern "C" {
0029 #endif
0030 
0031 typedef struct kiss_fftndr_state *kiss_fftndr_cfg;
0032 
0033 kiss_fftndr_cfg kiss_fftndr_alloc(const int *dims, int ndims, int inverse_fft, void *mem, size_t *lenmem);
0034 /*
0035  dims[0] must be even
0036 
0037  If you don't care to allocate space, use mem = lenmem = NULL
0038 */
0039 
0040 void kiss_fftndr(kiss_fftndr_cfg cfg, const kiss_fft_scalar *timedata, kiss_fft_cpx *freqdata);
0041 /*
0042  input timedata has dims[0] X dims[1] X ... X  dims[ndims-1] scalar points
0043  output freqdata has dims[0] X dims[1] X ... X  dims[ndims-1]/2+1 complex points
0044 */
0045 
0046 void kiss_fftndri(kiss_fftndr_cfg cfg, const kiss_fft_cpx *freqdata, kiss_fft_scalar *timedata);
0047 /*
0048  input and output dimensions are the exact opposite of kiss_fftndr
0049 */
0050 
0051 #define kiss_fftr_free free
0052 
0053 #ifdef __cplusplus
0054 }
0055 #endif