hamnet70/impl/test/test_interleaver.c
Thomas Kolb 2e91fd7c42 Apply free software+documentation licenses
All code is now licensed under GPLv3+. The documentation is licensed under
CC BY-SA 4.0.

This is now officially free software! \o/
2024-08-23 11:53:40 +02:00

33 lines
679 B
C

/*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Copyright (C) 2024 Thomas Kolb
*/
#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;
}
interleaver_interleave_cf(orig, interleaved, N);
interleaver_deinterleave_cf(interleaved, deinterleaved, N);
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]);
}
}