21 May '13 - 10:27 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Help with band equalization/kill  (Read 2802 times)
bobogol
Guest
« on: 18 Mar '10 - 10:44 »
Reply with quoteQuote

Hello

I have a problem creating a 3 band equalization for a channel.
I want to fully isolate the 3 bands (bass, mid and high frequencies) and I also want to kill the bands one at a time.

Here is what I did so far:

// set peaking equalizer effect with no bands
HFX fxEQ=BASS_ChannelSetFX(stream, BASS_FX_BFX_PEAKEQ,0);

// create now 3 bands
float fBandwidth = 2.5; // octaves
float fCenter_Bass =    125.0f;
float fCenter_Mid  =   1000.0f;
float fCenter_Treble = 8000.0f;

BASS_BFX_PEAKEQ eq;

eq.fGain=0;
eq.fQ=0;
eq.fBandwidth=fBandwidth;
eq.lChannel=BASS_BFX_CHANALL;

// create 1st band for bass
eq.lBand=0;
eq.fGain=0;
eq.fCenter=fCenter_Bass;
BASS_FXSetParameters(fxEQ, &eq);

// create 2nd band for mid
eq.lBand=1;
eq.fGain=0;
eq.fCenter=fCenter_Mid;
BASS_FXSetParameters(fxEQ, &eq);

// create 3rd band for treble
eq.lBand=2;
eq.fGain=0;
eq.fCenter=fCenter_Treble;

BASS_FXSetParameters(fxEQ, &eq);


Did I set the bandwidth parameters correct? The bands are 3 octaves apart; fBandwidth should be 3.0 to fully isolate the 3 bands, or 1.5?

If I set -15 Db attenuation (which is the maximum value specified in the documentation) the the full kill effect isn't possible.
If I however set -50 Db attenuation for a band, the band in case gets killed but the other bands get attenuated as well (probably because I didn't isolate them properly when setting the bandwidth parameters).

Can someone offer me some hints with this?  Smiley

Thanks,
Alex
Logged
Ian @ un4seen
Administrator
Posts: 15253


« Reply #1 on: 19 Mar '10 - 17:14 »
Reply with quoteQuote

I think the problem you're experiencing there is that the bands don't end abruptly, rather they slope (roll-off) and can overlap eachother. That's why setting one band to -50 dB is also attenuating the other bands. So you should probably set the bandwidth lower than you would think, to try to compensate for that.

If you only need to kill the bands (no gain control), another thing you could try is using the BASS_FX_BFX_BQF effect to apply a high-pass filter (BASS_BFX_BQF_HIGHPASS) to kill the low band, a notch filter (BASS_BFX_BQF_NOTCH) to kill the mid band, and a low-pass filter (BASS_BFX_BQF_LOWPASS) to kill the high band.
Logged
bobogol
Guest
« Reply #2 on: 26 Mar '10 - 10:53 »
Reply with quoteQuote

I've tried implementing a high pass filter:

    HFX fxBQF =  BASS_ChannelSetFX(chan, BASS_FX_BFX_BQF,0);

    BASS_BFX_BQF hiPass;
    hiPass.lFilter = BASS_BFX_BQF_HIGHPASS;
    hiPass.fCenter=500.0f;

    // necessary?
    hiPass.fGain=0;
    hiPass.fBandwidth=3.0f;
    hiPass.fQ=0.1f;
    hiPass.fS=0.1f;
    hiPass.lChannel = BASS_BFX_CHANALL;

    BOOL bbb = BASS_FXSetParameters(fxBQF, (void *)&hiPass);

I however get BASS_ERROR_ILLPARAM error...
Could you please help me with this! Thanks!
Logged
Ian @ un4seen
Administrator
Posts: 15253


« Reply #3 on: 26 Mar '10 - 14:39 »
Reply with quoteQuote

I think "fS" should be set to 0 when not using one of the shelving filters.
Logged
bobogol
Guest
« Reply #4 on: 26 Mar '10 - 14:45 »
Reply with quoteQuote

Thanks a lot, that was it!  Grin
Logged
bobogol
Guest
« Reply #5 on: 26 Mar '10 - 15:50 »
Reply with quoteQuote

I've put together a BASS_BFX_BQF_HIGHPASS and a BASS_BFX_BQF_LOWPASS filter, both having fCenter (cut off frequency) at 750. This should mean kill all frequencies right? I can still hear sound though at higher volume level. Is there a way to attenuate more, what parameters should I tune?
Logged
Ian @ un4seen
Administrator
Posts: 15253


« Reply #6 on: 29 Mar '10 - 17:02 »
Reply with quoteQuote

As before, there is the slope/roll-off to consider; that's 12dB per octave with these filters, ie. the attenuation increases 12dB for each additional octave from the cutoff frequency (fCenter). It should be possible to increase that by adding more filters (eg. it will be 24dB/octave with 2 filters), but I'm afraid I'm not sure exactly how the parameters should be optimally set for each additional filter.

With the low/high-pass filters, I think the Q (or bandwidth) option controls resonance. In your case, you probably don't want any resonance; using fQ=0.7 should give that with a single filter, but that would probably change when using multiple filters. Note the "fBandwidth" and "fQ" options are mutually exclusive, so one or the other should be 0.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines