Test de la STFT.
- Autor
- Fernando Pujaico Rivera
- Fecha
- 26-01-2012
#include <config.h>
#include <stdlib.h>
#include <pds/pdsft.h>
#include <pds/pdsvector.h>
#include <pds/pdscvector.h>
#include <math.h>
#include "extras.h"
int main(int argc, char** argv)
{
PdsVector *Vin=NULL;
PdsCVector *Vout=NULL;
PdsVector *V=NULL;
PdsRaReal max;
FILE *fd=NULL;
PdsMatrix * M=NULL;
M=pds_matrix_new (N/2,T);
Vin=pds_vector_new(L);
Vout=pds_cvector_new(N);
V=pds_vector_new(N);
for(i=0;i<T;i++)
{
for(j=0;j<L;j++) Vin->V[j]=sin(2.0*M_PI*(2.0 + (L*i*1.0+j)/(2.0*L))*j*1.0/L);
pds_cvector_modulus2(Vout,V);
pds_matrix_copy_vector_col(M,V,i);
}
pds_octplot_surf_matrix_in_png(M,"Tiempo ID","Frecuencia ID","|STFT|","graficaVout.m","graficaVout.png");
pds_cvector_free(Vout);
pds_vector_free(Vin);
pds_vector_free(V);
pds_matrix_free(M);
return EXIT_SUCCESS;
}