Frequency Sampling Filter
Filter
• Electronic filters are circuits which perform
signal processing functions, specifically to
remove unwanted frequency components
from the signal, to enhance wanted ones, or
both.
Introduction
• Basic filter classification
• We put emphasis on the digital filter now.
Filter
Analog Filter
Digital Filter
IIR Filter
FIR Filter
Digital Filter
• Digital Filter: numerical procedure or
algorithm that transforms a given sequence of
numbers into a second sequence that has
some more desirable properties.
DIGITAL FILTER
Input sequence Output Sequence
• A finite impulse response (FIR) filter is a filter
whose impulse response is of finite duration.
• Its design construction has not returned to the
part which gives.
• Its construction generally uses Direct form
and Cascade form.
Finite Impulse Response Filter
Introduction
• FIR filter design methods include the window
function, frequency sampling, minimize the
maximal error, and MSE.
• We emphasized at window function.
Window function
technique
Frequency sampling
technique
Minimize the
maximal error
FIR filter
Mean square
error
 The basic idea behind the window design is to choose a
proper ideal frequency-selective filter (which always has a
noncausal, infinite-duration impulse response) and then to
truncate (or window) its impulse response to obtain a linear-
phase and causal FIR filter.
 Therefore the emphasis in this method is on selecting an
appropriate windowing function and an appropriate ideal
filter. We will denote an ideal frequency-selective filter by
,which has a unity magnitude gain and linear-phase
characteristics over its passband, and zero response over its
stopband.
FIR Filter Design by Window function
technique
FIR Filter Design by Window function
technique
• Simplest FIR the filter design is window
function technique
• A supposition ideal frequency response may
express
where
( ) [ ]j j n
d d
n
H e h n e 



 
1
[ ] ( )
2
j j n
d dh n H e e d

 


 
 
The impulse response will be
FIR Filter Design by Window function
technique
• To get this kind of systematic causal FIR to be
approximate, the most direct method
intercepts its ideal impulse response!
[ ] [ ] [ ]dh n w n h n
( ) ( ) ( )dH W H   
FIR Filter Design by Window function
technique
• 1.Rectangular window
• 2.Triangular window (Bartett window)
1, 0
[ ]
0,
n M
w n
otherwise
 
 

2 , 0
2
2[ ] 2 ,
2
0,
n Mn
M
n Mw n n M
M
otherwise
  


   


FIR Filter Design by Window function
technique
• 1.Rectangular window
• 2.Triangular window (Bartett window)
0 10 20 30 40 50 60
0
0.5
1
sequence (n)
T(n)
Rectangular window
0 10 20 30 40 50 60
0
0.5
1
sequence (n)
T(n)
Bartlett window
FIR Filter Design by Window function
technique
• 3.HANN window
• 4.Hamming window
1 2
1 cos , 0
[ ] 2
0,
n
n M
w n M
otherwise
  
      


2
0.54 0.46cos , 0
[ ]
0,
n
n M
w n M
otherwise

  
 

0 10 20 30 40 50 60
0
0.5
1
sequence (n)
T(n)
Hanning window
0 10 20 30 40 50 60
0
0.5
1
sequence (n)
T(n)
Hamming window
FIR Filter Design by Window function
technique
• 3.HANN window
• 4.Hamming window
Frequency sampling-based FIR filter
design
• In this project we implemented FIR low and
high pass filters in matlab.
• For that we use matlab fir2 function that’s
uses frequency sampling to design filters.
• To obtain the filter coefficients, the function
applies an inverse fast Fourier transform to
the grid and multiplies by window.
• fir2(n,f,m) returns an nth-order FIR filter with
frequency-magnitude characteristics specified
in the vectors f and m. The function linearly
interpolates the desired frequency response
onto a dense grid and then uses the inverse
Fourier transform and a Hamming window to
obtain the filter coefficients.
Low pass Filter
Design a 30th-order low pass filter with a normalized cutoff
frequency of 0.6 PI rad/sample.
• Load the MAT-file chirp. The file contains a
signal, y, sampled at a frequency . y has most
of its power above , or half the Nyquist
frequency. Add random noise to the signal.
load chirp
y = y + 0.25*(rand(size(y))-0.5);
• Design a 34th-order FIR high pass filter. Specify a
cutoff frequency of 0.48. Visualize the frequency
response of the filter.
• It can be possible to implement this Hamming
window function for FIR filters to implement
low ,high,passband and stopband filters on
hardware (DSP Processor) for noise reduction
in any type of electonic circuits.
design of sampling filter

design of sampling filter

  • 1.
  • 2.
    Filter • Electronic filtersare circuits which perform signal processing functions, specifically to remove unwanted frequency components from the signal, to enhance wanted ones, or both.
  • 3.
    Introduction • Basic filterclassification • We put emphasis on the digital filter now. Filter Analog Filter Digital Filter IIR Filter FIR Filter
  • 4.
  • 5.
    • Digital Filter:numerical procedure or algorithm that transforms a given sequence of numbers into a second sequence that has some more desirable properties. DIGITAL FILTER Input sequence Output Sequence
  • 6.
    • A finiteimpulse response (FIR) filter is a filter whose impulse response is of finite duration. • Its design construction has not returned to the part which gives. • Its construction generally uses Direct form and Cascade form. Finite Impulse Response Filter
  • 7.
    Introduction • FIR filterdesign methods include the window function, frequency sampling, minimize the maximal error, and MSE. • We emphasized at window function. Window function technique Frequency sampling technique Minimize the maximal error FIR filter Mean square error
  • 8.
     The basicidea behind the window design is to choose a proper ideal frequency-selective filter (which always has a noncausal, infinite-duration impulse response) and then to truncate (or window) its impulse response to obtain a linear- phase and causal FIR filter.  Therefore the emphasis in this method is on selecting an appropriate windowing function and an appropriate ideal filter. We will denote an ideal frequency-selective filter by ,which has a unity magnitude gain and linear-phase characteristics over its passband, and zero response over its stopband. FIR Filter Design by Window function technique
  • 9.
    FIR Filter Designby Window function technique • Simplest FIR the filter design is window function technique • A supposition ideal frequency response may express where ( ) [ ]j j n d d n H e h n e       1 [ ] ( ) 2 j j n d dh n H e e d         
  • 10.
  • 11.
    FIR Filter Designby Window function technique • To get this kind of systematic causal FIR to be approximate, the most direct method intercepts its ideal impulse response! [ ] [ ] [ ]dh n w n h n ( ) ( ) ( )dH W H   
  • 14.
    FIR Filter Designby Window function technique • 1.Rectangular window • 2.Triangular window (Bartett window) 1, 0 [ ] 0, n M w n otherwise      2 , 0 2 2[ ] 2 , 2 0, n Mn M n Mw n n M M otherwise           
  • 15.
    FIR Filter Designby Window function technique • 1.Rectangular window • 2.Triangular window (Bartett window) 0 10 20 30 40 50 60 0 0.5 1 sequence (n) T(n) Rectangular window 0 10 20 30 40 50 60 0 0.5 1 sequence (n) T(n) Bartlett window
  • 16.
    FIR Filter Designby Window function technique • 3.HANN window • 4.Hamming window 1 2 1 cos , 0 [ ] 2 0, n n M w n M otherwise             2 0.54 0.46cos , 0 [ ] 0, n n M w n M otherwise       
  • 17.
    0 10 2030 40 50 60 0 0.5 1 sequence (n) T(n) Hanning window 0 10 20 30 40 50 60 0 0.5 1 sequence (n) T(n) Hamming window FIR Filter Design by Window function technique • 3.HANN window • 4.Hamming window
  • 19.
    Frequency sampling-based FIRfilter design • In this project we implemented FIR low and high pass filters in matlab. • For that we use matlab fir2 function that’s uses frequency sampling to design filters. • To obtain the filter coefficients, the function applies an inverse fast Fourier transform to the grid and multiplies by window.
  • 20.
    • fir2(n,f,m) returnsan nth-order FIR filter with frequency-magnitude characteristics specified in the vectors f and m. The function linearly interpolates the desired frequency response onto a dense grid and then uses the inverse Fourier transform and a Hamming window to obtain the filter coefficients.
  • 21.
  • 23.
    Design a 30th-orderlow pass filter with a normalized cutoff frequency of 0.6 PI rad/sample.
  • 25.
    • Load theMAT-file chirp. The file contains a signal, y, sampled at a frequency . y has most of its power above , or half the Nyquist frequency. Add random noise to the signal. load chirp y = y + 0.25*(rand(size(y))-0.5);
  • 26.
    • Design a34th-order FIR high pass filter. Specify a cutoff frequency of 0.48. Visualize the frequency response of the filter.
  • 28.
    • It canbe possible to implement this Hamming window function for FIR filters to implement low ,high,passband and stopband filters on hardware (DSP Processor) for noise reduction in any type of electonic circuits.

Editor's Notes

  • #15 1.main lobe越窄 resolution越高 side lobe 越低越好 2.統計上常用 resolution降一半 main lobe 變寬(trade off) Main lobe變寬(trade off) side lobe降一半
  • #17 1.In fact, the length of window is M-1 2.main lobe和HANN差不多但side lobe降了10dB 3.Hamming 常用在語音處理