This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getCenterFrequencies

Center frequencies of filters

Syntax

cf = getCenterFrequencies(obj)

Description

example

cf = getCenterFrequencies(obj) returns the center frequencies of the filters created by obj, in Hz.

Examples

collapse all

Create a gammatoneFilterBank and get the center frequencies of the filters in the filter bank.

gammaFiltBank = gammatoneFilterBank;

cf = getCenterFrequencies(gammaFiltBank)
cf =

   1.0e+03 *

  Columns 1 through 7

    0.0500    0.0822    0.1180    0.1581    0.2027    0.2525    0.3080

  Columns 8 through 14

    0.3700    0.4390    0.5161    0.6020    0.6979    0.8048    0.9241

  Columns 15 through 21

    1.0571    1.2054    1.3709    1.5555    1.7613    1.9909    2.2470

  Columns 22 through 28

    2.5327    2.8513    3.2066    3.6030    4.0451    4.5381    5.0881

  Columns 29 through 32

    5.7015    6.3857    7.1488    8.0000

Center frequencies of a gammatone filter bank are spaced evenly on the ERB scale. Convert the center frequencies vector to the ERB scale and calculate the differences between center frequencies.

diff(hz2erb(cf))
ans =

  Columns 1 through 7

    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116

  Columns 8 through 14

    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116

  Columns 15 through 21

    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116

  Columns 22 through 28

    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116    1.0116

  Columns 29 through 31

    1.0116    1.0116    1.0116

Create an octaveFilterBank and get the center frequencies of the filters in the filter bank.

octFiltBank = octaveFilterBank;

cf = getCenterFrequencies(octFiltBank)
cf =

   1.0e+04 *

  Columns 1 through 7

    0.0032    0.0063    0.0126    0.0251    0.0501    0.1000    0.1995

  Columns 8 through 10

    0.3981    0.7943    1.5729

Center frequencies of an octave filter bank are spaced evenly on a logarithmic scale. Convert the center frequencies vector to the log scale and calculate the differences between center frequencies.

diff(log10(cf))
ans =

  Columns 1 through 7

    0.3000    0.3000    0.3000    0.3000    0.3000    0.3000    0.3000

  Columns 8 through 9

    0.3000    0.2967

Create an octave bandwidth splMeter and get the center frequencies of the octave filter bank. Round the center frequencies to two significant digits for display purposes.

SPL = splMeter('SampleRate',44100,'Bandwidth','1 octave');
cf = getCenterFrequencies(SPL);
round(cf,2,'significant')
ans =

  Columns 1 through 6

          32          63         130         250         500        1000

  Columns 7 through 10

        2000        4000        7900       16000

Input Arguments

collapse all

Object to get filter bank center frequencies from, specified as an object of gammatoneFilterBank, octaveFilterBank, or splMeter.

Output Arguments

collapse all

Filter bank center frequencies in Hz, returned a scalar or vector.

Introduced in R2019a