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

Loopback in JRiver

As Thierry said, the loopback function of the JRiver allows to play every sound passing in Windows (music, video, REW, even system sounds;)) . The captured sound is then be convoluted in JRiver with any DSP you need, easy and nice.

Te simplest way is to create a zone in JRiver for/with loopback. The playback has then be started in that zone and voilà.
 
Is there a convolution engine that can run as some kind of driver or virtual device or whatever, so that every sound that windows plays (e.g. Firefox, windows media player, foobar, REW, etc) can connect to it?
If possible, a (link to a) setup guide would be helpful. Thanks
Your "convolver" is a plain simple FIR filter applied to audio. It doesn't need to be long for properly linearizing speaker drivers. This is quite simple actually. Please tell me, do you want to do something else with a FIR filter, like battling against rooms echoes? In such case, good luck ...

What's less simple, as you wrote, is to persuade Windows to send the stereo audio (like after the Windows mixer) not to some soundcard hardware, but to the FIR filter instead.

There have been extended discussions in XBMC and VLC forums about this. Actually those forums are the wrong place. Surely getting the equivalent of the Winamp DSP Studio on XBMC and VLC would be a nice addition. It is about time. Winamp has it since 10 years. Actually, the wheel has turned. We want to have the audio DSP applied, not only on XBMC audio or VLC audio, but on all the audio that's delivered by the Windows PC, after the Windows mixer. And, most important, we want to obey the VST standard.

What's concerning me, I use audio DSP for linearizing my speakers, actually individually linearizing my speaker drivers before applying some "perfect" digital crossover to feed them.

You can see this approach is action here, in a simplified manner. It relies on a state-variable full complementary 2nd-order IIR filter, which is far from a "perfect" crossover, as it introduces massive relative phase shifts. You may substitute the 2nd-order IIR filter by anything you like : FIR-filter based crossover, IIR-filter based crossover, etc.
DSP Robotics Support • View topic - WinXP directly driving two 4-way active speakers.

A realtime application can continuously measure the speaker frequency response, for automatically computing the FIR filter (convolver) that's required for linearizing the speaker frequency response. One can add a Linkwitz Transform for linearizing the deep bass end, using a plain simple 2nd-order IIR filter.
DSP Robotics Support • View topic - Speaker Lab

You may experiment with :
- The warped FIR filter (I don't like, as it degrades the phase) DSP Robotics Support • View topic - time-domain FIR filter (Convolver)
- The bidirectional IIR filter (I like very much, simple and linear phase, also applicable to very low frequencies) DSP Robotics Support • View topic - Bidirectional IIR filter

Thus, for building a stereo audio system on a Windows computer, strictly obeying the VST-ASIO standard, you may organize this way :
- rely on VAC (Virtual Audio Cable)
- rely on Flowstone (designing a .fsm that you will save as .exe)
- using Flowstone, design a stereo active 3-way system running on ASIO
- rely on ASIO4ALL, for enabling the ASIO subsystem of Flowstone to talk to the ubiquitous 8-channel HDaudio hardware that you may have in your computer (four stereo 3,5 jacks)
- possibly buy a decent multichannel USB audio hardware like the Asus Xonar U7 7.1 USB Sound Card (it seems to come with a custom ASIO driver)
- carefully and individually linearize the gain and phase of all speaker drivers using 64-tap or 128-tap FIR filters, which means that if you have 3-way speakers, your PC will execute six FIR filters before the crossovers
- for the crossover, rely on the bidirectional IIR filter (doesn't eat much processing power, and is phase linear by nature)
- reshape the deep-bass end using the 2nd-order IIR-based Linkwitz Transform (doesn't eat much processing power)
- put a bass/treble control before the whole chain using two 1st-order IIR filters in cascade, as shelving filters (doesn't eat much processing power)
- determine if you need a dedicated hardware volume control after the DACs
- determine the best Lepai or Lepy power amplifiers (analog or Class D)
- determine the best power supplies (analog or switched mode)

Actually, by saving the .fsm as a .exe, you will bypass the normal VST approach of launching a VST host, and loading a .vst into it.
You can consider the .exe like a mini VST host, automatically loading itself, and automatically loading the .vst corresponding to your .fsm.
Indeed, if you are fluent with the VST environment, you can save your .frm as a .vst. You can launch a mini VST host, and load your .vst into it. At the end of the day, you'll have your computer running your .vst. However, why would you bother doing so, with flowstone offering the possibility to directly save your .fsm as a .exe. Please note that .vst files don't exist as such. They are saved under the .dll extension.

So you see, the .exe save feature of Flowstone is a nice simplification. In case you are willing to experiment with this, please let me know using a PM, and I'll go along with you. Looks like a nice summer project, indeed.
 
Hi,
I’m new on this forum and I’m writing because I started to use RePhase (ver 0.9.7) some days ago.
I hope to write in the correct thread.
I find RePhase very useful, a very good software but I’m encountering some problems in its usage.
I generate a filter for flattening the phase but the filter behavior isn't the one expected.
I try to explain in a detailed way…

GOAL: I would like to flatten the phase of a two-way speaker. The loudspeaker has its own crossover, I would like to generate a single all-pass FIR modifying the phase from 300 Hz to 16kHz.

STEPS:
- I use CLIO and I export an Impulse Response as “.txt” file. The phase information is the “minimum phase” information because I would like to modify that part of the phase.
- RePhase imports correctly the curves (amplitude and phase)
- I start to flatten the phase using “Paragraphing Phase Eq”
- When the result satisfies me I move to the “Impulse Settings Section” for generating a “minimum phase filter”:
o Taps = 400
o Centering = Middle – float
o Windowing = “Hamming”
o Optimization = “extensive” -80dB (what is the meaning of this value? I tried also with -20dB...)
- Pressing “Generate” I save a filter in wav format
- I upload the filter on my hardware convolver FourAudio HD2
- I measure the speaker with and without the filter but… nothing changes… SIGH!

NOTES:
- I’m sure of the correct conversion from wav to HD2 convolver format (is an xml file containing the coefficients).
- The behavior of the filter is the same of an all-pass
- The Impulse Response is delayed of the right number of samples (the number indicated by RePhase during the generation) and the filter is not a clean Dirac’s Delta (some samples around the peak has an amplitude different from zeros).
- The same thing happens if I use a linear-phase filter (the peak is in the middle of the filter)

Any suggestions?
Is there something that I’m missing?
Any old posts on similar problems to suggest me?
Something goes wrong but I can’t find the solution…

Thanks a lot!!!
Kep
 
Hello Kep

Can you share your .rephase settings file?

You can test if everything is working correctly by generating a big amplitude correction, like a HP an LP at 1kHz. This kind of correction will be readily audible and you should be able to immediately tell if the convolution is doing its job.

If you can give me the specifications of the XML format used by the HD2 I could generate it directly in rePhase. That would probably help other people too.
 
Hi Pos,
thanks a lot for your interest in my problem.
After few hours of trials I’ve found the problem. I wrongly exported from Clio the “minimum phase” data, not the “Normal Phase” data!!! Exporting the correct measurements data everything worked!
I apologize for the long previous post, it was a consequence of my frustration… :(

So, at this point, do you still want to work on the “xml-export” for HD2 FourAudio? Somewhere I have a document with the details of this format and, if you want, I can send it to you (Maybe I should ask to FourAudio guys if I can share the document with you but I think it should be a “yes”). I’m also at disposal for testing the generation of the file.
Actually I generate the filter in WAV format and I convert it with a Matlab script.

At the end I have a question for you and for the other users: could you give me some references (papers or web sites) with good explanations, tricks and tips for loudspeaker phase tuning?

Thanks a lot,
Kep
 
Administrator
Joined 2004
Paid Member
A Question About Phase

I may have asked this before, but can't find it.

When I export the FR as text from HOLM and unwrap the phase, it is usually off by 720 to 1440 degs or more in rePhase. Why?

I've used different methods of setting the impulse in HOLM, but none help. Using the delay in rePhase just twists the high frequency phase.
There most be something I'm doing wrong in HOLM or the export, but I can't figure out what. Any ideas?
 
I may have asked this before, but can't find it.

When I export the FR as text from HOLM and unwrap the phase, it is usually off by 720 to 1440 degs or more in rePhase. Why?

I've used different methods of setting the impulse in HOLM, but none help. Using the delay in rePhase just twists the high frequency phase.
There most be something I'm doing wrong in HOLM or the export, but I can't figure out what. Any ideas?

Hi Pano
Can you post a measurement?
It’s hard to tell from the description alone but;
In a loudspeaker where the drivers are the same distance to the measuring position (like one over the other) then what one sees is the individual driver phase shift added to that produced by the crossover. To be clear this is the acoustic phase view of things and not the "minimum phase" view of the amplitude response.

Here, one ends up with a crossover related phase shift that (once past a first order) that has 90 degrees of rotation per order. With a Bessel, Butterworth or L&R 4th order xover, one has 360 degrees of rotation going from well above to well below xover. A 3 way system with 4th order slopes will have two sets of 360 degree phase shifts added to whatever the phase is from the drivers response.
In these cases, the time delay the phase shift denotes is such that the LF is behind the HF part of the output.

If you have a system where the HF is not physically in line with the LF, then that offset is added to the phase shift. If one has set the front / back driver location using the reversed polarity and Null listening test approach, one can be increments of 360 degrees off, either forward of back. Then one is “in phase” but off 1 cycle or more either way.

I have not used HOLM but do use ARTA which is similar. ARTA has a phase correction time delay that one can diddle the time to fine tune the phase to where it “looks right”. The TEF / TDS approach has an ETC measurement one does first to unambiguously find the correct time while Smaart finds the delay automatically. With both ARTA and smaart one should average a number of measurements to reduce the measurement to measurement variation (noise), with Smaart a 5 or 10 second measurement (or running until the coherence trace stops moving around) is sufficient, with ARTA averaging 5 or more measurements is sufficient. In both cases, if taking a measurement for DSP correction (Re-phase) , apply a 1/6 to 1/12 octave smoothing to further reduce the artifacts you shouldn’t try to fix.
Hope that helps
Tom
 
Administrator
Joined 2004
Paid Member
Hi Tom. I missed you at Infocomm this year. Every time I went to either the booth or the showroom, you had "just left". :( Oh well. There were some amazing NXT type speakers I wanted you to hear.

Back to rePhase.
I looked at the exported FR and phase text files from HOLM. It seems to start phase 0 at 0 Hz and drop from there. I can import that into Excel and correct it, but have not found a way in HOLMImpluse to set 0 degs to any certain point, E.G. 1Khz.

I will post a plot.
 
Administrator
Joined 2004
Paid Member
Here is an example plot. You can see the huge phase shift. It goes form approximately -1200 to -1800 degs. That's what's in the exported text file.
Pulling 1200 to 1500 degrees out of the text file at least makes the phase line cross zero, which is handy.

Guess I need to poke around in HOLM to see if that can be corrected during export.
 

Attachments

  • Phase_Export.png
    Phase_Export.png
    4.5 KB · Views: 477
Here is an example plot. You can see the huge phase shift. It goes form approximately -1200 to -1800 degs. That's what's in the exported text file.
Pulling 1200 to 1500 degrees out of the text file at least makes the phase line cross zero, which is handy.

Guess I need to poke around in HOLM to see if that can be corrected during export.

Hi Pano
That is odd. Is this without any DSP?
The curve (the phase shift between 400 and 1600Hz) suggests a 4th order crossover however the overall phase offset is puzzling.

As jmbee suggests, if you can, post the impulse with the T=0 shown.

If you can “fake” the curve up so that say 400Hz is around zero, you should be able to fix the rest in Re-phase. If you can make the phase flat around zero all the way up, it will be acting like a single point in time.
Sorry I missed you at infocomm, it was a very busy show this year, if you go to Orlando for the next one I will see you there!
Best,
Tom
 
Administrator
Joined 2004
Paid Member
I don't understand why you measure the impulse before to start?
I don't understand what you mean. The peak is at zero.

Hi Pano
That is odd. Is this without any DSP?
There is some mild room EQ and active crossover. No other DSP. This is at the listening chair, about 14ft from the speaker.

The curve (the phase shift between 400 and 1600Hz) suggests a 4th order crossover however the overall phase offset is puzzling.
Correct. Between woofer and horn there is a 4th order crossover circa 750Hz. Tweeter comes in about 7500Hz

I just did find that if you limit the frequency range of the HOLM export, there is less phase shift. E.G., starting the export at 20 Hz gives a maximum shift of about 720 degs. This seems to be a HOLM quirk.

As jmbee suggests, if you can, post the impulse with the T=0 shown.
See post above.

Hope to see you in Orlando.
 
After more than a year without any update, here is rePhase 0.9.8

rePhase | SourceForge.net

Code:
0.9.8 2014-09-28
    - minimum-phase filters tab with common IIR filter types:
        * 1st order
        * 2nd order with arbitrary Q
        * Butterworth with slopes ranging from 6dB/oct to 996dB/oct in 6dB
          increments
        * Linkwitz-Riley with slopes ranging from 12dB/oct to 996dB/oct in
          12dB increments
    - 'compensate' mode for generalized arbitrary order Linkwitz
      Transform-like manipulations in minimum-phase filters tab
    - new centering options expressed as a percentage to easily obtain
      matched delays
    - default to "middle" centering instead of "energy" to avoid delay
      mismatch problems for the unaware user (principle of least surprise)
    - praxis measurement format handling, scientific notation in frequency
      column
    - smaller executable, new installation method
    - bug correction: crash on impulse generation with some specific filter
      settings
    - directory handling bug correction
    - measurements can now be loaded from the command line or drop on exe,
      similarly to settings
    - revamped file extension handling (settings)
    - revamped icon
    - smoothed out taps/fft size calultation