dsp-0.2.4.1: Haskell Digital Signal Processing

Copyright(c) Matthew Donadio 2003
LicenseGPL
Maintainerm.p.donadio@ieee.org
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

DSP.Filter.IIR.IIR

Description

IIR functions

IMPORTANT NOTE:

Except in integrator, we use the convention that

y[n] = sum(k=0..M) b_k*x[n-k] - sum(k=1..N) a_k*y[n-k]
         sum(k=0..M) b_k*z^-1
H(z) = ------------------------
       1 + sum(k=1..N) a_k*z^-1
Synopsis

Documentation

integrator Source #

Arguments

:: Num a 
=> a

a

-> [a]

x[n]

-> [a]

y[n]

This is an integrator when a==1, and a leaky integrator when 0 < a < 1.

y[n] = a * y[n-1] + x[n]

fos_df1 Source #

Arguments

:: Num a 
=> a

a_1

-> a

b_0

-> a

b_1

-> [a]

x[n]

-> [a]

y[n]

First order section, DF1

v[n] = b0 * x[n] + b1 * x[n-1]
y[n] = v[n] - a1 * y[n-1]

fos_df2 Source #

Arguments

:: Num a 
=> a

a_1

-> a

b_0

-> a

b_1

-> [a]

x[n]

-> [a]

y[n]

First order section, DF2

w[n] = -a1 * w[n-1] + x[n]
y[n] = b0 * w[n] + b1 * w[n-1]

fos_df2t Source #

Arguments

:: Num a 
=> a

a_1

-> a

b_0

-> a

b_1

-> [a]

x[n]

-> [a]

y[n]

First order section, DF2T

v0[n] = b0 * x[n] + v1[n-1]
y[n] = v0[n]
v1[n] = -a1 * y[n] + b1 * x[n]

biquad_df1 Source #

Arguments

:: Num a 
=> a

a_1

-> a

a_2

-> a

b_0

-> a

b_1

-> a

b_2

-> [a]

x[n]

-> [a]

y[n]

Direct Form I for a second order section

v[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2]
y[n] = v[n] - a1 * y[n-1] - a2 * y[n-2]

biquad_df2 Source #

Arguments

:: Num a 
=> a

a_1

-> a

a_2

-> a

b_0

-> a

b_1

-> a

b_2

-> [a]

x[n]

-> [a]

y[n]

Direct Form II for a second order section (biquad)

w[n] = -a1 * w[n-1] - a2 * w[n-2] + x[n]
y[n] = b0 * w[n] + b1 * w[n-1] + b2 * w[n-2]

biquad_df2t Source #

Arguments

:: Num a 
=> a

a_1

-> a

a_2

-> a

b_0

-> a

b_1

-> a

b_2

-> [a]

x[n]

-> [a]

y[n]

Transposed Direct Form II for a second order section

v0[n] = b0 * x[n] + v1[n-1]
y[n] = v0[n]
v1[n] = -a1 * y[n] + b1 * x[n] + v2[n-1]
v2[n] = -a2 * y[n] + b2 * x[n]

iir_df1 Source #

Arguments

:: (Num a, Eq a) 
=> (Array Int a, Array Int a)

(b,a)

-> [a]

x[n]

-> [a]

y[n]

Direct Form I IIR

v[n] = sum(k=0..M) b_k*x[n-k]
y[n] = v[n] - sum(k=1..N) a_k*y[n-k]

v[n] is calculated with fir

iir_df2 Source #

Arguments

:: Num a 
=> (Array Int a, Array Int a)

(b,a)

-> [a]

x[n]

-> [a]

y[n]

Direct Form II IIR

w[n] = x[n] - sum(k=1..N) a_k*w[n-k]
y[n] = sum(k=0..M) b_k*w[n-k]

f1 :: Fractional a => [a] -> [a] Source #

f2 :: Fractional a => [a] -> [a] Source #

f3 :: Fractional a => [a] -> [a] Source #

f4 :: [Double] -> [Double] Source #

f5 :: [Double] -> [Double] Source #