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.
BiQuadFilter
-
- Site Admin
- Posts: 256
- Joined: Fri Jul 27, 2018 5:36 pm
Re: BiQuadFilter
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
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
Re: BiQuadFilter
Ah, that's great, just the info I needed! Thanks Dan!
Re: BiQuadFilter
Hi Dan...
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
I have some additional bi-quad questions for you...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
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
Re: BiQuadFilter
In case others are curious, what I've learned so far...
Cheers,
--
Terry McG
It is dB, but Googling suggests it's only used by shelf/peak filters (http://shepazu.github.io/Audio-EQ-Cookb ... kbook.html)
Yes, it doesterrymcg wrote: The bandwidth parameter : I assume it's applies to FilterType.BANDPASS as well as FilterType.NOTCH?
Cheers,
--
Terry McG