Home | Develop | Download | Contact
pdsfir.h
1 /*
2  * pdsfir.h
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 
34 #ifndef __PDSFIR_H__
35 #define __PDSFIR_H__
36 
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 #include <pds/pdsdfglobal.h>
43 #include <pds/pdsvector.h>
44 
45 #include <stdio.h>
46 
47 #ifndef TRUE
48  #define TRUE 1
49 #endif
50 
51 #ifndef FALSE
52  #define FALSE 0
53 #endif
54 
77 typedef struct
78 {
80  PdsVector *h;
84  PdsVector *X;
85 }PdsFir;
86 
87 
96 PdsFir *pds_fir_new(const PdsVector *h);
97 
98 
122 PdsFir *pds_fir_get_new_lowpass(PdsDfNatural Order,PdsDfReal Wn,const PdsVector *Window);
123 
124 
149 PdsFir *pds_fir_get_new_highpass(PdsDfNatural Order,PdsDfReal Wn,const PdsVector *Window);
150 
151 
152 
180 PdsFir *pds_fir_get_new_bandpass(PdsDfNatural Order,PdsDfReal Wn1,PdsDfReal Wn2,const PdsVector *Window);
181 
209 PdsFir *pds_fir_get_new_bandstop(PdsDfNatural Order,PdsDfReal Wn1,PdsDfReal Wn2,const PdsVector *Window);
210 
211 
224 
225 
241 int pds_fir_evaluate_vector(PdsFir *FIR,const PdsVector *x,PdsVector *y);
242 
243 
244 
257 
270 
271 
281 const PdsVector* pds_fir_get_h_vector(PdsFir *FIR);
282 
283 
291 int pds_fir_get_order(PdsFir *FIR);
292 
300 int pds_fir_get_length(PdsFir *FIR);
301 
302 
316 int pds_fir_frequency_response(const PdsFir *FIR,PdsVector *H);
317 
318 
325 void pds_fir_free(PdsFir *FIR);
326 
327 
334 void pds_fir_destroy(PdsFir **FIR);
335 
336 
341 #ifdef __cplusplus
342 }
343 #endif
344 
345 #endif /* __PDSFIR_H__ */
346 
PdsVector * h
Definition: pdsfir.h:80
int pds_fir_get_order(PdsFir *FIR)
Esta función retorna o grado del filtro FIR.
void pds_fir_destroy(PdsFir **FIR)
Libera el filtro de tipo PdsFir. y carga la variable con NULL.
PdsFir * pds_fir_get_new_bandstop(PdsDfNatural Order, PdsDfReal Wn1, PdsDfReal Wn2, const PdsVector *Window)
Crea un filtro FIR rechaza banda, con un orden y frecuencias de corte especificados.
int pds_fir_get_length(PdsFir *FIR)
Esta función retorna la longitud del vector que representa el filtro FIR.
void pds_fir_free(PdsFir *FIR)
Libera el filtro de tipo PdsFir.
int pds_fir_get_x_value(PdsFir *FIR, PdsDfNatural i, PdsDfReal *x)
Esta funcion retorna el valor de X[n-i].
int pds_fir_evaluate_vector(PdsFir *FIR, const PdsVector *x, PdsVector *y)
Evalúa el filtro FIR con el vector de entrada x, el resultado es cargado en el vector y...
int pds_fir_frequency_response(const PdsFir *FIR, PdsVector *H)
Encuentra el módulo de la respuesta en frecuencia, normalizada de 0 a pi del filtro digital conformad...
PdsVector * X
Definition: pdsfir.h:84
int pds_fir_evaluate_value(PdsFir *FIR, PdsDfReal x, PdsDfReal *y)
Evalúa el filtro FIR con el valor de entrada x, el resultado es cargado en y.
const PdsVector * pds_fir_get_h_vector(PdsFir *FIR)
Esta funcion retorna la dirección del vector h con los valores del filtro fir.
PdsDfNatural N
Definition: pdsfir.h:82
PdsFir * pds_fir_get_new_lowpass(PdsDfNatural Order, PdsDfReal Wn, const PdsVector *Window)
Crea un filtro FIR pasa bajo, con un orden y frecuencia de corte especificado.
int pds_fir_get_h_value(PdsFir *FIR, PdsDfNatural i, PdsDfReal *h)
Esta funcion retorna el valor de h[i].
unsigned int PdsDfNatural
Definition: pdsdfglobal.h:47
PdsFir * pds_fir_new(const PdsVector *h)
Crea un filtro FIR con parámetros h.
Una estructura tipo PdsFir .
Definition: pdsfir.h:77
PdsFir * pds_fir_get_new_bandpass(PdsDfNatural Order, PdsDfReal Wn1, PdsDfReal Wn2, const PdsVector *Window)
Crea un filtro FIR pasa banda, con un orden y frecuencias de corte especificados. ...
float PdsDfReal
Definition: pdsdfglobal.h:42
PdsFir * pds_fir_get_new_highpass(PdsDfNatural Order, PdsDfReal Wn, const PdsVector *Window)
Crea un filtro FIR pasa alto, con un orden y frecuencia de corte especificado.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed