Home | Develop | Download | Contact
 Todo Estructuras de Datos Funciones Variables 'typedefs' Grupos Páginas
testprograma3.c
1 /*
2  * testprograma3.c
3  *
4  * Copyright 2011 Fernando Pujaico Rivera <fernando.pujaico.rivera@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  */
22 
30 #include <config.h>
31 #include <stdlib.h>
32 #include <pds/pdsft.h>
33 #include <pds/pdsvector.h>
34 #include <pds/pdscvector.h>
35 #include <math.h>
36 
37 #include "extras.h"
38 
39 
40 int main(int argc, char** argv)
41 {
42 
43  PdsSpectrograph *SPECTROGRAPH=NULL;
44  PdsVector *Vin=NULL;
45  PdsMatrix *M=NULL;
46  PdsFtNatural j,L,N,T;
47  int id;
48 
49  L=42;
50  N=64;
51  T=3;
52 
53  Vin=pds_vector_new(L*T);
54 
55  SPECTROGRAPH=pds_spectrograph_new(L,&N);
56  id=pds_spectrograph_set_window_gauss(SPECTROGRAPH,0.4);
57 
58  M=pds_matrix_new (N/2,T);
59 
60  for(j=0;j<L*T;j++) Vin->V[j]=sin(2.0*M_PI*(2.0 + j/(1.0*L))*j*1.0/L);
61 
62  id=pds_spectrograph_evaluate_real(SPECTROGRAPH,M,Vin);
63 
64  pds_octplot_vector_in_png( Vin,
65  "n",
66  "Vin[n]",
67  "graficaVin.m",
68  "graficaVin.png"
69  );
70  pds_octplot_image_matrix_in_png( M,
71  "Tiempo ID",
72  "Frecuencia ID",
73  "|SPECTROGRAPH|",
74  "graficaM.m",
75  "graficaM.png"
76  );
77 
78  pds_vector_free(Vin);
79  pds_matrix_free(M);
80  pds_spectrograph_free(SPECTROGRAPH);
81 
82  return EXIT_SUCCESS;
83 }
84 
85 
86 
unsigned int PdsFtNatural
Definition: pdsftglobal.h:50
int pds_spectrograph_set_window_gauss(PdsSpectrograph *SPECTROGRAPH, PdsFtReal Sigma)
Copia una ventana de Gauss a W de la SPECTROGRAPH.
Estructura tipo PdsSpectrograph. Esta estructura genera un SPECTROGRAPH de L puntos de tiempo y M pun...
void pds_spectrograph_free(PdsSpectrograph *SPECTROGRAPH)
Libera una estructura de tipo puntero PdsSpectrograph.
PdsSpectrograph * pds_spectrograph_new(PdsFtNatural L, PdsFtNatural *N)
Crea una estructura de tipo PdsSpectrograph, para generar un SPECTROGRAPH de L puntos de tiempo y M p...
int pds_spectrograph_evaluate_real(PdsSpectrograph *SPECTROGRAPH, PdsMatrix *Out, const PdsVector *In)
Evalua la SPECTROGRAPH de un vector real. El número de lineas la matriz Out debe ser igual N/2=M...

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed