The system has been implemented in Matlab. The code has been tested using Matlab R2015a 8.5 and Octave 4.4.1.
Note that there is a bug in the strncmp function in Octave versions between 4.0 and 4.2: this function is used to convert text to bits, so the system may not work properly if using those versions of the program. The problem is fixed in newer versions; also, a patch is available.
Here you can download a ZIP archive with the Matlab source code that has been written to implement the system. Some demo audio files are included, too.
In the downloaded archive there are some folders and files, briefly described below.
The main Matlab script to call to use the system is audioURL.m: the program asks the user what to do (initialization, embedding the URL, recovering the URL), requests the needed inputs and then calls the proper functions. The user can also decide to display some plots about the main stages of the process and to do some tests. Lastly, there is a demo both for embedding and recovering the URL.
The original WAVE audio files in which the URLs have to be embedded must be stored in the folder ./audio/original/. The resulting audio files will be stored in the folder ./audio/embedded/ and their names will be the same of the original with an _out appended: if (filename).wav is used, the output will be (filename)_out.wav. Two other files are produced and saved in the same folder: (filename)_psk.wav and (filename)_test.mat. The first one is a WAVE audio file, that is the PSK signal that encodes the embedded URL and can be useful for testing, but it is not needed for the system to work. The other contains the expected signals at the various stages and is useful to test the various steps when recovering the URL.
When recovering the URL, the recorded audio could be obtained in three different way:
As stated above, there is also a demo. The WAV file that is used as the original audio is DEMO.wav in the folder ./audio/original/; this file is obtained from the one that can be found here licensed under CC0: the only modification to it were changing the bitdepth to 16 bit. As URL, the following is used:
DEMO_url = https://example.com/123abcd/index.htmlTo show an example of the embedding of an URL, the following files, that can be used for other tests too, are included and recreated each time in the folder ./audio/embedded/:
In the folder ./audio/recorded/ there are also some WAV files containing recordings of about 30 seconds of DEMO_out.wav, captured with a smartphone, that can be used to show examples of the recovering of an URL. Note that as this is a demonstration of a real environment, not always DEMO_url can be obtained. Six main situation have been included:
The function in the file audioURL_init.m initializes all the needed parameters, filters, etc (the ones described in System) and saves them in the file audioURL_parameters_filters.mat in the current working directory. The same file will be imported both by the URL2AUDIO and the AUDIO2URL functions described below, because the parameters, filters, etc must match. Any modification to these must be done in this function: initialization has to be done again by calling the script audioURL.m, so that the .mat file is updated (the demo will not work properly, though).
The function in the file URL2AUDIO.m takes the URL to encode and embeds it in the desired audio file.
The function in the file AUDIO2URL.m gets the recorded audio and recovers the URL.
Lastly, in the folder ./functions/ there are other Matlab functions that are used by the three main ones.
More details on the functions can in found in the relative .m files.
Also, in the subfolder ./functions/01_Varicode/data/ there are the .txt files with the mapping used for converting the text URL to a bit array, using custom Varicode encoding described in the System page. There are also the programs used to generate these files. More information can be found in the file INFO.txt in the same location.