Transcript for:
Lecture on FIR Filter Design and Parks-McClellan Algorithm

[Music] hi everyone uh this is Dr s chesu working as a professor of e at Hyderabad today we discussing about par MC clearing algorithm and remage algorithm using matlb so here uh so major thing is what is the introduction related to the this today's topic so we have to remember that rational h of z uh so linear time invariant system uh describes uh described by the constant uh coefficient difference equation okay so can be implemented with the finite uh what you call of adds with this multipliers and uh delays in other words filter design yeah if it is in a filter design means choose the number um what do you call in in other words filter design means choose the number and uh what do you call locations of the Jos and poles or maybe what do you call equivalently the number and values of the filter coefficients other than this th where that purpose we have to use the H of Z or h of n or h of Omega okay so we have to remember this all constraints for implementing that two algorithms okay so for that we will ready to overview this uh two algorithms okay where uh in terms of because of we are learning the T finite impulse response filter this is all nothing but a digital filter for this where n is n is equal to zero uh finite impulse response are all all zeros okay so we can consider that this is uh what you call linear pass band pH and where n greater than or equal to Z that infinite impulse response okay it is Lower Side Lopes for same number of coefficients if it is n is equal to z f is how it is the status we can consider the linear pass band pH if the n greater than or equal greater than zero for infinite impulse response we will expect that all the Lower Side loopes for the same number of coefficients okay for this we have to consider the what you call certain things that is going to be General considerations so ideally would like capital N there may be the filter and M or M plus M uh to be to be as small uh possible for minimal uh where the minimal computation or if is storage this is the general consideration and we can use the T causal or casual for low for now okay poles inside the unit circles for stability so we have to consider this all constraints General considerations okay so with this poles inside um inside unit circle for stability and causality casuality here it is we will uh focus on designing casual digital filters since uh those can be implemented in real time or if it is a normal time or real time is looking ready to design for we like to focus uh on designing the Casual digital filters since those uh can be implemented in the normally or educational purpose or maybe real time purpose and so on yeah they can be implemented in the real time how how we are using the real time on the normal case or education purpose or whatever it is you have to follow this type of constraints okay like in general considerations okay so non if it is a CA you have to follow and noncausal non-causal filter design best example for um what do you call offline applications okay uh is much easier uh and many of the same principles of uh what do you call apply anywhere if if it is that filter is non causal if the causal so the design of the Casual filters since the those can be implemented in real time or or other than that okay and LTA and linear time invent system is casual FF okay in next input and output relationship if you know that all output what do you call the output is in terms of this normally where what do you call H of what you call H of n or before that we to use that all y of what you call Y of n okay where that y of n this y ofn depends only on the current and past input signal values okay so impulse response if you are in the impulse response h of n that h of n where h of n is equal to what you call 0 for n less than Z like this input and output relation that output depends only on the current and past input signal values impul response where H of n is equal Z for n less than what do you call n less than Z okay so system function if you are using this the system function yeah here that system function the what you call number of finite zeros less than less than less than or equal to number of finite poles okay so these are the general consideration one is ideally second one is casual third one is causality and fourth one is noncausal and fifth one is input and output relationship with what you call system function this is the central consideration if you are m this General consideration we are able to design digal filter like and filter but here we are ready to concentrate on called finite impulse response filter okay so with this uh finally we are ready to verify that one more General consideration frequency response so what can we say about that h of Omega the frequency response based on the frequency response we will ready to decide the major factors okay for the performance levels of what you call the digital filter okay so like this you have to remember this all General considerations for implementing real time or maybe offline applications or online applications or whatever it is okay we require this all General considerations okay next uh what the facts if you are using this all General considerations okay what are the real facts so if H ofn is causal but we are try to implement in terms of the Practical aspects we already we have mentioned the two algorithms using the matlb okay what are the real facts the facts are depending upon what you call certain General considerations based on that General consideration if H ofn is caal then what do you call theorem it is followed by h of uh Omega cannot be what you call exactly zero over any band of the frequency okay except in the in travel case where H of n is equal to zero okay otherwise that otherwise it can be exactly zero for any band of the frequencies okay and uh furthermore if you are using that mod h of Omega if you are ready to analyze that frequency response so h of Omega mod h of Omega cannot be flat yeah cannot be flat flat means always it is constant okay we can consider cannot be a flat constant over any finite band okay so next one is H HR of Omega and hi of Omega are ilber transform PS you know that already we have discussed the previous uh uh lectures to remember this all backbone is required okay this is the knowledge based okay we have discuss that one here also with help of that we have to remember HR of Omega and H of Omega are transform Bas so therefore they are not independent which one HR of Omega and H of Omega are once it is Albert Elber transform pirs therefore they are not independent okay since the magn and phase response are what you call interdependent okay so if you are consider the transform it is what you call uh they are not independent if you are consider the parameter like if you are consider that all HR of Omega and H of Omega okay and the magnitude and phase response are inter interdependent okay so th uh those ideal filters with the finite bands of the zero response cannot be implemented with a cural filter or casual filter okay this is the factor instead what call we must design the filter that approximate the desired frequency response is D of Omega okay so this isdf Omega after using this all facts and general considerations e right to analyze the all characteristics of the Practical frequency selective filters after that to design the digital like fin plus response with help of today's that algorithms okay REM and box and algorithms with this no there is no perfectly flat rean facts since the Cal filters what you call cannot have the band of frequency with the uh with zero zero response so nor can they have any band of the frequency is um what do you call over which the um frequency response is the constant okay okay so proof by the what you call contradictions suppose okay h of Omega is equal to C for go on using the substitution here where H of Omega isal to C okay for that Omega 1 less than or equal to Omega less than or equal to Omega 2 with the corresponding impulse response okay so if it is specified that h of what you call impulse response h of what you call n impulse response so that to decide the of frequency responses okay the band of frequencies are which the frequency response is a constant or not so with this where H of Omega is = to C for Omega 1 less than oral Omega than Omega 2 with the corresponding input response h of n okay now Define the new filter G ofn is equal to H ofn minus C of Delta of okay so one using this all what do you call step by step process right to verify that characteristics of the Practical frequencies to filters okay maybe and F okay then certainly G ofn is is also casual or C but G of Omega isal h of Omega minus c = z for Omega 1 like here Omega 1 less than oral Omega less than or equal to Omega 2 okay like this so which is The Impossible if G of n is caal toze this all points can investigate the character practical frequen know perfectly flot is in fact by using the solar when the caal filters what you call cannot have the band of the frequencies with the zero response so band of frequencies over which the frequency response is a constant like this we are to verify that where H of Omega and G of N and what you call G of Omega in terms of the both the G of N and what you call G of Omega okay with this the Casual filters cannot have the band of frequencies with the zero response okay so with this particular response so after that we to decide the factor with characteristics of the Practical frequency selective filters is either it is it's a perfectly FL Reon facts or maybe or maybe no perfectly plot Reas and facts so nor can they have an infinitely sharp transition okay between the pass band and the stop band if the response is like this so they have an infinitely sharp transition between the pass band and the Star Band okay so nor can they have the perfectly flood pass band okay so a typical uh realistics magnitude response looks like the what you call following the parameter or may certain considerations May the real facts or what is to verify after that we can ready to justify character practical filter okay the Practical filter the Practical filter design means choosing the Delta one Delta 2 Omega C and Omega s and then designing uh you call out of the filter and maybe what you call M and AK and BK to satisfies satisfy the those requirements this is the Practical filter okay of when must iterate iterate okay of we plot h of magnitude of that mod h of Omega using DB that is 20 log Bas 10 of Omega mod and what do you call Express the and decibel as well this is the Practical filter specification in terms of the specification or what do you call like capital N or capital M AK and BK to satisfy the those requirements okay but one must iterate that we plot that graphically H H Omega using what you call DB that is 20 log based on H of okay so right to express in the Ripple in deel as well okay with the note that the stop band Ripple is not defined to Pi you know that okay in the Practical aspect okay now since that the highest magnitude response in the stop band is more important than how G the response is in the stop band okay this graphically right to verify that all we Omega Omega versus what call H okay with this 1 + Delta 1 so 1- Delta one and Delta 1 and Delta 2 okay here the star band triple and pass band Tri also observed with this pass band dle either is is transition band and stop band is can analyze in graphically okay so example application here say for example if you are using this one uh where where this all digital filter and all useful in CD distal crossover separ theer and the signals disly inser the CD player so separate the who a Hooper or maybe a bus speaker is a technical term for the loud speaker driver yeah designed to produce low frequency sounds okay because of clment purpose on field this this type of applications are involved here okay for a loudspeaker driver designed to produce low frequency sounds typically from 50 HZ to and what you call thousand heads so the name what name the you know that here it is you have seen that one and uh V or trible speaker is typical or special typ type of L speaker that is designed to produce high audio frequencies typically deliver high frequencies up to 100 kilo okay like here that means you can analyze the frequency range okay so once we are learning the T filter where it is applicable signal twer or the treatable speaker uh is a special type of loud speaker that is designed to produce twers are intended to convert an electrical signal into the mechanical Aid can the digitally inside the CD player okay seen that right side here CD player and so on rather and unlog at a speaker okay why is pass band triple tolerable in this context or if it is distorted or not okay so we have to analyze if you are using this on CD digital over using what you call the frequency variation and so on why is the pass band Ripple tolerable this contest is dist or not if you are using this our setup video setup or whats actually the another filter yeah this is the best example of envirment okay the speaker response is not perfectly flapped okay so some extra call noise is added extra noise as human noise and Thal noise and Atmospheric noise is added the clarity is missing so keep this filter Ripple below this other effects like here okay so imagine now imagine that we have specified Delta 1 Delta 2 Omega C and Omega s okay and we wish to design n capital n capital n AK BK to satisfy those requirements okay this is your task as mentioned above okay so we have two broad choices one is finite impulse response yeah it is our today's topic based on our finite impulse response only we will write to improve the two algorithms okay based on that we require this all basic things F and but here our topic is involved with f filter in depth that we have discussed the year okay we focus first on the f after that we'll see that a okay so we know that all this we have to remember this all this all filter we have discussed the previous classes but here you have to remember you have to rec the things because of real time purpose we require most of this dist filter we know that are types of dist filter discussed we all are familiar with this all there are two fundamental types of the distal filter one is f finite imp response and second one is infite imp response it is followed by okay as the terminology suggest so this this classification refer to the filter impulse response okay so this one significance by wearing the weight of these coefficients and the number of filters STS virtually uh any frequency response characteristics can be realized with the finite impulse response filter okay yeah as um as being shown finite impulse response filters PR we have discussed more than 20 lectures we have discussed uh with reference to that background signal Crossing and what the linear time invari system okay with all properties and so on finite impulse response filter can achieve performance levels which are not possible with analog digital filter technolog such as such a perfect linear phase response okay which one here it is the if analog filter technique so however high performance finite tempul response filter generally where require the large number of M what you call multiply accumulators and therefore require the fast and efficient dsps this processors are required and other hand on the other other hand the second dist filter like er filter infinite impulse response filters tends to mimic the performance of what do you call traditional what do you call traditional unlock filters and make use of the feedback okay so this are the fundamental aspect of the tall dist fter this all this stuff is required for Designing to algorithms therefore the impulse response extends over the what call finite period of the time okay so because of the feedback okay so I filter can be implemented with coefficients then fin depos respons filter ltis ltis filters are simply another way to implement either or F filter and of what you call often used in the speech processing applications okay this all related to the what real time so finally what you call digital filters learn themselves to adapt to filters application simply uh because of the speed and easy with Filter characteristics can be changed by wearing the filter coefficients okay so design of the F filter f as a class of l l line in filter we have done this one you have to remember this all things okay digal filter F filter designs can be derived from unlock filter what you call rational unlock filter cannot have the finite temp response why why why bother this all the distal filters cannot be derived from the filters because of they are inherently stable next they can be designed to have a linear pH third one there is a great flexibility in the shaping their magnitude response they are easy and uh what do you call convenient convenient to implement so remember very fast implementation using the fft fast for year transform okay with this these are all constraints so F filter design methodology okay we have discussed with this simples response truncation and weing design methodology we have seen optimal filter design methodology we have seen in bit a little bit now with this there is a advanced level algorithms Beyond with this the simplest design method has undesirable frequency domain characteristics not very useful for B to Window Design method simple and convenient but not optimal okay these are the drawbacks and the demerits in using this all what you call methodologies how to overcome this you have to choose initially that par m filter design here it is but in terms of practical aspects the Parx MC uh Clon Ali them published by the James MC Clon and thumb Sparks 1972 and what you call itgm for finding the optimal SAU fil finite impulse response filter okay so the Parx MC algorithm is utiliz Ed to design and Implement efficient optimal fin first mass filters it uses an indirect method for finding what you call the optimal filter coefficients compared to the previous methodology and this particular algorithm okay so the goal of the algorithm is to minimize minimize the error in the pass band and stop band stop bands by utilizing SAU approximation are the uh extraordinary design aspects while compared to previous technique and other techniques we have to use this what call this particular filter Lear filter design alori okay the PX M algorithm is a variation of the REM exchange algorithm that's two two algorithms are it is mentioned today's topics one is one one is this one and the second one is remage exchange okay them REM exchange them yeah with the change change that it is the specified design for finite impulse response digal filters okay it has become a standard method for finite impulse response filter design okay now depth of this so history of the optimal finite impulse filter distal filter design in the 1960s researchers like you or me within the field of analog filter design so are using the Sabu approximation for filter design okay so during this time it was well well known that the best filters contain an equal characteristics in their frequency response magnitude and the electric filter or verion filter was Optimum optimal with regards to the subu approximation this is the few background of this optimal finite impos response digital filter design aspects okay when the digital filter Revolution began in the 1960s right now we are in 2024 compare that one so when the digital filter Revolution began in the 1960s researchers used to B linear transformation to produce infinite impulse response digital elliptic filters the time okay so they also recognized the potential for Designing finite impulse response filters to accomplish the same filter task and soon the research was on for the optimum final depos response digital filter using the SAU approximation okay you know the T background of the SAU transmission filter so it was well known in the both mathematics and Engineering that optimal response exibit and equ behavior and the number of reels could be counted using the SAU approximation this is the major agenda so several attempts to produce design program for the optimal response dist filter were undertaken in the the period between 19 19 what do you call 196 to 71 19 what you call 60 to 71 okay so despite that the numerous attempts most did not succeed particular Peri period usually due to the problems in the algorithmic implementation problem formulation implementation in terms of the piece of code or the time that time there is no python there is no Java of course C language is Avon Pascal is available so that's why the despite the numerous attempts most did not succeed usually du to the problems in the almic implementation or problem formulation okay so to Herman for example proposed a method for Designing equal filter with restricted bandages this method to obtain an equel frequency response with the maximum number of repels by solving the set of nonlinear equations this is the background of this particular Ali implemented aspect another method introduced that the time implemented in an optimal sub isue approximation but the algorithm was limited to the design of relative low low order filters compare that from that period and another method is introduced that it is approximation the sub approximation optimal or not for the algorithm was limited to the design of relatively low low lower order FS okay similarly to harman's Method Ed what you call of presented an algorithm that designed finite impulse response filter with as many ripples as possible comp that period right now so this has become known as the maximal Ripple Al okay this maximal rle algorithm imposed and alternating the error condition bya what you call interpolation and then solved as a set of equations that the alternating the solution had to satisfy okay so one notable limitation of the maximum rithm was that band edges uh what you call were not specified as the impuls to the designed procedure okay because of that a similarity of this design with as many ripples as possible on that rather the initial frequency set Omega I and the desired function B of defined pass band and St band implicitly okay so like the previous attempts to design an optimal filter the maximum repel algorithm used to an exchange method that is trying to find the frequency set the frequency set is like this particular set frequency set okay so where the best filter had its ripples so number of ripples are increasing what happens number of ripples are decreasing we know that all how the impact do this maximum Ripple Alm was not an optimal filter design fin it is deciding the factor okay the maximum Ripple algorithm was not an optimal filter design but it had quite the significant impact significant impact on the how the parks mc mc Clen algorithm would formulate okay so here in 19 August 1970s James MC Clen entered graduate school at Rice University with medical concentration in mathematical models of anog filter design and enrolled in a new course called digital digital filter digital filter due to to his interest in the filter design like I and F filter design so without this digital filter design how they are overcoming the previous methodologies demits problems okay so due to his interest in the filter design the course was taught jointly by the thumbs thumbs spks and uh side BS Okay so at the time DSP dist signal processor was an emerging field and as a result lecture of one involved recently published research papers the following the same semester the spring the spring of the call Spring of the 1970s th spks off for a post called signal Theory okay if the implement the digital filter there concept on signal signal Theory which MC Clen took as well okay this is the background of this particular Alm during this uh spring break of the semester box driv from the house to princ to in order to attend the conference where the head head office trur the presentation about the new fin imp response filter design Al maximum that conference interaction anery sharing the environment this type of what you call uh what you call problems and Improvement isaly he bought brought the paper by of stress what you Callum and back to St thinking about the possibility of using this habitu approximation Theory to design finite imp response digital filters okay this is all background without this background how we are learning this type of algorithm that is the greatness of today's lecture you heard that the method implemented of St algorithm was similar to the particular excange REM exchange Ali and decided to use that path of use exchange them the students in the signal Theory this first he has identified the what call digal filter after the students in the signal Theory course so are required to do the to do a project since saish approximation was a major Topic in the course the implementation of this new algorithm became James MC Clen course project so this ultimately so led to the parks MC algorithm which involves the theory of the optimal Serv approximation and an efficient implementation okay this is the greatness of this the background of that at them by the end of the uh spring semester MC Clon and punks were attempting to write a variation of their exchange Alm for finite finite impulse response digal filters it took about the six weeks to develop and some optimal filters had been designed successfully by the end of that DSP course the digal signal processing course okay now practically it is identified in the pictures we take note of this uh what you various axis okay so whole axis okay or various radian frequencies like omeg I and we know that the two frequencies marked on the x-axis isn't it two Okay and like Omega p and Omega s Omega P indices indicates the pass band cut off frequencies like Omega s indicates the stop band cut off frequencies okay the two dashed what you call the two dashed lines on the top of top left of the graph what you call indicates what you call that Delta p and the two D dashed lines on the bottom right Delta s okay and uh what do you call it is mention all other frequencies State indicate the external frequencies of the frequency response plot okay so as a result there there are six uh extremal frequencies and then we add the pass band and stop Band frequencies to give a total of eight ex extremal frequencies on the plot like Omega 1 Omega 2 Omega p and and so on okay that Omega s okay and uh here it is so pass band stop band reference the stop pass band stop band with reference to this one pass band what you call and stop bands of the filter design by the fox MC cl cl Al them the yis is the frequency response h of Omega and the x-axis axis are the various radian the frequencies Omega I so it can be noted that two frequencies marked at the what you call previous diagram x-axis Omega p and Omega s where Omega P indicates the pass band cut off frequency where Omega s indicates the stop band cut off frequency tripple like a flot on the upper left is the pass band Ripple and the Ripple on the bottom right in the St Ander the solar can analyze these things okay the two D dashed lines on the top left of the graph indicates the Delta p and the two dash lines of the bottom right indicates the Delta s all other frequencies listed IND the extreme what call extremal frequencies of the frequency response plant as a results there are six extremal frequencies as for the previous diagram okay so and then we add the pass band and stop bands okay frequencies to give you the total of eight total of eight extremal frequency on the plant okay now with reference to this all background how how we are implement the Al Al the algorithm is say Al is identified okay for real time or maybe what you call education purpose or whatever it is the parks MC clear Ali them is implemented using the following the Steps step one initialization choose an extremal set of frequencies Omega a power Z this is the belongs to step one coming to the step two finite set approximation calculate the best subu approximation on the present extremal set given the value Delta power M for the minimum minimum Mini Max error on the present extremal set okay with this we are ready to enter the third step step number three interpolation so calc the calc the error function e of Omega over the what do you call the entire set of frequency Omega using two step number two now step coming to the step number four look for the local maximum of uh mod E power M of Omega on this set of Omega so coming to the step number five if maximum of what you call Omega okay Sigma with this mathematic notation then updated extremal set of extremal set of of by picking new frequency where has its local maximum make show that the error alternates on the order set of frequencies as described in Step number four and step number five and then return to the step number two and iterate so by following this all step by step can consider this algorithm who is the frame disol steps Fox MC CL that's why name itself Fox MC CL filter design Al okay next step number six if maximum is solve then the algorithm is complete using the set Z and the the interpolation formula to compute and inverse discrete 4 transform to obtain the fter coops okay now if the that algorithm mentioned above we can rewrite the algorithm above in uh call simpler form as okay like step one guess the pos position of the extremal or here it is extremal okay here it is extremal or evenly spaced in the pass band SPAC in the pass band are stop bands step number two we are ready to compress this one to analyze the reduce the T in terms of that complexity in perform the polinomial interpolation and reestimate the position of the local extrema coming to the step number three move the extrema to new positions and iterate until the extrema what do you call stock filters so this that's why we have to follow this all steps 12 six or it will compress the 1 2 3 can finally it is consider Ali Al algorithm is followed by Fox MC Clen filter design algorithm okay what is that description okay that description okay in this description the picture above on the right display on the various extremal frequencies plot we have seen that one the extremal frequencies are the maximum or minimum points in the toop band and fast band you have seen as for the diagram people are observing the stop band Ripple is in the lower portion of the Ripples and the bottom right of the plot and the pass band Ripple is the upper portion of the ripples on the left top left of the plot that's diagram so the dashed lines going to Across the plot daa or maximum error or given the position of the extremal frequencies there is a formula for the optimum Delta or Optimum error right to analyze the solar since we do do not know that Optimum Delta or the exact position of the extremal and the what you call first attempt we we we iterate so effectively we assume the positions of the extrema initially and calculate the Delta then we then the estimate and move the extrema and recalculate the delta or the ER so we repeat this process until Delta stops changing okay the algorithm will cause the Delta error to converse generally with the 10 to 12 ations okay before applying the saish approximation a set of steps were necessary okay so Step One is Define the set of basic functions for the approximation and uh step number two exploit the fact that the pass band and stop bands of the what you call band pass filter would always be separated by the transition regions okay since finite impulse response cell filters could be reduced to the sum of Co coine case the same core program could be used to perform all possible linear phase finite that's filter will concentrate on next lecture how it is L fin response filters in contrast to the maximum repel approach the band edges could now be specified ahead of the time to achieve an efficient implementation of the optimal filter design using the Box MC them two difficulties have to be overcome one is defining the flexible exchange strategy and step number two implementing the robust interpolation method okay in some sense the programming involved in the implementation because of implementation process the algorithm is ready based on the algorithm the step by step you have to follow you have write the piece of code of that right to implement ex the program how the impact the response and so on so in some Cas sense the programming involves the implementation adaptation of the known algorithm for use in the fin response disal design to faces of this Exchange strategy were taken to make the program more efficient okay you have to follow the one more Steps step one allocating the extremal frequencies between the pass band and stop band and then follow that is Step number two enabling the moment of the extremals between the bands as the program created yeah it is mentioned the reference according to our previous lectures and this one okay and uh that initialization okay the number of extremal in the pass band and stop band could be assigned by the using the RTI of the sizes of the Bands so further the pass band stop band edges would always be placed in the extremal set and uh the programs loic kept those Edge frequencies in the extremal set that means Sol a piece of code like program or software or software Engineers are involved here the moment between the man bands was controlled by the comparing the size of the erors at all the candidate extremal frequencies and taking the largest the second element of the algorithm was the interpolation steps need to be evalate ER function okay after that then used to Method called what to call very what you call B Centric form of what you call leg legr interpolation okay which was very robust okay so all conditions for the Box MC Clon Ali are based on the subu alternative theorem so the the alternation theorem states that the polinomial of the degree L that minimizes the maximum error will have at least L + 2 ex okay these are the conditions for the particular po MC the optimal frequency response will barely reach the maximum 12 pounds the extrema must occur at the pass band and Star Band edges and at either om = 0 or omegal Pi or Omega equal than that value or both okay the derivative of this polinomial degree L is a polom of the degree lus one okay so which can be zero at most at L minus one bis so these are the all conditions for the boxi are based on alna theem so the maximum number of local extrema is the L minus one local extrema plus the four bands edges giving the total number of l+ 3 Extreme okay like this using this all steps right to implement using what you call MLB okay we'll continue this with this stuff WR to implement in using the mat lab or maybe python or whatever whatever it is thank you like share and subscribe hit the Bell icon for more updates