/* * 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 "liquid.autotest.h" #include "liquid.internal.h" LIQUID_AUTOTEST(firpfbchr_crcf,"","",0.1) { // options unsigned int M = 16; // number of channels unsigned int P = 6; // output decimation rate unsigned int m = 12; // filter semi-length (symbols) unsigned int num_blocks=1<<16; // number of symbols float As = 60.0f; // filter stop-band attenuation // create filterbank objects from prototype firpfbchr_crcf qa = firpfbchr_crcf_create_kaiser(M, P, m, As); firpfbchr_crcf_print(qa); // create multi-signal source generator msourcecf gen = msourcecf_create_default(); // add signals (gen, fc, bw, gain, {options}) msourcecf_add_noise(gen, 0.00f, 1.00f, -60); // wide-band noise msourcecf_add_noise(gen, -0.30f, 0.10f, -20); // narrow-band noise msourcecf_add_noise(gen, 0.08f, 0.01f, -30); // very narrow-band noise // modulated data msourcecf_add_modem(gen, 0.1875f, // center frequency 0.065f, // bandwidth (symbol rate) -20, // gain LIQUID_MODEM_QPSK, // modulation scheme 12, // filter semi-length 0.3f); // modem parameters // create spectral periodogoram unsigned int nfft = 2400; spgramcf p0 = spgramcf_create_default(nfft); spgramcf c1 = spgramcf_create_default(nfft); spgramcf c3 = spgramcf_create_default(nfft); // run channelizer float complex buf_0[P]; float complex buf_1[M]; unsigned int i; for (i=0; i