class RemiAudio::DSP::ParaEQ

Overview

A mono parametric EQ.

The first band is always a low shelf, and the last band is always a high shelf. The others are all normal peaking bands.

Defined in:

remiaudio/dsp/paraeq.cr

Constant Summary

DEFAULT_HIGH_SHELF_FREQ = 15000.0

The default cutoff frequency for the high shelf, in Hertz.

DEFAULT_HIGH_SHELF_WIDTH = 0.7071067811865475

The default bandwidth for the high shelf, in octaves.

DEFAULT_LOW_SHELF_FREQ = 80.0

The default cutoff frequency for low shelf, in Hertz.

DEFAULT_LOW_SHELF_WIDTH = 0.7071067811865475

The default bandwidth for band 0, in octaves.

DEFAULT_PEAKING_FREQ = 500.0

The default cutoff frequency for the peaking bands, in Hertz.

DEFAULT_PEAKING_Q = 1.0

The default bandwidth for the peaking bands, as a Q value.

Constructors

Instance Method Summary

Constructor Detail

def self.new(numBands, newSampleRate) #

Creates a new parametric EQ. Bands 1 through numBands-2 are peaking bands, while bands 0 and numBands-1 are the shelves. numBands must be at least 2, and includes the lowshelf and highshelf.


[View source]

Instance Method Detail

def active=(active : Bool) #

When true, this equalizer will process audio, otherwise it will pass any audio through unmodified.


[View source]
def active? : Bool #

When true, this equalizer will process audio, otherwise it will pass any audio through unmodified.


[View source]
def plot(pt : PlotType) : String #

Generates a string that can be passed to a program to plot this equalizer on a graph. The PlotType dictates what kind of script is generated.


[View source]
def postGain : Float64 #

The amount of gain to apply after the EQ, in decibels.


[View source]
def postGain=(value : Float64) : Nil #

The amount of gain to apply after the EQ, in decibels.


[View source]
def process(sample : Float64) : Float64 #

Processes a single sample of audio with the equalizer, returning a processed sample.


[View source]
def process(sample : Float32) : Float32 #

Processes a single sample of audio with the equalizer, returning a processed sample.


[View source]
def process(block : Array(Float64) | Slice(Float64)) : Nil #

Processes a block of audio with the equalizer.


[View source]
def reset : Nil #

Resets all bands in the equalizer.


[View source]
def sampleRate : Float64 #

The sample rate of the equalizer.


[View source]
def setBand(band : Int, freq : Float64, gain : Float64, width : Float64) : Nil #

Sets the frequency/band/width for the given band.

If freq is greater than 49.9% of the sampling frequency, that band will be disabled.


[View source]