rePhase, a loudspeaker phase linearization, EQ and FIR filtering tool

TNT

Member
Joined 2003
Paid Member
I looked at what Sören used for the FIR1 stage in the DAC. I took this and added the EQ to it. While I can see that the available taps, 2k, now need to do other things than the brick-wall filter I realise that the precision go down.

pos, are you familiar with the DAM DAC filter structure?

Manual says:

FIR1, upsampling from incoming sample rate to 352/384 Ksps in one step, with different filter lenght based on incoming sample rate. All FIR1 filters are basic Parks-McClellan "brickwall" types, designed with http://t-filter.appspot.com/fir/index.html, but still shorter than your regular DAC.
IIR, bank of 15 biquads operating at 352/384 Ksps, with one used for the CD de-emphasis filter, none otherwise used for the basic DAC.
FIR2, upsampling from 352/384 Ksps to 2.8/3.1 Msps, reasonable short and soft but still using same design as FIR1.
All filters are using 32 bit coefficients, with up to 67 bit MAC accumulator.

I will try minimum phase biquads for my EQ instead - still using rePhase. I'm not sure how many taps are available per biquad - manual does not say. Is maybe a biquad defined in this terms?

//
 
Last edited:

TNT

Member
Joined 2003
Paid Member
I'm puzzled right now. Implementing the same EQ using rePhase as the one I have tried out with my Hypex DLCP gives different sound.

The rePhase/DAM incarnation sounds hollow and very midrange heavy. I did try to inverse the settings and loaded these - now the upper half sounded good but no bass. And no highs above 600-700?

Picture shows the DLCP vs. rePhase screens...

Colors: Hypex Blue is complete target, red is the current biquad. RP/DAM: Blue is theoretical, blue is what can be expected with available taps (?)

X-axis are aligned!

See also pink noise meas from hypex and RP/DAM.


//
 

Attachments

  • hypRepa.png
    hypRepa.png
    119.8 KB · Views: 278
  • repHyp.png
    repHyp.png
    154.5 KB · Views: 277
  • repPN.png
    repPN.png
    117.2 KB · Views: 275
Last edited:
TNT, once gain the target frequency for the FIR should be either 353.8kHz or 384kHz, not 44.1kHz.
What you see in your measurement is exactly your correction shift 8 octaves up (and no antialiasing filter...)

Regarding biquads, this is something else, you cannot design these with rephase (albeit you can simulate them)
 
Last edited:

TNT

Member
Joined 2003
Paid Member
Aha interesting - Thanks!

OK re biquads - I figured that one out :)

So where in the config file should they go? As a) or b)... these are the only way I can see...

It's a pity they are not described a little better. The configurability is advertised as a DAM feature but one has to guesswork how to do it :-(

a)

-- FIR1 filters for 352.8K/384K Samplerate, just bypass filter
--

dam1021,352800,1,4,1,0.975
04 Bypass FIR1, 352.8 Ksps

b)

-- FIR2 final filters 352.8K/384K Samplerate
--

dam1021,352800,8,1008,127,8
08 Linear Phase FIR2, 352.8 Ksps, 0-83 Khz -1 db, 209 Khz -100 db


Must be FIR2 final filters?
But I probably don't understand fully the config file structure and their consequences...

I should not bother you with this as it is not a rePhase issue at all - sorry! But you seem to have contributed to the DAM product so if you can help me, I'd be very appreciated.

//
 

TNT

Member
Joined 2003
Paid Member
Sorry one more - what is this for then? (underlined)

dam1021,44100,8,4,1975,7.8
04 Linear Phase FIR1, 44.1 Ksps, 0-19.7 Khz - 1 db, 22.3 Khz -150db

0
-0.0000000000031857274815944411
-0.000000000011577568853705035
-0.000000000022772725099556178
-0.000000000033212364468604533
-0.00000000003896236987926038
 
I am sorry I have no experience with the DAM.

I believe these parameters specifies something like 44.1khz base sampling rate and 8x oversampling, ie 352.8kHz

Here is an example of such a filter, running at 352.8kHzwith 1975 taps (don't know if this is the limit, but this is what is used in your example), -0.000002dB at 20kHz and <-165dB from 22.05kHz and up (and less than +/- 0.00000001dB ripples in the passband)

attachment.php



With this kind of filter capabilities (taps and sampling freq) is not at all suited for system EQ, as this will impact the quality of the antialiasing filter
 

Attachments

  • DAM.png
    DAM.png
    141.3 KB · Views: 562
Last edited:
blue is the target, red is the result.
Here the approach is a bit different than normal rephase uses where you want the result to be as close as possible to the target: in the case of a brickwall filter the result curve is dictated by the windowing algorithm. It is exactly like windowing a sinc function. It is only really useful in the precise case of an antialisaing filter though.
 
With 4000 taps and an Albrecht 11-term window you can get an in band response of +/-0.000000000000005dB up to 20kHz, <-300dB at and above 22.05kHz, and -1dB at 20.88kHz

Alternatively back to an an Albrecht 6-term window you can shoot for <-165dB at and above 22.05kHz, -1dB at 21.38kHz, and +/-0.00000001dB in the passband up to almost 20.9kHz
 
Last edited:
Yes, same basic setup as the screenshot but with 4000 taps.
Sorry I cannot post the rephase settings as the version I am using is a development version with a format that would not load in current rephase versions.

Start with the settings in the screenshot, adjust to 4000 taps, and then rise the brickwall cutoff frequency so that the rejection "floor" is obtained precisely at Nyquist (around -165dB for Albrecht 6-term, and -300dB for the 11-term variant).

For example that is 21530Hz for the Albrecht 6-term version. I don't have the other one anymore, but it was a bit lower.
 
Last edited:

TNT

Member
Joined 2003
Paid Member
Of course you where correct re: fs. The filter is to serve 44,1 material but it operates at 8xFs - how could I miss that :) Thanks for your stubbornness and excuse my thickness.

Now it plays with the EQ from #2503 and 3999 taps - and quite nice at that. Thanks again for help!

- How come the curve don't fit in the bass? It looked like it improved as one increased the no_of taps. Why is just bass affected on tap starvation? Is this math, or rePhase doing the best of the situation?

Let the speaker optimisation begin :) ( https://www.diyaudio.com/forums/ful...corner-ceiling-floor-array-4.html#post5553290 )

//
 
The lower you go and the higher the Q/slope, thee longer the (pre and post) ringing.
The F in "FIR" means you will have to window/truncate these ringing and the response will be impacted.

4000 taps at 352.8k rate is equivalent to 500 taps at 44.1k. That is more than enough for an antialiasing filter, but probably not enough for real world EQ.
In comparison an openDRC does 6144 at 48kHz.
 

TNT

Member
Joined 2003
Paid Member
I''ll take a chance as you are so kind to answer me and present this task:

This is what my Hypex DLCP do - they are "boost" or "cut":

1: -14,4dB at 210 hz Q 0,65
2: 14,4dB at 23 hz Q 0,55
3: -3,8 dB at 3000 hz Q 0,5
4: 2,2dB at 17000 hz Q 0,5

Resulting in attached picture...

(This is what I did in rePhase but could not keep the bass levels it seems, with 4k)

//
 

Attachments

  • hyp.png
    hyp.png
    106.5 KB · Views: 222
There is definitely not enough taps for such a correction at this sampling rate, especially considering the antialiasing filter that requires a very gentle windowing to reach a low stop band.

If you remove the 23Hz and 210Hz EQs and use biquads to apply them then it might work, but quite frankly I think it would be better to use an external DSP.