## Test signals

Along with listening tests SoundExpert performs objective measurements of audio devices and technologies. For the purpose a new audio metric is used. The core of the method is testing with some input signals and measuring level of their waveform degradation at the output. While test signals can be of any kind the measurement procedure stays the same and waveform degradation is measured with a single parameter - Difference level (dB). Below is a list of actual reference signals along with their time domain representation, frequency domain representation and Matlab code for their generation. All signals are 30s long, -10dBFS(rms), stereo, 16bit and have 44100Hz sample rate.

### Sine wave 1 kHz

`% Sin wave 1000 Hz`

% `30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

Fs = 44100; % [Hz]

L = 30; % [s]

G = -10; % [dB]

F = 1000; % [Hz]

Ls = round(L*Fs);

t = (0:Ls-1)';

ref = 10^(G/20) * sin(t*2*pi/(Fs/F));

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_sine1k.wav', int16(ref), Fs, 'BitsPerSample',16)

### Sine wave 12.5 kHz

`% Sin wave 12500 Hz`

`% ``30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

Fs = 44100; % [Hz]

L = 30; % [s]

G = -10; % [dB]

F = 12500; % [Hz]

Ls = round(L*Fs);

t = (0:Ls-1)';

ref = 10^(G/20) * sin(t*2*pi/(Fs/F));

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_sine12.5k.wav', int16(ref), Fs, 'BitsPerSample',16)

### DFD 12.5 kHz / 80 Hz

Difference Frequency Distortion (DFD) signal is described in the standards IEC60118 and IEC60268. It consists of two pure tones: 12460 Hz and 12540 Hz and is useful for assessment of intermodulation distortion.

`% DFD 12.5 kHz mean, 80 Hz difference (12460 Hz + 12540 Hz)`

`% ``30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

Fs = 44100; % [Hz]

L = 30; % [sec]

PdB = -10; % [dB]

F1 = 12460; % [Hz]

F2 = 12540; % [Hz]

Ls = round(L*Fs);

t = (0:Ls-1)';

ref = sin(t*2*pi/(Fs/F1)) + sin(t*2*pi/(Fs/F2));

Pr = sqrt(mean(ref.^2));

Pd = 10^(PdB/20)/sqrt(2);

Kp = Pd/Pr;

ref = ref .* Kp;

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_dfd12.5k.wav', int16(ref), Fs, 'BitsPerSample',16)

### Square wave 1 kHz

Band-limited version of square wave is used. It is generated by means of Fourier synthesis (http://www.dspguide.com/ch13/4.htm):

`% Fourier synthesis of square wave 1000 Hz`

`% ``30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

Fs = 44100; % [Hz]

L = 30; % [sec]

PdB = -10; % [dB]

F = 1000; % [Hz]

Ls = round(L*Fs);

t = (0:Ls-1)';

n = [1 3 5 7 9 11 13 15 17 19 21]; % harmonics for 44100Hz sample rate only

A0 = 0;

Bn = 0;

ref = zeros(Ls,1) + A0;

for N = n

An = sin(pi*N/2) * 2 / (pi*N);

ref = ref + An*cos(t*2*pi*N/(Fs/F)) - Bn*sin(t*2*pi*N/(Fs/F));

end

Pr = sqrt(mean(ref.^2));

Pd = 10^(PdB/20)/sqrt(2);

Kp = Pd/Pr;

ref = ref .* Kp;

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_square1k.wav', int16(ref), Fs, 'BitsPerSample',16)

### Triangle (odd) wave 1 kHz

Band-limited version of triangle wave is used. It is generated by means of Fourier synthesis (http://www.dspguide.com/ch13/4.htm):

`% Fourier synthesis of triangle wave 1000 Hz`

`% ``30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

Fs = 44100; % [Hz]

L = 30; % [sec]

PdB = -10; % [dB]

F = 1000; % [Hz]

Ls = round(L*Fs);

t = (0:Ls-1)';

n = [1 3 5 7 9 11 13 15 17 19 21]; `% harmonics for 44100Hz sample rate only`

A0 = 0;

Bn = 0;

ref = zeros(Ls,1) + A0;

for N = n

An = 4 / (N*pi)^2;

ref = ref + An*cos(t*2*pi*N/(Fs/F)) - Bn*sin(t*2*pi*N/(Fs/F));

end

Pr = sqrt(mean(ref.^2));

Pd = 10^(PdB/20)/sqrt(2);

Kp = Pd/Pr;

ref = ref .* Kp;

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_triangle(odd)1k.wav', int16(ref), Fs, 'BitsPerSample',16)

### Triangle (even) wave 1 kHz

This is an even-only harmonics companion of standard triangle signal. It is generated by means of Fourier synthesis (http://www.dspguide.com/ch13/4.htm) like triangle signal but using even-only set of harmonics :

`% Fourier synthesis of triangle (even) wave 1000 Hz (``ass train`

)

`% ``30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

Fs = 44100; % [Hz]

L = 30; % [sec]

PdB = -10; % [dB]

F = 1000; % [Hz]

Ls = round(L*Fs);

t = (0:Ls-1)';

n = [1 2 4 6 8 10 12 14 16 18 20 22]; `% harmonics for 44100Hz sample rate only`

A0 = 0;

Bn = 0;

ref = zeros(Ls,1) + A0;

for N = n

An = 4 / (N*pi)^2;

ref = ref + An*cos(t*2*pi*N/(Fs/F)) - Bn*sin(t*2*pi*N/(Fs/F));

end

Pr = sqrt(mean(ref.^2));

Pd = 10^(PdB/20)/sqrt(2);

Kp = Pd/Pr;

ref = ref .* Kp;

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_triangle(even)1k.wav', int16(ref), Fs, 'BitsPerSample',16)

### White noise

Generated with APx Waveform Generator Utility v4.2

`% White Noise`

`% ``30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

PdB = -10; % [dB]

ref = audioread('Noise_white_44k.32_1.wav','native');

ref = double(ref);

Pr = sqrt(mean(ref.^2));

Pd = 10^(PdB/20)/sqrt(2);

Kp = Pd/Pr;

ref = ref .* Kp;

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_whitenoise.wav', int16(ref), Fs, 'BitsPerSample',16)

### BS EN 50332-1

A special test signal "Program Simulation Noise", whose spectral content is representative of music and speech. It can be created by passing pink noise through a special filter network defined in IEC 60268-1. BS EN 50332 adds an additional requirement - that the crest factor of the test signal (the ratio between the instantaneous peak level of the signal and its RMS level) be between 1.80 and 2.2. Here it is generated with APx Waveform Generator Utility v4.2.

`% Pink Noise (BS EN 50332-1)`

`% ``30s, `

-10 dBFS (rms), 2 channels, 44100 Hz, 16 bit

PdB = -10; % [dB]

ref = audioread('Noise_bs_44k.32_1.wav','native');

ref = double(ref);

Pr = sqrt(mean(ref.^2));

Pd = 10^(PdB/20)/sqrt(2);

Kp = Pd/Pr;

ref = ref .* Kp;

ref = ref .* (2^15);

ref = round(ref);

ref = [ref,ref];

audiowrite('ref_bsen50332-1.wav', int16(ref), Fs, 'BitsPerSample',16)