A convolution based alternative to electrical loudspeaker correction networks

I have attached a test script for you to try. Copy your left and right pcm files and rename them to LeftManual.pcm and RightManual.pcm.

You should then end up with a combined stereo wav called FlatDRC.wav in the Convolver filters folder after running the script with the intermediate files deleted..

If you are having trouble with Sox and scripts try Audacity, that is point and click and harder to get wrong :) Although maybe not...
Nothing happen to me. Thanks btw. It's okay. I'll have to translate it directly into a command.

@emailtim
sox -t f32 -r 48000 -c 1 filename.pcm -t wav -r 48000 -c 1 filename.wav
This works for me.

Using Align2 and DRC designer, there are a lot of blockages trying to do it myself. Thank you all for your help.

1685170759832.png


What value should I use to fix the Access Phase more strongly from about 50 to 80hz?
I set the LF based on Align2 to around 250ms with the PLMaxGain minimum. (Phase only)
But Align2 didn't fix that either. (Minimal, Normal, Soft, Strong)

1685170947032.png


The recorded value of Align2 is as follows.
I think I need to raise the value of the ExcessPhase to fix that...

The reason why I left the value of Align2 below is to customize DRCfir by referring to that. (For ExcessPhase)
And PSOutWindow can be 8192taps minimum? (If understand right, it's final filter lengh)


set frequency=48000
set WEL1=12000
set WEL2=8400
set WEL3=4200
set WEL4=3000
set WEH=1
set BCIW=1
set UPW=48
set taps=65536
set drc=F:\align2\files\drc\48.0KHz\normal-48.0.drc
set correction=1
set maxgain=0.03
set Fmin=20
set Fmax=300
set path=F:\align2\files\
set PTType=L

cd %path%
drc.exe --BCInFile=%ir-L% --MCPointsFile=%mic% --MCFilterType=M --MCOutFile=%directory2%%prefix%-irc-L.pcm --MPWindowExponent=%WEH% --EPWindowExponent=%WEH% --RTWindowExponent=%WEH% --MPLowerWindow=%WEL1% --MPUpperWindow=%UPW% --EPUpperWindow=%UPW% --RTUpperWindow=%UPW% --EPLowerWindow=%WEL2% --RTLowerWindow=%WEL1% --ISPELowerWindow=%WEL3% --ISPEUpperWindow=%WEL4% --PLStartFreq=%Fmin% --PLEndFreq=%Fmax% --PSOutWindow=%taps% --PSOutFile=%directory2%convolution\%prefix%-SDLC-L.pcm --PSPointsFile=%target% --MSOutWindow=%taps% --MSOutFile=%directory2%convolution\%prefix%-SDMC-L.pcm --TCOutFile=%directory2%%prefix%-ircd-L.pcm --PTType=%PTType% --PLType=M --PLMaxGain=%maxgain% --PSInterpolationType=H %drc%
drc.exe --BCInFile=%ir-R% --MCPointsFile=%mic% --MCFilterType=M --MCOutFile=%directory2%%prefix%-irc-R.pcm --MPWindowExponent=%WEH% --EPWindowExponent=%WEH% --RTWindowExponent=%WEH% --MPLowerWindow=%WEL1% --MPUpperWindow=%UPW% --EPUpperWindow=%UPW% --RTUpperWindow=%UPW% --EPLowerWindow=%WEL2% --RTLowerWindow=%WEL1% --ISPELowerWindow=%WEL3% --ISPEUpperWindow=%WEL4% --PLStartFreq=%Fmin% --PLEndFreq=%Fmax% --PSOutWindow=%taps% --PSOutFile=%directory2%convolution\%prefix%-SDLC-R.pcm --PSPointsFile=%target% --MSOutWindow=%taps% --MSOutFile=%directory2%convolution\%prefix%-SDMC-R.pcm --TCOutFile=%directory2%%prefix%-ircd-R.pcm --PTType=%PTType% --PLType=M --PLMaxGain=%maxgain% --PSInterpolationType=H %drc%

Sorry if I had too many questions!
 
Last edited:
To increase the strength of any phase correction at the low end you need to increase EPLowerWindow and associated parameters.

Try this
--EPWindowGap=32 --EPLowerWindow=1366 --EPPFFinalWindow=1366 --EPUpperWindow=32 --EPWindowExponent=0.97 --ISPELowerWindow=6547 --ISPEUpperWindow=400

If you need more than that be cautious
 
result.png


I changed the setting as you suggested and applied it.
Red and yellow are the results I made in Align2, and blue applied your values exactly as they were.
The original filter is similar to the phase I applied before.... =(

Is it better to make additional adjustments with phase to catch the excess status like that way? In Drcfir, I thought it would be possible to modify that part if I changed a certain value.
 
I have never tried to make a phase only correction so it is quite possible that the other parameters you set in the configuration are doing more than just stop minium phase magnitude correction as you are aiming for. I would think if your desire is to remove excess phase from a measurement rephase might be a simpler solution.

It is quite hard to help people without the full information of what the goal is and what you are working with. A phase chart without the magnitude and a reference to minimum phase makes it hard to see what you are aiming for.

The blue phase trace suggests you have a very slight overall time delay. You can get a lot of apparent phase change at high frequencies just from half to a single sample of delay from having the time reference slightly offset.
 
FWIW, I checked the normal.drc file (for 44.1)

EPLowerWindow = 1836 # 20.8 ms
EPUpperWindow = 44 # 0.5 ms
EPStartFreq = 20
EPEndFreq = 20000

20.8ms @ 20Hz is less than half a cycle at 20Hz, where 0.5ms is @ 10 cycles at 20Hz.

If you read section 4.2, it describes how its correction algorithm is applied from the start to the stop frequencies as well as the curve between those 2 points.

https://drc-fir.sourceforge.net/doc/drc.html#sec32

If you look at figure 4, it implies that the normal.drc window @ 20Hz is 500ms, @ 10 cycles at 20Hz implying much stronger correction in the lower frequency range than what is in the normal.drc file for Excess Phase. The chart shows transitioning 10 cycles at the start freq to 10 cycles at the end freq. This is NOT what is being done for Excess Phase.

DRC_FIR_CORRECTION.png

Code:
".... Figure 4:  Frequency dependent windowing for the normal.drc sample settings on the time-frequency plane. Logarithmic time and frequency scales. The X axis is time in milliseconds, the Y axis is frequency in Hz. ..."

The chart uses milliseconds (which is sample rate agnostic) instead of # samples used in the config files. # cycles is both sample rate AND frequency agnostic. This is why I added # milliseconds and # cycles to my mods to avoid confusion/pilot error when switching between sample rates.

A straight weighted curve (WE=1) across the frequency range would be:

10 cycles: 500 ms @ 20 hz
10 cycles: 50 ms @ 200 hz
10 cycles: 5 ms @ 2,000 hz
10 cycles 0.5 ms @ 20,000 hz

What I see in the normal.drc file for EP is top heavy, tapering top down from 10 cycles to 1/2 cycle. You appear to want more correction lower in frequency, so you might try increasing the window width of the start freq to 5 or 10 cycles.

This might give you stronger phase correction in the lower frequencies than half a cycle.
 
Last edited:
Hmmm, something doesn't look right with the lengths and ms comments from the config file. They seem to be out by a factor of 2.

EPLowerWindow = 1836 # 20.8 ms
EPUpperWindow = 44 # 0.5 ms
EPStartFreq = 20
EPEndFreq = 20000

(1 second / 44100) * 1836 samples is 41.6 ms
(1 second / 44100) * 44 samples is 0.99 ms

Code:
sr 44100, freq 1 : 1 CYCLE => window width = 44100.0000 samples, 1000.000000 ms
sr 44100, freq 10 : 1 CYCLE => window width = 4410.0000 samples, 100.000000 ms
sr 44100, freq 20 : 1 CYCLE => window width = 2205.0000 samples, 50.000000 ms
sr 44100, freq 200 : 1 CYCLE => window width = 220.5000 samples, 5.000000 ms
sr 44100, freq 2000 : 1 CYCLE => window width = 22.0500 samples, 0.500000 ms
sr 44100, freq 20000 : 1 CYCLE => window width = 2.2050 samples, 0.050000 ms
sr 44100, freq 22050 : 1 CYCLE => window width = 2.0000 samples, 0.045351 ms
sr 44100, freq 44100 : 1 CYCLE => window width = 1.0000 samples, 0.022676 ms

sr 48000, freq 1 : 1 CYCLE => window width = 48000.0000 samples, 1000.000000 ms
sr 48000, freq 10 : 1 CYCLE => window width = 4800.0000 samples, 100.000000 ms
sr 48000, freq 20 : 1 CYCLE => window width = 2400.0000 samples, 50.000000 ms
sr 48000, freq 200 : 1 CYCLE => window width = 240.0000 samples, 5.000000 ms
sr 48000, freq 2000 : 1 CYCLE => window width = 24.0000 samples, 0.500000 ms
sr 48000, freq 20000 : 1 CYCLE => window width = 2.4000 samples, 0.050000 ms
sr 48000, freq 24000 : 1 CYCLE => window width = 2.0000 samples, 0.041667 ms
sr 48000, freq 48000 : 1 CYCLE => window width = 1.0000 samples, 0.020833 ms
 
Last edited:
Don't think it is in error. You get half of the length before the peak and the other half after the peak. So the length represents the total, not the effective part of the filter, which still is a 20.8 ms window with the 1836 length at 20 Hz.

Haven't verified in my own templates but if you look at the sample from @dingdong3 one page ago, length was set to 12000 at 20 Hz, but in the on screen output, length is shown as 24000.
 
Last edited:
@wesayso @emailtim
Thanks. I haven't used Drcfir for a long time, so I don't know how to set up a direct cycle like 10 cycles and 4 cycles.
And I didn't have a problem with any setting, or with no correction applied at all, the image of the music was captured strangely.
For the efficiency of Tap, and to adjust it in a more desired way, I directly adjust a few parts of the band below the Schroeder frequency with an IIR filter (approximately-3~-5db) and phase correction like this.
I read the sections of drcfir one by one, but I think I was misunderstanding by sending your posts.
Thank you!

1685233825157.png


When I saw this end, I thought it was something different from the linear phase I used before.
First of all, I found the most satisfying setting in Align2 yesterday. I'll copy some of these values to DRC fir, and I'll have to fix it a bit more.

Code:
set WEL1=12000
set WEL2=8400
set WEL3=4200
set WEL4=3000
set WEH=1
set BCIW=1
set UPW=48
set taps=12288
set drc=F:\align2\files\drc\48.0KHz\soft-48.0.drc
set target=F:\align2\files\target\48.0KHz\flat-48.0.txt
set correction=1
set maxgain=0.03
set Fmin=20
set Fmax=300
set PTType=L

drc.exe --BCInFile=%ir-L% --MCPointsFile=%mic% --MCFilterType=M --MCOutFile=%directory2%%prefix%-irc-L.pcm --MPWindowExponent=%WEH% --EPWindowExponent=%WEH% --RTWindowExponent=%WEH% --MPLowerWindow=%WEL1% --MPUpperWindow=%UPW% --EPUpperWindow=%UPW% --RTUpperWindow=%UPW% --EPLowerWindow=%WEL2% --RTLowerWindow=%WEL1% --ISPELowerWindow=%WEL3% --ISPEUpperWindow=%WEL4% --PLStartFreq=%Fmin% --PLEndFreq=%Fmax% --PSOutWindow=%taps% --PSOutFile=%directory2%convolution\%prefix%-SDLC-L.pcm --PSPointsFile=%target% --MSOutWindow=%taps% --MSOutFile=%directory2%convolution\%prefix%-SDMC-L.pcm --TCOutFile=%directory2%%prefix%-ircd-L.pcm --PTType=%PTType% --PLType=M --PLMaxGain=%maxgain% --PSInterpolationType=H %drc%
drc.exe --BCInFile=%ir-R% --MCPointsFile=%mic% --MCFilterType=M --MCOutFile=%directory2%%prefix%-irc-R.pcm --MPWindowExponent=%WEH% --EPWindowExponent=%WEH% --RTWindowExponent=%WEH% --MPLowerWindow=%WEL1% --MPUpperWindow=%UPW% --EPUpperWindow=%UPW% --RTUpperWindow=%UPW% --EPLowerWindow=%WEL2% --RTLowerWindow=%WEL1% --ISPELowerWindow=%WEL3% --ISPEUpperWindow=%WEL4% --PLStartFreq=%Fmin% --PLEndFreq=%Fmax% --PSOutWindow=%taps% --PSOutFile=%directory2%convolution\%prefix%-SDLC-R.pcm --PSPointsFile=%target% --MSOutWindow=%taps% --MSOutFile=%directory2%convolution\%prefix%-SDMC-R.pcm --TCOutFile=%directory2%%prefix%-ircd-R.pcm --PTType=%PTType% --PLType=M --PLMaxGain=%maxgain% --PSInterpolationType=H %drc%


I think the values that I should organize and pay attention to the above settings that I was satisfied with are as follows.

Code:
MPWindowExponent 1.0
EPWindowExponent 1.0
RTWindowExponent 1.0
MPLowerWindow 12000
MPUpperWindow 48
EPUpperWindow 48
RTUpperWindow 48
EPLowerWindow 8400
RTLowerWindow 12000
ISPELowerWindow 4200
ISPEUpperWindow 3000
PLStartFreq 20
PLEndFreq 300
PSOutWindow 12288
MSOutWindow 12288
PTType L
PLType M
PLMaxGain 0.03
PSInterpolationType H
 
In REW try setting yout T=0 time to be halfway up the impulse peak or manually adjust the t=0 time until the HF phase moves to where you want it. This is just changing the static time delay. I think you might be surprised just how little delay it needs to upset this balance.

You can see some graphics and discussion about this here and the pages surrounding it
https://www.diyaudio.com/community/threads/a-3-way-design-study.376620/post-7329190
 
  • Like
Reactions: 1 user
@fluid Yes. I know T=0.
But, Still, it shows a different aspect from the existing phase.

1685245074587.png


This is Blue is from Align2, yellow is made from DRCfir.

1685245139269.png


And if i manually correct t offset,
1685245171177.png


1685245192748.png


Still, after 4khz, it tends to be different from conventional filters.

One question I have is that the filter files from Align2 and DRC designer are located exactly at the impulse peak, even if the impulse is not adjusted to t every time.

I think I might have set the wrong option to detect impulses in DRC fir.
 
@dingdong3

You might want to check out MSFilterDelay to see if it applies to your questions.

MSFilterDelay

6.13.3 MSFilterDelay​


This parameter add an initial delay to the filter, making it possible to align it with other filters. Usually it is set to the same value assigned to EPLowerWindow, so that the filter has the same latency of the mixed phase filter when PSFilterType is set to T. If you want a zero delay filter set this parameter to 0.
 
Hello knowledgeable people.
I am very interested in the "DRC".
The automatic tools I've used are Sonarworks, DiracLive and GLM, and the only manual experience I've had is with Rephase.
I used to correct the overall phase in Rephase, check for excess phase in REW, and cut or invert the unnecessary parts.
Of course I liked that too. Because it meant something to me that my experience had lasted.
But then I discovered DRC-FIR and I've been drowning in a sea of information and I can hardly contain my joy. I am so happy.

However, there were quite a few variables that I had to play around with.
My goal with Rephase was and is the same.
It is to mimic DiracLive's PhaseCorrection.
Has anyone else had this same goal before me? Most seem to be doing weak reflections correction.
I'm looking for a value that can simulate this.

When I used DiracLive, I didn't save the messurement in REW, so I couldn't do a comparison analysis.
So I'm going to borrow a REW file from another user on another site, who was also trying to mimic Dirac and was using Rephase and DRC designer.
If uploading a file is an issue, I'll remove it.

I would appreciate it if knowledgeable geniuses could help me analyse the variation in this measurement to estimate something similar to the value in DiracLive.

First of all, the file I tried in DRC fir was soft, but if you look at someone else's file I posted, the pre-echo before Step Response 0 is almost perfectly matched to 0 when using Dirac, and you can see a very clean filter.
=
And
The first file is a general measurement file, and the second compressed file is the shape of the filter that I separated using REW arithmetic.
I want to make that shape.
 

Attachments

  • Karl Raw vs Dirac.mdat
    3.7 MB · Views: 33
  • Karl Raw vs Dirac 2.zip
    8.3 MB · Views: 45
Last edited:
@emailtim
You're like Santa at Christmas, it's a miracle.
How did you do it?

I fixed it to a sample rate of 48khz and was experimenting with the normal filter. But I was getting frustrated because the results I was getting were not at all what I was expecting or aiming for.
The filter you created is exactly the DRC-fir value I was looking for.
 
@emailtim
You're like Santa at Christmas, it's a miracle.
How did you do it?

I fixed it to a sample rate of 48khz and was experimenting with the normal filter. But I was getting frustrated because the results I was getting were not at all what I was expecting or aiming for.
The filter you created is exactly the DRC-fir value I was looking for.
Lucky Coincidence.

Here is the Minimum Phase target I have been testing with and what is in the plots above.

It is 256K taps, 176.4kHz, symmetric 96dB LR band pass at 15Hz and 26kHz.

It has flat amplitude where your DIRAC has a bit of tilt in it.
 

Attachments

  • BL_XO_FULL_MP.mdat
    2.1 MB · Views: 33