SlideShare a Scribd company logo
1 of 14
Beirut Arab University
Computer Engineering Program
Spring 2015
Digital Signal Processing (COME
384)
Instructor: Prof. Dr. Hamed Nassar
Filters (Chapter 6)
Textbook:
◦ V. Ingle and J. Proakis, Digital Signal Processing Using
MATLAB 3rd Ed, Cengage Learning, 2012
1
Dr. Hamed Nassar, Beirut Arab Univ
nal
 ;
Prof. H. Nassar, BAU
Digital Filters: FIR and IIR
 We will now use the theory of discrete systems that we
have studied to process of digital signals, which is carried
out using systems called filters (or spectrum analyzers in
some contexts).
 The filter design is influenced by such factors as the type
of the filter (IIR or FIR) or the form of its implementation
(structures).
 Hence, before we discuss the design issue, we look at
how these filters can be implemented in practice.
 This is an important concern because different filter
structures dictate different design strategies.
 IIR filters as designed and used in DSP, can be modeled
by rational system functions or, equivalently, difference
equations.
 Such filters are termed autoregressive moving average
(ARMA) or, more generally, as recursive filters.
Prof. H. Nassar, BAU
Finite Impulse Response (FIR) - Contrast it with IIR
 .
Prof. H. Nassar, BAU
Three Building Blocks
 Our filters are LTI systems, and thus we need only the
following three elements to describe their structures.
◦ 1. Adder: This element has two inputs and one output
and is shown in Figure 6.1a. Note that the addition of
three or more signals is implemented by successive
two-input adders.
◦ 2. Multiplier (gain): This is a single-input, single-output
element and is shown in Figure 6.1b. Note that the
multiplication by 1 is understood and hence not explicitly
shown.
◦ 3. Delay element (shifter or memory): This element
delays the signal passing through it by one sample, as
shown in Figure 6.1c. It is implemented by using a shift
register.
 Using these basic elements, we can now describe various
structures of both IIR and FIR filters.
 MATLAB is a convenient tool in the development of these
Prof. H. Nassar, BAU
IIR FILTER STRUCTURES: 3 types
 Three different structures can be used to implement IIR
filters:
◦ 1. Direct form: DE (6.2) is implemented directly. As it has two parts:
the moving average part (numerator) and the recursive part
(denominator), this implementation leads to two versions: direct
form I and direct form II.
◦ 2. Cascade form: H(z) in (6.1) is factored into smaller 2nd-order
sections, called biquads, and each biquad is implemented in a
direct form, and the entire system function is implemented as a
cascade of biquad sections. Prof. H. Nassar, BAU
)
 .
Prof. H. Nassar, BAU
)
 .
Prof. H. Nassar, BAU
MATLAB IMPLEMENTATION
 In MATLAB the direct form structure is implemented by the
built-in function filter whose syntax is:
Y = FILTER(B,A,X)
where B and A are vectors representing the the filter
paramters (B containing the {bn} coefficients and A
containing the {an} coefficients) of the filter’s difference
equation, which for M=N=4, takes the form:
.
Prof. H. Nassar, BAU
Echo Generation
 The most basic of all audio effects is that of time delay,
echoes.
 Echo used as building block of complex effects, e.g. reverb &
flanging.
 For example, the combination of the direct sound
represented by discrete signal y and a single echo
appearing D samples later (which is related to delay in
seconds) can be generated by the (difference) equation
(assuming x = input and y = output)
y(n)= x(n)+ αx(n − D), |α| < 1
where y is the resulting signal and α the attenuation.
 Difference equations are implemented in MATLAB using
the filter function Y = FILTER(B,A,X)
Thus, we will use here A=1 (coeff of output signal y(n))
Prof. H. Nassar, BAU
An Audio application of DSP: adding & removing echo
 DSP has applications audio and video. Here we add echo.
 %MA_SoundEcho.m: Add and remove echo from a sound piece.
 %9 s of Handel's Halleluja sampled at 8192 sam/sec. It is in file:
handel.mat.
 %We'll play it with echo delayed by D = 7196 samples, i.e 0.9 s
 load handel; %Place signal in vector y & sampling freq in
var Fs
 sound(y,Fs); % Play signal y with the sampling frequency
Fs
 pause(5);
 alpha = 0.9; D = 7196; %Attenuation=alpha, Delay=D
samples
 b= [1,zeros(1,D),alpha]; % Filter parameters (coffs of x in
DE)
 x= filter(b,1,y); % Place sound+echo piece in vector x
 sound(x,Fs); %Play sound+echo at frequency Fs
Prof. H. Nassar, BAU
Sound script Instructions
 LOAD Load data from MAT-file into workspace. The
samples go into a vector named y and the sampling
frequency goes to a variable named Fs (both can be
displayed into MATLAB’s workspace by writing their
names).
 SOUND(y,Fs) Sends the signal in y at the rate specified in
Fs (both initialized during file ‘load’ above) out to the
speaker. Values in y are assumed to be in the range -1.0
<= y <= 1.0; those outside that range are clipped.
 Y = FILTER(B,A,X) filters the data in vector X with the filter
described by vectors A and B to create the filtered data Y.
The filter is a "Direct Form II Transposed“ implementation
of the standard difference equation:
 a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-
nb)
 - a(2)*y(n-1) - ... - a(na+1)*y(n-na)
Prof. H. Nassar, BAU
Echo Removal
 After executing this simulation, you may experience that
the echo is an objectionable interference while listening.
 Again DSP can be used effectively to eliminate echoes.
 Given that w is the signal with echo, we can produce from
it a signal x without echo as follows:
w[n]+ αw[n − D]= x[n] (1.3)
where w[n]is the echo-corrupted sound signal and x[n] is
the output sound signal, which has the echo (hopefully)
removed.
 In MATLAB, this is equivalent to reversing the coefficients
A and B. Now the following MATLAB script on the echo-
corrupted signal w[n].
x= filter(1,b,w);
sound(x,Fs)
Prof. H. Nassar, BAU
Further Processing of Audio Signal
 When we load an audio signal, such as ‘Handel’, into
MATLAB with the ‘load’ function, the signal goes by default
to a vector named ‘y’, and the sampling frequency goes to
a variable named ‘Fs’
 Besides the echo addition/removal which we can do using
the ‘filter’ function, as we have demonestrated, we can
directly process the signal ‘y’ itself on MATLAB using the
techniques we have learned in the course: scale it up or
down, shift it right or left, delete part of it, copy part of it
into another part, etc.
 You are encouraged to practice with the audio pieces that
come with MATLAB, e.g. handel.mat and gong.mat.
Prof. H. Nassar, BAU

More Related Content

Similar to DSP_Filters_150505.pptx

“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...
“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...
“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...sipij
 
literature.pptx
literature.pptxliterature.pptx
literature.pptx8885684828
 
20575-38936-1-PB.pdf
20575-38936-1-PB.pdf20575-38936-1-PB.pdf
20575-38936-1-PB.pdfIjictTeam
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Amairullah Khan Lodhi
 
Feature Based watermarking algorithm for Image Authentication using D4 Wavele...
Feature Based watermarking algorithm for Image Authentication using D4 Wavele...Feature Based watermarking algorithm for Image Authentication using D4 Wavele...
Feature Based watermarking algorithm for Image Authentication using D4 Wavele...sipij
 
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...Ijripublishers Ijri
 
A Novel Architecture for Different DSP Applications Using Field Programmable ...
A Novel Architecture for Different DSP Applications Using Field Programmable ...A Novel Architecture for Different DSP Applications Using Field Programmable ...
A Novel Architecture for Different DSP Applications Using Field Programmable ...journal ijme
 
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree Multiplier
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree MultiplierDesign of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree Multiplier
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree MultiplierWaqas Tariq
 
A novel architecture of rns based
A novel architecture of rns basedA novel architecture of rns based
A novel architecture of rns basedVLSICS Design
 
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...Ijripublishers Ijri
 
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...sipij
 
High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...
High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...
High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...IJERA Editor
 
Analysis of different FIR Filter Design Method in terms of Resource Utilizati...
Analysis of different FIR Filter Design Method in terms of Resource Utilizati...Analysis of different FIR Filter Design Method in terms of Resource Utilizati...
Analysis of different FIR Filter Design Method in terms of Resource Utilizati...ijsrd.com
 
International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)inventionjournals
 
Design and determination of optimum coefficients of iir digital highpass filt...
Design and determination of optimum coefficients of iir digital highpass filt...Design and determination of optimum coefficients of iir digital highpass filt...
Design and determination of optimum coefficients of iir digital highpass filt...Subhadeep Chakraborty
 
DESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGIC
DESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGICDESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGIC
DESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGICVLSICS Design
 
Paper id 252014114
Paper id 252014114Paper id 252014114
Paper id 252014114IJRAT
 
Wavelet transform in two dimensions
Wavelet transform in two dimensionsWavelet transform in two dimensions
Wavelet transform in two dimensionsAyushi Gagneja
 

Similar to DSP_Filters_150505.pptx (20)

dsp.pdf
dsp.pdfdsp.pdf
dsp.pdf
 
“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...
“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...
“FIELD PROGRAMMABLE DSP ARRAYS” - A NOVEL RECONFIGURABLE ARCHITECTURE FOR EFF...
 
literature.pptx
literature.pptxliterature.pptx
literature.pptx
 
20575-38936-1-PB.pdf
20575-38936-1-PB.pdf20575-38936-1-PB.pdf
20575-38936-1-PB.pdf
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 
Feature Based watermarking algorithm for Image Authentication using D4 Wavele...
Feature Based watermarking algorithm for Image Authentication using D4 Wavele...Feature Based watermarking algorithm for Image Authentication using D4 Wavele...
Feature Based watermarking algorithm for Image Authentication using D4 Wavele...
 
signal and system
signal and system signal and system
signal and system
 
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
 
A Novel Architecture for Different DSP Applications Using Field Programmable ...
A Novel Architecture for Different DSP Applications Using Field Programmable ...A Novel Architecture for Different DSP Applications Using Field Programmable ...
A Novel Architecture for Different DSP Applications Using Field Programmable ...
 
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree Multiplier
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree MultiplierDesign of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree Multiplier
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree Multiplier
 
A novel architecture of rns based
A novel architecture of rns basedA novel architecture of rns based
A novel architecture of rns based
 
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
Ijri ece-01-02 image enhancement aided denoising using dual tree complex wave...
 
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...
ALEXANDER FRACTIONAL INTEGRAL FILTERING OF WAVELET COEFFICIENTS FOR IMAGE DEN...
 
High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...
High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...
High Speed Memory Efficient Multiplier-less 1-D 9/7 Wavelet Filters Based NED...
 
Analysis of different FIR Filter Design Method in terms of Resource Utilizati...
Analysis of different FIR Filter Design Method in terms of Resource Utilizati...Analysis of different FIR Filter Design Method in terms of Resource Utilizati...
Analysis of different FIR Filter Design Method in terms of Resource Utilizati...
 
International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)
 
Design and determination of optimum coefficients of iir digital highpass filt...
Design and determination of optimum coefficients of iir digital highpass filt...Design and determination of optimum coefficients of iir digital highpass filt...
Design and determination of optimum coefficients of iir digital highpass filt...
 
DESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGIC
DESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGICDESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGIC
DESIGN OF QUATERNARY LOGICAL CIRCUIT USING VOLTAGE AND CURRENT MODE LOGIC
 
Paper id 252014114
Paper id 252014114Paper id 252014114
Paper id 252014114
 
Wavelet transform in two dimensions
Wavelet transform in two dimensionsWavelet transform in two dimensions
Wavelet transform in two dimensions
 

Recently uploaded

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

DSP_Filters_150505.pptx

  • 1. Beirut Arab University Computer Engineering Program Spring 2015 Digital Signal Processing (COME 384) Instructor: Prof. Dr. Hamed Nassar Filters (Chapter 6) Textbook: ◦ V. Ingle and J. Proakis, Digital Signal Processing Using MATLAB 3rd Ed, Cengage Learning, 2012 1 Dr. Hamed Nassar, Beirut Arab Univ
  • 2. nal  ; Prof. H. Nassar, BAU
  • 3. Digital Filters: FIR and IIR  We will now use the theory of discrete systems that we have studied to process of digital signals, which is carried out using systems called filters (or spectrum analyzers in some contexts).  The filter design is influenced by such factors as the type of the filter (IIR or FIR) or the form of its implementation (structures).  Hence, before we discuss the design issue, we look at how these filters can be implemented in practice.  This is an important concern because different filter structures dictate different design strategies.  IIR filters as designed and used in DSP, can be modeled by rational system functions or, equivalently, difference equations.  Such filters are termed autoregressive moving average (ARMA) or, more generally, as recursive filters. Prof. H. Nassar, BAU
  • 4. Finite Impulse Response (FIR) - Contrast it with IIR  . Prof. H. Nassar, BAU
  • 5. Three Building Blocks  Our filters are LTI systems, and thus we need only the following three elements to describe their structures. ◦ 1. Adder: This element has two inputs and one output and is shown in Figure 6.1a. Note that the addition of three or more signals is implemented by successive two-input adders. ◦ 2. Multiplier (gain): This is a single-input, single-output element and is shown in Figure 6.1b. Note that the multiplication by 1 is understood and hence not explicitly shown. ◦ 3. Delay element (shifter or memory): This element delays the signal passing through it by one sample, as shown in Figure 6.1c. It is implemented by using a shift register.  Using these basic elements, we can now describe various structures of both IIR and FIR filters.  MATLAB is a convenient tool in the development of these Prof. H. Nassar, BAU
  • 6. IIR FILTER STRUCTURES: 3 types  Three different structures can be used to implement IIR filters: ◦ 1. Direct form: DE (6.2) is implemented directly. As it has two parts: the moving average part (numerator) and the recursive part (denominator), this implementation leads to two versions: direct form I and direct form II. ◦ 2. Cascade form: H(z) in (6.1) is factored into smaller 2nd-order sections, called biquads, and each biquad is implemented in a direct form, and the entire system function is implemented as a cascade of biquad sections. Prof. H. Nassar, BAU
  • 7. )  . Prof. H. Nassar, BAU
  • 8. )  . Prof. H. Nassar, BAU
  • 9. MATLAB IMPLEMENTATION  In MATLAB the direct form structure is implemented by the built-in function filter whose syntax is: Y = FILTER(B,A,X) where B and A are vectors representing the the filter paramters (B containing the {bn} coefficients and A containing the {an} coefficients) of the filter’s difference equation, which for M=N=4, takes the form: . Prof. H. Nassar, BAU
  • 10. Echo Generation  The most basic of all audio effects is that of time delay, echoes.  Echo used as building block of complex effects, e.g. reverb & flanging.  For example, the combination of the direct sound represented by discrete signal y and a single echo appearing D samples later (which is related to delay in seconds) can be generated by the (difference) equation (assuming x = input and y = output) y(n)= x(n)+ αx(n − D), |α| < 1 where y is the resulting signal and α the attenuation.  Difference equations are implemented in MATLAB using the filter function Y = FILTER(B,A,X) Thus, we will use here A=1 (coeff of output signal y(n)) Prof. H. Nassar, BAU
  • 11. An Audio application of DSP: adding & removing echo  DSP has applications audio and video. Here we add echo.  %MA_SoundEcho.m: Add and remove echo from a sound piece.  %9 s of Handel's Halleluja sampled at 8192 sam/sec. It is in file: handel.mat.  %We'll play it with echo delayed by D = 7196 samples, i.e 0.9 s  load handel; %Place signal in vector y & sampling freq in var Fs  sound(y,Fs); % Play signal y with the sampling frequency Fs  pause(5);  alpha = 0.9; D = 7196; %Attenuation=alpha, Delay=D samples  b= [1,zeros(1,D),alpha]; % Filter parameters (coffs of x in DE)  x= filter(b,1,y); % Place sound+echo piece in vector x  sound(x,Fs); %Play sound+echo at frequency Fs Prof. H. Nassar, BAU
  • 12. Sound script Instructions  LOAD Load data from MAT-file into workspace. The samples go into a vector named y and the sampling frequency goes to a variable named Fs (both can be displayed into MATLAB’s workspace by writing their names).  SOUND(y,Fs) Sends the signal in y at the rate specified in Fs (both initialized during file ‘load’ above) out to the speaker. Values in y are assumed to be in the range -1.0 <= y <= 1.0; those outside that range are clipped.  Y = FILTER(B,A,X) filters the data in vector X with the filter described by vectors A and B to create the filtered data Y. The filter is a "Direct Form II Transposed“ implementation of the standard difference equation:  a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n- nb)  - a(2)*y(n-1) - ... - a(na+1)*y(n-na) Prof. H. Nassar, BAU
  • 13. Echo Removal  After executing this simulation, you may experience that the echo is an objectionable interference while listening.  Again DSP can be used effectively to eliminate echoes.  Given that w is the signal with echo, we can produce from it a signal x without echo as follows: w[n]+ αw[n − D]= x[n] (1.3) where w[n]is the echo-corrupted sound signal and x[n] is the output sound signal, which has the echo (hopefully) removed.  In MATLAB, this is equivalent to reversing the coefficients A and B. Now the following MATLAB script on the echo- corrupted signal w[n]. x= filter(1,b,w); sound(x,Fs) Prof. H. Nassar, BAU
  • 14. Further Processing of Audio Signal  When we load an audio signal, such as ‘Handel’, into MATLAB with the ‘load’ function, the signal goes by default to a vector named ‘y’, and the sampling frequency goes to a variable named ‘Fs’  Besides the echo addition/removal which we can do using the ‘filter’ function, as we have demonestrated, we can directly process the signal ‘y’ itself on MATLAB using the techniques we have learned in the course: scale it up or down, shift it right or left, delete part of it, copy part of it into another part, etc.  You are encouraged to practice with the audio pieces that come with MATLAB, e.g. handel.mat and gong.mat. Prof. H. Nassar, BAU