LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp.filter.biquad Namespace Reference

Author: J.A. More...

Functions

 peaking (fs, f0, Q, gain)
 Design of peaking biquad filter.
 
 notch (fs, f0, Q, gain=None)
 Notch filter, parameter gain not used.
 
 lowpass (fs, f0, Q, gain=None)
 Second order low pass filter, parameter gain not used.
 
 highpass (fs, f0, Q, gain=None)
 Second order high pass filter, parameter gain not used.
 
 highshelf (fs, f0, Q, gain)
 High shelving filter.
 
 lowshelf (fs, f0, Q, gain)
 Low shelving filter.
 
 LP1compensator (fs, f0o, f0n)
 Shelving type filter that, when multiplied with a first-order low-pass filter, alters the response of that filter to a different first-order low-pass filter.
 
 LP2compensator (fs, f0o, Qo, f0n, Qn)
 Shelving type filter that, when multiplied with a second-order low-pass filter, alters the response of that filter to a different second-order low-pass filter.
 
 HP1compensator (fs, f0o, f0n)
 Shelving type filter that, when multiplied with a first-order high-pass filter, alters the response of that filter to a different first-order high-pass filter.
 
 HP2compensator (fs, f0o, Qo, f0n, Qn)
 Shelving type filter that, when multiplied with a second-order high-pass filter, alters the response of that filter to a different second-order high-pass filter.
 
 biquadTF (fs, freq, sos)
 Computes the transfer function of the biquad.
 

Detailed Description

Author: J.A.

de Jong - ASCEE V.O.F.

Description: Filter design implementation of common biquad filters that are often used in parametric equalizers.

Major source is Audio EQ Cookbook: https://archive.is/20121220231853/http://www.musicdsp.org/ files/Audio-EQ-Cookbook.txt

The definition of the BiQuad filter coefficients as coming out of these functions defines the filter as:

y[n] = 1/ba[3] * ( ba[0] * x[n] + ba[1] * x[n-1] + ba[2] * x[n-2] +

  • ba[4] * y[n-1] + ba[5] * y[n-2] )

Note that all filters are normalized such that ba[3] is by definition equal to 1.0!

Function Documentation

◆ biquadTF()

lasp.filter.biquad.biquadTF (   fs,
  freq,
  sos 
)

Computes the transfer function of the biquad.

Interpolates the frequency response to freq

Args: fs: Sampling frequency [Hz] freq: Frequency array to compute the ba: Biquad filter coefficients in common form.

TODO: This code is not yet tested

Definition at line 285 of file biquad.py.

◆ highpass()

lasp.filter.biquad.highpass (   fs,
  f0,
  Q,
  gain = None 
)

Second order high pass filter, parameter gain not used.

Args: fs: Sampling frequency [Hz] f0: Cut-on frequency [Hz] Q: Quality factor (~ inverse of bandwidth)

Definition at line 97 of file biquad.py.

◆ highshelf()

lasp.filter.biquad.highshelf (   fs,
  f0,
  Q,
  gain 
)

High shelving filter.

Args: fs: Sampling frequency [Hz] f0: Cut-on frequency [Hz] Q: Quality factor (~ inverse of bandwidth) gain: Increase in level w.r.t. "wire" [dB]

Definition at line 118 of file biquad.py.

◆ HP1compensator()

lasp.filter.biquad.HP1compensator (   fs,
  f0o,
  f0n 
)

Shelving type filter that, when multiplied with a first-order high-pass filter, alters the response of that filter to a different first-order high-pass filter.

Args: fs: Sampling frequency [Hz] f0o: Cut-on frequency of the original filter [Hz]
f0n: Desired cut-on frequency [Hz]

Definition at line 223 of file biquad.py.

◆ HP2compensator()

lasp.filter.biquad.HP2compensator (   fs,
  f0o,
  Qo,
  f0n,
  Qn 
)

Shelving type filter that, when multiplied with a second-order high-pass filter, alters the response of that filter to a different second-order high-pass filter.

Args: fs: Sampling frequency [Hz] f0o: Cut-on frequency of the original filter [Hz] Qo: Quality factor of the original filter (~inverse of bandwidth) f0n: Desired cut-on frequency [Hz] Qn: Desired quality factor(~inverse of bandwidth)

Definition at line 248 of file biquad.py.

◆ lowpass()

lasp.filter.biquad.lowpass (   fs,
  f0,
  Q,
  gain = None 
)

Second order low pass filter, parameter gain not used.

Args: fs: Sampling frequency [Hz] f0: Cut-off frequency [Hz] Q: Quality factor (~ inverse of bandwidth)

Definition at line 77 of file biquad.py.

◆ lowshelf()

lasp.filter.biquad.lowshelf (   fs,
  f0,
  Q,
  gain 
)

Low shelving filter.

Args: fs: Sampling frequency [Hz] f0: Cut-on frequency [Hz] Q: Quality factor (~ inverse of bandwidth) gain: Increase in level w.r.t. "wire" [dB]

Definition at line 140 of file biquad.py.

◆ LP1compensator()

lasp.filter.biquad.LP1compensator (   fs,
  f0o,
  f0n 
)

Shelving type filter that, when multiplied with a first-order low-pass filter, alters the response of that filter to a different first-order low-pass filter.

Args: fs: Sampling frequency [Hz] f0o: Cut-off frequency of the original filter [Hz]
f0n: Desired cut-off frequency [Hz]

Definition at line 161 of file biquad.py.

◆ LP2compensator()

lasp.filter.biquad.LP2compensator (   fs,
  f0o,
  Qo,
  f0n,
  Qn 
)

Shelving type filter that, when multiplied with a second-order low-pass filter, alters the response of that filter to a different second-order low-pass filter.

Args: fs: Sampling frequency [Hz] f0o: Cut-off frequency of the original filter [Hz] Qo: Quality factor of the original filter (~inverse of bandwidth) f0n: Desired cut-off frequency [Hz] Qn: Desired quality factor(~inverse of bandwidth)

Definition at line 186 of file biquad.py.

◆ notch()

lasp.filter.biquad.notch (   fs,
  f0,
  Q,
  gain = None 
)

Notch filter, parameter gain not used.

Args: fs: Sampling frequency [Hz] f0: Center frequency [Hz] Q: Quality factor (~ inverse of bandwidth)

Definition at line 57 of file biquad.py.

◆ peaking()

lasp.filter.biquad.peaking (   fs,
  f0,
  Q,
  gain 
)

Design of peaking biquad filter.

Args: fs: Sampling frequency [Hz] f0: Center frequency Q: Quality factor (~ inverse of bandwidth) gain: Increase in level at the center frequency [dB]

Definition at line 34 of file biquad.py.