SlideShare ist ein Scribd-Unternehmen logo
1 von 67
Downloaden Sie, um offline zu lesen
Design of FIR Filters

          Elena Punskaya
   www-sigproc.eng.cam.ac.uk/~op205


                            Some material adapted from courses by
                            Prof. Simon Godsill, Dr. Arnaud Doucet,
                       Dr. Malcolm Macleod and Prof. Peter Rayner




                                                                      68
FIR as a class of LTI Filters

Transfer function of the filter is




 Finite Impulse Response (FIR) Filters:
                            N = 0, no feedback




                                              69
FIR Filters


Let us consider an FIR filter of length M (order N=M-1, watch out!
                                           order – number of delays)




                                                                       70
FIR filters


Can immediately obtain the impulse response, with x(n)= δ(n)


                            δ



      The impulse response is of finite length M, as required

      Note that FIR filters have only zeros (no poles). Hence
      known also as all-zero filters

      FIR filters also known as feedforward or
      non-recursive, or transversal
                                                         71
FIR Filters

Digital FIR filters cannot be derived from analog filters –
     rational analog filters cannot have a finite impulse
     response.

Why bother?

1.    They are inherently stable
2.    They can be designed to have a linear phase
3.    There is a great flexibility in shaping their magnitude
      response
4.    They are easy and convenient to implement

          Remember very fast implementation using FFT?

                                                           72
FIR Filter using the DFT

FIR filter:




   Now N-point DFT (Y(k)) and then N-point IDFT (y(n)) can be used
   to compute standard convolution product and thus to perform
   linear filtering (given how efficient FFT is)

                                                                     73
Linear-phase filters

The ability to have an exactly linear phase response is the one
  of the most important of FIR filters


A general FIR filter does not have a linear phase response but
  this property is satisfied when



      four linear phase filter types




                                                          74
Linear-phase filters – Filter types


Some observations:

•  Type 1 – most versatile

•  Type 2 – frequency response is always 0 at
   ω=π – not suitable as a high-pass

•  Type 3 and 4 – introduce a π/2 phase shift,
   frequency response is always 0 at ω=0 - – not
   suitable as a high-pass


                                                75
FIR Design Methods

•  Impulse response truncation – the simplest
   design method, has undesirable frequency
   domain-characteristics, not very useful but
   intro to …

•  Windowing design method – simple and
   convenient but not optimal, i.e. order
   achieved is not minimum possible

•  Optimal filter design methods


                                                 76
Back to Our Ideal Low- pass Filter Example




                                             77
Approximation via truncation




                   M




M




                                   78
Approximated filters obtained by truncation

       M                              M



           transition band




       M                          M




                             M
                                              79
Window Design Method

To be expected …
Truncation is just pre-multiplication by a rectangular window
                                                  This is not very clever
                                                  – obviously one
                                                  introduces a delay




                                           spectrum convolution




                                                                 80
Rectangular Window Frequency Response




                                   81
Window Design Method



    M
                           M   M


M         N   M




                                   82
Magnitude of Rectangular Window Frequency Response




                                             83
Truncated Filter




                   84
Truncated Filter




                   85
Ideal Requirements


Ideally we would like to have
•        small – few computations
•             close to a delta Dirac mass for
              to be close to




                            our ideal low-pass filter


 These two requirements are conflicting!
                                                        86
Increasing the dimension of the window
            M                                            M




            M                                            M




•  The width of the main lobe decreases as M increases
                                                   M
                                                             87
Conflicting Ideal Requirements




                                 88
Solution to Sharp Discontinuity of Rectangular Window


   Use windows with no abrupt discontinuity in their time-
   domain response and consequently
   low side-lobes in their frequency response.

   In this case, the reduced ripple comes at the expense
   of a wider transition region but this

   However, this can be compensated for by increasing
   the length of the filter.



                                                             89
Alternative Windows –Time Domain

Many alternatives have been proposed, e.g.
    •  Hanning
    •  Hamming
    •  Blackman




                                             90
Windows –Magnitude of Frequency Response




                                       91
Summary of Windows Characteristics




We see clearly that a wider transition region (wider main-lobe)
is compensated by much lower side-lobes and thus less ripples.


                                                                  92
Filter realised with rectangular/Hanning windows


                               Back to our ideal filter




                                           realised with Hanning window
        realised with
        rectangular window

                        M=16                                 M=16
There are much less ripples for the Hanning window but
that the transition width has increased
                                                                 93
Filter realised with Hanning windows




   realised with Hanning window            realised with Hanning window
                       M=16                                    M=40




Transition width can be improved by increasing the size of the
Hanning window to M = 40
                                                                 94
Windows characteristics



•  Fundamental trade-off between main-lobe
   width and side-lobe amplitude

•  As window smoother, peak side-lobe
   decreases, but the main-lobe width increases.

•  Need to increase window length to achieve
   same transition bandwidth.


                                               95
Specification necessary for Window Design Method


                                           ωc - cutoff frequency
                                           δ  - maximum passband
                                           ripple
                                           Δω – transition bandwidth
                                           Δωm – width of the window
                                           mainlobe




           Response must not enter shaded regions
                                                               96
Key Property 1 of the Window Design Method




                                             97
Key Property 2 of the Window Design Method




                                             98
Key Property 3 of the Window Design Method




                                             99
Key Property 4 of the Window Design Method




                                         100
Key Property 5 of the Window Design Method




                                         101
Passband / stopband ripples

Passband / stopband ripples are often expressed in dB:

   passband ripple = 20 log10 (1+δp ) dB,
   or peak-to-peak passband ripple ≅ 20 log10 (1+2δp) dB;
   minimum stopband attenuation = -20 log10 (δs ) dB.


Example: δp= 6%        peak-to-peak passband ripple ≅ 20 log10 (1+2δp) = 1dB;

         δs = 0.01     minimum stopband attenuation = -20 log10 (δs) = 40dB.


The band-edge frequencies ωs and ωp are often called corner frequencies,
   particularly when associated with specified gain or attenuation (e.g. gain =
   -3dB).




                                                                            102
Summary of Window Design Procedure

•  Ideal frequency response has infinite impulse response

•  To be implemented in practice it has to be
    –  truncated
    –  shifted to the right (to make is causal)

•  Truncation is just pre-multiplication by a rectangular window
    –  the filter of a large order has a narrow transition band
    –  however, sharp discontinuity results in side-lobe
       interference independent of the filter’s order and
       shape Gibbs phenomenon


•  Windows with no abrupt discontinuity can be used to reduce
   Gibbs oscillations (e.g. Hanning, Hamming, Blackman) 103
Summary of the Key Properties of the Window
                   Design Method
1.  Equal transition bandwidth on both sides of the ideal cutoff
    frequency.
2.  Equal peak approximation error in the pass-band and stop-
    band.
3.  Distance between approximation error peaks is
    approximately equal to the width of the window main-lobe.
4.  The width of the main-lobe is wider than the transition band.
                 approximation error peaks

                                             5.  Peak
                   transition                    approximation error
                   bandwidth                     is determined by the
                                                 window shape,
                    mainlobe                     independent of the
                    width                        filter order.

                                                                104
Summary of the windowed FIR filter design
                   procedure

1.  Select a suitable window function

2.  Specify an ideal response Hd(ω)

3.  Compute the coefficients of the ideal filter hd(n)

4.  Multiply the ideal coefficients by the window function to
    give the filter coefficients

5.  Evaluate the frequency response of the resulting filter
    and iterate if necessary (typically, it means increase M if
    the constraints you have been given have not been
    satisfied)
                                                           105
Step by Step Windowed Filter Design Example


Design a type I low-pass filter according to
                             the specification
                                             passband frequency
                                ωp =0.2π
                                ωs =0.3π     stopband frequency

                                δ1 =0.01 
                                δ2 =0.01




                                                       106
Step 1. Select a suitable window function

Choosing a suitable window function can be done with the aid of
published data such as




The required peak error spec δ2 = 0.01, i.e. -20log10 (δs ) = - 40 dB
                                                     Hanning window
Main-lobe width ωs- ωp = 0.3π 0.2π = 0.1π, i.e. 0.1π = 8π / M
                                   filter length M ≥ 80, filter order N ≥ 79
Type-I filter have even order      N = 80
         although for Hanning window first and last ones are 0 so only 78 in reality   107
Step 2 Specify the Ideal Response

Property 1: The band-edge frequency of the ideal response
if the midpoint between ωs and ωp

                    ωc = (ωs + ωp)/2 = (0.2π+0.3π)/2 = 0.25π



                     1 if   |ω| ≤ 0.25π
                     0 if   0.25π < |ω|< π
                        our ideal low-pass filter
                        frequency response



                                                         108
Step 3 Compute the coefficients of the ideal filter


•  The ideal filter coefficients hd are given by the Inverse
   Discrete time Fourier transform of Hd(ω)




•  Delayed impulse response (to make it causal)
                             N


•  Coefficients of the ideal filter

                                       40
                                  40
                                                           109
Step 3 Compute the coefficients of the
              ideal filter


•  For our example this can be done analytically, but in
   general (for more complex Hd (ω) functions) it will be
   computed approximately using an N-point Inverse
   Fast Fourier Transform (IFFT).

•  Given a value of N (choice discussed later), create a
   sampled version of Hd (ω):

              Hd(p) = Hd(2πp/N), p=0,1,...N-1.

   [ Note frequency spacing 2π/N rad/sample ]


                                                        110
Step 3 Compute the coefficients of the
                  ideal filter
If the Inverse FFT, and hence the filter coefficients, are to be purely real-
valued, the frequency response must be conjugate symmetric:
                  Hd(-2πp/N) = Hd* (2πp/N)                       (1)


Since the Discrete Fourier Spectrum is also periodic, we see that
                   Hd(-2πp/N) = Hd(2π - 2πp/N) = Hd(2π(N-p)/N)   (2)



Equating (1) & (2) we must set Hd(N-p) = Hd* (p) for p = 1, ..., (N/2-1).



The Inverse FFT of Hd*(p) is an N-sample time domain function h´(n).
For h´(n) to be an accurate approximation of h(n), N must be made large
enough to avoid time-domain aliasing of h(n), as illustrated below.
                                                                                111
Time domain aliasing
Consider FFT and IFFT




The relationship (2) provides the reconstruction of the periodic signal
xn however it does not imply that we can recover xn from the samples.
For sequence xn of finite duration L this is only possible if N ≥ L




                                                                      112
Step 4 Multiply to obtain the filter coefficients


•  Coefficients of the ideal filter

                                  40
                             40


•  Multiplied by a Hamming window function




                                                     113
Step 5 Evaluate the Frequency Response and Iterate

The frequency response is computed as the DFT of the filter coefficient
vector.


If the resulting filter does not meet the specifications, one of the following
could be done
    •  adjust the ideal filter frequency response (for example, move the
       band edge) and repeat from step 2
    •  adjust the filter length and repeat from step 4
    •  change the window (and filter length) and repeat from step 4




                                                                          114
Matlab Implementation of the Window Method

Two methods FIR1 and FIR2

B=FIR2(N,F,M)

Designs a Nth order FIR digital filter
F and M specify frequency and magnitude breakpoints
  for the filter such that plot(N,F,M)shows a plot of
  desired frequency
The frequencies F must be in increasing order between
  0 and 1, with 1 corresponding to half the sample rate.
B is the vector of length N+1, it is real, has linear phase
  and symmetric coefficients
Default window is Hamming – others can be specified
                                                         115
Multi-band Design




                    116
Frequency sampling method




                            117
FIR Filter Design Using Windows

FIR filter design based on windows is simple and robust,
however, it is not optimal:
 •  The resulting pass-band and stop-band parameters
    are equal even though often the specification is more
    strict in the stop band than in the pass band
        unnecessary high accuracy in the pass band

•  The ripple of the window is not uniform (decays as we
   move away from discontinuity points according to
   side-lobe pattern of the window)

      by allowing more freedom in the ripple behaviour
      we may be able to reduce filter’s order and hence
      its complexity
                                                    118
FIR Design by Optimisation: Least-Square Method


We now present a method that approximates the desired frequency response by a linear-phase FIR
amplitude function according to the following optimality criterion.




The integral of the weighted square frequency-domain error is given by


                             ε 2 = ∫E2(ω)dω


and we assume that the order and the type of the filter are known. Under this assumptions designing
the FIR filter now reduces to determining the coefficients that would minimise ε 2 .
                                                                                             119
Recall Our Example

Design a type I low-pass filter according to specification


                                                             passband frequency
                                                ωp =0.2π
                                                ωs =0.3π     stopband frequency

                                                δ1 =0.1 
     But assume the
                                                              pass-band
                                                δ2 =0.01      tolerance of 0.1




 The filter designed using window method cannot benefit from this
 relaxation, however, a least-square method design gives N = 33
 (compared to N = 80).
                                                                        120
Least-Square Design of FIR Filters


•  Meeting the specification is not guaranteed a-priori,
   trial and error is often required. It might be useful to
   set the transition bands slightly narrower than
   needed, and it is often necessary to experiment with
   the weights

•  Occasionally the resulting frequency response may
   be peculiar. Again, changing the weights would help
   to resolve the problem




                                                              121
Equiripple Design


The least-square criterion of minimising
                    ε 2 = ∫E2(ω)dω

is not entirely satisfactory.



A better approach is to minimize the maximum
error at each band

                   ε = maxω |E(ω)|


                                               122
Equiripple Design


The method is optimal in a sense of minimising the maximum
magnitude of the ripple in all bands of interest, the filter order is
fixed




It can be shown that this leads to an equiripple filter – a filter which
amplitude response oscillates uniformly between the tolerance
bounds of each band




                                                                           123
Equiripple Design

                                        Many ripples achieve maximum
                     Passband
                                        Permitted amplitude




Overall and passband-only frequency response of length 37
                     minimax filter

                                                             124   124
Remez method



•  There exists a computational procedure known as the
   Remez method to solve this mathematical
   optimization problem.


•  There are also exist formulae for estimating the
   required filter length in the case of lowpass,
   bandpass and narrow transition bandwidths.
   However, these formulae are not always reliable so it
   might be necessary to iterate the procedure so as to
   satisfy the design constraints.



                                                      125
Equiripple Design: Weights

The weights can be determined in advance from a minimax specification.
For example, if a simple lowpass filter has a requirement for the passband
gain to be in the range 1-∂p to 1+∂p, and the stopband gain to be less than
∂s, the weightings given to the passband and stopband errors would be ∂s
and ∂p respectively.
The detailed algorithm is beyond the (time!) constraints of this module.




                                                                      126     126
Equiripple Design: Example

Obtain the coefficients of an FIR lowpass digital filter to meet these
specifications:
        passband edge frequency           1.625 kHz
        passband pk-to-pk ripple           <1 dB
        transition width                   0.5 kHz
        stopband attenuation               >50 dB
        sampling frequency                 8 kHz


The passband ripple corresponds to ±6%, while the stopband attenuation
is 0.32%, hence the weighting factors are set to 0.32 and 6.
Using the relevant length estimation formula gives order N=25.8 hence
N=26 was chosen, i.e. length =27. This proved to be substantially too
short, and it was necessary to increase the order to 36 (length 37) to meet
the specifications.                                                    127
Equiripple Design: Matlab
b = remez(n,f,m) designs an nth order FIR digital filter and returns the filter
coefficients in length n+1 vector b.
Vectors f and m specify the frequency and magnitude breakpoints [as for FIR2].
b = remez(n,f,m,w) uses vector w to specify weighting in each of the pass or stop
bands in vectors f and m.
Note again the frequency normalisation, where 1.0 equals half the sample rate.
The call which finally met this filter specification was:
h = remez(36,[0 1.625 2 4]/4, [1 1 0 0], [0.32 6]);
The resulting frequency response is as shown previously:




                                                                                  128   128
The Parks-McClellan Remez exchange algorithm

The computational procedure the optimization problem is by
Remez


The algorithm in common use is by Parks and McClellan.


The Parks-McClellan Remez exchange algorithm is widely
available and versatile.


Important: it designs linear phase (symmetric) filters or
antisymmetric filters of any of the standard types
                                                        129   129
Linear Symmetric Filters
The frequency response of the direct form FIR filter may be rearranged by grouping the
terms involving the first and last coefficients, the second and next to last, etc.:




and then taking out a common factor exp( -jMΩ/2):




If the filter length M+1 is odd, then the final term in curly brackets above is the single term
bM/2, that is the centre coefficient ('tap') of the filter.
                                                                                        130
Symmetric impulse response

Symmetric impulse response: if we put bM = b0, bM-1 = b1, etc., and note that exp(jθ)
+exp(-jθ) = 2cos(θ), the frequency response becomes




This is a purely real function (sum of cosines) multiplied by a linear phase term, hence
the response has linear phase, corresponding to a pure delay of M/2 samples, ie half the
filter length.
A similar argument can be used to simplify antisymmetric impulse responses in terms of a
sum of sine functions (such filters do not give a pure delay, although the phase still has a
linear form π/2-mΩ/2)

                                                                                     131       131
Implementation of symmetric FIR filters


The symmetric FIR filters of length N can be implemented using the folded delay line
structure shown below, which uses N/2 (or (N+1)/2) multipliers rather than N




                                                                               132     132
Limitations of the algorithm
Linear phase in the stopbands is never a real requirement, and in some
applications strictly linear phase in the passband is not needed either.


The linear phase filters designed by this method are therefore longer than
optimum non-linear phase filters.


However, symmetric FIR filters of length N can be implemented using the folded
delay line structure shown below, which uses N/2 (or (N+1)/2) multipliers rather
than N, so the longer symmetric filter may be no more computationally intensive
than a shorter non-linear phase one.




                                                                             133   133
Further options for FIR filter design


More general non-linear optimisation (least squared error or minimax) can of course
be used to design linear or non-linear phase FIR filters to meet more general frequency
and/or time domain requirements.


Matlab has suitable optimisation routines.




                                                                                 134      134

Weitere ähnliche Inhalte

Was ist angesagt?

Design of FIR Filters
Design of FIR FiltersDesign of FIR Filters
Design of FIR FiltersAranya Sarkar
 
Basics of Digital Filters
Basics of Digital FiltersBasics of Digital Filters
Basics of Digital Filtersop205
 
Decimation and Interpolation
Decimation and InterpolationDecimation and Interpolation
Decimation and InterpolationFernando Ojeda
 
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
DSP_2018_FOEHU - Lec 07 - IIR Filter DesignDSP_2018_FOEHU - Lec 07 - IIR Filter Design
DSP_2018_FOEHU - Lec 07 - IIR Filter DesignAmr E. Mohamed
 
Fir and iir filter_design
Fir and iir filter_designFir and iir filter_design
Fir and iir filter_designshrinivasgnaik
 
DSP_FOEHU - Lec 07 - Digital Filters
DSP_FOEHU - Lec 07 - Digital FiltersDSP_FOEHU - Lec 07 - Digital Filters
DSP_FOEHU - Lec 07 - Digital FiltersAmr E. Mohamed
 
Basics of digital filters
Basics of digital filtersBasics of digital filters
Basics of digital filtersSmile Hossain
 
Windowing techniques of fir filter design
Windowing techniques of fir filter designWindowing techniques of fir filter design
Windowing techniques of fir filter designRohan Nagpal
 
digital signal processing lecture 1.pptx
digital signal processing lecture 1.pptxdigital signal processing lecture 1.pptx
digital signal processing lecture 1.pptxImranHasan760046
 
FILTER DESIGN
FILTER DESIGNFILTER DESIGN
FILTER DESIGNnaimish12
 
Signal Filtering
Signal FilteringSignal Filtering
Signal FilteringImane Haf
 
DSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignDSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignAmr E. Mohamed
 
Butterworth filter design
Butterworth filter designButterworth filter design
Butterworth filter designSushant Shankar
 
Correlative level coding
Correlative level codingCorrelative level coding
Correlative level codingsrkrishna341
 

Was ist angesagt? (20)

Design of FIR Filters
Design of FIR FiltersDesign of FIR Filters
Design of FIR Filters
 
Basics of Digital Filters
Basics of Digital FiltersBasics of Digital Filters
Basics of Digital Filters
 
Fir filter_utkarsh_kulshrestha
Fir filter_utkarsh_kulshresthaFir filter_utkarsh_kulshrestha
Fir filter_utkarsh_kulshrestha
 
Decimation and Interpolation
Decimation and InterpolationDecimation and Interpolation
Decimation and Interpolation
 
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
DSP_2018_FOEHU - Lec 07 - IIR Filter DesignDSP_2018_FOEHU - Lec 07 - IIR Filter Design
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
 
digital filters
digital filtersdigital filters
digital filters
 
Chebyshev filter
Chebyshev filterChebyshev filter
Chebyshev filter
 
Fir and iir filter_design
Fir and iir filter_designFir and iir filter_design
Fir and iir filter_design
 
DSP_FOEHU - Lec 07 - Digital Filters
DSP_FOEHU - Lec 07 - Digital FiltersDSP_FOEHU - Lec 07 - Digital Filters
DSP_FOEHU - Lec 07 - Digital Filters
 
Basics of digital filters
Basics of digital filtersBasics of digital filters
Basics of digital filters
 
Windowing techniques of fir filter design
Windowing techniques of fir filter designWindowing techniques of fir filter design
Windowing techniques of fir filter design
 
digital signal processing lecture 1.pptx
digital signal processing lecture 1.pptxdigital signal processing lecture 1.pptx
digital signal processing lecture 1.pptx
 
FILTER DESIGN
FILTER DESIGNFILTER DESIGN
FILTER DESIGN
 
Signal Filtering
Signal FilteringSignal Filtering
Signal Filtering
 
DSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignDSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter Design
 
Butterworth filter design
Butterworth filter designButterworth filter design
Butterworth filter design
 
Adaptive equalization
Adaptive equalizationAdaptive equalization
Adaptive equalization
 
Sampling theorem
Sampling theoremSampling theorem
Sampling theorem
 
Correlative level coding
Correlative level codingCorrelative level coding
Correlative level coding
 
Introduction to equalization
Introduction to equalizationIntroduction to equalization
Introduction to equalization
 

Ähnlich wie Design of FIR filters

design of sampling filter
design of sampling filter design of sampling filter
design of sampling filter Anuj Arora
 
Design and Performance Analysis of Filters Using a Proposed Window Function
Design and Performance Analysis of Filters Using a Proposed Window FunctionDesign and Performance Analysis of Filters Using a Proposed Window Function
Design and Performance Analysis of Filters Using a Proposed Window FunctionRSIS International
 
MobileNet - PR044
MobileNet - PR044MobileNet - PR044
MobileNet - PR044Jinwon Lee
 
windows technique psp.pptx
windows technique psp.pptxwindows technique psp.pptx
windows technique psp.pptxSabithaCh
 
windows technique psp.pptx
windows technique psp.pptxwindows technique psp.pptx
windows technique psp.pptxSaiprasanthiD
 
A survey report for performance analysis of finite impulse response digital f...
A survey report for performance analysis of finite impulse response digital f...A survey report for performance analysis of finite impulse response digital f...
A survey report for performance analysis of finite impulse response digital f...eSAT Journals
 
A survey report for performance analysis of finite
A survey report for performance analysis of finiteA survey report for performance analysis of finite
A survey report for performance analysis of finiteeSAT Publishing House
 
Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...
Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...
Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...IDES Editor
 
A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...
A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...
A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...Nxfee Innovation
 
Senior design final presentation master
Senior design final presentation masterSenior design final presentation master
Senior design final presentation mastercladd7294
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionIOSR Journals
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionIOSR Journals
 

Ähnlich wie Design of FIR filters (20)

design of sampling filter
design of sampling filter design of sampling filter
design of sampling filter
 
Design and Performance Analysis of Filters Using a Proposed Window Function
Design and Performance Analysis of Filters Using a Proposed Window FunctionDesign and Performance Analysis of Filters Using a Proposed Window Function
Design and Performance Analysis of Filters Using a Proposed Window Function
 
MobileNet - PR044
MobileNet - PR044MobileNet - PR044
MobileNet - PR044
 
dsp dip.pptx
dsp dip.pptxdsp dip.pptx
dsp dip.pptx
 
Digital Filters Part 1
Digital Filters Part 1Digital Filters Part 1
Digital Filters Part 1
 
Fir1
Fir1Fir1
Fir1
 
C010431520
C010431520C010431520
C010431520
 
windows technique psp.pptx
windows technique psp.pptxwindows technique psp.pptx
windows technique psp.pptx
 
windows technique psp.pptx
windows technique psp.pptxwindows technique psp.pptx
windows technique psp.pptx
 
A survey report for performance analysis of finite impulse response digital f...
A survey report for performance analysis of finite impulse response digital f...A survey report for performance analysis of finite impulse response digital f...
A survey report for performance analysis of finite impulse response digital f...
 
Lte course
Lte courseLte course
Lte course
 
A survey report for performance analysis of finite
A survey report for performance analysis of finiteA survey report for performance analysis of finite
A survey report for performance analysis of finite
 
Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...
Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...
Design And Performance of Finite impulse Response Filter Using Hyperbolic Cos...
 
A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...
A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...
A 128 tap highly tunable cmos if finite impulse response filter for pulsed ra...
 
IDT2014 Chirp Presentation
IDT2014 Chirp PresentationIDT2014 Chirp Presentation
IDT2014 Chirp Presentation
 
Adaptive filter
Adaptive filterAdaptive filter
Adaptive filter
 
Senior design final presentation master
Senior design final presentation masterSenior design final presentation master
Senior design final presentation master
 
30 CHL PCM PDH SDH BY SKG
30 CHL PCM PDH SDH BY SKG30 CHL PCM PDH SDH BY SKG
30 CHL PCM PDH SDH BY SKG
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window Function
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window Function
 

Mehr von op205

3 f6 security
3 f6 security3 f6 security
3 f6 securityop205
 
3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologiesop205
 
3 f6 8_databases
3 f6 8_databases3 f6 8_databases
3 f6 8_databasesop205
 
3 f6 10_testing
3 f6 10_testing3 f6 10_testing
3 f6 10_testingop205
 
3 f6 9a_corba
3 f6 9a_corba3 f6 9a_corba
3 f6 9a_corbaop205
 
3 f6 9a_corba
3 f6 9a_corba3 f6 9a_corba
3 f6 9a_corbaop205
 
3 f6 9_distributed_systems
3 f6 9_distributed_systems3 f6 9_distributed_systems
3 f6 9_distributed_systemsop205
 
Lecture 7 Software Engineering and Design User Interface Design
Lecture 7 Software Engineering and Design User Interface Design Lecture 7 Software Engineering and Design User Interface Design
Lecture 7 Software Engineering and Design User Interface Design op205
 
Lecture 6 Software Engineering and Design Good Design
Lecture 6 Software Engineering and Design Good Design Lecture 6 Software Engineering and Design Good Design
Lecture 6 Software Engineering and Design Good Design op205
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patternsop205
 
Lecture 4 Software Engineering and Design Brief Introduction to Programming
Lecture 4 Software Engineering and Design Brief Introduction to ProgrammingLecture 4 Software Engineering and Design Brief Introduction to Programming
Lecture 4 Software Engineering and Design Brief Introduction to Programmingop205
 
Lecture 3 Software Engineering and Design Introduction to UML
Lecture 3 Software Engineering and Design Introduction to UMLLecture 3 Software Engineering and Design Introduction to UML
Lecture 3 Software Engineering and Design Introduction to UMLop205
 
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...op205
 
Lecture 1 Software Engineering and Design Introduction
Lecture 1 Software Engineering and Design Introduction Lecture 1 Software Engineering and Design Introduction
Lecture 1 Software Engineering and Design Introduction op205
 
More on DFT
More on DFTMore on DFT
More on DFTop205
 
Digital Signal Processing Summary
Digital Signal Processing SummaryDigital Signal Processing Summary
Digital Signal Processing Summaryop205
 
Implementation of Digital Filters
Implementation of Digital FiltersImplementation of Digital Filters
Implementation of Digital Filtersop205
 
Basics of Analogue Filters
Basics of Analogue FiltersBasics of Analogue Filters
Basics of Analogue Filtersop205
 
Introduction to Digital Signal Processing
Introduction to Digital Signal ProcessingIntroduction to Digital Signal Processing
Introduction to Digital Signal Processingop205
 
Fast Fourier Transform
Fast Fourier TransformFast Fourier Transform
Fast Fourier Transformop205
 

Mehr von op205 (20)

3 f6 security
3 f6 security3 f6 security
3 f6 security
 
3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies3 f6 11_softdevmethodologies
3 f6 11_softdevmethodologies
 
3 f6 8_databases
3 f6 8_databases3 f6 8_databases
3 f6 8_databases
 
3 f6 10_testing
3 f6 10_testing3 f6 10_testing
3 f6 10_testing
 
3 f6 9a_corba
3 f6 9a_corba3 f6 9a_corba
3 f6 9a_corba
 
3 f6 9a_corba
3 f6 9a_corba3 f6 9a_corba
3 f6 9a_corba
 
3 f6 9_distributed_systems
3 f6 9_distributed_systems3 f6 9_distributed_systems
3 f6 9_distributed_systems
 
Lecture 7 Software Engineering and Design User Interface Design
Lecture 7 Software Engineering and Design User Interface Design Lecture 7 Software Engineering and Design User Interface Design
Lecture 7 Software Engineering and Design User Interface Design
 
Lecture 6 Software Engineering and Design Good Design
Lecture 6 Software Engineering and Design Good Design Lecture 6 Software Engineering and Design Good Design
Lecture 6 Software Engineering and Design Good Design
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patterns
 
Lecture 4 Software Engineering and Design Brief Introduction to Programming
Lecture 4 Software Engineering and Design Brief Introduction to ProgrammingLecture 4 Software Engineering and Design Brief Introduction to Programming
Lecture 4 Software Engineering and Design Brief Introduction to Programming
 
Lecture 3 Software Engineering and Design Introduction to UML
Lecture 3 Software Engineering and Design Introduction to UMLLecture 3 Software Engineering and Design Introduction to UML
Lecture 3 Software Engineering and Design Introduction to UML
 
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
Lecture 2 Software Engineering and Design Object Oriented Programming, Design...
 
Lecture 1 Software Engineering and Design Introduction
Lecture 1 Software Engineering and Design Introduction Lecture 1 Software Engineering and Design Introduction
Lecture 1 Software Engineering and Design Introduction
 
More on DFT
More on DFTMore on DFT
More on DFT
 
Digital Signal Processing Summary
Digital Signal Processing SummaryDigital Signal Processing Summary
Digital Signal Processing Summary
 
Implementation of Digital Filters
Implementation of Digital FiltersImplementation of Digital Filters
Implementation of Digital Filters
 
Basics of Analogue Filters
Basics of Analogue FiltersBasics of Analogue Filters
Basics of Analogue Filters
 
Introduction to Digital Signal Processing
Introduction to Digital Signal ProcessingIntroduction to Digital Signal Processing
Introduction to Digital Signal Processing
 
Fast Fourier Transform
Fast Fourier TransformFast Fourier Transform
Fast Fourier Transform
 

Kürzlich hochgeladen

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Kürzlich hochgeladen (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

Design of FIR filters

  • 1. Design of FIR Filters Elena Punskaya www-sigproc.eng.cam.ac.uk/~op205 Some material adapted from courses by Prof. Simon Godsill, Dr. Arnaud Doucet, Dr. Malcolm Macleod and Prof. Peter Rayner 68
  • 2. FIR as a class of LTI Filters Transfer function of the filter is Finite Impulse Response (FIR) Filters: N = 0, no feedback 69
  • 3. FIR Filters Let us consider an FIR filter of length M (order N=M-1, watch out! order – number of delays) 70
  • 4. FIR filters Can immediately obtain the impulse response, with x(n)= δ(n) δ The impulse response is of finite length M, as required Note that FIR filters have only zeros (no poles). Hence known also as all-zero filters FIR filters also known as feedforward or non-recursive, or transversal 71
  • 5. FIR Filters Digital FIR filters cannot be derived from analog filters – rational analog filters cannot have a finite impulse response. Why bother? 1.  They are inherently stable 2.  They can be designed to have a linear phase 3.  There is a great flexibility in shaping their magnitude response 4.  They are easy and convenient to implement Remember very fast implementation using FFT? 72
  • 6. FIR Filter using the DFT FIR filter: Now N-point DFT (Y(k)) and then N-point IDFT (y(n)) can be used to compute standard convolution product and thus to perform linear filtering (given how efficient FFT is) 73
  • 7. Linear-phase filters The ability to have an exactly linear phase response is the one of the most important of FIR filters A general FIR filter does not have a linear phase response but this property is satisfied when four linear phase filter types 74
  • 8. Linear-phase filters – Filter types Some observations: •  Type 1 – most versatile •  Type 2 – frequency response is always 0 at ω=π – not suitable as a high-pass •  Type 3 and 4 – introduce a π/2 phase shift, frequency response is always 0 at ω=0 - – not suitable as a high-pass 75
  • 9. FIR Design Methods •  Impulse response truncation – the simplest design method, has undesirable frequency domain-characteristics, not very useful but intro to … •  Windowing design method – simple and convenient but not optimal, i.e. order achieved is not minimum possible •  Optimal filter design methods 76
  • 10. Back to Our Ideal Low- pass Filter Example 77
  • 12. Approximated filters obtained by truncation M M transition band M M M 79
  • 13. Window Design Method To be expected … Truncation is just pre-multiplication by a rectangular window This is not very clever – obviously one introduces a delay spectrum convolution 80
  • 15. Window Design Method M M M M N M 82
  • 16. Magnitude of Rectangular Window Frequency Response 83
  • 19. Ideal Requirements Ideally we would like to have •  small – few computations •  close to a delta Dirac mass for to be close to our ideal low-pass filter These two requirements are conflicting! 86
  • 20. Increasing the dimension of the window M M M M •  The width of the main lobe decreases as M increases M 87
  • 22. Solution to Sharp Discontinuity of Rectangular Window Use windows with no abrupt discontinuity in their time- domain response and consequently low side-lobes in their frequency response. In this case, the reduced ripple comes at the expense of a wider transition region but this However, this can be compensated for by increasing the length of the filter. 89
  • 23. Alternative Windows –Time Domain Many alternatives have been proposed, e.g. •  Hanning •  Hamming •  Blackman 90
  • 24. Windows –Magnitude of Frequency Response 91
  • 25. Summary of Windows Characteristics We see clearly that a wider transition region (wider main-lobe) is compensated by much lower side-lobes and thus less ripples. 92
  • 26. Filter realised with rectangular/Hanning windows Back to our ideal filter realised with Hanning window realised with rectangular window M=16 M=16 There are much less ripples for the Hanning window but that the transition width has increased 93
  • 27. Filter realised with Hanning windows realised with Hanning window realised with Hanning window M=16 M=40 Transition width can be improved by increasing the size of the Hanning window to M = 40 94
  • 28. Windows characteristics •  Fundamental trade-off between main-lobe width and side-lobe amplitude •  As window smoother, peak side-lobe decreases, but the main-lobe width increases. •  Need to increase window length to achieve same transition bandwidth. 95
  • 29. Specification necessary for Window Design Method ωc - cutoff frequency δ  - maximum passband ripple Δω – transition bandwidth Δωm – width of the window mainlobe Response must not enter shaded regions 96
  • 30. Key Property 1 of the Window Design Method 97
  • 31. Key Property 2 of the Window Design Method 98
  • 32. Key Property 3 of the Window Design Method 99
  • 33. Key Property 4 of the Window Design Method 100
  • 34. Key Property 5 of the Window Design Method 101
  • 35. Passband / stopband ripples Passband / stopband ripples are often expressed in dB: passband ripple = 20 log10 (1+δp ) dB, or peak-to-peak passband ripple ≅ 20 log10 (1+2δp) dB; minimum stopband attenuation = -20 log10 (δs ) dB. Example: δp= 6% peak-to-peak passband ripple ≅ 20 log10 (1+2δp) = 1dB; δs = 0.01 minimum stopband attenuation = -20 log10 (δs) = 40dB. The band-edge frequencies ωs and ωp are often called corner frequencies, particularly when associated with specified gain or attenuation (e.g. gain = -3dB). 102
  • 36. Summary of Window Design Procedure •  Ideal frequency response has infinite impulse response •  To be implemented in practice it has to be –  truncated –  shifted to the right (to make is causal) •  Truncation is just pre-multiplication by a rectangular window –  the filter of a large order has a narrow transition band –  however, sharp discontinuity results in side-lobe interference independent of the filter’s order and shape Gibbs phenomenon •  Windows with no abrupt discontinuity can be used to reduce Gibbs oscillations (e.g. Hanning, Hamming, Blackman) 103
  • 37. Summary of the Key Properties of the Window Design Method 1.  Equal transition bandwidth on both sides of the ideal cutoff frequency. 2.  Equal peak approximation error in the pass-band and stop- band. 3.  Distance between approximation error peaks is approximately equal to the width of the window main-lobe. 4.  The width of the main-lobe is wider than the transition band. approximation error peaks 5.  Peak transition approximation error bandwidth is determined by the window shape, mainlobe independent of the width filter order. 104
  • 38. Summary of the windowed FIR filter design procedure 1.  Select a suitable window function 2.  Specify an ideal response Hd(ω) 3.  Compute the coefficients of the ideal filter hd(n) 4.  Multiply the ideal coefficients by the window function to give the filter coefficients 5.  Evaluate the frequency response of the resulting filter and iterate if necessary (typically, it means increase M if the constraints you have been given have not been satisfied) 105
  • 39. Step by Step Windowed Filter Design Example Design a type I low-pass filter according to the specification passband frequency ωp =0.2π ωs =0.3π stopband frequency δ1 =0.01 δ2 =0.01 106
  • 40. Step 1. Select a suitable window function Choosing a suitable window function can be done with the aid of published data such as The required peak error spec δ2 = 0.01, i.e. -20log10 (δs ) = - 40 dB Hanning window Main-lobe width ωs- ωp = 0.3π 0.2π = 0.1π, i.e. 0.1π = 8π / M filter length M ≥ 80, filter order N ≥ 79 Type-I filter have even order N = 80 although for Hanning window first and last ones are 0 so only 78 in reality 107
  • 41. Step 2 Specify the Ideal Response Property 1: The band-edge frequency of the ideal response if the midpoint between ωs and ωp ωc = (ωs + ωp)/2 = (0.2π+0.3π)/2 = 0.25π 1 if |ω| ≤ 0.25π 0 if 0.25π < |ω|< π our ideal low-pass filter frequency response 108
  • 42. Step 3 Compute the coefficients of the ideal filter •  The ideal filter coefficients hd are given by the Inverse Discrete time Fourier transform of Hd(ω) •  Delayed impulse response (to make it causal) N •  Coefficients of the ideal filter 40 40 109
  • 43. Step 3 Compute the coefficients of the ideal filter •  For our example this can be done analytically, but in general (for more complex Hd (ω) functions) it will be computed approximately using an N-point Inverse Fast Fourier Transform (IFFT). •  Given a value of N (choice discussed later), create a sampled version of Hd (ω): Hd(p) = Hd(2πp/N), p=0,1,...N-1. [ Note frequency spacing 2π/N rad/sample ] 110
  • 44. Step 3 Compute the coefficients of the ideal filter If the Inverse FFT, and hence the filter coefficients, are to be purely real- valued, the frequency response must be conjugate symmetric: Hd(-2πp/N) = Hd* (2πp/N) (1) Since the Discrete Fourier Spectrum is also periodic, we see that Hd(-2πp/N) = Hd(2π - 2πp/N) = Hd(2π(N-p)/N) (2) Equating (1) & (2) we must set Hd(N-p) = Hd* (p) for p = 1, ..., (N/2-1). The Inverse FFT of Hd*(p) is an N-sample time domain function h´(n). For h´(n) to be an accurate approximation of h(n), N must be made large enough to avoid time-domain aliasing of h(n), as illustrated below. 111
  • 45. Time domain aliasing Consider FFT and IFFT The relationship (2) provides the reconstruction of the periodic signal xn however it does not imply that we can recover xn from the samples. For sequence xn of finite duration L this is only possible if N ≥ L 112
  • 46. Step 4 Multiply to obtain the filter coefficients •  Coefficients of the ideal filter 40 40 •  Multiplied by a Hamming window function 113
  • 47. Step 5 Evaluate the Frequency Response and Iterate The frequency response is computed as the DFT of the filter coefficient vector. If the resulting filter does not meet the specifications, one of the following could be done •  adjust the ideal filter frequency response (for example, move the band edge) and repeat from step 2 •  adjust the filter length and repeat from step 4 •  change the window (and filter length) and repeat from step 4 114
  • 48. Matlab Implementation of the Window Method Two methods FIR1 and FIR2 B=FIR2(N,F,M) Designs a Nth order FIR digital filter F and M specify frequency and magnitude breakpoints for the filter such that plot(N,F,M)shows a plot of desired frequency The frequencies F must be in increasing order between 0 and 1, with 1 corresponding to half the sample rate. B is the vector of length N+1, it is real, has linear phase and symmetric coefficients Default window is Hamming – others can be specified 115
  • 51. FIR Filter Design Using Windows FIR filter design based on windows is simple and robust, however, it is not optimal: •  The resulting pass-band and stop-band parameters are equal even though often the specification is more strict in the stop band than in the pass band unnecessary high accuracy in the pass band •  The ripple of the window is not uniform (decays as we move away from discontinuity points according to side-lobe pattern of the window) by allowing more freedom in the ripple behaviour we may be able to reduce filter’s order and hence its complexity 118
  • 52. FIR Design by Optimisation: Least-Square Method We now present a method that approximates the desired frequency response by a linear-phase FIR amplitude function according to the following optimality criterion. The integral of the weighted square frequency-domain error is given by ε 2 = ∫E2(ω)dω and we assume that the order and the type of the filter are known. Under this assumptions designing the FIR filter now reduces to determining the coefficients that would minimise ε 2 . 119
  • 53. Recall Our Example Design a type I low-pass filter according to specification passband frequency ωp =0.2π ωs =0.3π stopband frequency δ1 =0.1 But assume the pass-band δ2 =0.01 tolerance of 0.1 The filter designed using window method cannot benefit from this relaxation, however, a least-square method design gives N = 33 (compared to N = 80). 120
  • 54. Least-Square Design of FIR Filters •  Meeting the specification is not guaranteed a-priori, trial and error is often required. It might be useful to set the transition bands slightly narrower than needed, and it is often necessary to experiment with the weights •  Occasionally the resulting frequency response may be peculiar. Again, changing the weights would help to resolve the problem 121
  • 55. Equiripple Design The least-square criterion of minimising ε 2 = ∫E2(ω)dω is not entirely satisfactory. A better approach is to minimize the maximum error at each band ε = maxω |E(ω)| 122
  • 56. Equiripple Design The method is optimal in a sense of minimising the maximum magnitude of the ripple in all bands of interest, the filter order is fixed It can be shown that this leads to an equiripple filter – a filter which amplitude response oscillates uniformly between the tolerance bounds of each band 123
  • 57. Equiripple Design Many ripples achieve maximum Passband Permitted amplitude Overall and passband-only frequency response of length 37 minimax filter 124 124
  • 58. Remez method •  There exists a computational procedure known as the Remez method to solve this mathematical optimization problem. •  There are also exist formulae for estimating the required filter length in the case of lowpass, bandpass and narrow transition bandwidths. However, these formulae are not always reliable so it might be necessary to iterate the procedure so as to satisfy the design constraints. 125
  • 59. Equiripple Design: Weights The weights can be determined in advance from a minimax specification. For example, if a simple lowpass filter has a requirement for the passband gain to be in the range 1-∂p to 1+∂p, and the stopband gain to be less than ∂s, the weightings given to the passband and stopband errors would be ∂s and ∂p respectively. The detailed algorithm is beyond the (time!) constraints of this module. 126 126
  • 60. Equiripple Design: Example Obtain the coefficients of an FIR lowpass digital filter to meet these specifications: passband edge frequency 1.625 kHz passband pk-to-pk ripple <1 dB transition width 0.5 kHz stopband attenuation >50 dB sampling frequency 8 kHz The passband ripple corresponds to ±6%, while the stopband attenuation is 0.32%, hence the weighting factors are set to 0.32 and 6. Using the relevant length estimation formula gives order N=25.8 hence N=26 was chosen, i.e. length =27. This proved to be substantially too short, and it was necessary to increase the order to 36 (length 37) to meet the specifications. 127
  • 61. Equiripple Design: Matlab b = remez(n,f,m) designs an nth order FIR digital filter and returns the filter coefficients in length n+1 vector b. Vectors f and m specify the frequency and magnitude breakpoints [as for FIR2]. b = remez(n,f,m,w) uses vector w to specify weighting in each of the pass or stop bands in vectors f and m. Note again the frequency normalisation, where 1.0 equals half the sample rate. The call which finally met this filter specification was: h = remez(36,[0 1.625 2 4]/4, [1 1 0 0], [0.32 6]); The resulting frequency response is as shown previously: 128 128
  • 62. The Parks-McClellan Remez exchange algorithm The computational procedure the optimization problem is by Remez The algorithm in common use is by Parks and McClellan. The Parks-McClellan Remez exchange algorithm is widely available and versatile. Important: it designs linear phase (symmetric) filters or antisymmetric filters of any of the standard types 129 129
  • 63. Linear Symmetric Filters The frequency response of the direct form FIR filter may be rearranged by grouping the terms involving the first and last coefficients, the second and next to last, etc.: and then taking out a common factor exp( -jMΩ/2): If the filter length M+1 is odd, then the final term in curly brackets above is the single term bM/2, that is the centre coefficient ('tap') of the filter. 130
  • 64. Symmetric impulse response Symmetric impulse response: if we put bM = b0, bM-1 = b1, etc., and note that exp(jθ) +exp(-jθ) = 2cos(θ), the frequency response becomes This is a purely real function (sum of cosines) multiplied by a linear phase term, hence the response has linear phase, corresponding to a pure delay of M/2 samples, ie half the filter length. A similar argument can be used to simplify antisymmetric impulse responses in terms of a sum of sine functions (such filters do not give a pure delay, although the phase still has a linear form π/2-mΩ/2) 131 131
  • 65. Implementation of symmetric FIR filters The symmetric FIR filters of length N can be implemented using the folded delay line structure shown below, which uses N/2 (or (N+1)/2) multipliers rather than N 132 132
  • 66. Limitations of the algorithm Linear phase in the stopbands is never a real requirement, and in some applications strictly linear phase in the passband is not needed either. The linear phase filters designed by this method are therefore longer than optimum non-linear phase filters. However, symmetric FIR filters of length N can be implemented using the folded delay line structure shown below, which uses N/2 (or (N+1)/2) multipliers rather than N, so the longer symmetric filter may be no more computationally intensive than a shorter non-linear phase one. 133 133
  • 67. Further options for FIR filter design More general non-linear optimisation (least squared error or minimax) can of course be used to design linear or non-linear phase FIR filters to meet more general frequency and/or time domain requirements. Matlab has suitable optimisation routines. 134 134