/* * Copyright (c) 2007 - 2026 Joseph Gaeddert * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include #include #include "liquid.autotest.h" #include "liquid.h" // autotest helper function // _id : test id for saving log file // _type : NCO type (e.g. LIQUID_NCO) // _freq : normalized frequency (f/Fs), _freq in [-0.5,0.5) void testbench_nco_crcf_spectrum(liquid_autotest __q__, int _id, int _type, float _freq) { unsigned long int num_samples = 1UL<<16; unsigned int nfft = 9600; // create object and initialize nco_crcf nco = nco_crcf_create(_type); nco_crcf_set_frequency(nco, 2*M_PI*_freq); // sample buffer unsigned int buf_len = 3*nfft; float complex * buf_0 = (float complex*)malloc(buf_len*sizeof(float complex)); float complex * buf_1 = (float complex*)malloc(buf_len*sizeof(float complex)); unsigned int i; for (i=0; i