crossfeed dsp plugin?

Discussion in 'Effects and the DSP' started by wilho, Jun 7, 2003.

  1. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    Hi!

    This is partially question and another part request, cos I know the answer ;)

    So is there dsp plugin for Headphone crossfeed, or can I do it right with current stuff?

    I have allready mixed channels like this:
    [​IMG]
    Wheres pans are set to 50/50, and crossing channels cut down to 33% in mono mixes.

    Problem is that thats not all, there should be ~0.3 ms timeshift in crossover signal. Delay should be lower at higher frequences to prevent shadowing effect. Allso some frequency shaping ( cutting down lower frequences of crossover signals ) for good acoustic effect might be required...

    EDIT: Here's an guide to DIY device for correct crossfeeding with some theory, for those who are interested
    EDIT2: Another good link. Search for a "The Psychoacoustics of Headphone Listening"


    Dsp coders, here's you're next challenge :) ....which reminds me - is there any tutorial / document to dsp-coding? I thought that maybe I could make simple timeshifter, even that's better than nothing.
     
    Last edited: Jun 7, 2003
  2. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    double, sorry
     
  3. Mata Hari

    Mata Hari Active Member

    Joined:
    Feb 12, 2003
    Messages:
    214
    Likes Received:
    0
    Trophy Points:
    26
    If I understand it all correctly, you want to mix left with right for some 33%, and have 3 ms delay on that line..?
    you can fiddle around a bit with the sourounder plugin, and mix the rear channels with the front channels, crossed.
    The rear channels in the surounder have a settable delay (or actually the front channels)

    Maybe, the surounder, even has a workable preset allready, if not, then this would be a great addition I think.
     
  4. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    You understood just right. Thanks for a hint.

    I'm not quite sure that I found all possible use of surrounder, but it seems to me that what it does is that it adds timeshifted and original signal to rear output. That's at least better than nothing, but not exactly what I need - which is crossfeeding the timeshifted signal only. And of course, there's still that frequency-related amount-of-delay still missing.

    Damn portable headphones, allways runs out of battery... I'll have to take a charging brake to experimenting...
     
  5. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    If, someone is interested to try this out, I got some decent results with chain crossing-channels -> delay (found in this thread) 1% of .5S = 0.5ms -> lowpass -filter -> and finally stereo-mixing 100%orig/40%crossed-channels.

    I had to do that lowpass-filtering, becouse slightly delayed voice with original creates harshness or somekind of ringing in high frequences (shadowing effect).
     
    Last edited: Jun 11, 2003
  6. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48
    I hope I have the working version of such plugin for EAX/DirectSound3D spatialization stuff as soon as I start coding spatialization :)

    /E
     
  7. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48
    >> When do you start coding

    hmm.. I'm unsure :)

    anyway, a working plugin would be a good contribution from the kX Community :)
    so, you (or anybody else) can start coding the plugin right now ;)

    /E
     
  8. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    Oh and I wondered why it sound bad after all, when I got over my thrill - it was 0.5ms what I wanted. Check graph: [​IMG] - I had over 10 times more delay than needed.

    Somebody with interest of physics could calculate right values, I don't know them exectly, I just cutted as it sounded best for me. As said purpose was only to get rid of that affect of combifilter. I'm very accurate and helpfull here, right? Anyway, as bass frequencies below 100Hz are irrelevant in terms of sensing direction and space, they should be removed too.
     
  9. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    Man, you just became my personal hero :D. I'll let you know how it worked for me when I get home from work.

    edit: Not bad at all, It passed even my ultimate test - quakeworld DM challenge; Ihave listened those explosions countless of hours, so It's quite easy to notice littlebit smaller differences too ;) Might be that It's even better without that highpassfilter - It can be done with separate plugin anyway, and there's allways that lack of gprs's, and results are pretty good without it too.

    This is quite much what I was looking for. Thanks.
     
    Last edited: Jul 17, 2003
  10. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    I should think beforehand...I'll never learn. :rolleyes: It's definitely good thing to have.

    What filter/mix values you ended up to use? Lopass was at 50 % its ~1000Hz, how about hipass?

    Hmm, with kxl-version and gui - how would you describe it - I wouldn't have to ask. There's lot of good .da sources floating around boards...somebody should collect them, and if needed, compile them as 'real' plugin with gui, and put them available. Would it be quite easy, because you can export to C from .da with kxEditor, and there's that kx-sdk available? Eyagos, your page, translate it in english as you said somewhere!

    Nah, playing is more fun than listening it's noise...

    What I have listened so far, 3d spatializions and such usually do more harm than good - might be that I haven't heard good one yet, but this 'lite' -version here seems better to me, that is if we are talking about mixing/mastering/listening music. Games are all another thing, It's very nice that we are going to have hw-3d to Kx.

    Oh, then you do have some speakers, and propably nice ones bacouse you're talking about near-field monitors. I don't. :sigh: Well, nobody else is listening my mixes, so it won't matter don't you think :)
     
  11. wilho

    wilho New Member

    Joined:
    Jan 14, 2003
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    0
    Came back to this thread, and all LeMury's messages have been disappeared!!? ...well, here's his code again, if somebody is interested.

    ;---------------------------------------------------
    name "Xfeed";
    copyright "By LeMury 2003";
    engine "kX";
    created "07-19-2003";
    comment "Headphones Crossfeed Filter";
    guid "c7c0735d-ab70-4dd1-b743-d658b8c210f7";

    ;registers
    input inl, inr
    output suml, sumr
    control Hipass=0.5
    control Lopass=0.5
    control X-Mix=0.5
    static tl1=0x0, tl2=0x0, hl2=0x0
    static tr1=0x0, tr2=0x0, hr2=0x0
    temp tmp, tmpl, tmpr, f
    ;code
    macs tmpl, inl, 0, 0
    macs tmpr, inr, 0, 0
    exp f, Lopass, 0x7, 0x0
    macsn tmp, tmpl, tl1, 1
    macs tl1, tl1, tmp, f
    macsn tmp, tmpr, tr1, 1
    macs tr1, tr1, tmp, f
    exp f, hipass, 0x7, 0x0
    macsn hl2, tl1, tl2, 1
    macs tl2, tl2, hl2, f
    macsn hr2, tr1, tr2, 1
    macs tr2, tr2, hr2, f
    macs suml, tmpl, hr2, x-mix
    macs sumr, tmpr, hl2, x-mix
    end;
    ;---------------------------------------------------------
     
  12. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
  13. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    Hi Eugene,

    As promised here is the 'Headphone Speakersim' stuff again.

    I first add some simple backgound info for other ppl who just 'tuned in' ok?

    The original intention(purpose) of this plugin was to get rid of the
    'stringent' Left/Right stereo field common in auditing stereo music over Headphones.

    When auditing over a 2 speakers stereo system, there is always 'crosstalk'.
    I.e. left ear always hears a 'portion' of the Right speaker and vica versa.
    That 'portion' is not simply an attenuated copy of it's original.

    According to research in 3D positional audio, that crosstalk portion
    is attenuated, colorized and delayed/phaseshifted.
    These phenomenas are reconstructed in so called 'head-related transfer functions' (HRTFs).
    So far for the theorie. Ppl can check the various 3D links for in-depth info.

    Back to the plugin:
    For simplicity sake we leave out Room accoustics, coming close to
    'Near Field Monitoring' over speakers which also (tries) to rule out
    room accoustics.

    We take a 'copy' of the Left input, cut some high freq, delay it
    and feed/mix some to the Right output.
    Same for the Right input. Hence,..Crosstalk (CrossFeed..duh)

    **So basicly we are just 'narrowing' the stereo field in certain freq bands**
    I.e. mimicing Near Field monitor speakers over Headphones.

    To make the 'Crosstalk' signal I used a very simple LowPass IIR filter;
    // c = 0..1 (1 = passes all, 0 = passes nothing)
    // output(t) = output(t-1) + c*[input(t)-output(t-1)]
    // out_new =old_out + c*(in_new - old_out)
    // out = t1 + c*( in - t1)

    IIR filters act like analog filters and in this case gives the desired delay of ~0.3msec,
    and ,of course, cuts high frequencies in the Crosstalk signal.

    This is a very 'Experimental' plugin! (A toy if you wish)
    I also added a HighPass to cut lows and a control to 'flip' the Crosstalk signal phase 180 degrees.
    One can mess with the stereo field. Either 'Narrowing' or 'Widening' it.
    In extreme settings it can act as a 'Vocal Remover':)
    (this works bad with some mp3s, because of the mp3 compressing algo's etc)
    (use it on a good stereo source and hear stuff normally 'masked' by other stuff in a mix.:))
    Playing around with this thingie also proofs that high freq determine stereo position much more than lower freq.

    For it's intentional purpose however, it should be set to a very subtile Crossfeed.

    For ppl who actually want to use this plugin;
    -keep in mind that the Lopass and Hipass sliders set the cutoff points!
    -XPhase at 0 = Inverted, 100 = NOT Inverted
    -Dry_Wet at 0 = All dry, 100 = All wet (set to 100 to hear the crosstalk signal only)

    Here is a freq response plot of various filter settings (same for LP):
    http://members.home.nl/nahutec/kxplugins/hipass_graph.jpg
    (I've put in an exponential filter control to get a 'human' control)

    Here is the documented dsp code for all you 'code lurkers'..:)
    Or DL it here:
    http://members.home.nl/nahutec/kxplugins/crossfeed.da

    ;crossfeed.da
    ;---------------------------------------------------------
    name "Crossfeed";
    copyright "By LeMury 2003";
    engine "kX";
    created "08/23/2003";
    comment "Headphones Crossfeed/Vocal Remover";
    guid "6fa996e3-857e-4456-9865-a6cf624fc349";

    input inl, inr ;
    output outl, outr ;
    control Lopass=1 ; lopass cuttoff freq
    control Hipass=0 ; hipass cuttoff freq
    control XPhase=1 ; xfeed phase 'select'
    control Dry_Wet=0.5 ; direct/xfeed mix
    static tl1=0x0
    static tl2=0x0, hl2=0x0
    static tr1=0x0
    static tr2=0x0, hr2=0x0
    temp tmp, tmpl, tmpr, f

    ; read inputs
    macs tmpl, inl, 0, 0 ; get L dry sample
    macs tmpr, inr, 0, 0 ; get R dry sample

    exp f, Lopass, 0x7, 0x0 ; exp scale lp filter coef
    ; left lopass
    macsn tmp, tmpl, tl1, 1 ;
    macs tl1, tl1, tmp, f ; (tl1 is lp out)
    ; right lopass
    macsn tmp, tmpr, tr1, 1 ;
    macs tr1, tr1, tmp, f ; (tr1 is lp out)

    ; feed lopass output into hipass
    exp f, Hipass, 0x7, 0x0 ; exp scale hp filter coef
    ; left hipass
    macsn hl2, tl1, tl2, 1 ; tl1 is input to hp
    macs tl2, tl2, hl2, f ; (hl2 is hp out)

    ; right hipass
    macsn hr2, tr1, tr2, 1 ; tr1 is input to hp
    macs tr2, tr2, hr2, f ; (hr2 is hp out)

    ; make inverted xfeed signals
    macsn f, 0, hr2, 1
    macsn tmp, 0, hl2, 1

    ; pan/'select' between normal and inverted xfeed signal
    interp hr2, f, XPhase, hr2
    interp hl2, tmp, XPhase, hl2

    ; pan/mix between dry and crossfeed sigal, output
    interp outl, tmpl, dry_wet, hr2
    interp outr, tmpr, dry_wet, hl2
    ;-----------------------------------------------------------------
    end;

    Eugene,
    Allthough 3D HRTFs related, this stuff is more 'basic Binaural 2D' as I see it.
    Anyway, maybe it's usefull to your research in some way.
    Apart from that, if any (user) interest, I can dll it for UI stuff etc.

    Regards,

    /LeMury
     
    Last edited: Aug 31, 2003
  14. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48
    thanks -- I'll try it :)

    btw, concerning the 'best speaker simulation':
    do you have WinDVD installed? it has an option to output to 'headphones'
    in this mode it uses either 'Dolby Headphones' or 'SRS Headphones' algorithms
    these algorithms emulate 'room experience' (and have a slider 'room size': small, medium, large)
    the '5.1' input (well, '5.0') is placed in this virtual room

    that is, the desired effect should have 5( 6 ) inputs (center, left/right, surround left/right, rear center) and should create a virtual room experience (to be experienced with headphones)

    the algorithm is really a kind of HRTF with phase / delay / colorization...
    similar algorithms were created by Creative ('Headphones' mode), Sensaura and QSound

    a possible place for this effect in the present kX DSP layout: a preset for the Surrounder effect

    and, btw, without a crosstalk, such effect [could] produce a more 3-D-like surround for 2-speaker configuration

    so, the goal is to reproduce Dolby/Sensaura/QSound-like surround effect: including both 'virtual speakers' (5->2 stereo) and 'virtual room' (5->headphones)

    I understand that this is not an easy task -- moreover, a real surround effect might require some scientific researches (with HRTF modeling :)) -- and the usage for this effect will be limited for gaming (because I doubt any audio engineers use such effects for auditing their tracks...)

    please let me know if you have any ideas...

    /E

    p.s.
    present 'Surrounder' doesn't use any real 3-D algorithms but performs a generic ProLogic-like encoding (when 'surround' mode is on)
     
  15. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    Eugene,

    Let's see if I understand it right.

    -As I mentioned, the 'Crossfeed' plugin is for normal stereo 2 > 2 auditing over headphones.
    It just takes a 2 channel stereomix and mimics 'Near Field Monitoring' as used in a studio setup.
    Room accoustics are intentionally left out in those cases. I.e. no room reverberation at all.
    (of course, in practis this is never 100% the case)

    -Yep, I have treid those Headphone sims you mentioned, that emulate 'room experience'.
    For studio/music monitoring they all fail imho due to that 'room emulation' (amongst other things).
    In general, we don't want any room colorization in 'Near Field Monitoring'
    Sound engineers sit close at a fixed angle and at fixed distance to their Monitor speakers.
    (well, at least in small studio's they do..:))

    So we have to clearly distinghuis between 3D audio techniques/algos for gaming experience,
    DVD playback and such, and plain 'good old' 2 channel stereo audition.


    -If I understood you right, we (also) need a dsp plugin that does a good 3D > Stereo Headphones simulation.
    I.e. 3D hardware accelerated Surround, Dolby, EAX, etc. Game sound on Headphones,
    without having to use a Surround Speaker set.
    At the same time, one could test 3D programming/performance using headphones.

    If so, this is quite interesting since I'm looking for a good 3D Game sound on headphones solution
    for a long time now. I don't wanna use surround speakers.
    (Not pleasant for neighbours and family members..:))

    Let me know if I 'git' it right.

    Regards,

    /LeMury
     
  16. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48
    hello

    1. I think we should keep your 'crossfade' effect as a possible 'surrounder' preset -- for audio engineers and 'plain "good old" stereo audition'

    2. yes, we definitely need a set of DSP effects for gaming / movie purposes:
    * headphones (emulates 5.1 room)
    * 2.0 (emulates 'virtual rear' and 'virtual center')
    * 4.0 (emulates 'virtual center')
    * 5.0 (emulates a 'room' experience -- not very important, but might produce a better 'cinema' effect)

    3. we should also keep in mind two audio technologies: Dolby ProLogic encoding and decoding
    that is, the surrounder effect should be capable of processing the incoming stereo wave and 'expanding' it into 4.0/5.1,
    as well as process the incoming '5.1' data and encode it into 'stereo' (ProLogic)

    yes, the present Surrounder performs these tasks, but we should keep this functionality for gaming purposes, too

    probably, we should keep the '7.1' speaker configuration in mind, too (for future updates)

    /Eugene

    P.S.
    Surrounder currently handles passive ProLogic matrix. we should have a closer look at ProLogic ][...

    P.P.S.
    and, definitely, the 'headphones' effect will help us to develop better 3-D audio engine [especially for our neighbours and family members :)]
     
  17. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    Hi Eugene,

    Understood..!

    I've gathered info, White Papers, Docs, HRTF databases etc. etc. regarding
    current 3D/Surround/AC3 Dolby etc. audio standards/technologies.
    Indeed not easy, but quite intreging.

    Anyway; I have to finish other (promised) Kx-stuff first, before I can start on this.

    Regards,

    /LeMury
     
  18. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48
    >> HRTF databases

    you've got them? really? where? :)

    >> I have to finish other (promised) Kx-stuff first, before I can start on this

    that's ok
    and, by the way, there's one more task -- EAX reverb :)
    I'm currently working on the API front-end, but the actual reverb (probably based on Max's kXU one or CLEAX3Reverb) should be written, too

    so, there's always enough work for DSP Engineers and effect writers :)

    /E
     
  19. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
  20. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48

Share This Page

visited