#include <config.h>
#include <stdlib.h>
#include <pds/pdsdf.h>
#include <pds/pdsvector.h>
#include "extras.h"
#include <math.h>
int main(int argc, char** argv)
{
PdsVector *D=NULL;
PdsVector *X=NULL;
PdsVector *E=NULL;
PdsVector *Y=NULL;
FILE *fd=NULL;
char DATAFILE[]="datos.txt";
char OCTAVEFILE[]="plotinoctave.m";
FILE *fdh=NULL;
char HFILE[]="hdatos.txt";
char OCTAVEHFILE[]="plothinoctave.m";
N=500;
D=pds_vector_new(N);
X=pds_vector_new(N);
Y=pds_vector_new(N);
E=pds_vector_new(N);
M=24; Mhu=0.9;
y=0; e=0;
for(n=0;n<N;n++)
{
x=1.0 + sin(M_PI*n/32.0) + sin(12*M_PI*n/32.0) + sin(20*M_PI*n/32.0+M_PI/16.0);
d= sin(M_PI*n/32.0+M_PI/128.0) + sin(12*M_PI*n/32.0) ;
D->V[n]=d;
X->V[n]=x;
E->V[n]=e;
Y->V[n]=y;
}
fdh=fopen(HFILE,"w");
if(fdh==NULL) return EXIT_FAILURE;
pds_vector_fprintf(FirNlms->
Fir->
h,fdh);
fclose(fdh);
fd=fopen(DATAFILE,"w");
if(fd==NULL) return EXIT_FAILURE;
pds_vector_fprintf(D,fd);
pds_vector_fprintf(X,fd);
pds_vector_fprintf(E,fd);
pds_vector_fprintf(Y,fd);
fclose(fd);
pds_octave_plot_lin(OCTAVEFILE,DATAFILE);
pds_octave_plot_lin_fft(OCTAVEHFILE,HFILE);
pds_vector_free(D);
pds_vector_free(X);
pds_vector_free(E);
pds_vector_free(Y);
return EXIT_SUCCESS;
}