Presentation is loading. Please wait.

Presentation is loading. Please wait.

What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through.

Similar presentations


Presentation on theme: "What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through."— Presentation transcript:

1 What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through the filter. The critical frequency defines the end (or ends) of the passband. is normally specified at the point where the response drops - 3 dB (70.7%) from the passband response. What do we mean by passband ? What is critical frequency fc ? What is a transition region ? It is a region Following the passband leading into stopband region What is a stop region ? It is a region at the end of passband

2 Basic filter response

3 low-pass filter  Basic low-pass filter Circuit The low-pass filter allows frequencies below the critical frequency to pass and rejects other. The simplest low-pass filter is a passive RC circuit with the output taken across C

4  Ideal and Practical low-pass filter response

5  Practical low-pass filter response BW is the bandwidth of an ideal low-pass Where : BW=fc A certain low-pass filter has a critical frequency of 800 Hz. What is its bandwidth? Example:

6 Calculation

7 Simple LP Digital filter v in (t)  x i v out (t)  y i dt   t d v out  y i -y i-1

8 That is, this discrete-time implementation of a simple RC low-pass filter is the exponentially- weighted moving average // Return RC low-pass filter output samples, given input samples, // time interval dt, and time constant RC function lowpass(real[0..n] x, real dt, real RC) var real[0..n] y var real α := dt / (RC + dt) y[0] := x[0] for i from 1 to n y[i] := α * x[i] + (1-α) * y[i-1] return y for i from 1 to n y[i] := y[i-1] + α * (x[i] - y[i-1])

9 High-Pass filter Basic high-pass circuit A high-pass filter is one that significantly attenuates or rejects all frequencies below fc and passes all frequencies above fc. The critical frequency is, again, the frequency at which the output is 70.7% of the input (or - 3 dB)

10  Practical low-pass filter response

11  Ideal and Practical low-pass filter response

12 Calculation // Return RC high-pass filter output samples, given input samples, // time interval dt, and time constant RC function highpass(real[0..n] x, real dt, real RC) var real[0..n] y var real α := RC / (RC + dt) y[0] := x[0] for i from 1 to n y[i] := α * y[i-1] + α * (x[i] - x[i-1]) return y Simple HP Digital filter for i from 1 to n y[i] := α * (y[i-1] + x[i] - x[i-1])

13 FIR (finite impulse response) Filters

14 These filters are systems for which each output sample is the sum of a finite number of weighted samples of the input sequence. a filter is a system that is designed to remove some component or modify some characteristic of a signal, but often the two terms are used interchangeably. the basic input-output structure of the FIR filter as a time domain computation based on a feed-forward difference equation.

15 Discrete-Time Systems In general, we represent the operation of a system by the notation Block-diagram representation of a discrete time system. A discrete-time system is a computational process for transforming one sequence, called the input signal, into another sequence called the output signal

16 complicated example would be the following system definition: Simple Example In this case, the output depends on three consecutive input values. In this case, the output depends only on one input value.

17 The Running-Average (moving average) Filter A simple but useful transformation of a discrete-time signal is to compute a moving average or running average of two or more consecutive numbers of the sequence, thereby forming a new sequence of the average values. Averaging is commonly used whenever data fluctuate and must be smoothed prior to interpretation. Case study : stock-market prices fluctuate noticeably from day to day, or hour to hour.

18 example Finite-length input signal, x[n]. we can compute a new sequence called y [n], which is the output of the averaging operator. The sequence is an example of a finite-length signal.

19 A 3-point average of the values {x[0], x[l], x[2]} = [2, 4, 6} gives the answer 1/3 (2 + 4 + 6) =4. The next output value is obtained by averaging (x[l], x[2], x[3]} = (4, 6, 4} which, yields a value of 14/3. With this indexing, the equations for computing the output from the input are which generalizes to the following input-output equation: The equation given in is called a difference equation. It

20 Finite-length input signal, x[n]. Output of running-average filter, y[n]

21 to compute the entire output signal for all index values —  < n < . For the input of x[n], the result is the signal y[n] tabulated as follows: Note that the values in orange type in the x[n] row are the numbers involved in the computation of y[2]. Also note that y[n] = outside of the finite interval —2 < n < 4; i.e., the output also has finite support. Observe that the output sequence is longer (has more nonzero values) than the input sequence, and that the output appears to be a somewhat rounded-off version of the input; i.e. it is smoother than the input sequence. In this case, n would stand for time, and we can interpret y[n]. as the computation of the present value of the output based on three input values. Since these inputs are indexed as n, n + 1, and n + 2, two of them are "in the future."

22 Causal And Noncasual Filter

23 In general, values from either the past or the future or both may be used in the computation. as shown in the figure. In all cases of a 3-point running average, a sliding window of three samples determines which three samples are used in the computation of y[n]. The running-average filter calculation at the present time (l=n) uses values within a sliding window. Gray shading indicates the past (L n). Here, the sliding window encompasses values from both the future and the past.

24 A filter that uses only the present and past values of the input is called a causal filter. a filter that uses future values of the input is called noncausal. Noncausal systems cannot be implemented in a real-time application because the input is not yet available when the output has to be computed. In other cases, where stored data blocks are manipulated inside a computer, the issue of causality is not crucial. backward average Observe that the output of the causal filter is simply a shifted version of the output of the previous noncausal filter.

25 EXERCISE 5.1:Determine the output of a centralized average for the following figure Is this filter causal or noncausal? What is the support of the output for this input?

26 How would the plot of the output compare to the figure below ?

27

28

29 FIR filter in Labview

30 The General FIR Filter In the previous example ( not the exercise ): M = 2 and b k = 1/3 for k = 0, 1, 2, If the coefficients b k are not all the same, then we might say that y[n] defines a weighted running average of M + 1 samples.

31 Operation of the Mth order causal FIR filter showing various positions of the sliding window of M + 1 points under which the weighted average is calculated. When the input signal x [n] is also finite length (N points), the sliding window will run onto and off of the input data, so the resulting output signal will also have finite length The parameter M is the order of the FIR filter The number of filter coefficients is also called the filter length (L). L =M+1

32

33

34

35 An Illustration of FIR Filtering consider a signal

36

37

38

39

40 The unit impulse is perhaps the simplest sequence because it has only one nonzero value, which occurs at n = 0. The mathematical notation is that of the Kronecker delta function Unit Impulse Sequence It is tabulated in the second row of this table:

41 Shifted impulse sequence A shifted impulse such as  [n - 2] is nonzero when its argument is zero, i.e., n - 2 = 0, or equivalently n = 2. The third row of the table gives the values of the shifted impulse  [n-2]. The shifted impulse is a concept that is very useful in representing signals and systems. Consider, for example, the signal

42 The following table shows the individual sequences and their sum:

43 Block diagram showing definition of impulse response

44 any sequence can be represented in this way. The equation is true if k ranges over all the nonzero values of the sequence x[n]. The equation states the obvious: The sequence is formed by using scaled shifted impulses to place samples of the right size at the right positions.

45 Unit Impulse Response Sequence When the input to the FIR filter is a unit impulse sequence, x[n] =  [n], the output is, by definition, the unit impulse response, which we will denote by h[n]. Substituting x[n] =  [ n] in gives the output y[n] = h[n]: the impulse response h[n] of the FIR filter is simply the sequence of difference equation coefficients.

46 EXERCISE 5.3: Determine and plot the impulse response of the FIR system

47 The Unit-Delay System One important system is the operator that performs a delay or shift by an amount n 0 Delayed Finite-length input signal, y[n]=x[n-2]

48 The delay system is actually the simplest of FIR filters; it has only one nonzero coefficient. When n 0 = 1, the system is called a unit delay. For example, a system that produces a delay of 2 has filter coefficients {bk } = [0, 0, 1}. The order of this FIR filter is M = 2, and its difference equation is

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64


Download ppt "What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through."

Similar presentations


Ads by Google