#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 *h=NULL;
PdsVector *X=NULL;
PdsVector *Y1=NULL;
PdsVector *Y2=NULL;
FILE *fd=NULL;
char DATAFILE[]="datos.txt";
char OCTAVEFILE[]="plotinoctave.m";
N=128;
h=pds_vector_new(3);
X=pds_vector_new(N);
Y1=pds_vector_new(N);
Y2=pds_vector_new(N);
pds_vector_set_value(h,0,1.70710678118655);
pds_vector_set_value(h,1,-2.41421356237310);
pds_vector_set_value(h,2,1.70710678118655);
for(n=0;n<N;n++)
{
x=1.0+sin(M_PI*n/32.0)+sin(M_PI*n/4.0+M_PI/16.0);
X->V[n]=x;
Y1->V[n]=y;
}
fd=fopen(DATAFILE,"w");
if(fd==NULL) return EXIT_FAILURE;
pds_vector_fprintf(X,fd);
pds_vector_fprintf(Y1,fd);
pds_vector_fprintf(Y2,fd);
fclose(fd);
pds_octave_plot_lin(OCTAVEFILE,DATAFILE);
pds_vector_free(Y2);
pds_vector_free(Y1);
pds_vector_free(X);
pds_vector_free(h);
if(FIR1!=NULL)
{
printf("H:\n");
}
PdsVector* Hw=pds_vector_new(200);
pds_octplot_vector_in_png(Hw,"k","|H(k)|^2","testprog2a.m","testprog2a.png");
return EXIT_SUCCESS;
}