• No results found

ESE 531: Digital Signal Processing

N/A
N/A
Protected

Academic year: 2022

Share "ESE 531: Digital Signal Processing"

Copied!
43
0
0

Loading.... (view fulltext now)

Full text

(1)

ESE 531: Digital Signal Processing

Week 11

Lecture 20: March 24, 2021

Optimal Filter Design

(2)

Optimal Filter Design

!

Window method

"

Design Filters heuristically using windowed sinc functions

"

Choose order and window type

"

Check DTFT to see if filter specs are met

!

Optimal design

"

Design a filter h[n] with H(e

)

"

Approximate H

d

(e

) with some optimality criteria - or

satisfies specs.

2 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(3)

Mathematical Optimization

Penn ESE 531 Spring 2021 – Khanna

(4)

Solving Optimization Problems

4 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(5)

Least-Squares Optimization

Penn ESE 531 Spring 2021 – Khanna

(6)

Linear Programming

6 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(7)

Convex Optimization

Penn ESE 531 Spring 2021 – Khanna

(8)

Optimality – Least Squares

!

Least Squares:

!

Variation: Weighted Least Squares:

8 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(9)

Design Through Optimization

!

Idea: Sample/discretize the frequency response

!

Sample points are fixed

!

M+1 is the filter order

!

P >> M + 1 ( rule of thumb P=15M)

!

Yields a (good) approximation of the original problem

Penn ESE 531 Spring 2021 – Khanna

(10)

Example: Least Squares

!

Target: Design M+1= 2N+1 filter

!

First design non-causal and hence

10 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(11)

Example: Least Squares

!

Target: Design M+1= 2N+1 filter

!

First design non-causal and hence

!

Then, shift to make causal

Penn ESE 531 Spring 2021 – Khanna

(12)

Example: Least Squares

12 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(13)

Least-Squares

!

Result will generally be non-symmetric and complex valued.

!

However, if is real, should have symmetry!

Penn ESE 531 Spring 2021 – Khanna

(14)

Design of Linear-Phase L.P Filter

!

Suppose:

"

is real-symmetric

"

M is even (M+1 length)

!

Then:

"

is real-symmetric around midpoint

!

So:

14 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(15)

Least-Squares Linear Phase Filter

Penn ESE 531 Spring 2021 – Khanna

Capital P

(16)

Least-Squares Linear Phase Filter

16 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(17)

Extension:

!

LS has no preference for pass band or stop band

!

Use weighting of LS to change ratio

Penn ESE 531 Spring 2021 – Khanna

(18)

Weighted Least-Squares

18 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(19)

Optimality – min-max

!

Chebychev Design (min-max)

"

Parks-McClellan algorithm - equiripple

"

Also known as Remez exchange algorithms (signal.remez)

"

Can also use convex optimization

Penn ESE 531 Spring 2021 – Khanna

(20)

Parks-McClellan

!

Allows for multiple pass- and stop-bands.

!

Is an equi-ripple design in the pass- and stop-bands, but allows independent weighting of the ripple in each band.

!

Allows specification of the band edges.

20 Penn ESE 531 Spring 2021 - Khanna

(21)

Parks-McClellan: LP Filter

!

For the low-pass filter shown above the specifications are

(22)

Parks-McClellan: LP Filter

!

Need to determine M+1 (length of the filter) and the filter coefficients {h n }

22 Penn ESE 531 Spring 2021 - Khanna

(23)

Parks-McClellan: LP Filter

!

Need to determine M+1 (length of the filter) and the filter coefficients {h n }

!

If we assume M even and even symmetry FIR filter

(Type I), then

(24)

Parks-McClellan: LP Filter

!

Reformulate

!

To fitting a polynomial

24 Penn ESE 531 Spring 2021 - Khanna

(25)

Parks-McClellan: LP Filter

!

Define approximation error function

(26)

Parks-McClellan: LP Filter

!

Define approximation error function

!

Apply min-max or Chebyshev criteria

26 Penn ESE 531 Spring 2021 - Khanna

(27)

Min-Max Filter Design

!

Constraints:

"

min-max pass-band ripple

"

min-max stop-band ripple

Penn ESE 531 Spring 2021 – Khanna

(28)

Min-Max Ripple Design

!

Given ω p , ω s , M, find δ,

!

Formulation is a linear program with solution δ,

!

A well studied class of problems with good solvers

28 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(29)

Min-Max Ripple via LP

Penn ESE 531 Spring 2021 – Khanna

(30)

Parks-McClellan

!

The method is based on reformulating the problem as one in polynomial approximation, using

Chebyshev polynomials

30 Penn ESE 531 Spring 2021 - Khanna

(31)

Parks-McClellan – Alternation Theorem

!

The algorithm uses Chebyshev’s alternation theorem

to recognize the optimal solution.

(32)

Parks-McClellan – Alternation Theorem

32 Penn ESE 531 Spring 2021 - Khanna

- M+1=17# L=8

- Must exhibit at least 10

points of alternation to be

optimal

(33)

Alternation Theorem Example – 5 th order

(34)

Parks–McClellan algorithm

34 Penn ESE 531 Spring 2021 - Khanna

(35)

MATLAB Parks-McClellan Function

!

b = firpm(M,F,A,W)

"

b is the array of filter coefficients (impulse response)

"

M is the filter order (M+1 is the length of the filter),

"

F is a vector of band edge frequencies in ascending order

"

A is a set of filter gains at the band edges

"

W is an optional set of relative weights to be applied to

each of the bands

(36)

MATLAB Parks-McClellan Function

36 Penn ESE 531 Spring 2021 - Khanna

(37)

MATLAB Example

!

Design a 33 length PM band-pass filter and weight the stop-

band ripple 10x more than the pass-band ripple

(38)

MATLAB Example

38 Penn ESE 531 Spring 2021 - Khanna

!

Design a 33 length PM band-pass filter and weight the stop-

band ripple 10x more than the pass-band ripple

(39)

Optimality – Least Squares

!

Least Squares:

!

Parks-McClellan

Penn ESE 531 Spring 2021 – Khanna

(40)

Example of Complex Filter

!

Larson et. al, “Multiband Excitation Pulses for Hyperpolarized 13C Dynamic Chemical Shift Imaging” JMR 2008;194(1):121-127

!

Need to design length 11 filter with following frequency response:

40 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(41)

Convex Optimization

!

Many tools and Solvers

!

Tools:

"

CVX (Matlab) http://cvxr.com/cvx/

"

CVXOPT, CVXMOD (Python)

!

Engines:

"

Sedumi (Free)

"

MOSEK (commercial)

Penn ESE 531 Spring 2021 – Khanna

(42)

Using CVX (in Matlab)

42 Penn ESE 531 Spring 2021 – Khanna

Adapted from M. Lustig, EECS Berkeley

(43)

Admin

!

Project1 out now

"

Due Monday 4/5

References

Related documents

Conclusions: In the context of a well-structured programme setting, and under the described circumstances, it seems likely that the well-trained and supervised community-based

Comparing data from this experiment with data on in- activation of PEDV, it appears that PDCoV is more labile than PEDV to environmental temperature and storage conditions because

Preračun velik osti teoretične dotikalne elipse in lege

(D) Salmonella strains that were derivatives of the wild-type strain (wt) or the ssaV mutant (carrying a nonfunctional T3SS2) expressing SseJ in fusion with Pseudomonas antigens

The Implementation of ECG based Arrhythmia has been considered the best protection against of sudden death from ventricular arrhythmias in high risk patients. Long term of

Many residents also felt that police shared this perception and were not as concerned with crime or community problems in Dorner and Brookside as higher income, predominately

other community-based providers engage older people in dialogue regarding fall risk and. fall prevention, understanding the meaning of any previous experiences with