Skip to content

Matlab function to obtain the array of frequencies in octave bands or fractional octave bands.

License

Notifications You must be signed in to change notification settings

jmrplens/getANSIfrequencies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

getANSIfrequencies

Matlab function to obtain the array of frequencies in octave bands or fractional octave bands.

According to the standards ANSI s1.11-2004 and IEC 61260-1-2014.

Return the central frequencies and its edges (upper and lower).

It works similar to matlab's internal function:

[cf,g] = signal.internal.octave.getListOfANSICenterFrequencies(limits, b)

But getANSIfrequencies returns both center frequencies and edges.

Use

[fc,fl,fu] = getANSIfrequencies(b,limits,normalized)

The first input is the bandwidth:

  • b=1 One-octave band.
  • b=3 Third-octave band.
  • b=2 Half-octave band.
  • b=3/2 2/3-octave band.
  • b=24 1/24-octave band.

The second input is the limits of the array, by default frequencies between 12Hz and 20kHz are generated, enter another value if you need it or leave it empty to use the default value.

The third input only affects when the value of b is 1 or 3. It indicates whether you want the normalized or calculated frequencies. By default they are returned normalized (true).

One-octave band normalized frequencies:

fc = [16 31.5 63 125 250 500 1000 2000 4000 8000 16000]

One-octave band calculated frequencies:

fc = [15.85 31.62 63.1 125.89 251.19 501.19 1000 1995.26 3981.07 7943.28 15848.93]

Examples of use

% To get one-octave normalized frequencies between [12, 20000]
[fc,fl,fu] = getANSIfrequencies(1)
% To get one-octave normalized frequencies between [125, 8000]
[fc,fl,fu] = getANSIfrequencies(1,[125,8000])
%   To get one-octave calculated frequencies between [12, 20000]
[fc,fl,fu] = getANSIfrequencies(1,[],false)

About

Matlab function to obtain the array of frequencies in octave bands or fractional octave bands.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages