Filter Notes
Dr. Bradley J. BazuinWestern Michigan University
College of Engineering and Applied SciencesDepartment of Electrical and Computer Engineering
1903 W. Michigan Ave.Kalamazoo MI, 49008-5329
Filter Notes 2
Filter Notes
• Terminology and Real Filter Concepts– Transition band and filter shape factor
• Filter Bandwidth Definitions• Butterworth Filter Examples in Matlab• Chebyshev Type I Examples in Matlab• MATLAB Filtering
– Comparing classical analog filters– Matlab functions to support analog filter generation
Filter Notes 3
Real Filters: TerminologyLow Pass Filter• Passband
– Frequencies where signal is meant to pass
• Stopband– Frequencies where some defined
level of attenuation is desired• Transition-band
– The transitions frequencies between the passband and the stopband
• Filter Shape Factor– The ratio of the stopband bandwidth
to the passband bandwidthPB
SB
BWBWSF
0 dB
-XX dBStopband
Passband
TransitionBand
PBBW
SBBW
Freq.
Pow
er (d
B)
pf
sf
Filter Notes 4
Real Filters: TerminologyBand Pass Filter• Passband
– Frequencies where signal is meant to pass
• Stopband– Frequencies where some defined
level of attenuation is desired• Transition-band
– The transitions frequencies between the passband and the stopband
• Filter Shape Factor– The ratio of the stopband bandwidth
to the passband bandwidthPB
SB
BWBWSF
0 dB
-XX dBStopband
Passband
TransitionBand
PBBW
SBBW
Freq.
Pow
er (d
B)
TransitionBandStopband
plf
slf
puf
suf
Filter Notes 5
Passband/Stopband Ripple
• Based on the filter type, the passband and stopband may not be smooth
• The change in the band is defined as an allowable ripple– Note: for passbands, a 3 dB ripple may not be desirable; therefore,
for real filters the 3 dB point is often of no interest.
Stopband
Passband
TransitionBand
PBBW
SBBW
Freq.Po
wer
(dB)
dBpdB0
dBp
dBs
pf
sf
Filter Notes 6
Bandwidths that are Used
Notes and figures are based on or taken from materials in the course textbook: Bernard Sklar, Digital Communications, Fundamentals and Applications,
Prentice Hall PTR, Second Edition, 2001.
Filter Notes 7
Bandwidth Definitions(a) Half-power bandwidth. This is the interval between frequencies at which Gx(f
) has dropped to half-power, or 3 dB below the peak value.(b) Equivalent rectangular or noise equivalent bandwidth. The noise equivalent
bandwidth was originally conceived to permit rapid computation of output noise power from an amplifier with a wideband noise input; the concept can similarly be applied to a signal bandwidth. The noise equivalent bandwidth WN of a signal is defined by the relationship WN = Px/Gx(fc), where Px is the total signal power over all frequencies and Gx(fc) is the value of Gx(f ) at the band center (assumed to be the maximum value over all frequencies).
(c) Null-to-null bandwidth. The most popular measure of bandwidth for digital communications is the width of the main spectral lobe, where most of the signal power is contained. This criterion lacks complete generality since some modulation formats lack well-defined lobes.
Notes and figures are based on or taken from materials in the course textbook: Bernard Sklar, Digital Communications, Fundamentals and Applications,
Prentice Hall PTR, Second Edition, 2001.
Filter Notes 8
Bandwidth Definitions (2)(d) Fractional power containment bandwidth. This bandwidth criterion has been
adopted by the Federal Communications Commission (FCC Rules and Regulations Section 2.202) and states that the occupied bandwidth is the band that leaves exactly 0.5% of the signal power above the upper band limit and exactly 0.5% of the signal power below the lower band limit. Thus 99% of the signal power is inside the occupied band.
(e) Bounded power spectral density. A popular method of specifying bandwidth is to state that everywhere outside the specified band, Gx(f ) must have fallen at least to a certain stated level below that found at the band center. Typical attenuation levels might be 35 or 50 dB.
(f) Absolute bandwidth. This is the interval between frequencies, outside of which the spectrum is zero. This is a useful abstraction. However, for all realizable waveforms, the absolute bandwidth is infinite.
Notes and figures are based on or taken from materials in the course textbook: Bernard Sklar, Digital Communications, Fundamentals and Applications,
Prentice Hall PTR, Second Edition, 2001.
Filter Notes 9
Other Filter Types (Bandwidth and Center Frequency)
Vectron International, General technical information, http://www.vectron.com/products/saw/pdf_mqf/TECHINFO.pdf
BW
typi
cally
a
band
-pas
s filt
er
Op-Amp max freq.
Resonant electro-mechanical devices used for electrical filtering.
When op-amps, Rs and Cs don’t work anymore.
Filter Notes 10
Butterworth Low Pass Filter
• Maximally Flat, Smooth Roll-off, identical 3dB point for all filter orders
n2
0ww1
1jwHjwH
n2
0
n
n2
0
n2
n2
0
2
ws11
1w
sj1
1wj
s1
1sH
M.E. Van Valkenburg, Analog Filter Design, Oxford Univ. Press, 1982. SBN: 0-19-510734-9
10-1 100 101 102 103-120
-100
-80
-60
-40
-20
0
Butterworth Filter Family
Frequency (normalized)
Atte
nuat
ion
(dB
)
1st order2nd order3rd order4th order5th order
Filter Notes 11
Butterworth Filter PSD
10-1 100 101 102 103-120
-100
-80
-60
-40
-20
0
Butterworth Filter Family
Frequency (normalized)
Atte
nuat
ion
(dB
)
1st order2nd order3rd order4th order5th order
Filter Notes 12
Butterworth Filter PSD (2)
10-1 100-9
-8
-7
-6
-5
-4
-3
-2
-1
0
1Butterworth Filter Family
Frequency (normalized)
Atte
nuat
ion
(dB
)
1st order2nd order3rd order4th order5th order
Filter Notes 13
Matlab Script: ButterPlot.m%% Butterworth filter plots%
freqrange = logspace(-1,3,1024)';wrange=2*pi*freqrange;
[B1,A1]=butter(1,2*pi,'s');[H1] = freqs(B1,A1,wrange);
[B2,A2]=butter(2,2*pi,'s');[H2] = freqs(B2,A2,wrange);
[B3,A3]=butter(3,2*pi,'s');[H3] = freqs(B3,A3,wrange);
[B4,A4]=butter(4,2*pi,'s');[H4] = freqs(B4,A4,wrange);
[B5,A5]=butter(5,2*pi,'s');[H5] = freqs(B5,A5,wrange);
Hmatrix=[H1 H2 H3 H4 H5];
figure(1)semilogx(freqrange,dB(psdg(Hmatrix)));gridtitle('Butterworth Filter Family');xlabel('Frequency (normalized)');ylabel('Attenuation (dB)');legend('1st order','2nd order','3rd order','4th order','5th order','Location','SouthWest');axis([10^-1 10^3 -120 3]);
figure(2)semilogx(freqrange,dB(psdg(Hmatrix)));gridtitle('Butterworth Filter Family');xlabel('Frequency (normalized)');ylabel('Attenuation (dB)');legend('1st order','2nd order','3rd order','4th order','5th order','Location','SouthWest');axis([10^-1 3 -9 1]);
Filter Notes 14
Chebyshev Type IFilter PSD (Cheby1Plot.m)
10-1 100 101 102 103-120
-100
-80
-60
-40
-20
0
Chebyshev Type I Filter Family
Frequency (normalized)
Atte
nuat
ion
(dB
)
1st order2nd order3rd order4th order5th order
Filter Notes 15
Chebyshev Type IFilter PSD (2)
10-1 100-9
-8
-7
-6
-5
-4
-3
-2
-1
0
1Chebyshev Type I Filter Family
Frequency (normalized)
Atte
nuat
ion
(dB
)
1st order2nd order3rd order4th order5th order
Filter Notes 16
Available MATLAB Filters(Signal Proc. TB)
• http://www.mathworks.com/help/signal/index.html
• Analog (s-domain) or Digital (z-domain)– Butterworth– Chebyshev Type I– Chebyshev Type II– Elliptic or Cauer– Bessel
• Digital “Windows”– barthannwin– bartlett– blackman– blackmanharris– bohmanwin– chebwin– flattopwin– gausswin– hamming – hann– kaiser– nuttallwin– parzenwin– rectwin– triang– tukeywin
– http://www.mathworks.com/help/signal/windows.html
Filter Notes 17
Analog Lowpass Filter Design • Butterworth
– Monotonic Decreasing Magnitude
– All poles• Chebyshev (Cheby Type 1)
– Passband Ripple– All poles
• Inverse Chebyshev (Cheby Type2) – Stopband Ripple
• Elliptical or Cauer Filter – Passband Ripple– Stopband Ripple
• Bessel Filter– Linear Phase Maximized– Monotonic
101 102 103 104 105 106 107-160
-140
-120
-100
-80
-60
-40
-20
0
20Filter Comparison: Magnitude
ButterBesselCheby1Cheby2EllipSpec
Butterworth Order PredicationFilter Order = 4 3dB BW = 1778.28 Hz
Bessel Order PredicationFilter Order = 4 3dB BW = 1778.28 Hz
Chebyshev Type I Order PredicationFilter Order = 3 3dB BW = 1000 Hz
Chebyshev Type II Order PredicationFilter Order = 3 3dB BW = 8972.85 Hz
Elliptical or Cauer Order PredicationFilter Order = 3 3dB BW = 1000 Hz
Filter Notes 18
Matlab Filter Generation (1)• Passband • Stopband• Passband Ripple (dB)• Stopband Ripple (dB)
• fpass=1000;• fstop=10000;• AlphaPass=0.5;• AlphaStop=60;• w#### = 2 x pi x f####
[Nbutter, Wnbutter] = buttord(wpass, wstop, AlphaPass, AlphaStop,'s');
[Ncheby1, Wncheby1] = cheb1ord(wpass, wstop, AlphaPass, AlphaStop,'s');
[Ncheby2, Wncheby2] = cheb2ord(wpass, wstop, AlphaPass, AlphaStop,'s');
[Nellip, Wnellip] = ellipord(wpass, wstop, AlphaPass, AlphaStop,'s');
Filter Order and other design parameters
Filter Notes 19
Matlab Filter Generation (2)Filter Transfer Function Generation
[numbutter,denbutter] = butter(Nbutter,Wnbutter,'low','s')[numbesself,denbesself] = besself(Nbutter,Wnbutter)[numcheby1,dencheby1] = cheby1(Ncheby1,AlphaPass, Wncheby1,'low','s')[numcheby2,dencheby2] = cheby2(Ncheby2,AlphaStop, Wncheby2,'low','s')[numellip,denellip] = ellip(Nellip,AlphaPass,AlphaStop, Wnellip,'low','s');
Spectral Response from Transfer Function[Specbutter]=freqs(numbutter,denbutter,wspace);[Specbesself]=freqs(numbesself,denbesself,wspace);[Speccheby1]=freqs(numcheby1,dencheby1,wspace);[Speccheby2]=freqs(numcheby2,dencheby2,wspace);[Specellip]=freqs(numellip,denellip,wspace);
Filter Notes 20
Matlab Filter Generation (3)figure(10)semilogx((fspace),dB(psdg([Specbutter Specbesself Speccheby1 Speccheby2 Specellip])), ...
specfreq1,specmag1,'k-.',specfreq2,specmag2,'k-.',specfreq3,specmag3,'k-.');title('Filter Comparison: Magnitude')legend('Butter','Bessel','Cheby1','Cheby2','Ellip','Spec')
101 102 103 104 105 106 107-150
-100
-50
0
Filter Comparison: Magnitude
ButterBesselCheby1Cheby2EllipSpec
Generating Digital Filters
• MATLAB loves digital filter. – Leave off the ‘s’ from the design programs– Select the passband and stopband in terms of the sample rate/2
from (0 to 1)– IIR filters of defined order are generated.– For the spectrum, use freqz instead of freqs
Filter Notes 21
Filter Notes 22
Matlab Digital Filter Generation (1)• Sample Rate • Passband • Stopband• Passband Ripple (dB)• Stopband Ripple (dB)
• Fs=8000;• fpass=1000;• fstop=3750;• AlphaPass=0.1;• AlphaStop=80;• w#### = f####/(Fs/2)
[Nbutter, Wnbutter] = buttord(wpass, wstop, AlphaPass, AlphaStop);
[Ncheby1, Wncheby1] = cheb1ord(wpass, wstop, AlphaPass, AlphaStop);
[Ncheby2, Wncheby2] = cheb2ord(wpass, wstop, AlphaPass, AlphaStop);
[Nellip, Wnellip] = ellipord(wpass, wstop, AlphaPass, AlphaStop);
Filter Order and other design parameters
Filter Notes 23
Matlab Digital Filter Generation (2)Filter Transfer Function Generation
[numbutter,denbutter] = butter(Nbutter,Wnbutter,'low')[numcheby1,dencheby1] = cheby1(Ncheby1,AlphaPass, Wncheby1,'low')[numcheby2,dencheby2] = cheby2(Ncheby2,AlphaStop, Wncheby2,'low')[numellip,denellip] = ellip(Nellip,AlphaPass,AlphaStop, Wnellip,'low')
Spectral Response from Transfer Function
[Specbutter,wspace]=freqz(numbutter,denbutter,fftsize,'whole')[Speccheby1,wspace]=freqz(numcheby1,dencheby1,fftsize,'whole');[Speccheby2,wspace]=freqz(numcheby2,dencheby2,fftsize,'whole');[Specellip,wspace]=freqz(numellip,denellip,fftsize,'whole');
Filter Notes 24
Matlab Digital Filter Generation (3)plot((wspace)/(2*pi),dB(psdg([Specbutter Speccheby1 Speccheby2 Specellip Specfirpm])), ...
specfreq1/(2*pi),specmag1,'k-.',specfreq2/(2*pi),specmag2,'k-.',specfreq3/(2*pi),specmag3,'k-.',...specfreq4/(2*pi),specmag4,'k-.',specfreq5/(2*pi),specmag5,'k-.')
legend('Butter','Cheby1','Cheby2','Ellip','FIRPM','Spec.','Location','SouthEast')title('Digital Filter Comparison: Magnitude')
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-160
-140
-120
-100
-80
-60
-40
-20
0
20
/2
Mag
nitu
de (d
B)
Digital Filter Comparison: Magnitude
ButterCheby1Cheby2EllipFIRPMSpec.
Coherent Gain of a Digital Filter
• FIR: Sum the coefficients
• For x(k)=1 for all k, y(∞) for a LPF settles to a constant
• To adjust for unity gain, divide the sum of the numerator coefficients by the sum of the coherent gain
Filter Notes 25
22
11
22
110
1 zazazbzbbzH
2121 21021 nxbnxbnxbnyanyany
210211 bbbaay
21
210
1 aabbby
Filter Notes 26
Pulse Response and Risetime• Low Pass Filters cause sharp signal edges to be smoothed.• The amount of smoothing is based on the bandwidth of the
filter– More smoothing smaller bandwidth
• Fourier relationship:– a narrow rect function in time results in a broad (wide bandwidth)
sinc function in frequency– a wide rect function in time results in a narrow (small bandwidth)
sinc function in frequency
Filter Notes 27
Filter Step Response
• 1 Hz and 10 Hz 4th order Butterworth LPF Filters (s-domain)• The step response can be used to help define the bandwidth
required for pulse signals.
10-1 100 101 102 103 104-120
-100
-80
-60
-40
-20
0
Butterworth Filters
Frequency (normalized)
Atte
nuat
ion
(dB
)
1 Hz10 Hz
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.80
0.2
0.4
0.6
0.8
1
1.2
1.4
Step Response
Time (sec)
Ampl
itude
1 Hz10 Hz
Filter Notes 28
Filter Bandwidth for Pulses• Pulse of length T
• Null-to-null BW of
• Single Sided BW
• B/2 may be acceptable in some cases
TfcsinTTtrect
T2nulltonull
T1B -3 -2 -1 0 1 2 3
0
0.5
1
1.5
2
Filter Notes 29
Pulse Filtering
• Four one-sided BW filters• 0.1 sec pulse responses
– B=1/T = 10 Hz– 2B=2/T = 20 Hz– B/2 = 1/2T = 5 Hz– Fs = 100 Hz
0 10 20 30 40 50 60 70 80 90 100-160
-140
-120
-100
-80
-60
-40
-20
0
20Butterworth Filters
Frequency (fs = 100 Hz)
Atte
nuat
ion
(dB
)
2.5 Hz5.0 Hz10. Hz20. Hz
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-0.2
0
0.2
0.4
0.6
0.8
1
1.2Butterworth Filters
Time (fs=100Hz)
Am
plitu
de (d
B)
Test Signal2.5 Hz5.0 Hz10. Hz20. Hz
PulseTest1.m
(Butterworthdigital filters)
Filter Notes 30
Matlab Code Example so far
• AnalogFilterCompare.m• DigitalFilterCompare.m• PulseTest1.m
Design Parameters
• Signal Type• Signal bandwidth• Spectral filtering requirements• Special requirements
– Signal to Noise Ratio (SNR)– Bit Error Rate (BER)– Intersymbol interference (ISI)– Multipath considerations (reflected signal paths?)
Filter Notes 31
Example Bandwidth Considerations
• Analog communications signals have definable bandwidths based on the modulation type– Amplitude Modulation– Phase Modulation– Frequency Modulation
• Digital communications based on analog are concerned with “symbol” detection and ISI– Amplitude Shift Keying (ASK or OOK)– Phase Shift Keying (PSK)– Frequency Shift Keying (FSK)– Quadrature Amplitude Modulation (QAM)
Filter Notes 32
Filter Notes 33
Bandwidth Estimates for Common Communication Signals
AM Signals:• For both AM and DSB signals, for a signal with maximum
frequency , the bandwidths used should be:• Bandpass Signal:
– BPF bandwidth =
• Baseband Signal:– LPF bandwidth =
Wf max
maxmax ffffff ccc
max2 f
maxmax fff
maxf
tftmAts 01 2cos1
Filter Notes 34
Bandwidth Estimates for Common Communication Signals
PM Signals:• For both PM signals, for a signal with maximum frequency
, the bandwidth is based on Carson’s rule and should be:
• BPF Bandwidth:• LPF bandwidth
– These equations wok with the following restrictions; abs(m(t)) 1, A = 1, and
– After PM demodulation, a post-demodulation LPF with bandwidth W should be used to limit noise power contributions to the output.
Wf max
max12 fB PMT
max1 fB PMDpre
PM
tmtfAts p 202cos
Filter Notes 35
Bandwidth Estimates for Common Communication Signals
FM Signals:• For both FM signals, for a signal with maximum frequency
, the bandwidth is based on the Deviation ratio (D) which typically uses Carson’s rule for D>>1 or D<<1 and should be:
• BPF Bandwidth D>>1 or D<<1:• LPF Bandwidth D>>1 or D<<1:• BPF Bandwidth 2<D<10:• LPF Bandwidth 2<D<10:
– These equations wok with the following restrictions; abs(m(t)) 1 and A = 1.
– After FM demodulation, a post-demodulation LPF with bandwidth W should be used to limit noise power contributions to the output.
Wf max
max12 fDBT
max1 fDB Dpre
max22 fDBT
max2 fDB Dpre
t
f dmtfAts 30 22cosW
Dwhere f
Symbol Period PSK/FSK
• For a symbol period T, a 2/T LPF can be used.
• PulseTest2.m• PulseTest3.m
• Note: in many communication systems, the goal for demodulation is one sample per symbol. If time alignment is required 2 or more samples per symbol may be required or desired for receiver design considerations.
Filter Notes 36
Top Related