New effect to consider including: Localization Cue Correction
Hello,
I have a repository which represents a work in progress that I started yesterday. https://github.com/alankila/easyeffects/
It implements a new DSP effect as a processor in easyeffects called Localization Cue Currection. It is a crossfeed reduction plugin for over-air stereo speaker system. The idea is to estimate the sound about to hit the contralateral ear of a channel, and play a canceling waveform on that side's channel that will hit at the same time as the sound. It works like a digital absorption barrier in middle between channels, reducing the degree they are allowed to mix.
If the parameters are right and you turn the effect on, the sound immediately migrates from the somewhat forward angles of regular stereo to cover about the 180 degree arc. Some sound will appear to come directly from the side. The tone of the phantom center is also somewhat altered, probably due to the reduction of the comb filtering inherent to a phantom center.
It has only two parameters: delay and decay. The delay will be about 300-400 microseconds for most configurations, I think, and represents the time difference for when sound from the 2 channels hits either ear, for example the time delay from the left channel to right ear and right channel to right ear, which represents the situation where you are reducing the left channel's sound in the right ear. You can calculate this just by drawing the geometry of your listening position, or just use noise on either channel to find the delay value that seems to cancel the noise the best. When the delay is right, sounds panned to left or right will likely seem to come directly from the side.
The decay sets the level of the effect. It should create a deep cancellation, but not overpower the sound of the contralater channel, in which case it becomes an artifact and just messes up the stereo image and probably causes tonal coloration as well. I have not yet really established the desired filter curve for the contralateral audio cancellation, so this part is probably the weakest overall right now.
I'd be thrilled to have this effect one day appear in easyeffects. I'll probably work on this over the next weeks and try to find some measurement data that I could settle some of the questions that for now have been just tuned by ear. Still, even in this present rough form, it is definitely a nice toy and I think it is providing a substantial sonic improvement to my own listening experience.
If per-channel room correction is performed via FIR or IIR filters, this effect should be used after them. This plugin is all about canceling the direct sound using other direct sound, and it works poorly if the channels are asymmetric for any reason.
The UI is very bare bones, but shows my current actual setup.
Interesting. It is unique enough to justify its introduction. Let me know when the code is ready for testing.
I think the code is now ready for testing. I spoke about few weeks just couple of days ago, but it seems to me that all I had to do was to design some biquad filtering capability and then fit couple of filters in REW to estimate the HRTF interaural level difference of a KEMAR head fixture inside the program. I think doing this pretty much closed all the questions and made the effect sound pretty good at least to me!
This is the fit I made. Dark green shows the sound as received by ear on side of the speaker; dark red shows the contralateral ear's situation for the same stimulus. Orange curve is the difference, to be equalized down, and the light green trace is the error left over from the equalization. It doesn't matter how the error behaves past 6 kHz because the HRTF get highly individual and there's a lot of attenuation by that frequency, already in the cancellation signal.
I also added a "lite version" checkbox, for processing the middle channel only by doing middle/side transformation on the audio and then only putting the middle channel through the effect. This reduces the phantom center comb filtering issue without producing a very wide stereo picture because the unprocessed side channels still produce localization cues that limit soundstage width. I personally do not use it, but it could be useful for those that feel the very wide soundstage to be overhwelming.
Some caveats are left. I noticed that if album is already processed for spatialized audio, e.g. with QSound technology, then this effect "overcooks" the sound and makes it weird. In these kind of situations, the effect has to be turned off.
I'm sure there are some comments about my C++ coding practices. I am almost 100% a Java guy. I'll fix what is needed as issues are raised. I also wrote copyrights in my own name, do you want these transitioned in case testing goes well and merging is in order?
I also wrote copyrights in my own name, do you want these transitioned in case testing goes well and merging is in order?
I do not see any problem in also having your name in this plugin copyrights. You developed it after all :-). It is just a matter of following the same pattern as in https://github.com/wwmm/easyeffects/blob/master/include/autogain.hpp. Below the line that shows my name put something like "Localization Cue Plugin algorithm implemented by ....". It should be ok.
Alright. I mimicked the copyright line from other files and added a secondary line. I'm not sure about the LCC name because here is a plugin by same name https://www.foobar2000.org/components/view/foo_dsp_lcc which I googled earlier this week. I intended to implement that, but as it doesn't work with equilateral triangle listening, I had to redesign the whole thing, and now all that is left is the both are based on some kind of stereo reverb. Thus, a new name might be in order.
I am considering something along the lines of "Hemisonic" or even crazy ones like "Jam With The Band". These attempt to convey the idea that the plugin increases envelopment and wraps the soundstage into a 180 degree arc around the listener. It also improves the tonality of the center channel, which might be very interesting to some people, but is not the story I would lead with. The center is better, but at least for me the music expanding around me is the real drug.
Some cheeky names like "Straight talk" is pun on the idea that this reduces crosstalk, and this plugin is, in some respects, the opposite of crossfeed. Let me know what you think about the names, and we'll pick one.
Let me know what you think about the names, and we'll pick one.
Hum... Looking from the point of view of someone that has never used this kind of plugin and taking into consideration how other plugins available on EasyEffects had their names exposed to the users I would use something on the lines of Crosstalk Remover or Crosstalk Canceller. A little "boring" 😄 but I think it will give the users with less technical knowledge a simple idea about what the plugin does.
Yeah. Let's give it a sensible name that is as neutral and simple as possible. I'll use the word "canceller" in the name, because that's what it does. I like that it starts with C so it's fairly early in alphabet and next to the Crossfeed plugin, which is doing something related. So I christened it (Loudspeaker) Crosstalk Canceller, with the L being silent, so that I don't have to rename the code files. LCC also stands as homage to the O.G. algorithm, I suppose.
Today, I added a final missing DSP enhancement after I started validating the performance with REW and I realized that I had almost 180 degrees of phase shift in bass, and around 90 degrees in the range where the effect is operational. This threw the timing and cancellation off, which is probably why I had some issues. I added an allpass filter that warps the direct sound path phase at roughly same pace as the feedback path, so that the phase difference between them is minimized. This makes the sum correct, and there's only an inaudible impact to group delay.
I think there's always something minor you could be tweaking in an effect, but I've listened for hours now without spotting any issues that I feel need correcting, and in fact I've started to notice a whole bunch of new sounds and minor details in songs that the improved processing makes more clearly audible. Even QSound tracks sounded tolerable now, rather than obviously artifacted, though I still think they are a little overcooked. I think a better version would entirely eliminate the minor -20 to 20 degree phase shifts that remain between cancellation and direct sound by using e.g. a linear phase equalizer, but that is a quite a lot of complexity for potentially negligible benefit, so I'm not going to do that, I think.
I think this effect passes my own validation and should be ready for wider consumption. I believe that if you have a treated listening room, this effect allows the second most important sound upgrade after DSP room correction. The fact center channel sounds right is wonderful, and the soundstage is in my opinion just fantastic, too.