Contenido principal

lebedevLoudspeakerLayout

Lebedev loudspeaker layout coordinates

Since R2026a

    Description

    [LSSph,Weights] = lebedevLoudspeakerLayout returns the spatial location and weights of each loudspeaker in a default 11-degree Lebedev spherical grid.

    example

    [LSSph,Weights] = lebedevLoudspeakerLayout(Name=Value) specifies options using one or more name-value arguments. For example, to specify the Lebedev polynomial degree, set Degree.

    example

    lebedevLoudspeakerLayout is a convenience syntax that plots a default 11-degree Lebedev grid.

    example

    lebedevLoudspeakerLayout(Name=Value) is a convenience syntax that plots a Lebedev grid using the options specified in the name-value arguments.

    example

    Examples

    collapse all

    Before using the lebedevLoudspeakerLayout function for the first time, you must download and unzip the associated Audio Toolbox™ preconfigured Lebedev grid file.

    If the Audio Toolbox grid file is not installed, then the first call to lebedevLoudspeakerLayout provides a link to the download location. To download the file, click the link. Unzip the file to a location on the MATLAB® path.

    Alternatively, execute the following commands to download and unzip the Lebedev grid file to your temporary directory.

    downloadFolder = fullfile(tempdir,'LebedevDownload');
    loc = websave(downloadFolder,'https://ssd.mathworks.com/supportfiles/audio/loudspeakerGrids.zip');
    LebedevLocation = tempdir;
    unzip(loc,LebedevLocation)
    addpath(fullfile(LebedevLocation))

    Decode an ambisonic-encoded signal to a Lebedev loudspeaker layout, plot the layout, and scale the signal by the weights.

    Read in an ambisonic-encoded signal.

    [audioIn,fs] = audioread("Heli_16ch_ACN_SN3D.wav");

    Define a Lebedev design loudspeaker layout with a degree of seven and return the weights.

    [loudspeakers,weights] = lebedevLoudspeakerLayout(Degree=7);

    Plot the Lebedev layout grid.

    lebedevLoudspeakerLayout(Degree=7)

    Figure contains an axes object. The axes object with title Lebedev Grid. Degree = 7. Number of Loudspeakers = 26., xlabel x (m), ylabel y (m) contains an object of type patch.

    Design the decoding matrix with an order of three.

    dmtrx = ambisonicDecoderMatrix(3, loudspeakers,...
            Normalization="sn3d",ChannelOrder="acn");

    Decode the signal to the Lebedev loudspeaker layout.

    audioOut = audioIn*dmtrx;

    Scale each output channel by the corresponding Lebedev weight.

    audioOut = audioOut.*weights.';

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: [Lcoords,wgts] = lebedevLoudspeakerLayout(Degree=31)

    Lebedev polynomial degree, specified as an integer. Valid values are 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 35, 41, 47, 53, 59, 65, 71, 77, 83, 89, 95, 101, 107, 113, 119, 125, and 131. A higher degree results in a higher resolution spherical grid that contains more loudspeaker points. The default value of 11 generates 50 loudspeaker locations.

    Data Types: double

    Output data type, specified as "double" or "single". Set this argument to "single" to force all matrix computations to be performed in single precision.

    Data Types: char | string

    Output Arguments

    collapse all

    Spatial location of each loudspeaker in spherical coordinates, returned as an N-by-2 matrix, where N is the number of loudspeakers. The first column corresponds to the azimuth, and the second column corresponds to the elevation. The azimuth values are in the range [0,360], and the elevation values are in the range [–90,90]. Units are in degrees.

    Weight associated with each loudspeaker location on the Lebedev grid, returned as a length-N array, where N is the number of loudspeakers.

    References

    [1] V. I. Lebedev and D.N. Laikov. “A Quadrature Formula for the Sphere of the 131st Algebraic Order of Accuracy.” Doklady Mathematics, Vol. 59, no. 3 (1999): 477-481.

    Extended Capabilities

    expand all

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

    Version History

    Introduced in R2026a