mirror of https://github.com/drowe67/codec2.git
restore C app for Es/No est test
parent
866e0737ab
commit
276b510f12
|
@ -118,3 +118,6 @@ target_link_libraries(mksine m)
|
|||
|
||||
add_executable(vq_mbest vq_mbest.c)
|
||||
target_link_libraries(vq_mbest codec2)
|
||||
|
||||
add_executable(tesno_est tesno_est.c)
|
||||
target_link_libraries(tesno_est m codec2)
|
|
@ -0,0 +1,31 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
|
||||
FILE........: tesno_est.c
|
||||
AUTHORS.....: David Rowe
|
||||
DATE CREATED: Mar 2021
|
||||
|
||||
Test for C port of Es/No estimator.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "ofdm_internal.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *fin = fopen(argv[1],"rb"); assert(fin != NULL);
|
||||
size_t nsym = atoi(argv[2]); assert(nsym >= 0);
|
||||
complex float rx_sym[nsym];
|
||||
size_t nread = fread(rx_sym, sizeof(complex float), nsym, fin);
|
||||
assert(nread == nsym);
|
||||
fclose(fin);
|
||||
|
||||
float EsNodB = ofdm_esno_est_calc(rx_sym, nsym);
|
||||
printf("%f\n",EsNodB);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue