-
Notifications
You must be signed in to change notification settings - Fork 0
filter.SpecFilt.Function.filterSignal
dsp-collection / filter/SpecFilt / filterSignal
function filterSignal(
inSamples,
filterType,
filterFreq1,
filterFreq2,
smoothingWidth): Float64Array;Defined in: filter/SpecFilt.ts:123
Filters a signal using FFT and iFFT.
All frequency parameters are normalized frequencies according to the following formula:
nomalizedFrequency = frequencyInHz / sampleRate = 1 / waveLengthInSamples
The input signal should ideally be windoweded to prevent artifacts. But this would distort the amplitude curve of the output signal. In practice, the input signal should at least have a fade-in/fade-out.
ArrayLike<number>
The input signal samples. If the length of the input array is even, the computation is faster. If it's a power of 2, it's even faster.
The filter type (low-pass, high-pass, etc.).
number
Normalized filter frequency for low-pass or high-pass. Lower filter frequecy for band-pass or band-stop.
number
Normalized upper filter frequecy for band-pass or band-stop. Ignored for low-pass or high-pass.
number
Normalized frequency distance between the start of the smoothing and the -6dB point.
Float64Array
The filtered output signal samples.