Beruflich Dokumente
Kultur Dokumente
PDI 2007-08
6.1
2.
3.
PDI 2007-08
6.2
1 + 1 1 1 1
Banda de rechazo Banda de paso Banda de rechazo
2
Fq1 Fp1
PDI 2007-08
Fp 2 Fq 2
0.5
6.3
Paso Bajo
1
H (F )
Paso Alto
F
0.5 0.5
H (F )
1
Paso Banda
H (F )
1
Rechazo Banda
F
0.5 0.5
En la prctica, los mtodos de diseo se desarrollan para filtros paso bajo, porque los otro tres tipos se pueden obtener a partir de este
PDI 2007-08
6.4
Paso Bajo
1
H ( F 0 .5 )
Paso Alto
FC
F
0 .5
0 .5 FC
F
0 .5
Para convertir un filtro paso bajo en otro paso alto basta aplicar un desplazamiento de 0.5 a la respuesta frecuencial del filtro paso bajo. Esto por la propiedad del desplazamiento frecuencial de la DTFT equivale en el dominio del tiempo a:
Es decir, que basta cambiar de signo los elementos impares de la respuesta a impulso para obtener un filtro paso alto con frecuencia de corte 0.5-FC
PDI 2007-08
6.5
y(n)
x(n) h1(n)h2(n)
y(n)
Rechazo banda:
x(n) h1(n)+h2(n)
y(n)
h2(n)
PDI 2007-08
6.6
y (n) = hk x(n k )
h(n) = h( M n) n = 0,1, K , M
Siempre son estables. Mtodos de diseo generalmente lineales. Simples de realizar. Mtodos: Enventanado: Se basa en calcular la IDTFT de la H(F) deseada y truncarla utilizando alguna ventana a elegir para suavizar su efecto. MATLAB: fir1, fir2 No se suele especificar la banda de transicin. ptimos: Se basan en minimizar el error entre la H(F) deseada y la obtenida con el filtro segn algn criterio: Mnimos cuadrados (minimiza error cuadrtico) MATLAB: firls Parks-McClellan o equiripple (rizado uniforme) MATLAB: remez Otros. MATLAB: fircls, cremez,firrcos
Ojo! En las funciones MATLAB se usa una frecuencia normalizada en el rango 0-0.5. Es decir, la frecuencia 1 corresponde a 0.5 ciclos/muestra. PDI 2007-08
6.7
0.1
0.2
0.3
0.4
0.5
0.1
0.2
0.3
0.4
0.5
0.1
0.2
0.3
0.4
0.5
0.5
0.5
0.5
x
0 0 0
-0.2
0 10 20 30 40 50 60 70 80 90 100
-0.2 0 10 20 30 40 50 60 70 80 90 100
0 -0.2 0 10 20 30 40 50 60 70 80 90 100
PDI 2007-08
6.8
FIR1 FIR filter design using the window method. B = FIR1(N,Wn) designs an N'th order lowpass FIR digital filter and returns the filter coefficients in length N+1 vector B. The cut-off frequency Wn must be between 0 < Wn < 1.0, with 1.0 corresponding to half the sample rate. The filter B is real and has linear phase, i.e., even symmetric coefficients obeying B(k) = B(N+2-k), k = 1,2,...,N+1. . . By default FIR1 uses a Hamming window. Other available windows, including Boxcar, Hanning, Bartlett, Blackman, Kaiser and Chebwin can be specified with an optional trailing argument. For example, B = FIR1(N,Wn,kaiser(N+1,4)) uses a Kaiser window with beta=4. B = FIR1(N,Wn,'high',chebwin(N+1,R)) uses a Chebyshev window. . . See also KAISERORD, FIRCLS1, FIR2, FIRLS, FIRCLS, CREMEZ, REMEZ, FREQZ, FILTER.
FIRLS Linear-phase FIR filter design using least-squares error minimization. B=FIRLS(N,F,A) returns a length N+1 linear phase (real, symmetric coefficients) FIR filter which has the best approximation to the desired frequency response described by F and A in the least squares sense. F is a vector of frequency band edges in pairs, in ascending order between 0 and 1. 1 corresponds to the Nyquist frequency or half the sampling frequency. A is a real vector the same size as F which specifies the desired amplitude of the frequency response of the resultant filter B. The desired response is the line connecting the points (F(k),A(k)) and (F(k+1),A(k+1)) for odd k; FIRLS treats the bands between F(k+1) and F(k+2) for odd k as "transition bands" or "don't care" regions. Thus the desired amplitude is piecewise linear with transition bands. The integrated squared error is minimized. . . See also REMEZ, FIR1, FIR2, FREQZ and FILTER.
PDI 2007-08
6.9
a
k =0
y (n k ) = bk x(n k )
k =0
Propiedades: Consiguen cumplir unas determinadas especificaciones con un orden mucho menor que el necesario con filtros FIR. Pueden ser inestables. No pueden tener fase lineal.. Mtodos: Derivados de mtodos para filtros analgicos: se basan en utilizar los mtodos existentes para disear filtros analgicos y luego transformarlos en digitales: Ejemplos: Funciones MATLAB: Butterworth butter Chebyshev (1 y 2) cheby1, cheby2 Elptico ellip Bessel besself Directos: Se basan en minimizar el error entre la H(F) deseada y la obtenida con el filtro por algn criterio, por ejemplo, el de mnimos cuadrados: MATLAB: yulewalk
PDI 2007-08
6.10
CHEBY1 Chebyshev type I digital and analog filter design. [B,A] = CHEBY1(N,R,Wn) designs an Nth order lowpass digital Chebyshev filter with R decibels of ripple in the passband. CHEBY1 returns the filter coefficients in length N+1 vectors B (numerator) and A (denominator). The cut-off frequency Wn must be 0.0 < Wn < 1.0, with 1.0 corresponding to half the sample rate. Use R=0.5 as a starting point, if you are unsure about choosing R. . . See also CHEB1ORD, CHEBY2, BUTTER, ELLIP, FREQZ, FILTER.
YULEWALK Recursive filter design using a least-squares method. [B,A] = YULEWALK(N,F,M) finds the N-th order recursive filter coefficients B and A such that the filter: -1 B(z) -(n-1)
matches the magnitude frequency response given by vectors F and M. Vectors F and M specify the frequency and magnitude breakpoints for the filter such that PLOT(F,M) would show a plot of the desired frequency response. The frequencies in F must be between 0.0 and 1.0, with 1.0 corresponding to half the sample rate. They must be in increasing order and start with 0.0 and end with 1.0.
See also FIR1, BUTTER, CHEBY1, CHEBY2, ELLIP, FREQZ and FILTER.
PDI 2007-08
6.11
F2
0.5
F2
H ( F1 , F2 )
0.5
0.5
H ( F1 , F2 )
0.5
F1
F1
Filtro paso-bajo
Filtro paso-banda
Existen mtodos de diseo que son una extensin de los de 1 dimensin Pueden ser IIR o FIR, pero en la prctica slo se usan los FIR (por simplicidad y porque en imagen es importante que el filtro sea de fase lineal). Por ello, en MATLAB slo hay mtodos para sistemas FIR: fsamp2, ftrans2, fwind1, fwind2.
PDI 2007-08
6.12
PDI 2007-08
6.13
x(n) h(0)
z-1 h(1)
+
z-1 h(2)
+
z-1 h(3)
+
L L
+
z-1 h(M-2)
L
+
z-1
z-1 h(0)
+
z-1 h(1)
L L
+
z-1
M 3 h 2
+
PDI 2007-08
6.14
H ( z ) = (b0 k + b1k z 1 + b2 k z 2 )
k =1
x(n)
b01
b02
+
z-1 b11 z-1 b12
+
z-1 b21 z-1 b22
PDI 2007-08
6.15
PDI 2007-08
6.16
M
bM-1 z-1 bM
M M
M
-aN-1
M
-aN-1 +
M
bN-1 z-1 -aN bN
M
+
Forma directa I
PDI 2007-08
6.17
y(n)
b0
+
x(n)
z-1 -a1
+
b1 z-1
-a2
+
b2 z-1
-a3
+
b3
FILTIC Make initial conditions for 'filter' function. Z = filtic( B, A, Y, X ) converts past input X and output Y into initial conditions for the state variables Z needed in the TRANSPOSED DIRECT FORM II filter structure. The vectors of past inputs & outputs are stored with more recent values first, i.e. X = [ x[-1] x[-2] x[-3] ... x[-nb] ... ] Y = [ y[-1] y[-2] y[-3] ... y[-na] ... ]
M
-aN-1
M
+
M
bN-1
z-1 -aN
+
bN
PDI 2007-08
6.18