Quadriga-Lib
C++/MEX/Python Utility library for radio channel modelling and simulations
MALAB / Octave API Documentation for Quadriga-Lib v0.12.2


Markdown version of this page:
# General usage notes
Overview
Array antenna functions

arrayant_calc_beamwidthCalculate the beamwidth and pointing angles of array antenna elements in degrees
arrayant_calc_directivityCalculates the directivity in dBi of array antenna elements
arrayant_combine_patternCombine element patterns, positions, and coupling weights into effective radiation patterns
arrayant_concatConcatenate two arrayant structs into a single one
arrayant_copy_elementCreate copies of array antenna elements
arrayant_export_obj_fileExport antenna pattern geometry to a Wavefront OBJ file for 3D visualization
arrayant_generateGenerates predefined array antenna models
arrayant_interpolateInterpolate polarimetric array antenna field patterns (single- and multi-frequency)
arrayant_qdant_readReads array antenna data from QDANT files
arrayant_qdant_writeWrites array antenna data to QDANT files
arrayant_rotate_patternRotate antenna radiation patterns around the principal axes using Euler rotations
generate_speakerGenerate a parametric frequency-dependent loudspeaker directivity model

Channel functions

baseband_freq_responseCompute the baseband frequency response of a MIMO channel
channel_export_obj_fileExport propagation paths to a Wavefront OBJ file for 3D visualization
hdf5_create_fileCreate a new HDF5 channel file with a custom storage layout
hdf5_read_channelRead one or more channel objects from an HDF5 file
hdf5_read_dsetRead a single unstructured dataset from an HDF5 file
hdf5_read_dset_namesRead names of unstructured datasets stored at a 4D slot in an HDF5 file
hdf5_read_layoutRead the storage layout of channel data inside an HDF5 file
hdf5_reshape_layoutReshape the storage layout inside an existing HDF5 file
hdf5_versionReturn the HDF5 library version string
hdf5_write_channelWrite one or more channel objects to an HDF5 file
hdf5_write_dsetWrite a single unstructured dataset to an HDF5 file
qrt_file_parseRead metadata from a QRT file
qrt_file_readRead ray-tracing CIR data from a QRT file
quantize_delaysMap path delays to a fixed tap grid using two-tap power-weighted interpolation

Channel generation functions

get_channels_ieee_indoorGenerate indoor MIMO channel realizations for IEEE TGn/TGac/TGax/TGah models
get_channels_irsCalculate MIMO channel coefficients for IRS-assisted communication
get_channels_multifreqCompute channel coefficients for spherical waves across multiple frequencies
get_channels_planarCalculate MIMO channel coefficients for planar wave paths
get_channels_sphericalCalculate MIMO channel coefficients and delays for spherical wave propagation

Channel statistics

acdfCalculate the empirical averaged cumulative distribution function (CDF)
calc_angular_spreadCalculate azimuth and elevation angular spreads with spherical wrapping
calc_cross_polarization_ratioCalculate the cross-polarization ratio (XPR) for linear and circular polarization bases
calc_delay_spreadCalculates RMS delay spread from per-CIR delays and linear-scale powers
calc_rician_k_factorCalculate the Rician K-Factor from channel impulse response data

Math functions

calc_rotation_matrixCalculate rotation matrices from Euler angles
cart2geoConvert elementwise Cartesian coordinates to azimuth/elevation angles and vector length
fast_sincosCompute elementwise approximate sine and/or cosine of a vector
geo2cartConvert elementwise azimuth/elevation angles to Cartesian coordinates
interpPerform linear interpolation (1D or 2D) on single or multiple data sets

Miscellaneous / Tools

versionReturns the quadriga-lib version number
write_pngWrite a data matrix to a color-coded PNG file

Site-specific simulation tools

calc_diffraction_gainCalculate diffraction gain for multiple TX-RX pairs using a 3D triangular mesh
cubeConstruct a triangulated cube mesh
generate_diffraction_pathsGenerate elliptic propagation paths and weights for diffraction gain estimation
icosphereConstruct a geodesic polyhedron from recursive icosahedron subdivision
obj_file_readRead a Wavefront `.obj` file and extract geometry, visual materials, and EM/acoustic materials
obj_file_writeWrite a Wavefront .obj file
planeConstruct a triangulated plane mesh
point_cloud_aabbCompute the axis-aligned bounding boxes (AABB) of a 3D point cloud
point_cloud_segmentationReorganize a point cloud into spatial sub-clouds for efficient processing
point_inside_meshTest whether 3D points are inside a triangle mesh using raycasting
ray_mesh_interactCalculates reflection, transmission, or refraction of EM/acoustic waves at mesh surfaces
ray_point_intersectCalculate intersections of ray beams with points in 3D space
ray_triangle_intersectCompute ray-triangle intersections in 3D using the Möller–Trumbore algorithm
subdivide_trianglesSubdivide triangles into smaller triangles
triangle_mesh_aabbCalculate the axis-aligned bounding box (AABB) of a triangle mesh and its sub-meshes
triangle_mesh_segmentationReorganize a 3D triangular mesh into spatially clustered sub-meshes for faster processing




Array antenna functions



arrayant_calc_beamwidth

Calculate the beamwidth and pointing angles of array antenna elements in degrees Usage:
% Input as struct (struct mode)
[ beamwidth_az, beamwidth_el, az_point_ang, el_point_ang ] = quadriga_lib.arrayant_calc_beamwidth( arrayant );

[ beamwidth_az, beamwidth_el, az_point_ang, el_point_ang ] = quadriga_lib.arrayant_calc_beamwidth( arrayant, i_element, threshold_dB );

% Separate inputs (split mode)
[ beamwidth_az, beamwidth_el, az_point_ang, el_point_ang ] = ...
    quadriga_lib.arrayant_calc_beamwidth( e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid );

[ beamwidth_az, beamwidth_el, az_point_ang, el_point_ang ] = ...
    quadriga_lib.arrayant_calc_beamwidth( e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid, ...
    i_element, threshold_dB );
Inputs (struct mode):
Inputs (split mode):
Outputs:
See also:


arrayant_calc_directivity

Calculates the directivity in dBi of array antenna elements Usage:
% Input as struct (struct mode)
directivity = quadriga_lib.arrayant_calc_directivity(arrayant);
directivity = quadriga_lib.arrayant_calc_directivity(arrayant, i_element);

% Separate inputs (split mode)
directivity = quadriga_lib.arrayant_calc_directivity(e_theta_re, e_theta_im, e_phi_re, ...
    e_phi_im, azimuth_grid, elevation_grid);

directivity = quadriga_lib.arrayant_calc_directivity(e_theta_re, e_theta_im, e_phi_re, ...
    e_phi_im, azimuth_grid, elevation_grid, i_element);
Inputs (struct mode):
Inputs (split mode):
Output:
See also:


arrayant_combine_pattern

Combine element patterns, positions, and coupling weights into effective radiation patterns Usage:
% Input as struct (struct mode)
arrayant_out = quadriga_lib.arrayant_combine_pattern( arrayant_in );
arrayant_out = quadriga_lib.arrayant_combine_pattern( arrayant_in, center_freq_new, azimuth_grid_new, elevation_grid_new );

% Separate outputs, struct input (single-freq only)
[e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid, element_pos, coupling_re, ...
    coupling_im, center_freq, name] = quadriga_lib.arrayant_combine_pattern( arrayant_in );

% Separate inputs (split-mode, single-freq only)
arrayant_out = quadriga_lib.arrayant_combine_pattern( [], center_freq_new, azimuth_grid_new, elevation_grid_new, ...
    e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid, element_pos, coupling_re, coupling_im, center_freq, name );
Inputs:
Outputs:
See also:


arrayant_concat

Concatenate two arrayant structs into a single one Usage:
arrayant_out = quadriga_lib.arrayant_concat( arrayant_in1, arrayant_in2 );
Inputs:
Outputs:


arrayant_copy_element

Create copies of array antenna elements Usage:
arrayant_out = quadriga_lib.arrayant_copy_element( arrayant_in, source_element, dest_element );
Inputs:
Outputs:


arrayant_export_obj_file

Export antenna pattern geometry to a Wavefront OBJ file for 3D visualization Usage:
quadriga_lib.arrayant_export_obj_file( fn, arrayant, directivity_range, colormap,  object_radius, ...
   icosphere_n_div, i_element, i_freq );
Inputs:
See also:


arrayant_generate

Generates predefined array antenna models Usage:
% Simple antennas (v-pol)
ant = quadriga_lib.arrayant_generate('omni', res);
ant = quadriga_lib.arrayant_generate('dipole', res);
ant = quadriga_lib.arrayant_generate('half-wave-dipole', res);

% Cross-polarized isotropic
ant = quadriga_lib.arrayant_generate('xpol', res);

% Custom 3dB beamwidth
ant = quadriga_lib.arrayant_generate('custom', res, freq, az_3dB, el_3dB, bfr);

% Uniform linear array (N horizontal elements, half-wavelength spacing by default)
ant = quadriga_lib.arrayant_generate('ula', res, freq, [], [], [], [], N, pol, [], spacing);

% Uniform linear array with custom per-element pattern struct
ant = quadriga_lib.arrayant_generate('ula', res, freq, [], [], [], [], N, [], [], spacing, [], [], [], [], pattern);

% 3GPP-NR array (default 3GPP element pattern)
ant = quadriga_lib.arrayant_generate('3GPP', res, freq, [], [], [], M, N, pol, tilt, spacing, Mg, Ng, dgv, dgh);

% 3GPP-NR array with custom element beamwidth
ant = quadriga_lib.arrayant_generate('3GPP', res, freq, az_3dB, el_3dB, bfr, M, N, pol, tilt, spacing, Mg, Ng, dgv, dgh);

% 3GPP-NR array with custom per-element pattern struct
ant = quadriga_lib.arrayant_generate('3GPP', res, freq, [], [], [], M, N, pol, tilt, spacing, Mg, Ng, dgv, dgh, pattern);

% Multi-beam M×N array (one combined beam / one beam per direction)
ant = quadriga_lib.arrayant_generate('multibeam', res, freq, az_3dB, el_3dB, bfr, M, N, pol, dir, spacing);
ant = quadriga_lib.arrayant_generate('multibeam_sep', res, freq, az_3dB, el_3dB, bfr, M, N, pol, dir, spacing);

% Separate outputs (must request exactly 11)
[e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid, element_pos, ...
    coupling_re, coupling_im, center_freq, name] = quadriga_lib.arrayant_generate( ... );
Mapping table with defaults:

Position 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Varialbe res freq az_3dB el_3dB bfr M N pol tilt_dir spacing Mg Ng dgv dgh pattern
Type / Unit deg Hz deg deg lin int int int deg λ int int dbl dbl struct
omni 10 300k
dipole 1 300k
half-wave-dipole 1 300k
xpol 10 300k
custom 1 300k 90 90 0
ula 1 300k 1 1
3GPP 1 300k 67 67 0 1 1 1 tilt = 0 0.5 1 1 0.5 0.5
multibeam 1 300k 120 120 0 1 1 1 [0;0;1] 0.5
multibeam_sep 1 300k 120 120 0 1 1 1 [0;0;1] 0.5
Inputs (common):
Inputs (type custom, 3GPP, multibeam, multibeam_sep):
Inputs (type ula, 3GPP, multibeam, multibeam_sep):
Inputs (type 3GPP only):
Inputs (type ula, 3GPP):
Inputs (type multibeam, multibeam_sep):
Outputs:


arrayant_interpolate

Interpolate polarimetric array antenna field patterns (single- and multi-frequency) Usage:
% Single-frequency, struct input
[V_re, V_im, H_re, H_im, dist, azimuth_loc, elevation_loc, gamma] = ...
    quadriga_lib.arrayant_interpolate( arrayant, azimuth, elevation, element, orientation, element_pos );

% Single-frequency, separate arrayant inputs
[V_re, V_im, H_re, H_im, dist, azimuth_loc, elevation_loc, gamma] = ...
    quadriga_lib.arrayant_interpolate( [], azimuth, elevation, element, orientation, element_pos, [], ...
    e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid );

% Multi-frequency, struct array input
[V_re, V_im, H_re, H_im] = quadriga_lib.arrayant_interpolate( arrayant_multi, azimuth, elevation, ...
    element, orientation, element_pos, freq );
Inputs:
Inputs (separate arrayant data, required when arrayant is [], single-frequency only):
Outputs:
See also:


arrayant_qdant_read

Reads array antenna data from QDANT files Usage:
% Multi-frequency read (struct array, all entries)
[ ant, layout ] = quadriga_lib.arrayant_qdant_read( fn );

% Single-frequency read (struct output)
[ ant, layout ] = quadriga_lib.arrayant_qdant_read( fn, id );

% Single-frequency read (separate fields)
[ e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid, element_pos, ...
    coupling_re, coupling_im, center_freq, name, layout ] = quadriga_lib.arrayant_qdant_read( fn, id );
Inputs:
Outputs:
See also:


arrayant_qdant_write

Writes array antenna data to QDANT files Usage:
% Arrayant as struct
id_in_file = quadriga_lib.arrayant_qdant_write( fn, arrayant, id, layout );

% Arrayant as separate inputs
id_in_file = quadriga_lib.arrayant_qdant_write( fn, [], id, layout, e_theta_re, e_theta_im, e_phi_re, ...
    e_phi_im, azimuth_grid, elevation_grid, element_pos, coupling_re, coupling_im, center_freq, name );
Inputs:
Inputs (separate arrayant data, required when `arrayant` is `[]`):
Outputs:
See also:


arrayant_rotate_pattern

Rotate antenna radiation patterns around the principal axes using Euler rotations Usage:
% Struct in / struct out
arrayant_out = quadriga_lib.arrayant_rotate_pattern(arrayant_in, x_deg, y_deg, z_deg, usage, i_element);

% Separate-field outputs (single-frequency results only)
[e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid, element_pos, ...
    coupling_re, coupling_im, center_freq, name] = quadriga_lib.arrayant_rotate_pattern( ...
    arrayant_in, x_deg, y_deg, z_deg, usage, i_element);

% Separate inputs (single-frequency only)
arrayant_out = quadriga_lib.arrayant_rotate_pattern([], x_deg, y_deg, z_deg, usage, element, ...
    e_theta_re, e_theta_im, e_phi_re, e_phi_im, azimuth_grid, elevation_grid, element_pos, ...
    coupling_re, coupling_im, center_freq, name);
Inputs:
Outputs:


generate_speaker

Generate a parametric frequency-dependent loudspeaker directivity model Usage:
arrayant = quadriga_lib.generate_speaker( driver_type, radius, lower_cutoff, upper_cutoff, ...
    lower_rolloff_slope, upper_rolloff_slope, sensitivity, radiation_type, hor_coverage, ...
    ver_coverage, horn_control_freq, baffle_width, baffle_height, frequencies, ...
    angular_resolution );
Inputs:
Outputs:



Channel functions



baseband_freq_response

Compute the baseband frequency response of a MIMO channel Usage:
[ hmat_re, hmat_im ] = quadriga_lib.baseband_freq_response( coeff_re, coeff_im, delay, ...
    pilot_grid, bandwidth, center_freq, carrier_freq, i_snap );
Dispatch modes:

Mode Triggered by coeff_re shape Output shape
Single-frequency 3D coeff_re and i_snap omitted [n_rx, n_tx, n_path] [n_rx, n_tx, n_carrier]
Multi-frequency 4D coeff_re and i_snap omitted [n_rx, n_tx, n_path, n_freq] [n_rx, n_tx, n_carrier]
Multi-snapshot i_snap supplied (may be 0 for all) [n_rx, n_tx, n_path, n_snap] [n_rx, n_tx, n_carrier, n_out]
Inputs:
Outputs:
See also:


channel_export_obj_file

Export propagation paths to a Wavefront OBJ file for 3D visualization Usage:
quadriga_lib.channel_export_obj_file( fn, max_no_paths, gain_max, gain_min, colormap, radius_max,  radius_min, ...
    n_edges, rx_pos, tx_pos, no_interact, interact_coord, center_freq, coeff_re, coeff_im, i_snap );
Inputs:
Outputs:


hdf5_create_file

Create a new HDF5 channel file with a custom storage layout Usage:
storage_space = quadriga_lib.hdf5_create_file( fn, storage_dims );
Inputs:
Output:
See also:


hdf5_read_channel

Read one or more channel objects from an HDF5 file Usage:
[ chan, par ] = quadriga_lib.hdf5_read_channel( fn, ix, iy, iz, iw, snap );
Inputs:
Outputs:
See also:


hdf5_read_dset

Read a single unstructured dataset from an HDF5 file Usage:
dset = quadriga_lib.hdf5_read_dset( fn, location, name, prefix );
Inputs:
Outputs:
See also:


hdf5_read_dset_names

Read names of unstructured datasets stored at a 4D slot in an HDF5 file Usage:
names = quadriga_lib.hdf5_read_dset_names( fn, location, prefix );
Inputs:
Outputs:
See also:


hdf5_read_layout

Read the storage layout of channel data inside an HDF5 file Usage:
[ storage_dims, has_data ] = quadriga_lib.hdf5_read_layout( fn );
Input:
Outputs:
See also:


hdf5_reshape_layout

Reshape the storage layout inside an existing HDF5 file Usage:
storage_space = quadriga_lib.hdf5_reshape_layout( fn, storage_dims );
Inputs:
Outputs:
See also:


hdf5_version

Return the HDF5 library version string Usage:
version = quadriga_lib.hdf5_version;
Outputs:


hdf5_write_channel

Write one or more channel objects to an HDF5 file Usage:
storage_dims = quadriga_lib.hdf5_write_channel( fn, chan, par, ix, iy, iz, iw );
Inputs:
Outputs:
See also:


hdf5_write_dset

Write a single unstructured dataset to an HDF5 file Usage:
storage_dims = quadriga_lib.hdf5_write_dset( fn, location, name, data, prefix );
Inputs:
Outputs:
See also:


qrt_file_parse

Read metadata from a QRT file Usage:
[ no_cir, no_orig, no_dest, no_freq, cir_offset, orig_names, dest_names, version, center_freq, ...
     cir_pos, cir_orientation, orig_pos, orig_orientation ] = quadriga_lib.qrt_file_parse( fn );
Input:
Outputs:


qrt_file_read

Read ray-tracing CIR data from a QRT file Usage:
[ center_freq, tx_pos, tx_orientation, rx_pos, rx_orientation, fbs_pos, lbs_pos, path_gain, ...
    path_length, M, aod, eod, aoa, eoa, path_coord, no_int, coord, interact_type ] = ...
    quadriga_lib.qrt_file_read( fn, i_cir, i_orig, downlink, normalize_M );
Inputs:
Outputs:
See also:


quantize_delays

Map path delays to a fixed tap grid using two-tap power-weighted interpolation Usage:
[ coeff_re_q, coeff_im_q, delay_q ] = quadriga_lib.quantize_delays( coeff_re, coeff_im, delay, ...
    tap_spacing, max_no_taps, power_exponent, fix_taps );
Inputs:
Outputs:



Channel generation functions



get_channels_ieee_indoor

Generate indoor MIMO channel realizations for IEEE TGn/TGac/TGax/TGah models Usage:
chan = quadriga_lib.get_channels_ieee_indoor( ap_array, sta_array, channel_type, center_freq, ...
   tap_spacing_s, n_users, observation_time, update_rate, speed_station_kmh, speed_env_kmh, ...
   dist_m, n_floors, uplink, offset_angles, n_subpath, doppler_effect, seed, ...
   KF_linear, XPR_NLOS_linear, SF_std_dB_LOS, SF_std_dB_NLOS, dBP_m, n_walls, wall_loss );
Inputs:
Output:
See also:


get_channels_irs

Calculate MIMO channel coefficients for IRS-assisted communication Usage:
[ coeff_re, coeff_im, delay, active_path_out, aod, eod, aoa, eoa ] = quadriga_lib.get_channels_irs( ...
    ant_tx, ant_rx, ant_irs, ...
    fbs_pos_1, lbs_pos_1, path_gain_1, path_length_1, M_1, ...
    fbs_pos_2, lbs_pos_2, path_gain_2, path_length_2, M_2, ...
    tx_pos, tx_orientation, rx_pos, rx_orientation, irs_pos, irs_orientation, ...
    i_irs, threshold_dB, center_freq, use_absolute_delays, active_path_in, ant_irs_2 );
Inputs:
Outputs:
See also:


get_channels_multifreq

Compute channel coefficients for spherical waves across multiple frequencies Usage:
[ coeff_re, coeff_im, delay ] = quadriga_lib.get_channels_multifreq( tx_array, rx_array, ...
    fbs_pos, lbs_pos, path_gain, path_length, M, tx_pos, tx_orientation, rx_pos, rx_orientation, ...
    freq_in, freq_out, use_absolute_delays, add_fake_los_path, propagation_speed );
Inputs:
Outputs:
See also:


get_channels_planar

Calculate MIMO channel coefficients for planar wave paths Usage:
[ coeff_re, coeff_im, delay, rx_Doppler ] = quadriga_lib.get_channels_planar( tx_array, rx_array, ...
    aod, eod, aoa, eoa, path_gain, path_length, M, tx_pos, tx_orientation, rx_pos, rx_orientation, ...
    center_freq, use_absolute_delays, add_fake_los_path );
Inputs:
Outputs:
See also:


get_channels_spherical

Calculate MIMO channel coefficients and delays for spherical wave propagation Usage:
[ coeff_re, coeff_im, delay, aod, eod, aoa, eoa ] = quadriga_lib.get_channels_spherical( tx_array, rx_array, ...
    fbs_pos, lbs_pos, path_gain, path_length, M, tx_pos, tx_orientation, rx_pos, rx_orientation, ...
    center_freq, use_absolute_delays, add_fake_los_path, use_avx2 );
Inputs:
Outputs:
See also:



Channel statistics



acdf

Calculate the empirical averaged cumulative distribution function (CDF) Usage:
[ cdf_per_set, bins_out, cdf_avg, mu, sig ] = quadriga_lib.acdf( data, bins_in, n_bins );
Inputs:
Outputs:


calc_angular_spread

Calculate azimuth and elevation angular spreads with spherical wrapping Usage:
[ as, es, orientation, phi, theta ] = quadriga_lib.calc_angular_spread( az, el, powers, ...
    wrapping, calc_bank_angle, quantize );
Inputs:
Outputs:


calc_cross_polarization_ratio

Calculate the cross-polarization ratio (XPR) for linear and circular polarization bases Usage:
[ xpr, pg ] = quadriga_lib.calc_cross_polarization_ratio( powers, M, path_length, tx_pos, rx_pos, include_los, window_size );
Inputs:
Outputs:


calc_delay_spread

Calculates RMS delay spread from per-CIR delays and linear-scale powers Usage:
[ ds, mean_delay ] = quadriga_lib.calc_delay_spread( delays, powers, threshold, granularity );
Inputs:
Outputs:
See also:


calc_rician_k_factor

Calculate the Rician K-Factor from channel impulse response data Usage:
[ kf, pg ] = quadriga_lib.calc_rician_k_factor( powers, path_length, tx_pos, rx_pos, window_size );
Inputs:
Outputs:



Math functions



calc_rotation_matrix

Calculate rotation matrices from Euler angles Usage:
rotation = quadriga_lib.calc_rotation_matrix( orientation, invert_y_axis, transpose );
Inputs:
Outputs:


cart2geo

Convert elementwise Cartesian coordinates to azimuth/elevation angles and vector length Usage:
[ az, el, len ] = quadriga_lib.cart2geo( x, y, z, use_kernel );
Inputs:
Outputs:


fast_sincos

Compute elementwise approximate sine and/or cosine of a vector Usage:
[s, c] = quadriga_lib.fast_sincos(x);
s = quadriga_lib.fast_sincos(x);
c = quadriga_lib.fast_sincos(x, true);
Inputs:
Outputs:


geo2cart

Convert elementwise azimuth/elevation angles to Cartesian coordinates Usage:
split = true;
[ x, y, z, sAZ, cAZ, sEL, cEL ] = quadriga_lib.geo2cart( az, el, len, use_kernel, split );

split = false;
cart = quadriga_lib.geo2cart( az, el, len, use_kernel, split );
Inputs:
Outputs:


interp

Perform linear interpolation (1D or 2D) on single or multiple data sets Usage:
dataI = quadriga_lib.interp( x, y, data, xI, yI );      % 2D case

dataI = quadriga_lib.interp( x, [], data, xI );         % 1D case
Inputs:
Output:



Miscellaneous / Tools



version

Returns the quadriga-lib version number Usage:
version = quadriga_lib.version;
Outputs:


write_png

Write a data matrix to a color-coded PNG file Usage:
quadriga_lib.write_png( fn, data, colormap, min_val, max_val, log_transform );
Inputs:



Site-specific simulation tools



calc_diffraction_gain

Calculate diffraction gain for multiple TX-RX pairs using a 3D triangular mesh Usage:
[ gain, xprmat, coord ] = quadriga_lib.calc_diffraction_gain( orig, dest, mesh, mtl_ind, mtl_prop, ...
    center_freq, lod, verbose, sub_mesh_index, use_kernel, gpu_id, scalar_mode, resolve_multi_bounce );
Inputs:
Outputs:
See also:


cube

Construct a triangulated cube mesh

Description:
Usage:
mesh = quadriga_lib.cube( scale, rotation, location, n_div );
Inputs:
Outputs:
See also:


generate_diffraction_paths

Generate elliptic propagation paths and weights for diffraction gain estimation Usage:
[ rays, weights ] = quadriga_lib.generate_diffraction_paths( orig, dest, center_frequency, lod );
Inputs:
Outputs:
See also:


icosphere

Construct a geodesic polyhedron from recursive icosahedron subdivision Usage:
[ center, length, vert, direction ] = quadriga_lib.icosphere( n_div, radius, direction_xyz );
Inputs:
Outputs:


obj_file_read

Read a Wavefront `.obj` file and extract geometry, visual materials, and EM/acoustic materials

Description:
Usage:
[ mesh, vert_list, face_ind, obj_ind, obj_names, mtl_ind, mtl_names, bsdf, ...
    csv_ind, csv_names, csv_prop ] = quadriga_lib.obj_file_read( fn, fn_csv, csv_strict );
Inputs:
Outputs:
See also:


obj_file_write

Write a Wavefront .obj file Usage:
[ vert_list_out, face_ind_out ] = quadriga_lib.obj_file_write( fn, mesh, obj_ind, mtl_ind, obj_names, ...
    mtl_names, vert_list, face_ind, bsdf, threshold, csv_ind, csv_names, csv_prop, csv_write_defaults, ...
    split_loose_parts );
Inputs:
Outputs:
See also:


plane

Construct a triangulated plane mesh

Description:
Usage:
mesh = quadriga_lib.plane( scale, rotation, location, n_div );
Inputs:
Outputs:
See also:


point_cloud_aabb

Compute the axis-aligned bounding boxes (AABB) of a 3D point cloud Usage:
aabb = quadriga_lib.point_cloud_aabb( points, sub_cloud_index, vec_size );
Inputs:
Outputs:
See also:


point_cloud_segmentation

Reorganize a point cloud into spatial sub-clouds for efficient processing Usage:
[ pointsR, sub_cloud_index, forward_index, reverse_index ] = ...
    quadriga_lib.point_cloud_segmentation( points, target_size, vec_size );
Inputs:
Outputs:


point_inside_mesh

Test whether 3D points are inside a triangle mesh using raycasting Usage:
result = quadriga_lib.point_inside_mesh( points, mesh, obj_ind, distance );
Inputs:
Output:


ray_mesh_interact

Calculates reflection, transmission, or refraction of EM/acoustic waves at mesh surfaces Usage:
[ origN, destN, fbsN, sbsN, gainN, xprmatN, trivecN, tridirN, fbs_angleN, thicknessN, ...
    edge_lengthN, normal_vecN, out_typeN, path_dirN, ray_indN ] = ...
    quadriga_lib.ray_mesh_interact( interaction_type, center_frequency, orig, dest, mesh, ...
    mtl_ind, mtl_prop, fbs_ind, sbs_ind, trivec, tridir, compact );
Inputs:
Outputs:
See also:


ray_point_intersect

Calculate intersections of ray beams with points in 3D space Usage:
[ hit_count, ray_ind ] = quadriga_lib.ray_point_intersect( orig, trivec, tridir, points, ...
    sub_cloud_index, use_kernel, gpu_id );
Inputs:
Outputs:
See also:


ray_triangle_intersect

Compute ray-triangle intersections in 3D using the Möller–Trumbore algorithm Usage:
[ fbs, sbs, no_interact, fbs_ind, sbs_ind ] = quadriga_lib.ray_triangle_intersect( ...
    orig, dest, mesh, sub_mesh_index, aabb, use_kernel, gpu_id );
Inputs:
Outputs:
See also:


subdivide_triangles

Subdivide triangles into smaller triangles Usage:
[ triangles_out, mtl_ind_out ] = quadriga_lib.subdivide_triangles( triangles_in, n_div, mtl_ind_in );
Inputs:
[n_triangles_in]; default: [] Outputs:


triangle_mesh_aabb

Calculate the axis-aligned bounding box (AABB) of a triangle mesh and its sub-meshes Usage:
aabb = quadriga_lib.triangle_mesh_aabb( mesh, sub_mesh_index, vec_size );
Inputs:
Output:
See also:


triangle_mesh_segmentation

Reorganize a 3D triangular mesh into spatially clustered sub-meshes for faster processing Usage:
[ triangles_out, sub_mesh_index, mesh_index, mtl_ind_out ] = ...
    quadriga_lib.triangle_mesh_segmentation( triangles_in, target_size, vec_size, mtl_ind_in );
Inputs:
Outputs: