Re: Parametric Equalizer Design

Sergei Steshenko via Help-octave <[email protected]> Tue, 8 Mar 2022 02:03:16 +0200
Newsgroups gmane.comp.gnu.octave.general
Message-ID <[email protected]>
On 07/03/2022 18:58, Renato S. Yamane wrote:
> Em seg., 7 de mar. de 2022 às 15:50, Nicholas Jankowski
> <[email protected]> escreveu:
>>> There is no way to add a feature like this on Octave, right?
>>> https://www.mathworks.com/help/audio/ug/parametric-equalizer-design.html
>> looking at the examples on that page, and many of the functions they call (object oriented design
>> tools like fdesign) are still listed as unimplemented in the Signal package, it likely is not currently
>> possible to do exactly what they do.  depending on your exact needs, there may be other ways
>> to accomplish the tasks you need to do.  Here are links to the current signal package with function
>> reference, and the wiki 'missing' list:
> Hi, thanks for your feedback.
>
> Basically, this is a sketch of what I'm doing:
>
> signal = noise(30 * 44100, 1, 'pink');
> [z, p, k] = butter(2, [100/(44100/2), 2000/(44100/2)]);
> sos = zp2sos (z, p, k);
> filtered = sosfilt(sos, signal);
> normalized = filtered / (rms(filtered) / 10^(-6/20));
> audiowrite ('test.wav', normalized, 44100);
>
> But, before export the file, I would like to add a booster (or a
> reduction) in a specific area (let's say -3dB at 500Hz, with a Q=1)
>
> Many thanks,
> Renato
>
>
> ----------
> We are transitioning to a web based forum
> for community help discussions at
> https://octave.discourse.group/c/help


Renato,

if I understand correctly what you're doing, you work on finite length 
signal not in real time.

If it's the case, then why not use the following approach:

direct_fft(signal_time domain) -> 
multiply_the_spectrum_by_arbitrary_needed_filer -> 
inverse_fft(filtered_signal)

?

The question is how to implement the arbitrary_filter.

The trivial approach: you just "draw" it, i.e. you create peaks/dips by 
whatever means necessary in magnitude only.

The problem (?) is that such a filter won't be minimum phase. If it is 
indeed a problem, there is open source code allowing to produce minimum 
phase filter spectrum from magnitude only spectrum. The mathematical 
foundation of this all is here: 
https://en.wikipedia.org/wiki/Kramers%E2%80%93Kronig_relations .

--Sergei.



----------
We are transitioning to a web based forum
for community help discussions at
https://octave.discourse.group/c/help