主要内容

bw2octavebw

Convert bandwidth to octave bandwidth

Since R2026a

    Description

    [N,FcAnalog] = bw2octavebw(CutoffFrequencies) converts cutoff frequencies into octave bandwidths, N. FcAnalog are the center frequencies of the octave bands.

    [N,FcAnalog,FcDigital] = bw2octavebw(CutoffFrequencies,SampleRate=fs) returns the analog center frequencies, FcAnalog, and the digital center frequencies, FcDigital, of the octave bands when you specify a sample rate using SampleRate=fs.

    example

    Examples

    collapse all

    Start with three sets of bands: 1500 Hz to 3500 Hz, 2500 Hz to 5000 Hz, and 4000 Hz to 6000 Hz. Each band is defined by its lower and upper cutoff frequencies (fcut).

    fcut = [1500 3500; 2500 5000; 4000 6000]';

    Compute the octave bandwidths (N) and the analog center frequencies (fca).

    [N,fca] = bw2octavebw(fcut)
    N = 1×3
    
        1.2224    1.0000    0.5850
    
    
    fca = 1×3
    103 ×
    
        2.2913    3.5355    4.8990
    
    

    Provide a sample rate to additionally compute the digital center frequencies.

    fs = 16000;
    [N,fca,fcd] = bw2octavebw(fcut,SampleRate=fs)
    N = 1×3
    
        1.2224    1.0000    0.5850
    
    
    fca = 1×3
    103 ×
    
        2.2913    3.5355    4.8990
    
    
    fcd = 1×3
    103 ×
    
        2.3571    3.7164    5.0875
    
    

    Input Arguments

    collapse all

    Cutoff frequencies, specified as a 2-element positive-valued vector for one filter or a 2-by-P positive-valued matrix for P filters.

    Data Types: single | double

    Sample rate, specified as a positive scalar in Hz. The default value is 2. CutoffFrequencies must be in the range [0,fs/2].

    Data Types: single | double

    Output Arguments

    collapse all

    Octave bandwidths, returned as a positive-valued vector.

    Example: 0.2

    Data Types: single | double

    Analog center frequencies, returned as a positive-valued vector.

    Data Types: single | double

    Digital center frequencies, returned as a positive-valued vector.

    Data Types: single | double

    Algorithms

    This function outputs the octave bandwidth and the center frequency. For both the analog and digital domains, the octave bandwidth is given by

    N=log2Fcut2Fcut11

    The analog center frequency is given by

    Fc=Fcut1Fcut2

    The digital center frequency is different from the analog center due to warping:

    Om1=tan(πFcut1/2)Om2=tan(πFcut3/2)Om0=2Om1Om2Fcd=Fsarctan(Om0/π)

    where Fs is the sample rate.

    References

    [1] Orfanidis, Sophocles, "High-Order Digital Parametric Equalizer Design", J. Audio Eng. Soc, 53, 2005.

    Extended Capabilities

    expand all

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2026a