THE AUDITORY MODELING TOOLBOX

Applies to version: 1.6.0

View the code

Go to function

amt_load
Load auxiliary data from the auxdata repository

Usage:

data = amt_load(model, fn);
data = amt_load(model, fn, variable);
[audio, fs] = amt_load(model, fn);
sofa = amt_load(model, fn);
table = amt_load(model, fn);
filename = amt_load(model, fn);

Input parameters:

model Directory within the auxdata repository.
fn

Filename of the auxiliary data. The filename fn must be provided with the extension. The extension determines the type of the output:

  • .wav: Output as that from audioread: audio will be the audio signal with the size of (time x channels), and fs will be the sampling frequency (in Hz).
  • .mat: Output as that from load: data will contain the structure loaded from the file fn. This extension also supports the optional string variable to load specific variables only (see load for more details).
  • .sofa: Output as that from SOFAload: sofa will be the SOFA structure (see SOFAload for more details).
  • .csv: Output as that from tableread: table will be a matrix as interpreted by tableread. The usage of this extension is dangerous as the actual output may depend on the Matlab/Octave version. Storing auxdata as a .mat file is thus highly recommended.
  • others: Does not load the local auxdata, but if fn not found in the local repository, it will be downloaded from the remote auxdata repository. The output filename will be the absolute filename to the local file stored in the local auxdata repository.
variable Optional string with the name of the variable(s) to be loaded in the format of the command load. This applies only to auxdata stored as .mat files.

Output parameters:

data Structure with the loaded variables.
audio Audio signal with the size of (time x channels).
fs Sampling frequency (in Hz) of audio.
sofa SOFA structure as output by SOFAload.
table Table with a matrix loaded from a CSV file and interpreted by tableread.
filename Absolute filename to the local file stored in the local auxdata repository.

Description:

amt_load(model, fn) loads the auxiliary data from the file fn. The data will loaded from the directory model located in the local directory given by amt_auxdatapath, which per default is the directory auxdata located in the AMT base path.

If the file fn is not found in the local repository given by amt_auxdatapath, it will be downloaded from the remote (online) repository given by amt_auxdataurl, which is per default http://amtoolbox.org/amt-version/auxdata with version being the latest AMT version.

Note that the remote auxdata repository is versioned: The search starts with the latest AMT version, but if not found, it then continues in previous versions, going back up to AMT 1.0.0.

amt_load(model, data, variable) loads just particular variables given in the string variable. This applies to fn with the extension .mat only.