Pre-Equalization gain for parametric equalization (PEQ)

How big are the differences in required pre-gain in your use case? Just applying the inverse of max. boost (to be on the safe side) sounds a bit too coarse for me to make sense. We'll want to give up as little volume and resolution as possible.

In the end, not applying appropriate negative pre-gain doesn't mean that distortion will occur, but that distortion can occur, depending on programme material.

Anyway, I see no downside of (possibly) automatically calculated pre-gain stored per EQ profile, so I'm a supporter.

Difference between calculated pre-gains and maximum of individual gain is 0.06dB for my use case - pretty small difference.

I agree to your point about probability of distortion since I won't listen to 0dB impulse or step function.
 
Screenshot_20240615-164142809.jpg

Hello. Since I don't have rew or any other software, I would like to ask how, for example, in the case of the settings shown in the attached picture, how can I calculate the percentage by which I should reduce the gain. Thanks.
 
View attachment 8072

Hello. Since I don't have rew or any other software, I would like to ask how, for example, in the case of the settings shown in the attached picture, how can I calculate the percentage by which I should reduce the gain. Thanks.
See this and related posts

 
View attachment 8072

Hello. Since I don't have rew or any other software, I would like to ask how, for example, in the case of the settings shown in the attached picture, how can I calculate the percentage by which I should reduce the gain. Thanks.
3.1 dB headroom, according to REW. To be on the safe side you would have to set the volume limit to 94%.

Are you sure that this +7.9 dB peak at 76 Hz is really helpful when moving your head just slightly from the center position?

Couldn't Wiim app make the calculation and automatically set the volume limiter to the correct value?
That's why I started this topic, but I didn't manage to request a ticket. I wrote to them from the app.
If you really need it that much then I don't understand why you not upvote the feature request created by @jed1 .
 
3.1 dB headroom, according to REW. To be on the safe side you would have to set the volume limit to 94%.

Are you sure that this +7.9 dB peak at 76 Hz is really helpful when moving your head just slightly from the center position?



If you really need it that much then I don't understand why you not upvote the feature request created by @jed1 .
Sorry, I'm still new, I'm posting on mobile, I accidentally missed the like. 76 Hz is right, it's really a lot. Thanks.
 
Are there any adverse consequences in setting the volume limiter quite low (e.g. 80%), just to stay safe?
 
Are there any adverse consequences in setting the volume limiter quite low (e.g. 80%), just to stay safe?
Max volume, in the first place. Available resolution, if you go over the top (at least in theory).

80% would give you 12 dB of headroom for positive gain, which is quite a lot, probably much more than you'll need.
 
Max volume, in the first place. Available resolution, if you go over the top (at least in theory).

80% would give you 12 dB of headroom for positive gain, which is quite a lot, probably much more than you'll need.
With 80% I have no problem getting enough SPL from my HiFi chain.
I don’t understand “Available resolution, if you go over the top (at least in theory)”…
Can you please elaborate a bit?
 
View attachment 8072

Hello. Since I don't have rew or any other software, I would like to ask how, for example, in the case of the settings shown in the attached picture, how can I calculate the percentage by which I should reduce the gain. Thanks.
Turho76,

I wrote a Python script and calculated the impulse response.

With the current PEQ setting, you need -0.93dB pre-EQ gain to avoid clipping. If you are fine with removing filters #7-#10, you need -0.00044884373667138284dB (i.e. 0dB).


Below is a Python script - it works in Windows, Mac OS and etc. Forum does not allow attaching a Python script so I dump as below.

import numpy as np
from scipy.signal import lfilter

# reference: https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html
def parametric_eq(bands, fs, pregain):
# Initialize impulse response
impulse = np.zeros(1000)
impulse[0] = 1.0*pow(10,pregain/20)

for band in bands:
filter_type, center_freq, gain, Q = band

A = pow(10,gain/40)
omega = 2*np.pi*center_freq / fs
cos_omega = np.cos(omega)
sin_omega = np.sin(omega)
alpha = sin_omega / (2*Q)

# Define filter types
if filter_type == 'low_shelf':
b0 = A*((A+1) - (A-1)*cos_omega + 2*np.sqrt(A)*alpha)
b1 = 2*A*((A-1) - (A+1)*cos_omega)
b2 = A*((A+1) - (A-1)*cos_omega - 2*np.sqrt(A)*alpha)
a0 = (A+1) + (A-1)*cos_omega + 2*np.sqrt(A)*alpha
a1 = -2*((A-1) + (A+1)*cos_omega)
a2 = (A+1) + (A-1)*cos_omega - 2*np.sqrt(A)*alpha
elif filter_type == 'high_shelf':
b0 = A*((A+1) + (A-1)*cos_omega + 2*np.sqrt(A)*alpha)
b1 = -2*A*((A-1) + (A+1)*cos_omega)
b2 = A*((A+1) + (A-1)*cos_omega - 2*np.sqrt(A)*alpha)
a0 = (A+1) - (A-1)*cos_omega + 2*np.sqrt(A)*alpha
a1 = 2*((A-1) - (A+1)*cos_omega)
a2 = (A+1) - (A-1)*cos_omega - 2*np.sqrt(A)*alpha
elif filter_type == 'peaking':
b0 = 1 + alpha*A
b1 = -2*cos_omega
b2 = 1 - alpha*A
a0 = 1 + alpha/A
a1 = -2*cos_omega
a2 = 1 - alpha/A
elif filter_type == 'low_pass':
b0 = (1 - cos_omega)/2
b1 = 1 - cos_omega
b2 = (1 - cos_omega)/2
a0 = 1 + alpha
a1 = -2*cos_omega
a2 = 1 - alpha
elif filter_type == 'high_pass':
b0 = (1 + cos_omega)/2
b1 = -(1 + cos_omega)
b2 = (1 + cos_omega)/2
a0 = 1 + alpha
a1 = -2*cos_omega
a2 = 1 - alpha
elif filter_type == 'band_pass':
b0 = Q*alpha
b1 = 0
b2 = -Q*alpha
a0 = 1 + alpha
a1 = -2*cos_omega
a2 = 1 - alpha
elif filter_type == 'all_pass':
b0 = 1 - alpha
b1 = -2*cos_omega
b2 = 1 + alpha
a0 = 1 + alpha
a1 = -2*cos_omega
a2 = 1 - alpha
elif filter_type == 'notch':
b0 = 1
b1 = -2*cos_omega
b2 = 1
a0 = 1 + alpha
a1 = -2*cos_omega
a2 = 1 - alpha
else:
raise ValueError('Invalid filter type. Choose either "low_shelf", "high_shelf", or "peaking".')

# Normalize filter coefficients
b = [b0 / a0, b1 / a0, b2 / a0]
a = [a0 / a0, a1 / a0, a2 / a0]

# Calculate impulse response for this band and add to total response
response = lfilter(b, a, impulse)
impulse = response
print([center_freq,min(impulse),max(impulse)])

return impulse

bands = [('peaking', 28.0, 2.0, 1.00),
('peaking', 53.5, -6.4, 1.75),
('peaking', 76.0, 7.9, 1.65),
('peaking', 100.0, -3.0, 0.65),
('peaking', 120.0, -3.6, 1.65),
('peaking', 155.0, 5.0, 1.25),
('peaking', 2000.0, 0.0, 0.25),
('peaking', 4000.0, 0.0, 0.25),
('peaking', 8000.0, 0.0, 0.25),
('peaking',22000.0, 1.3, 0.20)]

response = parametric_eq(bands, 96000,0)

20*np.log10(max(response))

bands_trunc = [('peaking', 28.0, 2.0, 1.00),
('peaking', 53.5, -6.4, 1.75),
('peaking', 76.0, 7.9, 1.65),
('peaking', 100.0, -3.0, 0.65),
('peaking', 120.0, -3.6, 1.65),
('peaking', 155.0, 5.0, 1.25)]

response_trunc = parametric_eq(bands_trunc, 96000,0)

20*np.log10(max(response))
 
That's different from the calculation REW does.

Just stating the facts, not evaluating.
I assume WiiM apply IIR filters (biquad) sequentially. If that assumption holds, as long as each IIR filter step does not clip, the final filtered signal is not clipped.
 
Impulse response through IIR filters will simulate how DSP works internally. As long as there is no clipping at each step, there will be no clipping at the end. Main benefit is to use a higher gain than REW (it seems to use maximum spectral response for headroom).
 
Back
Top