Home | Develop | Download | Contact
testprog8.c
1 /*
2  * testprog8.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 
23 
30 #include <config.h>
31 #include <stdlib.h>
32 #include <pds/pdsdf.h>
33 #include <pds/pdsvector.h>
34 #include "extras.h"
35 
36 
37 int main(int argc, char** argv)
38 {
39  PdsVector *Hnum=NULL;
40  PdsVector *Hden=NULL;
41  PdsVector *H=NULL;
42  PdsVector *Hband=NULL;
43  PdsVector *Hreject=NULL;
44  PdsVector *H2=NULL;
45 
46  H2=pds_vector_new(200);
47 
48  //Hnum=pds_df_butterworth_hnum_new(7,0.25);
49  //Hden=pds_df_butterworth_hden_new(7,0.25);
50  Hden=pds_vector_new(7);
51  Hnum=pds_vector_new(7);
52  pds_vector_lowpass_butterworth(Hnum,Hden,0.25);
54  pds_octplot_vector_in_png(H2,"k","Butterworth:|H(k)|^2","modulohiir.m","modulohiir.png");
55  pds_vector_free(Hnum);
56  pds_vector_free(Hden);
57 
60  pds_octplot_vector_in_png(H2,"k","Rectangular:|H(k)|^2","modulohfir1.m","modulohfir1.png");
61  pds_vector_free(H);
62 
65  pds_octplot_vector_in_png(H2,"k","Hanning:|H(k)|^2","modulohfir2.m","modulohfir2.png");
66  pds_vector_free(H);
67 
70  pds_octplot_vector_in_png(H2,"k","Hamming:|H(k)|^2","modulohfir3.m","modulohfir3.png");
71  pds_vector_free(H);
72 
76  pds_octplot_vector_in_png(H2,"k","Hamming|H(k)|^2","modulohfir4.m","modulohfir4.png");
77  pds_vector_free(H);
78 
82  pds_octplot_vector_in_png(H2,"k","Rectangular:|H(k)|^2","modulohfir5.m","modulohfir5.png");
83  pds_vector_free(Hband);
84  pds_vector_free(H);
85 
89  pds_octplot_vector_in_png(H2,"k","Rectangular:|H(k)|^2","modulohfir6.m","modulohfir6.png");
90  pds_vector_free(Hreject);
91  pds_vector_free(H);
92 
93 
94  pds_vector_free(H2);
95 
96  return EXIT_SUCCESS;
97 }
int pds_vector_iir_frequency_response(const PdsVector *hnum, const PdsVector *hden, PdsVector *H)
Encuentra el módulo de la respuesta en frecuencia, normalizada de 0 a pi del filtro digital conformad...
int pds_vector_fir_frequency_response(const PdsVector *h, PdsVector *H)
Encuentra el módulo de la respuesta en frecuencia, normalizada de 0 a pi del filtro digital conformad...
PdsVector * pds_vector_new_lowpass_hanning(PdsDfNatural N, PdsDfReal Wn)
Devuelve un vector con los coeficientes de un filtro FIR pasa bajo. Usando el método de la ventana...
PdsVector * pds_vector_new_lowpass_hamming(PdsDfNatural N, PdsDfReal Wn)
Devuelve un vector con los coeficientes de un filtro FIR pasa bajo. Usando el método de la ventana...
int pds_vector_lowpass_butterworth(PdsVector *hnum, PdsVector *hden, PdsDfReal Wn)
Encuentra el numerador y denominador de un filtro Butterworth pasa bajo. Ambos vectores de entrada ti...
PdsVector * pds_vector_new_lowpass_rectangular(PdsDfNatural N, PdsDfReal Wn)
Devuelve un vector con los coeficientes de un filtro FIR pasa bajo. Usando el método de la ventana...
PdsVector * pds_vector_new_lowpass_to_bandreject(const PdsVector *H)
Retorna un vector con . Crea a partir de un filtro pasa bajo con un corte en Wc un filtro rechaza ban...
int pds_vector_lowpass_to_highpass(PdsVector *H)
Carga un vector con . Tranforma un filtro pasa bajo con un corte en Wc a un filtro pasa alto con un c...
PdsVector * pds_vector_new_lowpass_to_bandpass(const PdsVector *H)
Retorna un vector con . Crea a partir de un filtro pasa bajoo con un corte en Wc un filtro pasa banda...

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed