BiQuadFilter

Post Reply
Benard
Posts: 62
Joined: Mon Oct 01, 2018 11:40 am

BiQuadFilter

Post by Benard »

Is it possible to get some information about the BiQuadFilter in the MD library?

BiQuadFilter(FilterType type, double frequency, double gain)

I see the constructor requires a FilterType, but it's not clear to me what the options for type are. I also see no method for getting its value, such as GetLowpassValue() in AnalogFilter.

Any help would be appreciated.
Cherry Dan
Site Admin
Posts: 256
Joined: Fri Jul 27, 2018 5:36 pm

Re: BiQuadFilter

Post by Cherry Dan »

Benard,

Biquad filters are simple two-pole filters that are often combined together to create more complex filters. If you look ion the Enumerations section of the Library tab in Voltage Module Designer, you'll find the BiQuadFilter.FilterType enumeration.

Here's an example of a lowpass filter at 4,000 Hz:

BiQuadFilter lowpassFilter = new BiQuadFilter(BiQuadFilter.FilterType.LOWPASS, 4000.0, 0);

Here's an example of a notch filter, at 10,000 Hz, with a bandwidth of 1 octave:

BiQuadFilter notchFilter = new BiQuadFilter(BiQuadFilter.FilterType.NOTCH, 10000, 0, 1.0);

To use a BiQuadFilter you've created, just call ProcessSample() on it:

double outputSignal = lowpassFilter.ProcessSample(inputSignal);

Please let us know if you have any further questions!

Thanks,
Dan
Benard
Posts: 62
Joined: Mon Oct 01, 2018 11:40 am

Re: BiQuadFilter

Post by Benard »

Ah, that's great, just the info I needed! Thanks Dan!
terrymcg
Posts: 85
Joined: Mon Apr 08, 2019 12:35 am

Re: BiQuadFilter

Post by terrymcg »

Hi Dan...
Cherry Dan wrote: Thu Apr 25, 2019 4:32 pm
Here's an example of a notch filter, at 10,000 Hz, with a bandwidth of 1 octave:

BiQuadFilter notchFilter = new BiQuadFilter(BiQuadFilter.FilterType.NOTCH, 10000, 0, 1.0);

[ . . . ]

Please let us know if you have any further questions!

Thanks,
Dan
I have some additional bi-quad questions for you...

What's the 'slope' of these filters? Specifically, the low, high, and bandpass bi-quads?

The gain parameter : What units/range of values is expected? The set/get method names suggest dB, if so, are there min/max values? Or is it some other unit?

The bandwidth parameter : I assume it applies to FilterType.BANDPASS as well as FilterType.NOTCH?

And it sure would be nice to be able to specify the bandwidth in Hz... many tedious calculations later I think I have the specific widths I wanted figured out ;)

Thanks in advance!

Cheers,
--
Terry McG
terrymcg
Posts: 85
Joined: Mon Apr 08, 2019 12:35 am

Re: BiQuadFilter

Post by terrymcg »

In case others are curious, what I've learned so far...
terrymcg wrote: Mon May 13, 2019 3:25 am The gain parameter : What units/range of values is expected? The set/get method names suggest dB, if so, are there min/max values? Or is it some other unit?
It is dB, but Googling suggests it's only used by shelf/peak filters (http://shepazu.github.io/Audio-EQ-Cookb ... kbook.html)
terrymcg wrote: The bandwidth parameter : I assume it's applies to FilterType.BANDPASS as well as FilterType.NOTCH?
Yes, it does :)

Cheers,
--
Terry McG
Post Reply

Return to “Module Designer”