NotchFilterA notch filter audio effector that attenuates a very narrow frequency band around a configurable center frequency. It is commonly used to remove resonances, hum (e.g. 50/60 Hz), or feedback frequencies without significantly affecting the rest of the spectrum.
Internally this effector is based on the Web Audio API BiquadFilterNode with notch type.
import { NotchFilter } from "@fluex/fluexgl-dsp";
const notch = new NotchFilter({
frequency: 50,
q: 10
});
await notch.InitializeOnAttachment(audioContext);
new NotchFilter(options?: Partial<NotchFilterOptions>): NotchFilter;
options?: Partial<NotchFilterOptions>label: string | nullCustom label for this effector. Defaults to "NotchFilter".
name: stringInternal name for this effector. Defaults to "NotchFilter".
filterNode: BiquadFilterNode | nullUnderlying Web Audio API filter node. Available after initialization.
InitializeOnAttachment(context: AudioContext): Promise<void>Initializes the notch filter by creating a BiquadFilterNode with type = "notch" and
applying the configured options.
context: AudioContextPromise<void>SetOptions(options: Partial<NotchFilterOptions>): voidApplies filter parameters such as center frequency and Q factor.
Live-updates the internal BiquadFilterNode when available.
options: Partial<NotchFilterOptions>void