From e98f1b8eec61d61dc96c49a846877c6fb10257a9 Mon Sep 17 00:00:00 2001 From: "Joseph D. Gaeddert" Date: Tue, 16 Apr 2024 18:53:24 -0400 Subject: [PATCH] firpfbchr: extending test to include multiple output spectra --- .../tests/firpfbchr_crcf_autotest.c | 82 +++++++++++-------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/src/multichannel/tests/firpfbchr_crcf_autotest.c b/src/multichannel/tests/firpfbchr_crcf_autotest.c index b2f2a52a8..e12acb018 100644 --- a/src/multichannel/tests/firpfbchr_crcf_autotest.c +++ b/src/multichannel/tests/firpfbchr_crcf_autotest.c @@ -29,13 +29,10 @@ void autotest_firpfbchr_crcf() // options unsigned int M = 16; // number of channels unsigned int P = 6; // output decimation rate - unsigned int m = 5; // filter semi-length (symbols) + 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 - unsigned int i; - unsigned int channel_id = 3; - // create filterbank objects from prototype firpfbchr_crcf qa = firpfbchr_crcf_create_kaiser(M, P, m, As); firpfbchr_crcf_print(qa); @@ -43,27 +40,29 @@ void autotest_firpfbchr_crcf() // create multi-signal source generator msourcecf gen = msourcecf_create_default(); - // add signals (gen, fc, bw, gain, {options}) - msourcecf_add_noise(gen, 0.00f, 1.0f, -60); // wide-band noise - msourcecf_add_noise(gen, -0.30f, 0.1f, -20); // narrow-band noise - msourcecf_add_tone (gen, 0.08f, 0.0f, 0); // tone + // 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, - (float)channel_id/(float)M, // center frequency - 0.080f, // bandwidth (symbol rate) - -20, // gain - LIQUID_MODEM_QPSK, // modulation scheme - 12, // filter semi-length - 0.3f); // modem parameters + 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 p1 = 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