0
Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Ajal filters

891

Published on

The Time and Frequency Response of the Analog Filter …

The Time and Frequency Response of the Analog Filter
digital delay

Published in: Engineering
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total Views
891
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
16
0
Likes
1
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. The Basic Theory of Filtering AJAL.A.J ASSISTANT PROFESSOR UNIVERSAL ENGINEERING COLLEGE Mail: ec2reach@gmail.com , Mob: 8907305642 1AJAL.A.J , 8907305642
• 2. What is a filter? Vin Vout Simply put, it retains history of the input signal. Take this simple lowpass filter for an example. This simple filter is a kind of integrator, in which the capacitor integrates the charge provided through the resistor. As the rate of change of Vout depends on the current through the resistor, low frequencies will be filtered less than high frequencies. 2AJAL.A.J , 8907305642
• 3. In other words: &#x2022; The output of a filter is a function not only of the input at the present time, but also of previous events. &#x2022; That&#x2019;s what a linear filter does. No more, no less. We are sticking to linear filters today, thank you! &#x2022; There are many ways to build filters. 3AJAL.A.J , 8907305642
• 4. The Time and Frequency Response of the Analog Filter Time (impulse) Response Frequency Response 4AJAL.A.J , 8907305642
• 5. How does the analog filter exhibit memory? &#x2022; In the case shown, the capacitor is the memory element. &#x2013; It retains previous history. &#x2013; It does so by summing the history into one value, the voltage across the capacitor. &#x2013; In such a way, a single component can have a long memory. 5AJAL.A.J , 8907305642
• 6. Ok, what&#x2019;s the &#x201C;impulse response&#x201D; Impulse response is the response of the circuit to a (mathematical) signal of infinite height (and power), and infinitely short duration. This &#x201C;unit impulse&#x201D; has very special characteristics: 1) It contains all frequencies 2) It has energy of &#x201C;1&#x201D; at all frequencies. 3) It describes the behavior of the filter at all frequencies. Completely. POINT 3 is what you need to remember. The impulse response of a filter is a complete description of what it does. 6AJAL.A.J , 8907305642
• 7. Another way to look at the impulse response. &#x2022; The impulse response of a system shows how a filter captures the HISTORY of the signal. In other words: &#x2013; The value of the impulse response at a time &#x2018;t&#x2019; demonstrates how much of the HISTORY of the signal is added to the output at time &#x2018;t&#x2019; later. 7AJAL.A.J , 8907305642
• 8. Remember last month? &#x2022; Multiple speakers created a &#x201C;comb filter&#x201D;? &#x2013; Yep, that&#x2019;s a filter. Different distance means &#x201C;different times in the history of the signal. &#x2013; You can plot a time response for such a filter just like you can plot the one for the simple RC filter above. &#x2013; We saw some of that last month. 8AJAL.A.J , 8907305642
• 9. Getting back to the analog filter: &#x2022; The analog filter&#x2019;s output can not change instantly as that would require infinite current in the resistor, that means that the output depends on the HISTORY of the signal. &#x2022; In fact, if you have an input signal, and you integrate the product of the time- reversed impulse response times the signal, you get the filter&#x2019;s output. 9AJAL.A.J , 8907305642
• 10. DID YOU SAY INTEGRATE? &#x2022; Well, it can be a sum, rather than an integral, and in fact in the digital domain, it is a sum, rather than an integral. &#x2022; In the digital domain, rather than having all frequencies, you have all frequencies inside the digital passband, which will be &#xBD; the sample rate wide. 10AJAL.A.J , 8907305642
• 11. I&#x2019;ll say more about that later. &#x2022; For now, let&#x2019;s get back to that analog filter again for a minute. 11AJAL.A.J , 8907305642
• 12. So, what did that filter actually do? &#x2022; It stored part of the history of the signal. As the time went on, it &#x201C;forgot&#x201D;, exponentially, the contributions to its output from previous history. &#x2013; Not all impulse responses are so simple. &#x2013; An impulse response may be positive or negative &#x2013; An impulse response may &#x201C;ring&#x201D; or not. 12AJAL.A.J , 8907305642
• 13. How about a &#x201C;Digital&#x201D; filter? + One Sample Delay Feedback X (1-1/8) Input Output The digital filter uses history explicitly. 13AJAL.A.J , 8907305642
• 14. That digital delay &#x2022; In digital terms, a delay of one sample is defined as a multiplication by &#x2018;z&#x2019;. &#x2013; Some texts use z-1 . &#x2013; Either works. The rules are the same, except for how you interpret some things that I&#x2019;ll leave out for now. &#x2013; Remember a delay of &#x2018;z&#x2019; is one sample. If I say I multiplied a signal by z3 , it means I delayed it by 3 samples. Yes, it really is that simple. 14AJAL.A.J , 8907305642
• 15. What is it&#x2019;s time and frequency response? The result is the same (below half the sampling rate) 15AJAL.A.J , 8907305642
• 16. What about not below half the sampling rate? &#x2022; Inside the &#x2018;z&#x2019; domain, there is no such thing. &#x2013; The &#x2018;z&#x2019; domain is also called the &#x201C;digital domain&#x201D; by many people. This does involve a potential confusion that I will ignore for the time being. &#x2022; Remember when we talked about the sampling theorem a long time ago? We used an anti-aliasing filter. &#x2022; All other &#x201C;frequencies&#x201D; are represented by aliases below fs/2, and you don&#x2019;t let them in in the first place! &#x2022; All information in the sampled domain is contained inside that bandwidth. All aliases/images contain exactly the SAME information as the baseband spectrum. No more, no less. 16AJAL.A.J , 8907305642
• 17. Why is the response the same? &#x2022; This filter also stores the history of the signal in an exponentially decaying fashion. In the digital filter, you can see the storage more directly, as the &#x2018;z&#x2019; element. In the analog filter, reactive components provide the history in a continuous fashion. &#x2022; I picked the parameters to provide the same visible response as long as we stay well below half the sampling rate. &#x2022; Recursive (IIR) filter outputs depend on both previous outputs and input(s). &#x2022; Analog filters are mostly (but not completely) filters that depend on both output and input. 17AJAL.A.J , 8907305642
• 18. Back to Impulse Response &#x2022; The response of either filter to an impulse is called its &#x201C;impulse response&#x201D;. A digital impulse is simpler (as the bandwidth is finite), and consists of one &#x2018;1&#x2019; sample but both have the same use. &#x2022; This is the &#x201C;time response&#x201D; plotted in the proceeding diagrams. &#x2022; The impulse response of a filter defines its memory (history) of a signal. &#x2022; Remember. The impulse response of the filter contains exactly all the information about a filter. &#x2022; This is, you will find out, very handy. 18AJAL.A.J , 8907305642
• 19. Ok, what&#x2019;s the big deal, JJ? &#x2022; Since the impulse response of the filter defines its interaction with the signal, this means that we can either use the recursive form shown before to implement the filter, or we can simply multiply the time reversed impulse response by the signal and sum (integrate) the result, to get the filter output. &#x2022; The two operations are exactly the same. 19AJAL.A.J , 8907305642
• 20. Let us use a 9th order Elliptical filter as an example: Impulse response Noise Input Red: By time reverse, multiply, and sum Green: By direct filtering (the two exactly overlap) 20AJAL.A.J , 8907305642
• 21. Convolution &#x2022; The process of multiplying the time-reversed signal by the impulse response, and summing (integrating) is called &#x201C;convolution&#x201D;. &#x2211; &#x221E;= &#x2212;&#x221E;= &#x2212; t t thtTx )()( Think of it as a way to expressly include the history of the signal in the filter output. 21AJAL.A.J , 8907305642
• 22. I thought we multiplied transfer functions, jj???? S(&#x3C9;) H(&#x3C9;) Y(&#x3C9;) = S(&#x3C9;)*H(&#x3C9;) The usual way we see transfer functions expressed: (notice this is in the &#x2018;&#x3C9;&#x2019;, or frequency, domain) What&#x2019;s actually happening in the time domain: (Note: &#x2297; is used here to denote convolution. There are other notations.) s(t) s(t)&#x2297;h(t) y(t) These are two ways of saying the exact same thing! 22AJAL.A.J , 8907305642
• 23. Multiplication in the time domain is the same as convolution in the frequency domain. Multiplication in the FREQUENCY domain is the same as convolution in the TIME domain. It works either way. If you read a DSP text, you will see the word &#x201C;duality&#x201D;. This is duality in action. 23AJAL.A.J , 8907305642
• 24. &#x2022; For typical filters, convolution is what happens in the time domain. &#x2022; Convolution is merely another way of expressing what happens when you filter a signal. &#x2022; It&#x2019;s the same as multiplying the signal by the transfer function. This relationship holds for the &#x2018;s&#x2019; domain, the &#x2018;z&#x2019; domain, and quite some other domains as well. 24AJAL.A.J , 8907305642
• 25. &#x2022; Convolution is important because: &#x2013; Convolving in the time domain (like we just saw here) is the same as multiplying the Fourier Transform of the signal by the Fourier Transform of the Impulse Response and then taking the Inverse Fourier Transform &#x2013; This works the other way around, too, but isn&#x2019;t usually as interesting to discuss in most filtering applications except perhaps as window functions. (There are exceptions, for instance, &#x201C;TNS&#x201D;.) 25AJAL.A.J , 8907305642
• 26. Multiplication of Transforms of Signal and Filter Signal Signal Spectrum Filter Filter Spectrum Product of Spectra Inverse transform Of Product 26AJAL.A.J , 8907305642
• 27. An example of Convolution Time Domain Frequency Domain h(t) s(t) y=s(t) h(t)&#x2297; |FFT(y)| |H(w)| |S(w)| |Y(w)=H(w)*S(w)| IFFT(Y) In this plot, it&#x2019;s easier to see the linear superposition in the time domain because the two parts of the signal s(t) do not overlap. 27AJAL.A.J , 8907305642
• 28. What&#x2019;s my point? &#x2022; Filtering is Convolution. Convolution is filtering. They are the same thing expressed in different domains. There are several ways to do filtering: &#x2013; IIR (Infinite Impulse Response) filters, like the two shown much earlier. They are called IIR because the filter&#x2019;s impulse response continues to infinity (yes, at infinitely small value for a stable filter). These filters, effectively, use a topology that implements the history inside a few (very important, sensitive) state variables. &#x2013; FIR (Finite Impulse Response) filters, in other words, just do the convolution using a ( potentially arbitrary) impulse response. 28AJAL.A.J , 8907305642
• 29. So, they are the same? &#x2022; Well, no. In fact, FIR filters have zeros, and IIR filters have poles. (In reality, nearly all IIR filters have both poles and zeros, which is to say that they have both an FIR and an IIR part. &#x2022; FIR and IIR filters can have quite different properties, and usually do, they are two different means to an end. Neither one nor the other is always better. 29AJAL.A.J , 8907305642
• 30. More about IIR filters &#x2022; IIR filters must be implemented using feedback to implement the poles, in order to be truly IIR. &#x2013; IIR filters are &#x201C;longer&#x201D; (in terms of impulse response) compared to the memory they directly use. (i.e. a 2nd order filter can have 1000&#x2019;s of samples of significant energy in its impulse response.) &#x2022; The impulse response length is what can determine the sharpness of the filter&#x2019;s frequency and phase response. &#x2013; This extension places substantial requirements on the implementation in terms of accuracy, both of coefficients (analog or digital), and of related processes (digital storage, multiplication, addition). &#x2013; The data is stored in a few variables, so the accuracy required for those variables rises accordingly. 30AJAL.A.J , 8907305642
• 31. FIR Filters &#x2022; FIR filters are not generally as sensitive to coefficient roundoff &#x2022; FIR filters often require more computation, because you must do a multiply-add for each term in the impulse response &#x2022; FIR filters can be constant delay, IIR filters can not. Sometimes this matters. 31AJAL.A.J , 8907305642
• 32. What are the meaningful properties of a filter? &#x2022; The amplitude response (plotted in terms of amplitude vs. frequency) &#x2022; The phase response (plotted in terms of phase vs. frequency) &#x2013; What does phase response mean? &#x2022; Linear phase (i.e. constant time delay) &#x2022; Minimum phase &#x2022; Non-minimum-phase Linear phase is an important subset of this class that has all zeros. Attention: We are talking about single filters here, not filter banks. That is another subject, and one that places more constraints on individual filters! 32AJAL.A.J , 8907305642
• 33. A bit more on phase response &#x2022; &#x201C;Linear Phase&#x201D; (constant delay) &#x2013; If a filter has a constant delay, the phase shift of the filter will be t*w, where t is the time delay, and w the natural frequency (2 pi f). &#x2022; This means that a delay can exhibit enormous phase shift. &#x2022; This phase shift, however, is ONLY delay. &#x2022; Non-linear delay &#x2013; This is the part of the phase shift (in and around the filter&#x2019;s passband) that is not modeled by a straight line) &#x2022; The part that does not correspond to a straight line constitutes non- constant-time phase shift. &#x2022; Phase shift of &#x201C;1 million degrees&#x201D; in and of itself tells you nothing! 33AJAL.A.J , 8907305642
• 34. Some example plots: IIR FIR Impulse Response Notice similar length Magnitude Response Notice similar frequency response Phase Response DIFFERENT PHASE RESPONSE 13th order elliptical, (poles and zeros) 512 point Symmetric FIR &#x201C;Linear&#x201D; phaseNote phase Nonlinearity in passband 34AJAL.A.J , 8907305642
• 35. Properties of Impulse Responses &#x2022; Symmetry &#x2022; Antisymmetry &#x2022; Asymmetry &#x2022; DC Gain &#x2022; Fs/2 Gain &#x2022; Frequency response &#x2022; Phase Response 35AJAL.A.J , 8907305642
• 36. DC gain &#x2022; The DC gain of an impulse response is exactly the sum of all of its non-zero coefficients. &#x2022; For many applications, one wishes to set this to one. &#x2013; This is easy. Divide the entire impulse response by the sum of all values of the impulse response. 36AJAL.A.J , 8907305642
• 37. Gain at FS/2 &#x2022; This is also easy. &#x2022; Sum all of the EVEN taps &#x2022; Sum all of the ODD taps &#x2022; The difference of the two is the gain of the filter at FS/2 37AJAL.A.J , 8907305642
• 38. Some useful things to know (I won&#x2019;t prove them here) &#x2022; A symmetric impulse response implies: &#x2013; The passband phase response (one or multiple passbands) will look like a pure delay (linear phase) &#x2022; &#x201C;Linear phase&#x201D; &#xF0E0; phi = w*t, where omega is the natural frequency and &#x2018;t&#x2019; is the time delay &#x2022; An antisymmetric impulse response has some interesting (and special) properties. They are beyond this introductory tutorial, but are worth looking into for some applications. Such filters will have &#x201C;linear phase&#x201D; in the passband, but the intercept of such a filter at DC must be at +_ 90 degrees, and the filter must have a zero at DC. &#x2022; An asymmetric impulse response implies: &#x2013; The passband phase response is not a pure delay. &#x2013; Practically speaking this means that the response is the sum of a symmetric and an antisymmetric response. 38AJAL.A.J , 8907305642
• 39. Implications of the previous page No IIR filter can be linear phase. If it were, it would have to extend to infinity on both sides, and have infinite delay. Some IIR filters can &#x201C;come close&#x201D; under some circumstances. In such cases, they have substantial &#x201C;pre- ringing&#x201D; (as they must). A true IIR filter with linear phase must be &#x201C;non-causal&#x201D;, i.e. it must be able to &#x201C;look ahead&#x201D; in time 9th order Butterworth Impulse response With 108 gain 39AJAL.A.J , 8907305642
• 40. FIR filters are usually designed as &#x201C;type 1 linear phase&#x201D; meaning that they are symmetric, with even filters having two identical center taps, and odd filters symmetric about a single center tap. Symmetric filters with an even number of taps must have a zero at pi and can not be highpass. Even Odd 40AJAL.A.J , 8907305642
• 41. There are other kinds of FIR filters, in particular antisymmetric even tap filters, which have linear phase in the passband, but do not have zero phase shift at DC. Rather, they have + or &#x2013; 90 degree phase shift at DC, and must have a zero at DC. These &#x201C;type 4 filters&#x201D; can not be used as lowpass filters. 41AJAL.A.J , 8907305642
• 42. A completely asymmetric FIR filter is a valid filter, and in some cases (phase compensation, etc) may be used. Such filters are usually for special-purpose applications, however. 42AJAL.A.J , 8907305642
• 43. A comparison of 3 FIR filters 43AJAL.A.J , 8907305642
• 44. Even vs. odd length Even Odd (we will compare 32 tap vs. 33 tap Lowpass FIR&#x2019;s with identical parameters except for length Zero at pi Nonzero at pi Delay of 15.5 samples. Delay of 16 samples 44AJAL.A.J , 8907305642
• 45. So? &#x2022; If you need an integer delay in the filter, use an odd-length filter. (N.B. In many applications, where even filters are applied twice, you can use two even filters.) &#x2022; If you need a zero at pi, use an even-length filter. &#x2022; If you don&#x2019;t want a zero at pi, you can&#x2019;t use a symmetric even-length filter. You can use an antisymmetric even length filter if you want a highpass filter, but then you&#x2019;ll have a zero at DC. &#x2013; This means that symmetric high pass filters are of odd length. 45AJAL.A.J , 8907305642
• 46. More useful things to know &#x2022; The longer the impulse response is at a given level, the sharper the filter cutoff will be to that level &#x2013; This expresses the old, familiar knowledge that df &#xB7; dt &gt;= 1 (for a two-sided Gaussian) &#x2013; Yes, this means that if you want 1 Hz resolution, you need a 1 second impulse response. 46AJAL.A.J , 8907305642
• 47. Frequency Response vs. Length Short Long 32 tap 64 tap The top filters have a wide transition band (.25) The bottom a .05 transition band. 47AJAL.A.J , 8907305642
• 48. The filters vs. their responses 32 tap first Big Small Note: The passband ripple performs in a similar fashion. 48AJAL.A.J , 8907305642
• 49. Filter vs. response 64 tap 49AJAL.A.J , 8907305642
• 50. There are other tradeoffs possible &#x2022; IIR filters can have: &#x2013; Passband ripple only &#x2013; Stop band ripple only &#x2013; Neither passband nor stop band ripple (monotonic response) &#x2013; Both passband and stop band ripple &#x2022; FIR filters as usually designed can have: &#x2013; Ratio of passband ripple to stop band ripple controlled via design parameters. The filter response is not defined in a &#x201C;transition&#x201D; band. &#x2013; There are other FIR types possible, they are not that common in most present-day uses. 50AJAL.A.J , 8907305642
• 51. FIR Example &#x2013; Passband vs. stopband ripple. Both filters have 32 taps and the same edge frequency and transition bandwidth Passband weight 10, stop band .1 Passband weight .1, stopband 10 51AJAL.A.J , 8907305642
• 52. What&#x2019;s this about &#x201C;windows&#x201D;? &#x2022; A window is just another filter, usually a lowpass filter. &#x2013; It is a filter that is most often used to mitigate &#x201C;edge effects&#x201D; or other artifacts of truncation or blocking. &#x2013; It is normally MULTIPLIED in the time domain, therefore it CONVOLVES in the frequency domain. 52AJAL.A.J , 8907305642
• 53. Several examples of windows: These are examples of a windowed sync (brick wall) filter All filters are length 8191 Black is rectangular window, red is Hann, green is Blackman, blue is Hamming, cyan is Kaiser(5), magenta is Bartlett, yellow is Nutall 53AJAL.A.J , 8907305642
• 54. How are filters described? &#x2022; FIR filters usually are simply listed by either the tap weights (individual values) or by a function that describes the tap weights. This is the same as providing numerator polynomial. &#x2022; IIR filters are described as sets of poles and zeros. More on that now: 54AJAL.A.J , 8907305642
• 55. Poles? Zeros? WHAT!? &#x2022; Poles and zeros are a way of expressing a transfer function as two polynomials, one in the numerator, and one in the denominator. &#x2022; For either numerator or denominator, a polynomial can be described as a1+ a2 * z1 + a3* z2 &#x2026; where a1, a2, a3 are the &#x201C;tap weights&#x2019;. &#x2022; One can also calculate the roots of the polynomial. &#x2013; The roots of the numerator are the ZEROS. &#x2013; The roots of the denominator are the POLES. 55AJAL.A.J , 8907305642
• 56. Why poles? Why Zeros? &#x2022; A zero shows a value for the polynomial variable that results in a ZERO output. &#x2022; A pole shows a value for the polynomial that has an INFINTE output. (the response looks like a pole) &#x2022; The meaning of poles and zeros in terms of frequency changes depending on the kind of transfer function (i.e. &#x2018;s&#x2019; or Laplace domain, &#x2018;z&#x2019; domain, &#x2018;&#x3C9;&#x2019; or Fourier domain, or others) but for the commonly used domains will still be some expression of frequency. 56AJAL.A.J , 8907305642
• 57. A pole/zero plot for a 5th order Butterworth, using bilinear Z form 57AJAL.A.J , 8907305642
• 58. Expressing Poles and Zeros &#x2022; In the FIR filter, the zeros are expressed by directly providing an impulse response, corresponding to the polynomial that results in the zeros. &#x2022; In an IIR filter, both the poles and zeros are often factored. This leads to a variety of topologies, shown on the next page. &#x2022; Factoring depends on the fact that any real coefficient polynomial can be factored into real roots or complex pairs of roots. A complex pair of roots will always have real coefficients. 58AJAL.A.J , 8907305642
• 59. Direct form 2nd order Cascade form 1&#x2212; z 1&#x2212; z These are not the only two possibilities. a1 a2 a3 a4 a5 1&#x2212; z 1&#x2212; z 1&#x2212; z b1 b2 b3 b4 b5 a1 a2 b1 b2 One Second Order Section (multiple sections are cascaded) 59AJAL.A.J , 8907305642
• 60. The Direct Form &#x2022; The direct form creates a number of difficulties. &#x2013; It increases the size (in terms of bit depth) of numerical coefficients &#x2013; It increases the depth required for accumulators (mantissa for floating point) &#x2022; It&#x2019;s not, generally speaking, very common or useful for more than 3rd order. Don&#x2019;t do this. &#x2013; This can result in instabilities due to numerical resolution &#x2013; You can get &#x201C;limit cycles&#x201D; and other disturbing nonlinear behavior 60AJAL.A.J , 8907305642
• 61. Factoring into second-order sections: &#x2022; There are a number of ways to make second order sections. &#x2013; All depend on the fact that you can factor a real-valued polynomial into second-order sections with real coefficient values. &#x2013; How does this relate to filtering? &#x2022; If you convolve a set of factored polynomials, you get the original polynomial &#x2013; That means that if you cascade sections with the polynomials implemented, you MULTIPLY the transfer functions. This is the same old duality in another form. What you&#x2019;re doing is convolving things a part at a time, and then doing more and more in cascade. &#x2022; A second-order section is easy to check for stability. &#x2022; By factoring both numerator and denominator and grouping things correctly, you can ensure the best gain structure for a given filter. &#x2022; Your computer does this for you! 61AJAL.A.J , 8907305642
• 62. So we factor FIR&#x2019;s as well? &#x2022; Generally not. There are several reasons: &#x2013; The coefficient bit-depth growth is not nearly as extreme &#x2013; Coefficients are not generally as large (in FIR filters coefficients are most often considerably smaller than 1. &#x2013; FIR&#x2019;s can&#x2019;t go unstable, have limit cycles, or some other kinds of disturbing behavior. &#x2013; Of course, they require more calculation, and they may require a wider accumulator than you expect. 62AJAL.A.J , 8907305642
• 63. Some examples of Filter Coefficients &#x2022; For an IIR 3rd order bilinear Z Butterworth filter with a cutoff at .125 fs/2, the numerator is: 0.0053 0.0159 0.0159 0.0053 &#x2022; The denominator is: 1.0000 -2.2192 1.7151 -0.4535 &#x2022; For a similar FIR filter, the tap values are: 0.0003 0.0034 0.0067 -0.0031 -0.0312 -0.0397 0.0349 0.1945 0.3343 0.3343 0.1945 0.0349 -0.0397 -0.0312 -0.0031 0.0067 0.0034 0.0003 &#x2022; Notice the difference in the size of the tap weights. In this example, the tap weights are quite moderate for an IIR denominator. Longer filters will have often have a substantially larger range of values. In general, this kind of tradeoff is well beyond the scope of a beginning tutorial, but everyone must be aware of this kind of issue. As you will discover in the next part of this tutorial, most filter design packages take care of this problem. 63AJAL.A.J , 8907305642
• 64. How to write a transfer function, in the &#x2018;z&#x2019; domain: &#x2022; The transfer function for the third order Butterworth is written as: &#x2022; In factored form, it would look like this: 3-2-1- -3-2-1 z0.4535-z1.7151z2.2192-1.0000 z0.0053z0.0159z0.01590.0053 + +++ 6788.551.1 12 * 6682. 1 *0053. 12 12 1 1 +&#x2212; ++ &#x2212; + &#x2212; &#x2212;&#x2212; &#x2212; &#x2212; zz zz z z Doing factoring is one of the things Matlab, Octave, and other linear algebra and/or filter design packages are for. 64AJAL.A.J , 8907305642
• 65. More about poles and zeros &#x2022; We&#x2019;ll show some pole/zero plots, along with the impulse responses, frequency responses and phase responses. 65AJAL.A.J , 8907305642
• 66. Symmetric FIR (odd length) 66AJAL.A.J , 8907305642
• 67. Allpass Filter 67AJAL.A.J , 8907305642
• 68. Designing Filters &#x2022; Steve will show you Octave, a freeware program that allows you to design both IIR and FIR filters. &#x2022; We&#x2019;ll discuss a bit, here, about designing both kinds of filters. 68AJAL.A.J , 8907305642
• 69. Designing IIR Filters &#x2022; First, decide what kind of filter you want: &#x2013; Butterworth (no ripple, monotonic amplitude response, requires more poles/zeros) &#x2013; Chebychev 1 (passband ripple, monotonic stopband) &#x2013; Chebychev 2 (stopband ripple, monotonic passband) &#x2013; Elliptical (equiripple passband, equiripple stopband. Shortest filter for a given rejection ratio. Has issues.) 69AJAL.A.J , 8907305642
• 70. How to do that? &#x2022; Use the &#x201C;help&#x201D; function. &#x2013; help butter (for Butterworth) &#x2013; help cheby1 (for Chebychev 1) &#x2013; help cheby2 (for Chebychev 2) &#x2013; help ellip (for Cauer elliptical) &#x2022; Follow the directions. Time does not permit a full examination of all of the calling parameters. &#x2022; All have the form &#x2013; [bb, aa]=butter(3,.125) for example. &#x2013; BB is the zero polynomial &#x2013; AA is the pole polynomial 70AJAL.A.J , 8907305642
• 71. What does the Frequency Response look like? &#x2022; Use &#x201C;freqz(bb,aa)&#x201D; &#x2022; It will give you frequency and phase response. 71AJAL.A.J , 8907305642
• 72. Designing FIR filters &#x2022; Use &#x201C;remez&#x201D; &#x2022; This takes a bit of doing. &#x2022; Before you use &#x201C;remez&#x201D; you need to decide: &#x2013; Length of the filter (a single integer) &#x2013; The points at which frequency response changes &#x2013; The amplitudes at each of those points. 72AJAL.A.J , 8907305642
• 73. So you have &#x2022; len=15 (NOTE: That means a 16 tap filter, the order is 1 less than the filter length) &#x2022; freq=[ 0 .2 .6 1] (that is a list of 4 frequencies, corresponding to DC, .2 .6 and 1 times half the sampling rate, whatever that is). 0 and 1 must be included. &#x2022; amp=[1 1 0 0] (that means that the amplitude at 0 and .2 you want to be close to 1. at .6 and 1, you want it to be zero. &#x2022; bb=remez(len,freq,amp) will give you a filter that is optimized to be as close as possible to that response. 73AJAL.A.J , 8907305642
• 74. But I care about passband ripple! (or stopband ripple) &#x2022; w=[10 1] (this is half as long as freq and amp vectors, both of which must be even length) Here, the 10 means that the ERROR in the filter design between the first two frequency points is counted 10 times as much as the weight (1) between the second two points. &#x2022; So bb=remez(len,freq,amp,w) will give you a filter with the error weighting you specify. &#x2022; NOTE: you can not weight the error in a transition band. By definition, there is no error in a transition band. 74AJAL.A.J , 8907305642
• 75. Now, frequency response &#x2022; freqz(bb) &#x2022; That&#x2019;s all it takes. You will see frequency and phase response. &#x2022; remez always designs symmetric filters, unless you tell it to do something else &#x2022; &#x201C;help remez&#x201D; will get you as many options as you wanted to ever know about. 75AJAL.A.J , 8907305642
• 76. To Take Home: &#x2022; Filtering is the practice of convolving an impulse response (the time response of the filter) with the signal. &#x2022; FIR filters directly implement this convolution. &#x2022; IIR filters use a functional representation that does the convolution implicitly, with some cost in implementation issues. 76AJAL.A.J , 8907305642
• 77. More to take home: &#x2022; Frequency (complex spectrum) response and impulse response are duals. &#x2022; The relationship df * dt &gt; matters in filter design just like it does in anything else. &#x2013; If you want a sharp filter, you have a long impulse response. &#x2013; If you want a short impulse response, you can not have a sharp filter cutoff. &#x2022; IIR filters do not shorten the impulse response, they simply operate in a different fashion. 77AJAL.A.J , 8907305642
• 78. To come after the break: &#x2022; Steve Hastings will give you a set of tips for tools that you can get off the net to help you design, plot, and understand filters (and a whole lot more things) &#x2022; boB Gudgel will show you what it sounds like to implement various filters, and offer tips on how to do this kind of work in the real world. 78AJAL.A.J , 8907305642
• 79. Filterbanks &#x2022; Ok, now what is a filter? &#x2022; And a filterBANK? Filter in out Filterbank in outputs 79AJAL.A.J , 8907305642
• 80. Filterbanks &#x2022; A filterbank is nothing but a way to implement a set of filters, generally strongly mathematically related, in one operation. &#x2022; A filterbank can always be decomposed into a set of individual filters &#x2013; This is usually a lot more work that it&#x2019;s worth, but not always. 80AJAL.A.J , 8907305642
• 81. The famous audio filterbank: &#x2022; This would be the &#x201C;MDCT&#x201D;, or &#x201C;Modified Discrete Cosine Transform&#x201D;. &#x2013; Annoyingly, it&#x2019;s not a transform, it&#x2019;s a FILTERBANK. &#x2013; It is an exact reconstruction filterbank, though, so it does obey most of the rules of transforms, except that it has overlap between blocks, and remains critically sampled. A transform either has no overlap, OR is not critically sampled. 81AJAL.A.J , 8907305642
• 82. Critically Sampled &#x2013; Whaaa??? &#x2022; Critically sampled is a simple concept at its heart, it means that in the filtered domain, you have the same number of samples that you do in the unfiltered domain. 82AJAL.A.J , 8907305642
• 83. The theory of filterbanks is long, deep, and wide &#x2022; And I won&#x2019;t even try to relate it in an hour. &#x2022; BUT, what you need to remember is that an output of a filterbank is just like running some particular kind of a filter on the signal. The filterbank just does a lot of these at once. &#x2022; It may also: &#x2013; Downsample (i.e. critical sampling) &#x2013; Be oversampled (more values in the filtered domain than in the input and output domains) 83AJAL.A.J , 8907305642
• 84. What are some applications? &#x2022; For an MDCT, the obvious one is coding: &#x2013; It is critically sampled. Ergo, no extra data to code &#x2013; It does a good job of frequency analysis, so you can relate the perceptual model well, and you can also get good signal processing gain from it. &#x2013; It has an efficient form for calculation, very similar to an FFT of half its length. 84AJAL.A.J , 8907305642
• 85. Some rules about critically sampled banks. &#x2022; If you&#x2019;re not careful, very odd things happen when you modify the filtered results. &#x2013; The best known of these is the &#x201C;pre-echo&#x201D; in audio codecs. &#x2013; There are also other things that can go wrong &#x2022; Why? That critical sampling means that the filterbank creates a lot of aliasing, and then cancels it on reconstruction. Mess with the signal in the filtered domain, and the aliasing does not cancel. 85AJAL.A.J , 8907305642
• 86. How about oversampled filterbanks &#x2022; You can avoid aliasing problems, so &#x2013; You can modify the signal &#x2013; You can use it for things like equalizers &#x2013; Gain compressors work well with this kind of filterbank &#x2022; There are other applications that are far too complicated to bring up at present. 86AJAL.A.J , 8907305642
• 87. So - Filterbanks &#x2022; At their heart, nothing but a handy way of implementing a whole set of filters at the same time. &#x2013; There are more things to this than computational efficiency. 87AJAL.A.J , 8907305642
• 88. Thank u all AJAL.A.J , 8907305642 88