2024-08-23 11:53:40 +02:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* Copyright (C) 2024 Thomas Kolb
|
|
|
|
*/
|
|
|
|
|
2024-07-21 17:23:15 +02:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <layer1/interleaver.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
const size_t N = 100;
|
|
|
|
float complex orig[N];
|
|
|
|
float complex interleaved[N];
|
|
|
|
float complex deinterleaved[N];
|
|
|
|
|
|
|
|
for(size_t i = 0; i < N; i++) {
|
|
|
|
orig[i] = (float complex)i;
|
|
|
|
}
|
|
|
|
|
2024-08-14 19:13:41 +02:00
|
|
|
interleaver_interleave_cf(orig, interleaved, N);
|
|
|
|
interleaver_deinterleave_cf(interleaved, deinterleaved, N);
|
2024-07-21 17:23:15 +02:00
|
|
|
|
|
|
|
for(size_t i = 0; i < N; i++) {
|
|
|
|
printf("%5zu %5.1f %5.1f %5.1f\n", i, crealf(orig[i]), crealf(interleaved[i]), crealf(deinterleaved[i]));
|
|
|
|
assert(orig[i] == deinterleaved[i]);
|
|
|
|
}
|
|
|
|
}
|