27 lines
582 B
C
27 lines
582 B
C
#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(orig, interleaved, N);
|
|
interleaver_deinterleave(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]);
|
|
}
|
|
}
|