Questions tagged [infinite-impulse-response]

Infinite impulse response (IIR) is a property of signal processing systems.

Filter by
Sorted by
Tagged with
28
votes
2answers
40k views

Filter order vs number of taps vs number of coefficients

I'm learning DSP slowly and trying to wrap my head around some terminology: Question 1: Suppose I have the following filter difference equation: $$y[n] = 2 x[n] + 4 x[n-2] + 6 x[n-3] + 8 x[n-4]$$ ...
24
votes
5answers
15k views

What Is the Best First Order IIR (AR Filter) Approximation to a Moving Average Filter (FIR Filter)?

Assume the following first order IIR Filter: $$ y[n] = \alpha x[n] + (1 - \alpha) y[n - 1] $$ How can I choose the parameter $ \alpha $ s.t. the IIR approximates as good as possible the FIR which is ...
22
votes
2answers
29k views

Applying filter in scipy.signal: Use lfilter or filtfilt?

I saw in a SO thread a suggestion to use filtfilt which performs backwards/forwards filtering instead of lfilter. What is the ...
20
votes
3answers
10k views

How does cascading biquad sections for higher order filters work?

I'm trying to implement an 8th order IIR filter and every application note and textbook I've read says that it is best to implement any filter of order more than 2 as second order sections. I used <...
17
votes
2answers
3k views

Are there any standard implementation forms for tunable Butterworth filters?

One of the standard ways to implement a Butterworth filter is with a cascade of second-order sections, each corresponding to a pair of complex-conjugate poles. For a fourth-order filter, for example, ...
16
votes
5answers
2k views

What factors should I consider when choosing an IIR filter realization?

IIR filters may be implemented as direct form 1 or 2. But how do you decide which form to use? What are the pros and cons of each?
15
votes
3answers
1k views

How can I design a very narrow filter?

Suppose I've got an audio signal sampled at $48000$ Hz, and I'd like to design a low-pass filter that isolates everything below ~$60$Hz. In the digital world, this is a low-pass filter with the ...
14
votes
1answer
5k views

Digital filter design basic principles (IIR/FIR)

Although I have a solid experience in designing audio engines and such, I am fairly new to the realm of Digital Filter Design, particularly IIR and FIR filters. In other words, I'm trying to learn as ...
14
votes
2answers
1k views

What bandpass filter design will yield the shortest impulse response?

Designing a simple 2nd order IIR bandpass Buterworth filter with a centre frequency of 500 Hz and a 1 octave bandwidth gives me the following frequency response ... Now, if I take the impulse ...
10
votes
1answer
2k views

What's the advantage of adaptive IIR filter against FIR?

Adaptive IIR filters is not straightforward, and may be unstable. Many people say that adaptive IIR filters use less coefficients than FIR filters. What I'm curious about is how many coefficients can ...
9
votes
5answers
1k views

How can I vectorize the computations for a first-order recursive filter?

I have a simple single pole low pass filter (for parameter smoothing) that can be explained by the following formula: $$ y[n] = (1-a) y[n-1] + a x[n] $$ The architecture that I'm using has access ...
9
votes
2answers
2k views

IIR Filter for Smoothing (Low Pass Filter)

I am using IIR filter for smoothing $$y[n] = ax[n]+(1-a)y[n-1]$$ My question is, if I add another IIR filter, will it be the second order of IIR filter? If not, what it can be called? My second ...
9
votes
5answers
8k views

What is the exact meaning of unstable system in DSP?

In physical systems I understand what is the meaning of stability or unstability. An operational amplifier for example, if working in positive feedback will either saturate or start osscilating (i.e ...
8
votes
6answers
3k views

Convert a FIR to an equivalent IIR

Is there a way to convert a FIR to an IIR filter with the most similar behavior?
8
votes
2answers
7k views

Filter Order Rule of Thumb

Is there a rule of thumb for calculating the approximate filter order of a FIR/IIR based on passband vs sample rate? I seem to remember reading about it once in Undergrad. I'd think you could make a ...
8
votes
3answers
3k views

Downsampling lowpass filter for audio: FIR or IIR?

I'm working on a real-time audio processing project in which I have to downsample a 44.1 kHz to a yet-to-be-determined lower sampling rate essentially for reducing computational complexity. I'm ...
8
votes
2answers
6k views

How does MATLAB handle IIR filters?

MATLAB has a butter, which constructs a Butterworth filter given an order and relative cutoff frequency. The filter created can be used to ...
8
votes
2answers
952 views

complementary IIR filters

I would like a pair of complementary IIR filters (lowpass/highpass). By complementary, I mean, when the output from the two filters is summed, the original signal is recovered. I thought I could build ...
7
votes
3answers
348 views

Protect an IIR filter from being reverse-engineered

I created a somewhat unique IIR filter and I want to protect the filter from being reverse-engineered I think you all know it is quite easy to get all the different weights of an IIR by using impulse ...
7
votes
1answer
2k views

Do FFT-based filtering methods add intrinsic latency to a real time algorithm?

In a current audio processing application, I am working entirely in the time domain using IIR filters. This is so I can use an audio buffer of just 3 or 4 samples and can guarantee that there will be ...
7
votes
2answers
141 views

Why can adaptive IIR filters result in unstable solutions?

For adaptive filtering, both finite and infinite impulse response (FIR/IIR) filters can be utilized. As an advantage of FIR filters in this context, guaranteed stability is often mentioned, while IIR ...
7
votes
1answer
3k views

Realtime fixed point IIR filter implementation in C

I would like to implement a fourth order fixed point low-pass IIR filter in C (with Q15 arithmetic), and I will prepare this filter by using two stages cascaded direct form-II bi-quad filters. I have ...
7
votes
2answers
994 views

Zero Phase Filter: Determining Initial Conditions for Forward Backward Filtering

Is anybody familiar with Gustafson's algorithm for minimizing transients in forward backward filtering [1]? I'm trying to implement it and my first guess was to check Matlab's filtfilt.m, since they ...
7
votes
1answer
290 views

Designing an IIR to generate a specific data sequence

I know that it's possible to design an IIR with specific poles and zeroes to create specific frequency responses. Is it also possible to design an IIR such that when you give it an impulse, it ...
6
votes
1answer
1k views

Complex Least Squares FIR filter design using Levinson' s algorithm

i'm trying to implement an arbitrary IIR filter design. I'm decomposing all the algorithm into smaller pieces that i can test. I currently am on the part where it designs a FIR filter from an ...
5
votes
6answers
413 views

Optimal $ n $ -th Order IIR /AR Approximation of a Moving Average Filter

I would like to approximate a moving average filter with an IIR filter of much lower order than the tap-length of the moving average filter. Optimality shall refer to the $L_2$ norm of the impulse ...
5
votes
2answers
4k views

best implementation of a real-time, fixed-point iir filter with constant coefficients

I have implemented IIR filter in direct form, parallel form, and cascade form. The input in all the cases is a kronecker delta function. How to judge which implementation is better is in real time and ...
5
votes
2answers
2k views

Frequency Domain Filtering

Can you create a zero phase IIR filter by transforming its impulse response into frequency domain and only taking the magnitude of that frequency repsone? I have seen this in an open source project ...
5
votes
4answers
2k views

Why is the first value in digital first-order IIR filter impulse response not the largest?

When I create a digital first-order IIR low-pass filter with scipy (code below), I get the following coefficients: B: [ 0.1367 0.1367] A: [ 1. -0.7265] The ...
5
votes
3answers
871 views

Is there a common name for the first order IIR averaging filter?

Is there a term to describe this IIR averaging/smoothing filter? $ y[n] = \alpha x[n] + (1 - \alpha) y[n - 1] $
5
votes
2answers
592 views

Understanding $\mathcal Z$-transforms and pole locations

I am trying to gain a better understanding of pole locations in the $z$-plane of a given discrete transfer function, $H(z)$. I think I have a pretty good understanding of how to use the $\mathcal Z$-...
5
votes
6answers
3k views

Design of a digital A-weighting filter with arbitrary sample rate

I want to A-weight a time series with arbitrary sample rate. An analog A-weighting filter is defined exactly by IEC 61672-1. But there's no definition for a digital filter. One method is to use the ...
5
votes
2answers
322 views

What does the uncertainty principle say about recursive filters?

The uncertainty principle is usually stated as a relationship between a continuous signal and that signal's Fourier transform, and says that $$ \int_{-\infty}^{\infty} \! x^2 f(x) \ \mathrm{dx} \int_{-...
5
votes
1answer
1k views

DC blocking IIR filter clipping?

I'm processing audio data for voice input from a mic. The data arrives in 32 bit floats [-1 ~ +1]. My first filter is to remove DC: ...
5
votes
1answer
112 views

sequence to perform filtering? which filter first?

Hi all Is there a generally accepted rule as to which order to perform filtering in? for example if I have three iir filters, a low pass filter a notch and a high pass filter, which sequence would ...
4
votes
3answers
559 views

Why is it easier to design an IIR filter in the continuous time domain than in the discrete time domain?

Given that the goal is to approximate the ideal filter with an IIR filter, why would it be easier to design it in the continuous time domain than the discrete? This paper says: Discrete time ...
4
votes
2answers
168 views

Analytical way to generate an IIR that is the square root response of another IIR

For simplicity take the transfer function of a second order IIR in $z$-domain: $$ H(z) = \frac {b_0 + b_1 z^{-1} + b_2 z^{-2}} {a_0 + a_1 z^{-1} + a_2 z^{-2}} $$ Is it possible to generate a new ...
4
votes
1answer
1k views

How does this “simple filter” work?

I'm new to DSP, and I'm using this basic "1-pole LPF" Param Smooth filter which "smooth" param when I change it. The code is pretty simple: ...
4
votes
1answer
185 views

Advancing a causal IIR filter's impulse response

Given an infinite impulse response (IIR) filter as coefficients in a topology of your choice, what is a straightforward way to modify the filter so that the impulse response is shifted in time (...
4
votes
2answers
101 views

Filtering without using any transforms

A composite signal is defined as $$x(t) = \sin(2\pi 10t) + \sin(2\pi 40t) + \sin(2\pi 60t) + \sin(2\pi 50t)$$ Separate the four frequencies without using any of the transform techniques.
4
votes
2answers
1k views

Step response overshoot in IIR filters

Is there an analytic expression by which it is possible to calculate overshoot of step-response of second order IIR digital filter? I have tried to search through Mitra's signal processing book and ...
4
votes
1answer
3k views

Is it possible to design noncausal filters in Matlab?

I'm trying to design a lowpass IIR filter with 5Hz cutoff frequency (sample frequency is 200Hz). i know how to create it with fdatool, or with functions such as 'butter' or 'ellip'. However, i think ...
4
votes
2answers
1k views

Least-squares digital IIR filter design (with arbitrary responses)

I'm studying the IIR filter design that is described in the book: Algorithms for the constrained design of digital filters with arbitrary phase and magnitude responses. You can get the code at page ...
4
votes
2answers
177 views

references for techniques to reduce recursive filter startup transients

I am trying to track down references (published articles or reports ideally) that establish the basis for some of the techniques being used to minimize the effect of recursive digital filter startup ...
4
votes
1answer
522 views

How to implement a FIR filter with correction of group delay on c#?

I read respect to digital filters, and implemented both IIR and FIR filters and I found that this type of filters have a called "group delay". Now I know that the IIR have a non-linear group delay and ...
4
votes
1answer
420 views

Discrete-time Biquad filter: Relation between peak frequency and pole frequency

This question arose from a discussion in the comments to this question and its answer. The author of that question discussed a discrete-time second order filter described by the following difference ...
3
votes
2answers
5k views

Are all IIR filters unstable in nature?

I know this question has been asked here numerous times. But I am still unclear here :( My book says, A linear time-invariant system is stable if its impulse response is absolutely summable. (G. ...
3
votes
2answers
582 views

Design a linear-phase FIR filter approximating the magnitude of a given IIR filter

I have a biquad IIR filter from which I want to get a linear-phase FIR. I saw that related question but the OP does not care much about phase. I have troubles getting the exact same magnitude curve ...
3
votes
3answers
840 views

Berchin's FDLS arbitrary filter design algorithm

I'm trying to use Berchin's FDLS methods (for those that don't know what it is, it's a way to design arbitrary magnitude and phase of an IIR Eq) I tried different things but neither gave me what i ...
3
votes
2answers
988 views

Matlab `filtfilt` provides excessive transient

I observed that filtfilt suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; ...