<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>audio &#8211; ASN Home</title>
	<atom:link href="https://www.advsolned.com/tag/audio/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.advsolned.com</link>
	<description>ASN home site</description>
	<lastBuildDate>Tue, 01 Jul 2025 14:40:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Difference between IIR and FIR filters: a practical design guide</title>
		<link>https://www.advsolned.com/difference-between-iir-and-fir-filters-a-practical-design-guide/</link>
		
		<dc:creator><![CDATA[Dr. Sanjeev Sarpal]]></dc:creator>
		<pubDate>Tue, 28 Apr 2020 11:35:44 +0000</pubDate>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[ASN Filter Designer]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[biomedical]]></category>
		<category><![CDATA[digital filter]]></category>
		<category><![CDATA[DSP]]></category>
		<category><![CDATA[FIR]]></category>
		<category><![CDATA[FIR filter]]></category>
		<category><![CDATA[IIR]]></category>
		<category><![CDATA[IIR Biquad]]></category>
		<category><![CDATA[IoT]]></category>
		<guid isPermaLink="false">http://www.advsolned.com/?p=11955</guid>

					<description><![CDATA[<p>A digital filter is a mathematical algorithm that operates on a digital dataset (e.g. sensor data) in order extract information of interest and remove any unwanted information. Applications of this type of technology, include removing glitches from sensor data or even cleaning up noise on a measured signal for easier data analysis. But how do [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.advsolned.com/difference-between-iir-and-fir-filters-a-practical-design-guide/">Difference between IIR and FIR filters: a practical design guide</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>A digital filter is a mathematical algorithm that operates on a digital dataset (e.g. sensor data) in order extract information of interest and remove any unwanted information. Applications of this type of technology, include removing glitches from sensor data or even cleaning up noise on a measured signal for easier data analysis. But how do we choose the best type of digital filter for our application? And what are the differences between an IIR filter and an FIR filter?  </p>



<p>Digital filters are divided into the following two categories: </p>



<ul class="wp-block-list">
<li>Infinite impulse response (IIR) </li>



<li>Finite impulse response (FIR)</li>
</ul>



<p>As the names suggest, <strong>each type of filter is categorised by the length of its impulse response</strong>. However, before beginning with a detailed mathematical analysis, it is prudent to appreciate the differences in performance and characteristics of each type of filter.</p>



<h3 class="wp-block-heading"><strong>Example</strong></h3>



<p>In order to illustrate the differences between an IIR and FIR, the frequency response of a 14th order FIR (solid line), and a 4th order<a style="color: #0000ff;" href="http://www.advsolned.com/iir-filters-a-practical-guide/"> Chebyshev Type</a> I IIR (dashed line) is shown below in Figure 1. &nbsp;Notice that although the magnitude spectra have a similar degree of attenuation, the phase spectrum of the IIR filter is non-linear in the passband (\(\small 0\rightarrow7.5Hz\)), and becomes very non-linear at the cut-off frequency,  \(\small f_c=7.5Hz\).  Also notice that the FIR requires a higher number of coefficients (15 vs the IIR’s 10) to match the attenuation characteristics of the IIR.</p>


<div class="wp-block-image is-style-default">
<figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="622" height="453" src="http://www.advsolned.com/wp-content/uploads/2020/04/fir_iir.png" alt="FIR vs IIR: frequency response of a 14th order FIR (solid line), and a 4th order Chebyshev Type I IIR (dashed line); Fir Filter, IIR Filter" class="wp-image-12028" srcset="https://www.advsolned.com/wp-content/uploads/2020/04/fir_iir.png 622w, https://www.advsolned.com/wp-content/uploads/2020/04/fir_iir-300x218.png 300w, https://www.advsolned.com/wp-content/uploads/2020/04/fir_iir-450x328.png 450w" sizes="(max-width: 622px) 100vw, 622px" /><figcaption class="wp-element-caption"><em>Figure 1:</em> <em>FIR vs IIR: frequency response of a 14th order FIR (solid line), and a 4th order Chebyshev Type I IIR (dashed line)</em></figcaption></figure></div>


<p>These are just some of the differences between the two types of filters. A detailed summary of the main advantages and disadvantages of each type of filter will now follow.</p>



<h2 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span><strong>IIR filters</strong></h2>



<p>IIR (infinite impulse response) filters are generally chosen for applications where linear phase is not too important and memory is limited. They have been widely deployed in audio equalisation, biomedical sensor signal processing, IoT/IIoT smart sensors and high-speed telecommunication/RF applications.</p>



<p><strong>Advantages</strong></p>



<ul class="wp-block-list">
<li><strong>Low implementation cost</strong>: requires less coefficients and memory than FIR filters in order to satisfy a similar set of specifications, i.e., cut-off frequency and stopband attenuation.</li>



<li><strong>Low latency</strong>: suitable for real-time control and very high-speed RF applications by virtue of the low number of coefficients.</li>



<li><strong>Analog equivalent</strong>: May be used for mimicking the characteristics of analog filters using s-z plane mapping transforms.</li>
</ul>



<p><strong>Disadvantages</strong></p>



<ul class="wp-block-list">
<li><strong>Non-linear phase characteristics</strong>:  The phase charactersitics of an IIR filter are generally nonlinear, especially near the cut-off frequencies. <a style="color: #0000ff;" href="https://www.advsolned.com/linear-phase-iir-filters-analysis-and-design/">All-pass equalisation filters</a> can be used in order to improve the passband phase characteristics.</li>



<li><strong>More detailed analysis:</strong> Requires more scaling and numeric overflow analysis when implemented in fixed point. The <strong>Direct form II</strong> filter structure is especially sensitive to the effects of quantisation, and requires special care during the design phase.</li>



<li><strong>Numerical stability</strong>: Less numerically stable than their FIR (finite impulse response) counterparts, due to the feedback paths.</li>
</ul>



<h2 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span><strong>FIR filters</strong></h2>



<p>FIR (finite impulse response) filters are generally chosen for applications where linear phase is important and a decent amount of memory and computational performance are available. They have a widely deployed in audio and biomedical signal enhancement applications. Their all-zero structure (discussed below) ensures that they never become unstable for any type of input signal, which gives them a distinct advantage over the IIR.</p>



<p><strong>Advantages</strong></p>



<ul class="wp-block-list">
<li><strong>Linear phase</strong>: FIRs can be easily designed to have linear phase. This means that no phase distortion is introduced into the signal to be filtered, as all frequencies are shifted in time by the same amount – thus maintaining their relative harmonic relationships (i.e. constant group and phase delay). This is certainly not case with IIR filters, that have a non-linear phase characteristic. &nbsp;&nbsp;</li>



<li><strong>Stability</strong>: As FIRs do not use previous output values to compute their present output, i.e. they have no feedback, they can never become unstable for any type of input signal, which is gives them a distinct advantage over IIR filters.</li>



<li><strong>Arbitrary frequency response</strong>: The Parks-McClellan and ASN FilterScript’s <a style="color: #0000ff;" href="https://www.advsolned.com/fir-arbitrary-magnitude-response-filter/">firarb() </a>function allow for the design of an FIR with an arbitrary magnitude response. This means that an FIR can be customised more easily than an IIR.</li>



<li><strong>Fixed point performance</strong>: the effects of quantisation are less severe than that of an IIR.</li>
</ul>



<p><strong>Disadvantages</strong></p>



<ul class="wp-block-list">
<li><strong>High computational and memory requirement:</strong> FIRs usually require many more coefficients for achieving a sharp cut-off than their IIR counterparts. The consequence of this is that they require much more memory and significantly a higher amount of MAC (multiple and accumulate) operations. However, modern microcontroller architectures based on the Arm’s Cortex-M cores now include DSP hardware support via SIMD (signal instruction, multiple data) that expedite the filtering operation significantly.</li>



<li><strong>Higher latency</strong>: the higher number of coefficients, means that in general a linear phase FIR is less suitable than an IIR for fast high throughput applications. This becomes problematic for real-time closed-loop control applications, where a linear phase FIR filter may have too much group delay to achieve loop stability.</li>



<li><strong>Minimum phase filters</strong>: A solution to ovecome the inherent N/2 latency (group delay) in a linear filter is to use a so-called <strong>minimum phase filter,</strong> whereby any zeros outside of the unit circle are moved to their conjugate reciprocal locations inside the unit circle. The result of the<em> </em>zero flipping operation is that the magnitude spectrum will be identical to the original filter, and the phase will be nonlinear, but most importantly the <strong>latency will be reduced from N/2 to something much smaller</strong> (although non-constant), making it suitable for real-time control applications.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For applications where phase is less important, this may sound ideal, but the difficulty arises in the numerical accuracy of the root-finding algorithm when dealing with large polynomials. Therefore, orders of <strong>50 or 60 should be considered a maximum</strong> when using this approach. Although other methods do exist (e.g. the Complex Cepstrum), transforming higher-order linear phase FIRs to their minimum phase cousins remains a challenging task. </li>



<li><strong>No analog equivalent</strong>: using the <a style="color: #0000ff;" href="https://www.advsolned.com/bilinear-transform/">Bilinear</a>, <a style="color: #0000ff;" href="https://www.advsolned.com/match-z-transform/">matched z-transform</a> (s-z mapping), an analog filter can be easily be transformed into an equivalent IIR filter. &nbsp;However, this is not possible for an FIR as it has no analog equivalent.</li>
</ul>



<h2 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span><strong>Mathematical definitions</strong></h2>



<p>As discussed in the introduction, the name IIR and FIR originate from the mathematical definitions of each type of filter, i.e. an IIR filter is categorised by its theoretically infinite impulse response,</p>


<p><center>\(\displaystyle<br />
y(n)=\sum_{k=0}^{\infty}h(k)x(n-k)<br />
\)</center></p>



<p>and an FIR categorised by its finite impulse response,</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow"><p><center>\(\displaystyle<br />
y(n)=\sum_{k=0}^{N-1}h(k)x(n-k)<br />
\)</center></p>
</div></div>



<p>We will now analyse the mathematical properties of each type of filter in turn.</p>



<h3 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span><strong>IIR definition</strong></h3>



<p>As seen above, an IIR filter is categorised by its theoretically infinite impulse response,</p>



<p class="has-text-align-center">\(\displaystyle y(n)=\sum_{k=0}^{\infty}h(k)x(n-k) \)</p>



<p>Practically speaking, it is not possible to compute the output of an IIR using this equation. Therefore, the equation may be re-written in terms of a finite number of poles \(\small p\) and zeros \(\small q\), as defined by the linear constant coefficient difference equation given by:</p>


<p><center>\(\displaystyle<br />
y(n)=\sum_{k=0}^{q}b_k x(n-k)-\sum_{k=1}^{p}a_ky(n-k)<br />
\)</center></p>



<p>where, \(\small a_k\) and \(\small b_k\) are the filter&#8217;s denominator and numerator polynomial coefficients, who&#8217;s roots are equal to the filter&#8217;s <strong>poles</strong> and <strong>zeros</strong> respectively. Thus, a relationship between the difference equation and the z-transform (transfer function) may therefore be defined by using the z-transform delay property such that,</p>


<p><center>\(\displaystyle<br />
\sum_{k=0}^{q}b_kx(n-k)-\sum_{k=1}^{p}a_ky(n-k)\quad\stackrel{\displaystyle\mathcal{Z}}{\longleftrightarrow}\quad\frac{\sum\limits_{k=0}^q b_kz^{-k}}{1+\sum\limits_{k=1}^p a_kz^{-k}}<br />
\)</center></p>



<p>As seen, the <strong>transfer function</strong> is a frequency domain representation of the filter. Notice also that the <strong>poles</strong> act on the <strong>output</strong> <strong>data</strong>, and the <strong>zeros</strong> on the <strong>input</strong> <strong>data</strong>. Since the poles act on the output data, and affect stability, it is essential that their radii <strong>remain inside the unit circle </strong>(i.e. &lt;1) for BIBO (bounded input, bounded output) stability. The radii of the zeros are less critical, as they do not affect filter stability. This is the primary reason why all-zero FIR (finite impulse response) filters are always stable.</p>



<h3 class="wp-block-heading"><strong>BIBO stability</strong></h3>



<p>A linear time invariant (LTI) system (such as a digital filter) is said to be <strong>bounded input, bounded output stable</strong>, or BIBO stable, if every bounded input gives rise to a bounded output, as</p>



<p class="has-text-align-center">\(\displaystyle \sum_{k=0}^{\infty}\left|h(k)\right|&lt;\infty \)</p>



<p>Where, \(\small h(k)\) is the LTI system&#8217;s impulse response. Analyzing this equation, it should be clear that the BIBO stability criterion will only be satisfied if the <strong>system&#8217;s poles lie inside the unit circle</strong>, since the system&#8217;s ROC (region of convergence) must include the unit circle. Consequently, it is sufficient to say that a bounded input signal will always produce a bounded output signal if all the poles lie inside the unit circle. </p>



<p>The zeros on the other hand,  are not constrained by this requirement, and as a consequence may lie anywhere on z-plane, since they do not directly affect system stability. Therefore, a system stability analysis may be undertaken by firstly calculating the roots of the transfer function (i.e., roots of the numerator and denominator polynomials) and then plotting the corresponding poles and zeros upon the z-plane.</p>



<p>An interesting situation arises if any poles lie on the unit circle, since the system is said to be <strong>marginally stable</strong>, as it is neither stable or unstable. Although marginally stable systems are not BIBO stable, they have been exploited by digital oscillator designers, since their impulse response provides a simple method of generating sine waves, which have proved to be invaluable in the field of telecommunications.</p>



<p></p>



<h3 class="wp-block-heading"><strong>Biquad IIR filters</strong></h3>



<p>The IIR filter implementation discussed herein is said to be <strong>biquad</strong>, since it has two poles and two zeros as illustrated below in Figure 2. The biquad implementation is particularly useful for fixed point implementations, as the effects of quantization and numerical stability are minimised. However, the overall success of any biquad implementation is dependent upon the available number precision, which must be sufficient enough in order to ensure that the quantised poles are always inside the unit circle.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFI.png"><img decoding="async" width="867" height="331" src="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFI.png" alt="Direct Form I (biquad) IIR filter realization and transfer function.; Direct Form; Biquad filter" class="wp-image-7891" srcset="https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFI.png 867w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFI-300x115.png 300w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFI-768x293.png 768w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFI-705x269.png 705w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFI-450x172.png 450w" sizes="(max-width: 867px) 100vw, 867px" /></a></figure></div>


<p class="has-text-align-center"><em>Figure 2: Direct Form I (biquad) IIR filter realization and transfer function.</em></p>



<p class="has-text-align-left">Analysing Figure 2, it can be seen that the biquad structure is actually comprised of two feedback paths (scaled by \(\small a_1\) and \(\small a_2\)), three feed forward paths (scaled by \(\small b_0, b_1\) and \(\small b_2\)) and a section gain, \(\small K\). Thus, the filtering operation of Figure 1 can be summarised by the following simple recursive equation:</p>



<p class="has-text-align-center">\(\displaystyle y(n)=K\times\Big[b_0 x(n) + b_1 x(n-1) + b_2 x(n-2)\Big] &#8211; a_1 y(n-1)-a_2 y(n-2)\)</p>



<p>Analysing the equation, notice that the biquad implementation only requires four additions (requiring only one accumulator) and five multiplications, which can be <strong>easily accommodated on any Cortex-M microcontroller</strong>. The section gain, \(\small K\) may also be pre-multiplied with the forward path coefficients before implementation.<span class="" style="display:block;clear:both;height: 0px;padding-top: 10px;border-top-width:0px;border-bottom-width:0px;"></span></p>



<p>A collection of Biquad filters is referred to as a <strong>Biquad Cascade</strong>, as illustrated below.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquadcascade.png"><img decoding="async" width="739" height="111" src="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquadcascade.png" alt="Biquad Cascade; Biquad filter" class="wp-image-7890" srcset="https://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquadcascade.png 739w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquadcascade-300x45.png 300w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquadcascade-705x106.png 705w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquadcascade-450x68.png 450w" sizes="(max-width: 739px) 100vw, 739px" /></a></figure></div>


<p>The ASN Filter Designer can design and implement a cascade of up to 50 biquads (Professional edition only).<span class="" style="display:block;clear:both;height: 0px;padding-top: 10px;border-top-width:0px;border-bottom-width:0px;"></span></p>



<h4 class="wp-block-heading" id="floating_point"><strong>Floating point implementation</strong></h4>



<p>When implementing a filter in floating point (i.e. using double or single precision arithmetic) Direct Form II structures are considered to be a better choice than the <strong>Direct Form I</strong> structure. The <strong>Direct Form II Transposed</strong> structure is considered the most numerically accurate for floating point implementation, as the undesirable effects of numerical swamping are minimised as seen by analysing the difference equations.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFIITrans.png"><img loading="lazy" decoding="async" width="902" height="407" src="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFIITrans.png" alt="Direct Form II Transposed strucutre, transfer function and difference equations; IIR Filters; Biquad Filters" class="wp-image-7892" srcset="https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFIITrans.png 902w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFIITrans-300x135.png 300w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFIITrans-768x347.png 768w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFIITrans-705x318.png 705w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_DFIITrans-450x203.png 450w" sizes="auto, (max-width: 902px) 100vw, 902px" /></a></figure></div>


<p class="has-text-align-center"><em>Figure 3 &#8211; Direct Form II Transposed strucutre, transfer function and difference equations</em></p>



<p>The filter summary (shown in Figure 4) provides the designer with a detailed overview of the designed filter, including a detailed summary of the technical specifications and the filter coefficients, which presents a quick and simple route to documenting your design.<span class="" style="display:block;clear:both;height: 0px;padding-top: 10px;border-top-width:0px;border-bottom-width:0px;"></span></p>


<div class="wp-block-image">
<figure class="alignright"><a href="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquad.png"><img loading="lazy" decoding="async" width="330" height="169" src="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquad.png" alt="" class="wp-image-7889" srcset="https://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquad.png 330w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_biquad-300x154.png 300w" sizes="auto, (max-width: 330px) 100vw, 330px" /></a></figure></div>


<p>The ASN Filter Designer supports the design and implementation of both single section and Biquad (default setting) IIR filters.</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_filtersummary.png"><img loading="lazy" decoding="async" width="894" height="598" src="http://www.advsolned.com/wp-content/uploads/2018/09/asn25_filtersummary.png" alt="Biquad filter ASN Filter Designer DSP" class="wp-image-7888" srcset="https://www.advsolned.com/wp-content/uploads/2018/09/asn25_filtersummary.png 894w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_filtersummary-300x201.png 300w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_filtersummary-768x514.png 768w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_filtersummary-705x472.png 705w, https://www.advsolned.com/wp-content/uploads/2018/09/asn25_filtersummary-450x301.png 450w" sizes="auto, (max-width: 894px) 100vw, 894px" /></a></figure></div>


<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>



<center>Figure 4: detailed specification.</center>



<h3 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span><strong>FIR definition</strong></h3>



<p>Returning the IIR’s linear constant coefficient difference equation, i.e.</p>


<p><center>\(\displaystyle<br />
y(n)=\sum_{k=0}^{q}b_kx(n-k)-\sum_{k=1}^{p}a_ky(n-k)<br />
\)</center></p>



<p>Notice that when we set the \(\small a_k\) coefficients (i.e. the feedback) to zero, the definition reduces to our original the FIR filter definition, meaning that the FIR computation is just based on past and present inputs values, namely:</p>


<p><center>\(\displaystyle<br />
y(n)=\sum_{k=0}^{q}b_kx(n-k)<br />
\)</center></p>



<h4 class="wp-block-heading"><strong>Implementation</strong></h4>



<p>Although several practical implementations for FIRs exist, the direct form<strong> </strong>structure and its transposed cousin are perhaps the most commonly used, and as such, all designed filter coefficients are intended for implementation in a Direct form structure.</p>



<p>The Direct form structure and associated difference equation are shown below. The <strong>Direct Form</strong> is advocated for fixed point implementation by virtue of the single accumulator concept.</p>



<p class="has-text-align-center">\(\displaystyle y(n) = b_0x(n) + b_1x(n-1) + b_2x(n-2) + &#8230;. +b_qx(n-q) \)<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span></p>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="883" height="249" src="http://www.advsolned.com/wp-content/uploads/2020/04/df1_fir.png" alt="Direct form; Direct form structure" class="wp-image-11977" srcset="https://www.advsolned.com/wp-content/uploads/2020/04/df1_fir.png 883w, https://www.advsolned.com/wp-content/uploads/2020/04/df1_fir-300x85.png 300w, https://www.advsolned.com/wp-content/uploads/2020/04/df1_fir-768x217.png 768w, https://www.advsolned.com/wp-content/uploads/2020/04/df1_fir-705x199.png 705w, https://www.advsolned.com/wp-content/uploads/2020/04/df1_fir-450x127.png 450w" sizes="auto, (max-width: 883px) 100vw, 883px" /></figure>



<p>The recommended (default) structure within the ASN Filter Designer is the <strong>Direct Form Transposed</strong> structure, as this offers superior numerical accuracy when using floating point arithmetic. This can be readily seen by analysing the difference equations below (used for implementation), as the undesirable effects of numerical swamping are minimised, since floating point addition is performed on numbers of similar magnitude.</p>



<p class="has-text-align-center">\(\displaystyle \begin{eqnarray}y(n) &amp; = &amp;b_0x(n) &amp;+&amp; w_1(n-1) \\ w_1(n)&amp;=&amp;b_1x(n) &amp;+&amp; w_2(n-1) \\ w_2(n)&amp;=&amp;b_2x(n) &amp;+&amp;  w_3(n-1) \\  \vdots\quad &amp;=&amp; \quad\vdots &amp;+&amp;\quad\vdots \\ w_q(n)&amp;=&amp;b_qx(n) \end{eqnarray}\)</p>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="900" height="306" src="http://www.advsolned.com/wp-content/uploads/2020/04/df2T_fir.png" alt="Direct form Transposed" class="wp-image-11978" srcset="https://www.advsolned.com/wp-content/uploads/2020/04/df2T_fir.png 900w, https://www.advsolned.com/wp-content/uploads/2020/04/df2T_fir-300x102.png 300w, https://www.advsolned.com/wp-content/uploads/2020/04/df2T_fir-768x261.png 768w, https://www.advsolned.com/wp-content/uploads/2020/04/df2T_fir-705x240.png 705w, https://www.advsolned.com/wp-content/uploads/2020/04/df2T_fir-450x153.png 450w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure>



<h2 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 25px;border-top-width:0px;border-bottom-width:0px;"></span><strong>Implementing your filter on an Arm Cortex-M processor</strong></h2>



<p>Although a few processor technologies exist for microcontrollers (e.g. RISC-V, Xtensa, MIPS), over 90% of the microcontrollers used in the smart product market are powered by so-called Arm Cortex-M processors that offer a combination of high algorithmic performance, low-power and security. The Arm Cortex-M4 is a very popular choice with several silicon vendors (including ST, TI, NXP, ADI, Nordic, Microchip, Renesas), as it offers DSP (digital signal processing) functionality traditionally found in more expensive devices and is low-power.</p>



<h3 class="wp-block-heading"><strong>Filtering libraries and support</strong></h3>



<p>Arm and ASN provide developers with extensive easy-to-use tooling and tried and tested software libraries used internationally by tens of thousands of developers.</p>



<p>The <a style="color:#0000ff" href="https://www.keil.com/pack/doc/CMSIS/DSP/html/index.html">Arm CMSIS-DSP</a> software framework is interesting as it provides IoT developers with a rich collection of fast mathematical and vector functions, interpolation functions, digital filtering (FIR/IIR) and adaptive filtering (LMS) functions, motor control functions (e.g. PID controller), complex math functions and supports various data types, including fixed and floating point. The important point to make here is that all of these functions have been optimised for Arm Cortex-M processors, allowing you to focus on your application rather than worrying about optimisation.  </p>



<p>Despite the broad functionality, the CMSIS-DSP library is somewhat limited for filters, so the flexible <a style="color:#0000ff" href="https://www.advsolned.com/optimised-dsp-filtering-library-for-arm-risc-v-and-mips-microcontrollers/">ASN DSP filtering library </a>can be used instead, which supports the higher numerical accuracy Direct Form Transposed FIR filter structure and single section IIR filters. A benchmark of ASN’s floating point application-specific DSP filtering library versus Arm&#8217;s CMSIS-DSP library is shown below for three types of Arm cores. </p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="832" height="476" src="https://www.advsolned.com/wp-content/uploads/2021/08/benchmarks.png" alt="" class="wp-image-16944" srcset="https://www.advsolned.com/wp-content/uploads/2021/08/benchmarks.png 832w, https://www.advsolned.com/wp-content/uploads/2021/08/benchmarks-300x172.png 300w, https://www.advsolned.com/wp-content/uploads/2021/08/benchmarks-768x439.png 768w, https://www.advsolned.com/wp-content/uploads/2021/08/benchmarks-705x403.png 705w, https://www.advsolned.com/wp-content/uploads/2021/08/benchmarks-450x257.png 450w" sizes="auto, (max-width: 832px) 100vw, 832px" /><figcaption class="wp-element-caption"><em>Framework Benchmarks: lower number of clock cycles means higher performance.</em></figcaption></figure></div>


<p>As seen, the performance of the ASN library is slightly faster by virtue of the application-specific nature of the implementation. The C code is automatically generated from the <a style="color:#0000ff" href="https://www.advsolned.com/asn_filter_designer_digital_filter_software/" data-type="page">ASN Filter Designer</a> tool.</p>



<h2 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>What have we learned?</h2>



<p>Digital filters are divided into the following two categories: </p>



<ul class="wp-block-list">
<li>Infinite impulse response (IIR) </li>



<li>Finite impulse response (FIR)</li>
</ul>



<p>IIR (infinite impulse response) filters are generally chosen for applications where linear phase is not too important and memory is limited. They have been widely deployed in audio equalisation, biomedical sensor signal processing, IoT/AIoT smart sensors and high-speed telecommunication/RF applications.</p>



<p>FIR (finite impulse response) filters are generally chosen for applications where linear phase is important and a decent amount of memory and computational performance are available. They have a widely deployed in audio and biomedical signal enhancement applications.</p>



<p>ASN Filter Designer provides engineers with everything they need to design, experiment and deploy complex IIR and FIR digital filters for a variety of IoT sensor measurement applications. These advantages coupled with automatic C code generation with ASN&#8217;s DSP filtering library functionality allow engineers to design, validate and then deploy their designs to an Arm Cortex-M processor within hours rather than more traditional routes that could take days.</p>



<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>
<p><a href="https://www.advsolned.com/asn_filter_designer/"><img loading="lazy" decoding="async" class="alignleft wp-image-3310" style="margin: 10px 80px 10px 20px;" src="https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png" alt="" width="183" height="253" srcset="https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png 800w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-217x300.png 217w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-768x1062.png 768w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-745x1030.png 745w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-510x705.png 510w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-450x622.png 450w" sizes="auto, (max-width: 183px) 100vw, 183px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: left;"><a class="button" href="https://www.advsolned.com/request-form-asn-filter-designer-demo/">Download demo now</a></p>
<p> </p>
<p><a class="button" href="https://www.advsolned.com/pricing-and-licencing/#Best_licence_forme">Licencing information</a></p>



<h2 class="wp-block-heading" id="block-d6f4e6e1-36db-41c0-998c-9f4f04f93625"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span></h2>



                
                    <!--begin code -->

                    
                    <div class="pp-multiple-authors-boxes-wrapper pp-multiple-authors-wrapper pp-multiple-authors-layout-boxed multiple-authors-target-shortcode box-post-id-19551 box-instance-id-1 ppma_boxes_19551"
                    data-post_id="19551"
                    data-instance_id="1"
                    data-additional_class="pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode"
                    data-original_class="pp-multiple-authors-boxes-wrapper pp-multiple-authors-wrapper box-post-id-19551 box-instance-id-1">
                                                                                    <h2 class="widget-title box-header-title">Author</h2>
                                                                            <span class="ppma-layout-prefix"></span>
                        <div class="ppma-author-category-wrap">
                                                                                                                                    <span class="ppma-category-group ppma-category-group-1 category-index-0">
                                                                                                                        <ul class="pp-multiple-authors-boxes-ul author-ul-0">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                    <li class="pp-multiple-authors-boxes-li author_index_0 author_ssarpal has-avatar">
                                                                                                                                                                                    <div class="pp-author-boxes-avatar">
                                                                    <div class="avatar-image">
                                                                                                                                                                                                                <img alt='' src='https://www.advsolned.com/wp-content/uploads/2023/05/sanjeevsarpal.jpeg' srcset='https://www.advsolned.com/wp-content/uploads/2023/05/sanjeevsarpal.jpeg' class='multiple_authors_guest_author_avatar avatar' height='80' width='80'/>                                                                                                                                                                                                            </div>
                                                                                                                                    </div>
                                                            
                                                            <div class="pp-author-boxes-avatar-details">
                                                                <div class="pp-author-boxes-name multiple-authors-name"><a href="https://www.advsolned.com/author/ssarpal/" rel="author" title="Dr. Sanjeev Sarpal" class="author url fn">Dr. Sanjeev Sarpal</a></div>                                                                                                                                                                                                        <p class="pp-author-boxes-description multiple-authors-description author-description-0">
                                                                                                                                                    Sanjeev is a RTEI (Real-Time Edge Intelligence) visionary and expert in signals and systems with a track record of successfully developing over 26 commercial products. He is a Distinguished Arm Ambassador and advises top international blue chip companies on their AIoT/RTEI solutions and strategies for I5.0, telemedicine, smart healthcare, smart grids and smart buildings.                                                                                                                                                </p>
                                                                                                                                
                                                                                                                                    <span class="pp-author-boxes-meta multiple-authors-links">
                                                                        <a href="https://www.advsolned.com/author/ssarpal/" title="View all posts">
                                                                            <span>View all posts</span>
                                                                        </a>
                                                                    </span>
                                                                                                                                <a class="ppma-author-user_email-profile-data ppma-author-field-meta ppma-author-field-type-email" aria-label="Email" href="mailto:sanjeev.sarpal@advsolned.com"  target="_self"><span class="dashicons dashicons-email-alt"></span> </a>
                                                                                                                            </div>
                                                                                                                                                                                                                        </li>
                                                                                                                                                                                                                                    </ul>
                                                                            </span>
                                                                                                                        </div>
                        <span class="ppma-layout-suffix"></span>
                                            </div>
                    <!--end code -->
                    
                
                                <style>
                .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img { 
        width: 80px !important; 
        height: 80px !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img {
        border-radius: 50% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        border-radius: 100% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        border-radius: 100% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-recent-posts-title {
        border-bottom-style: dotted !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        border-style: solid !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        color: #3c434a !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        border-radius: px !important; 
    }

            </style>
        
        
		<div class="wpulike wpulike-default " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="11955"
					data-ulike-nonce="b0d76f2535"
					data-ulike-type="post"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_11955"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="+24"></span>			</div></div>
	<p>The post <a rel="nofollow" href="https://www.advsolned.com/difference-between-iir-and-fir-filters-a-practical-design-guide/">Difference between IIR and FIR filters: a practical design guide</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Classical IIR filter design: a practical guide</title>
		<link>https://www.advsolned.com/iir-filters-practical-guide/</link>
					<comments>https://www.advsolned.com/iir-filters-practical-guide/#respond</comments>
		
		<dc:creator><![CDATA[Dr. Sanjeev Sarpal]]></dc:creator>
		<pubDate>Fri, 05 Oct 2018 10:54:58 +0000</pubDate>
				<category><![CDATA[ASN Filter Designer]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[bridge sensors]]></category>
		<category><![CDATA[Butterworth]]></category>
		<category><![CDATA[Chebyshev]]></category>
		<category><![CDATA[DSP]]></category>
		<category><![CDATA[Elliptic]]></category>
		<category><![CDATA[IIR]]></category>
		<category><![CDATA[IIR Biquad]]></category>
		<category><![CDATA[industrial]]></category>
		<category><![CDATA[IoT]]></category>
		<category><![CDATA[smart sensors]]></category>
		<guid isPermaLink="false">http://www.advsolned.com/?p=8027</guid>

					<description><![CDATA[<p>A practical guide of the most commonly used or classical IIR digital filter design methods: Butterworth, Chebyshev Type I, Chebyshev Type II and Elliptic</p>
<p>The post <a rel="nofollow" href="https://www.advsolned.com/iir-filters-practical-guide/">Classical IIR filter design: a practical guide</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>IIR (infinite impulse response) filters are generally chosen for applications where linear phase is not too important and memory is  limited. They have been widely deployed in audio equalisation, biomedical sensor signal processing, IoT/IIoT smart sensors and high-speed telecommunication/RF applications and form a critical building block in algorithmic design.</p>



<h3 class="wp-block-heading"><strong>Advantages </strong></h3>



<ul class="wp-block-list">
<li>Low implementation footprint: requires less coefficients and memory than FIR filters in order to satisfy a similar set of specifications, i.e., cut-off frequency and stopband attenuation.</li>
<li>Low latency: suitable for real-time control and very high-speed RF applications by virtue of the low coefficient footprint.</li>
<li>May be used for mimicking the characteristics of analog filters using s-z plane mapping transforms.</li>
</ul>



<h3 class="wp-block-heading"><strong>Disadvantages</strong></h3>



<ul class="wp-block-list">
<li>Non-linear phase characteristics.</li>
<li>Requires more scaling and numeric overflow analysis when implemented in fixed point.</li>
<li>Less numerically stable than their FIR (finite impulse response) counterparts, due to the feedback paths.</li>
</ul>



<h2 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>Definition</h2>



<p class="has-text-align-left">An IIR filter is categorised by its theoretically infinite impulse response,</p>


<p><center>\(\displaystyle y(n)=\sum_{k=0}^{\infty}h(k)x(n-k) \)</center></p>



<p class="has-text-align-left">Practically speaking, it is not possible to compute the output of an IIR using this equation. Therefore, the equation may be re-written in terms of a finite number of poles \(p\) and zeros \(q\), as defined by the linear constant coefficient difference equation given by:</p>


<p><center>\(\displaystyle y(n)=\sum_{k=0}^{q}b(k)x(n-k)-\sum_{k=1}^{p}a(k)y(n-k) \)</center></p>



<p class="has-text-align-left">where, \(a(k)\) and \(b(k)\) are the filter&#8217;s denominator and numerator polynomial coefficients, who&#8217;s roots are equal to the filter&#8217;s <strong>poles</strong> and <strong>zeros</strong> respectively. Thus, a relationship between the difference equation and the z-transform (transfer function) may therefore be defined by using the z-transform delay property such that,</p>


<p><center>\(\displaystyle \sum_{k=0}^{q}b(k)x(n-k)-\sum_{k=1}^{p}a(k)y(n-k)\quad\stackrel{\displaystyle\mathcal{Z}}{\longleftrightarrow}\quad\frac{\sum\limits_{k=0}^q b(k)z^{-k}}{1+\sum\limits_{k=1}^p a(k)z^{-k}} \)</center></p>



<p>As seen, the <strong>transfer function</strong> is a frequency domain representation of the filter. Notice also that the <strong>poles</strong> act on the <strong>output</strong> <strong>data</strong>, and the <strong>zeros</strong> on the <strong>input</strong> <strong>data</strong>. Since the poles act on the output data, and affect stability, it is essential that their radii <strong>remain inside the unit circle </strong>(i.e. &lt;1) for BIBO (bounded input, bounded output) stability. The radii of the zeros are less critical, as they do not affect filter stability. This is the primary reason why all-zero FIR (finite impulse response) filters are always stable.</p>



<p>A discussion of IIR filter structures for both fixed point and floating point can be found <a style="color: #0000ff;" href="http://www.advsolned.com/implementing-biquad-iir-filters-with-the-asn-filter-designer-and-the-arm-cmsis-dsp-software-framework/#figure1">here</a>.</p>



<h2 class="wp-block-heading">Classical IIR design methods</h2>



<p>A discussion of the most commonly used or classical IIR design methods (Butterworth, Chebyshev and Elliptic) will now follow. For anybody looking for more general examples, please visit the <a style="color: #0000ff;" href="http://www.advsolned.com/examples-and-answers/">ASN blog</a> for the many articles on the subject.</p>



<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.advsolned.com/wp-content/uploads/2018/08/ellip-550.png"><img loading="lazy" decoding="async" width="550" height="527" class="wp-image-7342" src="http://www.advsolned.com/wp-content/uploads/2018/08/ellip-550.png" alt="Passband ripple, Transition band and Stopband attenuation, IIR filter" srcset="https://www.advsolned.com/wp-content/uploads/2018/08/ellip-550.png 550w, https://www.advsolned.com/wp-content/uploads/2018/08/ellip-550-300x287.png 300w, https://www.advsolned.com/wp-content/uploads/2018/08/ellip-550-450x431.png 450w" sizes="auto, (max-width: 550px) 100vw, 550px" /></a></figure>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;"> </div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;"> </div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-3 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p>ASN Filter Designer’s graphical designer supports the design of the following four IIR classical design methods:</p>



<ul class="wp-block-list">
<li>Butterworth</li>
<li>Chebyshev Type I</li>
<li>Chebyshev Type II</li>
<li>Elliptic</li>
</ul>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-2 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;"> </div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;"> </div>
</div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="149" height="109" class="wp-image-12156" src="https://www.advsolned.com/wp-content/uploads/2020/04/classiciirmethods.png" alt="" /></figure>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-4 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p>The algorithm used for the computation first designs an analog filter (via an analog design prototype) with the desired filter specifications specified by the graphical design markers – i.e. pass/stopband ripple and cut-off frequencies. The resulting analog filter is then transformed via the Bilinear z-transform into its discrete equivalent for realisation.</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="330" height="169" class="wp-image-12157" src="https://www.advsolned.com/wp-content/uploads/2020/04/asn25_biquad.png" alt="" srcset="https://www.advsolned.com/wp-content/uploads/2020/04/asn25_biquad.png 330w, https://www.advsolned.com/wp-content/uploads/2020/04/asn25_biquad-300x154.png 300w" sizes="auto, (max-width: 330px) 100vw, 330px" /></figure>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-5 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 10%;">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="49" height="53" class="wp-image-12160" src="https://www.advsolned.com/wp-content/uploads/2018/10/appnote_infosymbol.png" alt="" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p>Biquad implementations are advocated for numerical stability.</p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-6 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 10%;">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="49" height="53" class="wp-image-12160" src="https://www.advsolned.com/wp-content/uploads/2018/10/appnote_infosymbol.png" alt="" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p>The Bessel prototype is not supported, as the Bilinear transform warps the linear phase characteristics. However, a <a href="https://www.advsolned.com/asn-filterscript-reference/#toggle-id-9">Bessel filter design method</a> is available in <a href="http://www.advsolned.com/asn-filterscript-gsg/">ASN FilterScript</a>.</p>
</div>
</div>



<p><span class="" style="display:block;clear:both;height: 0px;padding-top: 10px;border-top-width:0px;border-bottom-width:0px;"></span>As discussed below, each method has its pros and cons, but in general the <strong>Elliptic method should be considered as the first choice as it meets the design specifications with the lowest order</strong> of any of the methods. However, this desirable property comes at the expense of ripple in both the passband and stopband, and very non-linear passband phase characteristics. Therefore, the Elliptic filter should only be used in applications where memory is limited and passband phase linearity is less important.</p>



<p>The Butterworth and Chebyshev Type II methods have flat passbands (no ripple), making them a good choice for DC and low frequency measurement applications, such as bridge sensors (e.g. loadcells). However, this desirable property comes at the expense of wider transition bands, resulting in low passband to stopband transition (slow roll-off). The Chebyshev Type I and Elliptic methods roll-off faster but have passband ripple and very non-linear passband phase characteristics.</p>



<h2 class="wp-block-heading">Comparison of classical design methods</h2>



<p>The frequency response charts shown below, show the differences between the various design prototype methods for a <strong>5th order lowpass filter with the same specifications</strong>. As seen, the Butterworth response is the slowest to roll-off and the Elliptic the fastest.</p>



<h2 id="Elliptic"><strong>Elliptic</strong></h2>



<p>Elliptic filters offer steeper roll-off characteristics than Butterworth or Chebyshev filters, but are equiripple in both the passband and the stopband. In general, Elliptic filters meet the design specifications with the lowest order of any of the methods discussed herein.</p>



<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="577" height="656" class="wp-image-6435" src="https://www.advsolned.com/wp-content/uploads/2018/07/Elliptic-5th-order.png" alt="Elliptic 5th order, Elliptic Filter" srcset="https://www.advsolned.com/wp-content/uploads/2018/07/Elliptic-5th-order.png 577w, https://www.advsolned.com/wp-content/uploads/2018/07/Elliptic-5th-order-264x300.png 264w, https://www.advsolned.com/wp-content/uploads/2018/07/Elliptic-5th-order-450x512.png 450w" sizes="auto, (max-width: 577px) 100vw, 577px" /></figure>
</div>



<h3 class="wp-block-heading"><strong>Filter characteristics</strong></h3>



<ul class="wp-block-list">
<li>Fastest roll-off of all supported prototypes</li>
<li>Equiripple in both the passband and stopband</li>
<li>Lowest order filter of all supported prototypes</li>
<li>Non-linear passband phase characteristics</li>
<li>Good choice for real-time control and high-throughput (RF applications) applications</li>
</ul>



<h2 id="Butterworth"><span class="" style="display:block;clear:both;height: 0px;padding-top: 10px;border-top-width:0px;border-bottom-width:0px;"></span>Butterworth</h2>



<p>Butterworth filters have a magnitude response that is maximally flat  in the passband and monotonic overall, making them a good choice for DC and low frequency measurement applications, such as loadcells. However, this highly desirable ‘smoothness’ comes at the price of decreased roll-off steepness. As a consequence, the <strong>Butterworth method has the slowest roll-off characteristics of all the methods</strong> discussed herein.</p>



<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="577" height="656" class="wp-image-6438" src="https://www.advsolned.com/wp-content/uploads/2018/07/Butterworth-5th-order.png" alt="Butterworth filter 5th order" srcset="https://www.advsolned.com/wp-content/uploads/2018/07/Butterworth-5th-order.png 577w, https://www.advsolned.com/wp-content/uploads/2018/07/Butterworth-5th-order-264x300.png 264w, https://www.advsolned.com/wp-content/uploads/2018/07/Butterworth-5th-order-450x512.png 450w" sizes="auto, (max-width: 577px) 100vw, 577px" /></figure>
</div>



<h3 class="wp-block-heading"><strong>Filter characteristics</strong></h3>



<ul class="wp-block-list">
<li>Smooth monotonic response (no ripple)</li>
<li>Slowest roll-off for equivalent order</li>
<li>Highest order of all supported prototypes</li>
<li>More linear passband phase response than all other methods</li>
<li>Good choice for DC measurement and audio applications</li>
</ul>


<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>



<h2 class="wp-block-heading" id="Chebyshev">Chebyshev Type I</h2>



<p>Chebyshev Type I filters are equiripple in the passband and monotonic in the stopband. As such, Type I filters roll off faster than Chebyshev Type II and Butterworth filters, but at the expense of greater passband ripple.</p>



<div class="wp-block-image">
<figure class="aligncenter"><a href="http://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-I-5th-order.png"><img loading="lazy" decoding="async" width="577" height="656" class="wp-image-6437" src="http://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-I-5th-order.png" alt="Chebyshev I; Chebyshev type 1 filter" srcset="https://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-I-5th-order.png 577w, https://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-I-5th-order-264x300.png 264w, https://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-I-5th-order-450x512.png 450w" sizes="auto, (max-width: 577px) 100vw, 577px" /></a></figure>
</div>



<h3 class="wp-block-heading"><strong>Filter characteristics</strong></h3>



<ul class="wp-block-list">
<li>Passband ripple</li>
<li>Maximally flat stopband</li>
<li>Faster roll-off than Butterworth and Chebyshev Type II</li>
<li>Good compromise between Elliptic and Butterworth</li>
</ul>



<h2 class="wp-block-heading"><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>Chebyshev Type II</h2>



<p>Chebyshev Type II filters are monotonic in the passband and equiripple in the stopband making them a good choice for bridge sensor applications. Although filters designed using the Type II method are slower to roll-off than those designed with the Chebyshev Type I method, the roll-off is faster than those designed with the Butterworth method.</p>



<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="577" height="656" class="wp-image-6436" src="https://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-II-5th-order.png" alt="Chebyshev type II 5th order" srcset="https://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-II-5th-order.png 577w, https://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-II-5th-order-264x300.png 264w, https://www.advsolned.com/wp-content/uploads/2018/07/Chebyshev-type-II-5th-order-450x512.png 450w" sizes="auto, (max-width: 577px) 100vw, 577px" /></figure>
</div>



<h3 class="wp-block-heading"><strong>Filter characteristics</strong></h3>



<ul class="wp-block-list">
<li>Maximally flat passband</li>
<li>Faster roll-off than Butterworth</li>
<li>Slower roll-off than Chebyshev Type I</li>
<li>Good choice for DC measurement applications</li>
</ul>


<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>



<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>
<p><a href="https://www.advsolned.com/asn_filter_designer/"><img loading="lazy" decoding="async" class="alignleft wp-image-3310" style="margin: 10px 80px 10px 20px;" src="https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png" alt="" width="183" height="253" srcset="https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png 800w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-217x300.png 217w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-768x1062.png 768w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-745x1030.png 745w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-510x705.png 510w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-450x622.png 450w" sizes="auto, (max-width: 183px) 100vw, 183px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: left;"><a class="button" href="https://www.advsolned.com/request-form-asn-filter-designer-demo/">Download demo now</a></p>
<p>&nbsp;</p>
<p><a class="button" href="https://www.advsolned.com/pricing-and-licencing/#Best_licence_forme">Licencing information</a></p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"> </div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 46.2%;"> </div>
</div>



<p>&nbsp;</p>
<p><strong><span class="" style="display:block;clear:both;height: 0px;padding-top: 25px;border-top-width:0px;border-bottom-width:0px;"></span></strong></p>
<p>

</p>

                
                    <!--begin code -->

                    
                    <div class="pp-multiple-authors-boxes-wrapper pp-multiple-authors-wrapper pp-multiple-authors-layout-boxed multiple-authors-target-shortcode box-post-id-19551 box-instance-id-1 ppma_boxes_19551"
                    data-post_id="19551"
                    data-instance_id="1"
                    data-additional_class="pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode"
                    data-original_class="pp-multiple-authors-boxes-wrapper pp-multiple-authors-wrapper box-post-id-19551 box-instance-id-1">
                                                                                    <h2 class="widget-title box-header-title">Author</h2>
                                                                            <span class="ppma-layout-prefix"></span>
                        <div class="ppma-author-category-wrap">
                                                                                                                                    <span class="ppma-category-group ppma-category-group-1 category-index-0">
                                                                                                                        <ul class="pp-multiple-authors-boxes-ul author-ul-0">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                    <li class="pp-multiple-authors-boxes-li author_index_0 author_ssarpal has-avatar">
                                                                                                                                                                                    <div class="pp-author-boxes-avatar">
                                                                    <div class="avatar-image">
                                                                                                                                                                                                                <img alt='' src='https://www.advsolned.com/wp-content/uploads/2023/05/sanjeevsarpal.jpeg' srcset='https://www.advsolned.com/wp-content/uploads/2023/05/sanjeevsarpal.jpeg' class='multiple_authors_guest_author_avatar avatar' height='80' width='80'/>                                                                                                                                                                                                            </div>
                                                                                                                                    </div>
                                                            
                                                            <div class="pp-author-boxes-avatar-details">
                                                                <div class="pp-author-boxes-name multiple-authors-name"><a href="https://www.advsolned.com/author/ssarpal/" rel="author" title="Dr. Sanjeev Sarpal" class="author url fn">Dr. Sanjeev Sarpal</a></div>                                                                                                                                                                                                        <p class="pp-author-boxes-description multiple-authors-description author-description-0">
                                                                                                                                                    Sanjeev is a RTEI (Real-Time Edge Intelligence) visionary and expert in signals and systems with a track record of successfully developing over 26 commercial products. He is a Distinguished Arm Ambassador and advises top international blue chip companies on their AIoT/RTEI solutions and strategies for I5.0, telemedicine, smart healthcare, smart grids and smart buildings.                                                                                                                                                </p>
                                                                                                                                
                                                                                                                                    <span class="pp-author-boxes-meta multiple-authors-links">
                                                                        <a href="https://www.advsolned.com/author/ssarpal/" title="View all posts">
                                                                            <span>View all posts</span>
                                                                        </a>
                                                                    </span>
                                                                                                                                <a class="ppma-author-user_email-profile-data ppma-author-field-meta ppma-author-field-type-email" aria-label="Email" href="mailto:sanjeev.sarpal@advsolned.com"  target="_self"><span class="dashicons dashicons-email-alt"></span> </a>
                                                                                                                            </div>
                                                                                                                                                                                                                        </li>
                                                                                                                                                                                                                                    </ul>
                                                                            </span>
                                                                                                                        </div>
                        <span class="ppma-layout-suffix"></span>
                                            </div>
                    <!--end code -->
                    
                
                                <style>
                .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img { 
        width: 80px !important; 
        height: 80px !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img {
        border-radius: 50% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        border-radius: 100% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        border-radius: 100% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-recent-posts-title {
        border-bottom-style: dotted !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        border-style: solid !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        color: #3c434a !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        border-radius: px !important; 
    }

            </style>
        
        
		<div class="wpulike wpulike-default " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="8027"
					data-ulike-nonce="f193621883"
					data-ulike-type="post"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_8027"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="+7"></span>			</div></div>
	<p>The post <a rel="nofollow" href="https://www.advsolned.com/iir-filters-practical-guide/">Classical IIR filter design: a practical guide</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.advsolned.com/iir-filters-practical-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>All-pass filter</title>
		<link>https://www.advsolned.com/all-pass-filter/</link>
		
		<dc:creator><![CDATA[Dr. Sanjeev Sarpal]]></dc:creator>
		<pubDate>Thu, 05 Jul 2018 15:18:25 +0000</pubDate>
				<category><![CDATA[ASN FilterScript]]></category>
		<category><![CDATA[allpass filter]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[biquad]]></category>
		<category><![CDATA[equaliser]]></category>
		<category><![CDATA[IIR]]></category>
		<guid isPermaLink="false">http://www.advsolned.com/?p=6118</guid>

					<description><![CDATA[<p>All-pass filters (phase equalisers) provide a simple way of altering/improving the phase response of an IIR without affecting its magnitude response.</p>
<p>The post <a rel="nofollow" href="https://www.advsolned.com/all-pass-filter/">All-pass filter</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style='padding-bottom:10px; ' class='av-special-heading av-special-heading-h1     '><h1 class='av-special-heading-tag '  itemprop="headline"  >All-pass filters</h1><div class='special-heading-border'><div class='special-heading-inner-border' ></div></div></div>
<p><section class="av_textblock_section "  itemscope="itemscope" itemtype="https://schema.org/BlogPosting" itemprop="blogPost" ><div class='avia_textblock  '   itemprop="text" ><p>All-pass filters provide a simple way of altering/improving the phase response of an IIR without affecting its magnitude response. As such, they are commonly referred to as phase equalisers and have found particular use in digital audio applications.</p>
<p>In its simplest form, a filter can be constructed from a first order transfer function, i.e.,</p>
<p style="text-align: center;">\( A(z)=\Large{\frac{r+z^{-1}}{1+r z^{-1}}}  \, \,  \normalsize{; r&lt;1} \)</p>
<p>Analysing \(\small A(z)\), notice that the pole and zero lie on the real z-plane axis and that the pole at radius \(\small r\) has a zero at radius \(\small 1/r\), such that the poles and zeros are reciprocals of another. This property is key to the all-pass filter concept, as we will now see by expanding the concept further to a second order all-pass filter:</p>
<p style="text-align: center;">\( A(z)=\Large\frac{r^2-2rcos \left( \frac{2\pi f_c}{fs}\right) z^{-1}+z^{-2}}{1-2rcos \left( \frac{2\pi f_c}{fs}\right)z^{-1}+r^2 z^{-2}} \)</p>
<p>Where, \(\small f_c\) is the centre frequency, \(\small r\) is radius of the poles and<a href="http://www.advsolned.com/wp-content/uploads/2018/07/allpassPZ.png"><img loading="lazy" decoding="async" class="alignright wp-image-6129 size-square" style="margin-top: 15px; margin-bottom: 15px; margin-left: 40px;" src="https://www.advsolned.com/wp-content/uploads/2018/07/allpassPZ-180x180.png" alt="all pass filter, all-pass filter, allpass filter, all pass pole-zero" width="180" height="180" srcset="https://www.advsolned.com/wp-content/uploads/2018/07/allpassPZ-180x180.png 180w, https://www.advsolned.com/wp-content/uploads/2018/07/allpassPZ-80x80.png 80w, https://www.advsolned.com/wp-content/uploads/2018/07/allpassPZ-36x36.png 36w, https://www.advsolned.com/wp-content/uploads/2018/07/allpassPZ-120x120.png 120w" sizes="auto, (max-width: 180px) 100vw, 180px" /></a> \(\small f_s\) is the sampling frequency. Notice how the numerator and denominator coefficients are arranged as a <strong>mirror image pair</strong> of one another.  The mirror image property is what gives the all-pass filter its desirable property, namely allowing the designer to alter the phase response while keeping the magnitude response constant or flat over the complete frequency spectrum.</p>
<p style="text-align: center;"><a href="http://www.advsolned.com/wp-content/uploads/2018/07/allpass.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-6122 size-full" src="https://www.advsolned.com/wp-content/uploads/2018/07/allpass.png" alt="all pass filter, all-pass filter, allpass, phase equaliser, altering/improving the phase response of an IIR without affecting its magnitude response" width="426" height="422" srcset="https://www.advsolned.com/wp-content/uploads/2018/07/allpass.png 426w, https://www.advsolned.com/wp-content/uploads/2018/07/allpass-80x80.png 80w, https://www.advsolned.com/wp-content/uploads/2018/07/allpass-300x297.png 300w, https://www.advsolned.com/wp-content/uploads/2018/07/allpass-36x36.png 36w, https://www.advsolned.com/wp-content/uploads/2018/07/allpass-120x120.png 120w" sizes="auto, (max-width: 426px) 100vw, 426px" /></a><em>Frequency response of all-pass filter:<br />
</em><em>Notice the constant magnitude spectrum (shown in blue). </em></p>
<span class="" style="display:block;clear:both;height: 0px;padding-top: 10px;border-top-width:0px;border-bottom-width:0px;"></span>
<h2>Implementation</h2>
<p>An All-pass filter may be implemented in <span style="color: #0000ff;"><a style="color: #0000ff;" href="http://www.advsolned.com/asn_filter_designer/#live-math-scripting">ASN FilterScript</a></span> as follows:<br />
[code language=&#8221;java&#8221;]<br />
ClearH1;  // clear primary filter from cascade</p>
<p>interface radius = {0,2,0.01,0.5};   // radius value<br />
interface fc = {0,fs/2,1,fs/10};     // frequency value</p>
<p>Main()<br />
Num = {radius^2,-2*radius*cos(Twopi*fc/fs),1};<br />
Den = reverse(Num); // mirror image of Num<br />
Gain = 1;</p>
<p>[/code]<br />
<span class="" style="display:block;clear:both;height: 0px;padding-top: 10px;border-top-width:0px;border-bottom-width:0px;"></span>For a detailed discussion on IIR filter phase equalisation, and the ASN Filter designer&#8217;s APF (all-pass filter) design tool, please refer to the following <a style="color: #0000ff;" href="https://www.advsolned.com/linear-phase-iir-filters-analysis-and-design/">article</a>. <span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span></p>
<p><a href="https://www.advsolned.com/asn_filter_designer/"><img loading="lazy" decoding="async" class="alignleft wp-image-3310" style="margin: 10px 80px 10px 20px;" src="http://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png" alt="ASN Filter Designer DSP" width="183" height="253" srcset="https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png 800w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-217x300.png 217w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-768x1062.png 768w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-745x1030.png 745w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-510x705.png 510w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-450x622.png 450w" sizes="auto, (max-width: 183px) 100vw, 183px" /></a></p>
<p style="text-align: left;"></br><a class="button" href="http://www.advsolned.com/request-form-asn-filter-designer-demo/">Download demo now</a></p>
<p><a class="button" href="http://www.advsolned.com/pricing-and-licencing/#Best_licence_forme">Licencing information</a></p>
</div></section><span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>
                
                    <!--begin code -->

                    
                    <div class="pp-multiple-authors-boxes-wrapper pp-multiple-authors-wrapper pp-multiple-authors-layout-boxed multiple-authors-target-shortcode box-post-id-19551 box-instance-id-1 ppma_boxes_19551"
                    data-post_id="19551"
                    data-instance_id="1"
                    data-additional_class="pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode"
                    data-original_class="pp-multiple-authors-boxes-wrapper pp-multiple-authors-wrapper box-post-id-19551 box-instance-id-1">
                                                                                    <h2 class="widget-title box-header-title">Author</h2>
                                                                            <span class="ppma-layout-prefix"></span>
                        <div class="ppma-author-category-wrap">
                                                                                                                                    <span class="ppma-category-group ppma-category-group-1 category-index-0">
                                                                                                                        <ul class="pp-multiple-authors-boxes-ul author-ul-0">
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                    <li class="pp-multiple-authors-boxes-li author_index_0 author_ssarpal has-avatar">
                                                                                                                                                                                    <div class="pp-author-boxes-avatar">
                                                                    <div class="avatar-image">
                                                                                                                                                                                                                <img alt='' src='https://www.advsolned.com/wp-content/uploads/2023/05/sanjeevsarpal.jpeg' srcset='https://www.advsolned.com/wp-content/uploads/2023/05/sanjeevsarpal.jpeg' class='multiple_authors_guest_author_avatar avatar' height='80' width='80'/>                                                                                                                                                                                                            </div>
                                                                                                                                    </div>
                                                            
                                                            <div class="pp-author-boxes-avatar-details">
                                                                <div class="pp-author-boxes-name multiple-authors-name"><a href="https://www.advsolned.com/author/ssarpal/" rel="author" title="Dr. Sanjeev Sarpal" class="author url fn">Dr. Sanjeev Sarpal</a></div>                                                                                                                                                                                                        <p class="pp-author-boxes-description multiple-authors-description author-description-0">
                                                                                                                                                    Sanjeev is a RTEI (Real-Time Edge Intelligence) visionary and expert in signals and systems with a track record of successfully developing over 26 commercial products. He is a Distinguished Arm Ambassador and advises top international blue chip companies on their AIoT/RTEI solutions and strategies for I5.0, telemedicine, smart healthcare, smart grids and smart buildings.                                                                                                                                                </p>
                                                                                                                                
                                                                                                                                    <span class="pp-author-boxes-meta multiple-authors-links">
                                                                        <a href="https://www.advsolned.com/author/ssarpal/" title="View all posts">
                                                                            <span>View all posts</span>
                                                                        </a>
                                                                    </span>
                                                                                                                                <a class="ppma-author-user_email-profile-data ppma-author-field-meta ppma-author-field-type-email" aria-label="Email" href="mailto:sanjeev.sarpal@advsolned.com"  target="_self"><span class="dashicons dashicons-email-alt"></span> </a>
                                                                                                                            </div>
                                                                                                                                                                                                                        </li>
                                                                                                                                                                                                                                    </ul>
                                                                            </span>
                                                                                                                        </div>
                        <span class="ppma-layout-suffix"></span>
                                            </div>
                    <!--end code -->
                    
                
                                <style>
                .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img { 
        width: 80px !important; 
        height: 80px !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-avatar img {
        border-radius: 50% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-meta a:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        border-radius: 100% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_url-profile-data:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        background-color: #655997 !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        border-radius: 100% !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .ppma-author-user_email-profile-data:hover {
        color: #ffffff !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-author-boxes-recent-posts-title {
        border-bottom-style: dotted !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        border-style: solid !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        color: #3c434a !important; 
    }

    .pp-multiple-authors-boxes-wrapper.pp-multiple-authors-layout-boxed.multiple-authors-target-shortcode .pp-multiple-authors-boxes-li {
        border-radius: px !important; 
    }

            </style>
        
        </p>
		<div class="wpulike wpulike-default " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="6118"
					data-ulike-nonce="503763e3b4"
					data-ulike-type="post"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_6118"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="+4"></span>			</div></div>
	<p>The post <a rel="nofollow" href="https://www.advsolned.com/all-pass-filter/">All-pass filter</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>FIR Comb Filter: powerline harmonic cancellation and CIC</title>
		<link>https://www.advsolned.com/fir-comb-filter/</link>
					<comments>https://www.advsolned.com/fir-comb-filter/#respond</comments>
		
		<dc:creator><![CDATA[ASN consultancy team]]></dc:creator>
		<pubDate>Wed, 04 Jul 2018 14:18:48 +0000</pubDate>
				<category><![CDATA[ASN FilterScript]]></category>
		<category><![CDATA[50Hz mains interference]]></category>
		<category><![CDATA[50Hz powerline]]></category>
		<category><![CDATA[60Hz powerline]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[CIC]]></category>
		<category><![CDATA[comb]]></category>
		<category><![CDATA[FIR]]></category>
		<category><![CDATA[harmonics]]></category>
		<guid isPermaLink="false">http://www.advsolned.com/?p=5990</guid>

					<description><![CDATA[<p>Comb filters: powerline (50/60Hz) harmonic cancellation filters, audio applications; cascaded integrator–comb (CIC) filters: anti-aliasing, anti-imaging</p>
<p>The post <a rel="nofollow" href="https://www.advsolned.com/fir-comb-filter/">FIR Comb Filter: powerline harmonic cancellation and CIC</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style='padding-bottom:10px; ' class='av-special-heading av-special-heading-h1    '><h1 class='av-special-heading-tag '  itemprop="headline"  >FIR Comb Filter: powerline harmonic cancellation and CIC</h1><div class='special-heading-border'><div class='special-heading-inner-border' ></div></div></div>
<section class="av_textblock_section "  itemscope="itemscope" itemtype="https://schema.org/BlogPosting" itemprop="blogPost" ><div class='avia_textblock  '   itemprop="text" ><p>Comb filters have found use as powerline (50/60Hz) harmonic cancellation filters in audio applications, and form the basis of so called CIC (cascaded integrator–comb) filters used for anti-aliasing in decimation (sample rate reduction), and anti-imaging in interpolation (sample rate increase) applications.</p>
<p style="text-align: left;">The frequency response of a comb filter consists of a series of regularly-spaced troughs, giving the appearance of a comb. As seen in the plot below, the spacing of each trough appears at either odd or even harmonics of the desired fundamental frequency.</p>
<p style="text-align: center;"><a href="http://www.advsolned.com/wp-content/uploads/2018/07/fircomb.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-5991" src="http://www.advsolned.com/wp-content/uploads/2018/07/fircomb.png" alt="Comb filters have found use as powerline (50/60Hz) harmonic cancellation filters in audio applications, and form the basis of so called CIC (cascaded integrator–comb) filters used for anti-aliasing in decimation (sample rate reduction), and anti-imaging in interpolation (sample rate increase) application" width="453" height="536" srcset="https://www.advsolned.com/wp-content/uploads/2018/07/fircomb.png 464w, https://www.advsolned.com/wp-content/uploads/2018/07/fircomb-254x300.png 254w, https://www.advsolned.com/wp-content/uploads/2018/07/fircomb-450x532.png 450w" sizes="auto, (max-width: 453px) 100vw, 453px" /></a><em>Frequency response of a typical FIR comb filter (odd harmonics cancellation):<br />
</em><em>\(f_s=500Hz\),  \(f_c=25Hz\), \(L=10\) and \(\alpha=1\)<br />
</em></p>
<p style="text-align: left;"><span class="" style="display:block;clear:both;height: 0px;padding-top: 25px;border-top-width:0px;border-bottom-width:0px;"></span>An FIR comb filter can be described by the following transfer function:</p>
<p style="text-align: center;">\(H(z)=1+\alpha z^{-L}\)<span class="" style="display:block;clear:both;height: 0px;padding-top: 2px;border-top-width:0px;border-bottom-width:0px;"></span><br />
\(\Rightarrow Y(z)=X(z)\left[1+\alpha z^{-L}\right]\)</p>
<p style="text-align: left;">Clearly, the comb filter is simply a weighted delayed replica of itself, specifiied by \(L\). Taking inverse z-transforms, we obtain the difference equation needed for implementation,</p>
<p style="text-align: center;">\(y(n)=x(n)+\alpha x(n-L)\)</p>
<p>where, \(\alpha\) is used to set the Q (bandwidth) of the notch and may be either positive or negative depending on what type of frequency response is required. In order to elaborate on this, negative values of \(\alpha\) have their first trough at DC and their second trough at the fundamental frequency. Clearly this type of comb filter can be used to remove any DC components from a measured waveform if so required. All subsequent troughs appear at even harmonics up to and including the Nyquist frequency.</p>
<p>Positive values of \(\alpha\) on the other hand, only have troughs at the fundamental and odd harmonic frequencies, and as such cannot be used to remove any DC components.</p>
<h2>Application to powerline interference cancellation</h2>
<p>The affectivity of the comb filter is dependent on the sampling frequency, \(f_s\), as \(L\) is limited to integer values only. Also, a relationship between \(f_s\), as \(L\) and will be dependent on the sign of \(\alpha\). Thus, for the purposes of the mains cancellation application considered in this discussion, only positive values of will be considered, as we need only cancel odd harmonics.</p>
<p>A simple relationship for determining  \(L\) can be summarized for positive values of \(\alpha\) as follows:</p>
<p style="text-align: center;">\(L=ceil\left( \large{\frac{f_s}{2f_c}}\right)\)</p>
<p>where, \(f_c\) is the desired centre point of the fundamental notch frequency. Based on this expression, we can re-calculate the sampling frequency, such that \(f_c\) is a true multiple of \(f_s\)</p>
<p style="text-align: center;">\(f_{snew}=2f_c L\)</p>
<h2>Example of a comb filter</h2>
<p>For the example considered herein, i.e. \(f_s=500Hz\) and \(f_c=25Hz\), we obtain \(L=10\). However, if \(f_c=60Hz\), we would need \(L=5\), and a new sampling rate of \(600Hz\) respectively, although it&#8217;s interesting to note that \(f_s=480Hz\) for \(L=4\) would also suffice.</p>
<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span>
<h2>Implementation</h2>
<p>An FIR comb filter may be implemented in <span style="color: #0000ff;"><a style="color: #0000ff;" href="http://www.advsolned.com/asn_filter_designer/#live-math-scripting">ASN FilterScript</a></span> as follows:<br />
[code language=&#8221;java&#8221;]<br />
ClearH1;  // clear primary filter from cascade<br />
interface L = {4,20,1,5}; // delay<br />
interface alpha = {-1,1,0.01,1};</p>
<p>Main()<br />
Num = {1,zeros(L-1),alpha}; // numerator coefficients<br />
Den = {1};<br />
Gain = 1/sum(abs(Num));<br />
[/code]<br />
<span class="" style="display:block;clear:both;height: 0px;padding-top: 20px;border-top-width:0px;border-bottom-width:0px;"></span></p>
<p><a href="http://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png"><img loading="lazy" decoding="async" class="alignleft wp-image-3310" style="margin: 10px 80px 10px 20px;" src="http://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png" alt="" width="183" height="253" srcset="https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox.png 800w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-217x300.png 217w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-768x1062.png 768w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-745x1030.png 745w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-510x705.png 510w, https://www.advsolned.com/wp-content/uploads/2018/02/ASNFDbox-450x622.png 450w" sizes="auto, (max-width: 183px) 100vw, 183px" /></a></p>
<p style="text-align: left;"><a class="button" href="http://www.advsolned.com/request-form-asn-filter-designer-demo/">Download demo now</a></p>
<p><a class="button" href="http://www.advsolned.com/pricing-and-licencing/#Best_licence_forme">Licencing information</a></p>
</div></section>
</div></div></div><!-- close content main div --></div></div><div id='av_section_1' class='avia-section main_color avia-section-default avia-no-border-styling avia-bg-style-scroll   container_wrap sidebar_right' style=' '  ><div class='container' ><div class='template-page content  av-content-small alpha units'><div class='post-entry post-entry-type-page post-entry-5990'><div class='entry-content-wrapper clearfix'></div></div></div><!-- close content main div --></div></div><div id='after_section_1' class='main_color av_default_container_wrap container_wrap sidebar_right' style=' '  ><div class='container' ><div class='template-page content  av-content-small alpha units'><div class='post-entry post-entry-type-page post-entry-5990'><div class='entry-content-wrapper clearfix'>
</div></div></div><!-- close content main div --></div></div><div id='av_section_2' class='avia-section main_color avia-section-default avia-no-border-styling avia-bg-style-scroll   container_wrap sidebar_right' style=' '  ><div class='container' ><div class='template-page content  av-content-small alpha units'><div class='post-entry post-entry-type-page post-entry-5990'><div class='entry-content-wrapper clearfix'></div></div></div><!-- close content main div --></div></div><div id='after_section_2' class='main_color av_default_container_wrap container_wrap sidebar_right' style=' '  ><div class='container' ><div class='template-page content  av-content-small alpha units'><div class='post-entry post-entry-type-page post-entry-5990'><div class='entry-content-wrapper clearfix'>
		<div class="wpulike wpulike-default " ><div class="wp_ulike_general_class wp_ulike_is_not_liked"><button type="button"
					aria-label="Like Button"
					data-ulike-id="5990"
					data-ulike-nonce="97ab17370c"
					data-ulike-type="post"
					data-ulike-template="wpulike-default"
					data-ulike-display-likers=""
					data-ulike-likers-style="popover"
					class="wp_ulike_btn wp_ulike_put_image wp_post_btn_5990"></button><span class="count-box wp_ulike_counter_up" data-ulike-counter-value="+4"></span>			</div></div>
	<p>The post <a rel="nofollow" href="https://www.advsolned.com/fir-comb-filter/">FIR Comb Filter: powerline harmonic cancellation and CIC</a> appeared first on <a rel="nofollow" href="https://www.advsolned.com">ASN Home</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.advsolned.com/fir-comb-filter/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
