low-pass filter · low-pass filter!"= $(") '(") = 1)*"+1 a low-pass filter...

24
Low-pass Filter Hans-Petter Halvorsen https://www.halvorsen.blog

Upload: others

Post on 29-Sep-2020

23 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Low-pass Filter

Hans-Petter Halvorsen

https://www.halvorsen.blog

Page 2: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Contents• Introduction to Filters–Overview of different Filters–What is a Low-pass Filter?–Why do we need a Lowpass Filter?

• Using a built-in Lowpass Filter in LabVIEW• Create your own Lowpass Filter from

scratch

Page 3: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Filters• A Filters are typically used in frequency response analysis • A filter is used to remove given frequencies or an interval

of frequencies from a signal. • Such an application would typically be to remove noise

from a signal. • The most common is the low pass filter.• We have 4 types of filter:– Low-pass Filter– High-pass Filter– Band-pass Filter– Band-stop Filter

Page 4: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Filters

Page 5: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Low-pass Filter

High frequencies (above !") are removed (or attenuated)

# $ = 1'$ + 1 =

11!" $ + 1

Low-pass Filter in LabVIEW

Page 6: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Low-pass Filter• In Measurement systems and Control Systems

we typically need to deal with noise• Noise is something we typically don’t want• Noise is high-frequency signals• Low-pass Filters are used to remove noise

from the measured signals

Page 7: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

High-pass Filter

Low frequencies (below !") are removed (or attenuated)

# $ = &$&$ + 1 =

1!) $1!) $ + 1

High-pass Filter in LabVIEW

Page 8: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Band-pass Filter

and High frequencies (above !") are removed (or attenuated)

Low frequencies (below !#) are removed (or attenuated)

Band-pass Filter in LabVIEW

Page 9: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Band-stop Filter

Frequencies between !" and !# are removed

Band-stop Filter in LabVIEW

Page 10: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Using a built-in Low-pass Filter in LabVIEW

Hans-Petter Halvorsen

https://www.halvorsen.blog

Page 11: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Using a Low-pass Filter to reduce NoiseFunctions palette: Express -> Signal Analysis -> Simulate Signal

Functions palette: Express -> Signal Analysis -> Filter

Here we use one of the built-in (Low-pass) Filters

Page 12: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Properties

Page 13: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Using a Low-pass Filter to reduce Noise

Page 14: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Using a Low-pass Filter to reduce Noise

We see the noise from the signal

has been reduced

Page 15: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Create your own Low-pass Filter from scratch

Hans-Petter Halvorsen

https://www.halvorsen.blog

Page 16: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Low-pass Filter

! " = $(")'(") =

1)*" + 1

A Low-pass Filter has the following Transfer Function:

In LabVIEW we can implement a Low-pass Filter in many ways.If we want to implement the Low-pass Filter in a text-based programming or using e.g., the Formula Node in LabVIEW we typically need to find a discrete version of the filter.

! "'(") $(")

Input Output

Page 17: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Low-pass Filter

! " = $(")'(") =

1)*" + 1

A Low-pass Filter has the following Transfer Function

We can find the Differential Equation for this filter using Inverse Laplace

We get:

$ " )*" + 1 = ' "

)*$ " " + $ " = ' "

Finally we get the following differential equation:

)*$̇ + $ = ' We apply Euler on the Differential Equation in order to find the Discrete Differential equation

Page 18: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Discretization of Low-pass FilterWe have the following differential equation:

!"$̇ + $ = '

We use Euler Backward method: (̇ ≈ * + ,* +,-./

Then we get:

!"$ 0 − $ 0 − 1

!3+ $ 0 = ' 0

This gives: $ 0 = .4.45./

$ 0 − 1 + ./.45./

' 0

We define:!3

!" + !3≡ 7

This finally gives:

$ 0 = 1 − 7 $ 0 − 1 + 7' 0

This equation can easily be implemented in LabVIEW or another programming language

Page 19: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Discrete Low-pass Filter Example

We use the Euler Backward method:

Inverse Laplace the differential Equation:

This gives:

Lowpass Filter Transfer function:We define:

This gives:

This algorithm can be easly implemented in a Programming language

Filter output Noisy input signal

Page 20: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Low-pass Filter/Measurement Filter - Example

Page 21: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Testing the FilterIn this example we add noise to a Sine function. We then use the Measurement Filter to see if we can remove the noise afterwards.

As you can see this gives good results. The filter removes the noise from the signal.

Page 22: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want
Page 23: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want
Page 24: Low-pass Filter · Low-pass Filter!"= $(") '(") = 1)*"+1 A Low-pass Filter has the following Transfer Function: In LabVIEW we can implement a Low-pass Filter in many ways. If we want

Hans-Petter Halvorsen

University of South-Eastern Norwaywww.usn.no

E-mail: [email protected]: https://www.halvorsen.blog