ar1st0crat / NWaves

.NET DSP library with a lot of audio processing functions
MIT License
459 stars 71 forks source link

Is there method for series filter? or parallel filter? #65

Closed pokjnb closed 2 years ago

pokjnb commented 2 years ago

as the title I want to parallel connection few butterworthfilters for LR filter, does it work by using NWaves? I have checked the notes of Nwaves, but havent seen the similar function, maybe I missed something. Please give some guide, thanks.

ar1st0crat commented 2 years ago

Here: Parallel/Sequential filtering.

Also, there's a class called FilterChain that can be used for online and offline filtering if several filters should be applied one after another (i.e. connected sequentially):

var chain = new FilterChain(new[] { filter1, filter2 });

//while (new sample is available)
{
    var outputSample = chain.Process(sample);
    // ...
}

// or chunks:
void GotNewChunk(float[] chunk)
{
    chain.Process(chunk, chunk);
}

chain.Reset();

At any time new filter can be added to the chain or removed:

chain.Add(filter3);
chain.RemoveAt(0);
pokjnb commented 2 years ago

I havent check wiki page of filters, thanks for your guide. You are reaaally efficient, and solve the issue accurately. I will reopen it if I have using problem. Thnaks again, for your work, this library is good.