Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Maximum Length Sequences and the use with HRTFs and Room impulses
1. Rob Schubert
ACS – Virtual Acoustics
Final Paper: Page 1 of 6
Maximum Length Sequences and the use with HRTFs and Room impulses
1.0 Virtual Acoustics and transfer function measurement
Virtual acoustics requires the use of head related transfer functions and sometimes
employs reverberation from real acoustic spaces to create an environment to attempt a
real space for the listener. There are several ways to measure these transfer functions,
swept sine waves, impulses, periodic impulse response (PIR) and maximum length
sequences. The later has many advantages and some disadvantages to the former
methods which will be reviewed here.
2.0 What exactly is Maximum Length Sequences?
Maximum Length Sequences (MLS) is a pseudo-random signal of positive and
negative maximum value digital shift registers called a comb function. This function
would be represented this by a +1 and a 0. The length of a MLS can be any length
defined by 2N
-1 samples, where N is the order of the function. The MLS is designed to
have sub-sequences where one half of the runs are of length 1, one quarter of the runs are
of length 2, one eighth of the runs are of length 3, etc. This causes MLS to have nearly
the same number of +1s as 0s. To use to measure audio transfer functions, it would be
required to translate to an analog signal. To implement this signal, these digital shift
registers would be convolved with a pulse signal of length dt, shown in figure 1.
2. Rob Schubert
ACS – Virtual Acoustics
Final Paper: Page 2 of 6
Figure 1: Implementation of 7 point MLS, converted to a continuous analog signal. (a) is
convolved with (b) to form (c).
This would create a continuous time signal. To maximize signal to noise ratio in audio
and to minimize DC offset, the zeros are replaced by –1. This provides a DC offset
(mean) inversely proportional to N, which with large values of N, would approach zero.
Consequently, if one uses the MLS as the input to a system, the cross-correlation of the
input and the output will result in the system's impulse response. Since the MLS is
deterministic and repeatable, and the autocorrelation provides 1 at zero time lag, and near
zero everywhere else – which is nearly the same as white noise. There are some
commercially available software packages as well as some freely available scripts to
generate MLS, a few of which will be reviewed later.
3. Rob Schubert
ACS – Virtual Acoustics
Final Paper: Page 3 of 6
One measure to indicate how these various functions perform in signal to noise ratio is
crest factor, peak/RMS – where lower is better. For the impulse, this is very high since
peak would be high and depending on the length the RMS would be low. The PIR
method would have a lower crest factor, but still fairly high. For swept sine, the crest
factor is 1.414. The best is MLS, which equals 1.
According to Rife and Vanderkooy, when MLS is employed, it will excite the measured
system at (L-1)/2 frequencies, where L is the length of the MLS. The discrete
frequencies which will be excited are spaced 1/(L*dt), in which dt is the sample interval
in seconds. So longer the MLS, the more frequencies will be excited and the better lower
the DC offset will be.
Figure 2: Example of Matlab generated MLS with N=7 (order: 7). This was generated
with Ludwig’s sequence in appendix.
4. Rob Schubert
ACS – Virtual Acoustics
Final Paper: Page 4 of 6
3.0 Improvements to the basic MLS sequence
To improve MLS measurements, repeating periods of MLSs can be used. To avoid
aliasing, it is recommended the length of the MLS exceeds the length of decay of the
system to be measured. Pre-averaging these periods before computing the cross
correlation improves signal to noise ratio even further. Another method to improve signal
to noise ratio, is to put some pre-emphasis filter on the MLS sequence. This is
advantageous when the interfering noise is not flat. If a pink noise filter is used for pre-
emphasis, it increases low frequency noise immunity, as well as providing a nearly
gausian probability density function.
4.0 Commercially available systems
There are several commercially available MLS based systems, the first of which is
MLSSA. The MLSSA system was developed by Rife and DRA laboratories to use MLS
sequences to measure speaker performance as well as room performance. The literature
states many advantages to using MLS over RTA (Real Time Analysis) which emits white
noise to equalize room frequencies. This system also is capable of employing pink noise
MLS - not defined in their literature, but I suppose one can assume it is a filtered MLS to
contain frequencies known as pink noise. Another advancement, which is also not
defined, is the ability to use rotating tables with MLS. Other systems which use MLS are
LAUD/Praxis and Automatica’s Clio, of which little is said on how MLS is employed.
5.0 Issues with MLS testing
5. Rob Schubert
ACS – Virtual Acoustics
Final Paper: Page 5 of 6
Vorlander and Kob reviewed the practical use of MLS in measuring room acoustics. In
essence, they determined that small changes in temperature and wind speed can result in
a significant error in measuring reverberation time, on the order of 0.1 deg C or 0.6 m/s.
This is causes a small phase shift basically causing a repeated MLS sequence to cancel
each other out. To use MLS, it appears critical that the system remains completely time
invariant. In addition, it has been found that low frequency is particularly hard to
measure, and the MLS test method has no advantage over other methods in this area.
Appendix:
Matlab Script to generate a MLS:
% MLS Sequence generator. Copyright Arthur C. Ludwig, March 2001
if exist(N') ~= 1; N= 15; end;
if N == 18; taps=[0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1]; end;
if N == 17; taps=[0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1]; end;
if N == 16; taps=[0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 1]; end;
if N == 15; taps=[0 0 0 0 0 0 0 0 0 0 0 0 0 1 1]; end;
if N == 14; taps=[0 0 0 1 0 0 0 1 0 0 0 0 1 1]; end;
if N == 13; taps=[0 0 0 0 0 0 0 0 1 1 0 1 1]; end;
if N == 12; taps=[0 0 0 0 0 1 0 1 0 0 1 1]; end;
if N == 11; taps=[0 0 0 0 0 0 0 0 1 0 1]; end;
if N == 10; taps=[0 0 0 0 0 0 1 0 0 1]; end;
if N == 9; taps=[0 0 0 0 1 0 0 0 1]; end;
if N == 8; taps=[0 0 0 1 1 1 0 1]; end;
if N == 7; taps=[0 0 0 1 0 0 1]; end;
if N == 6; taps=[0 0 0 0 1 1]; end;
if N == 5; taps=[0 0 1 0 1]; end;
if N == 4; taps=[0 0 1 1]; end;
if N == 3; taps=[0 1 1]; end;
M = 2^N-1;
m = ones(1,N);
regout = zeros(1,M);
for ind = 1:M
buf = mod(sum(taps.*m),2);
m(2:N) = m(1:N-1);
6. Rob Schubert
ACS – Virtual Acoustics
Final Paper: Page 6 of 6
m(1)=buf;
regout(ind) = m(N);
end
comp = ~ regout; sequence = regout - comp;
Sources:
Bristow-Johnson, Robert. “Little MLS Tutorial,” http://www.dspguru.com March 2003.
Waslo, Bill. “Maximum Length Sequence based measurements with LAUD,”
http://www.libinst.com, June 1993.
“MLSSA acoustic measurement system,” http://www.mlssa.com
Rife, Douglas; Vanderkooy, John; “Transfer-function measurement with Maximum
Length Sequences,” Journal of the Audio Engineering Society, V37, I6, pp 419-444.
Vorlander, Michael; Kob, Malte. “Practical Aspects of MLS Measurements in Building
Acoustics,” Applied Acoustics V52, pp 239-258
Ludwig, Art. “Part III: Maximum Length Sequences,” http://www.silcom.com/~aludwig/
March 2001
Peterson, W., W., Error Correcting Codes, MIT Press, Cambridge, MA, 1961
7. Rob Schubert
ACS – Virtual Acoustics
Final Paper: Page 6 of 6
m(1)=buf;
regout(ind) = m(N);
end
comp = ~ regout; sequence = regout - comp;
Sources:
Bristow-Johnson, Robert. “Little MLS Tutorial,” http://www.dspguru.com March 2003.
Waslo, Bill. “Maximum Length Sequence based measurements with LAUD,”
http://www.libinst.com, June 1993.
“MLSSA acoustic measurement system,” http://www.mlssa.com
Rife, Douglas; Vanderkooy, John; “Transfer-function measurement with Maximum
Length Sequences,” Journal of the Audio Engineering Society, V37, I6, pp 419-444.
Vorlander, Michael; Kob, Malte. “Practical Aspects of MLS Measurements in Building
Acoustics,” Applied Acoustics V52, pp 239-258
Ludwig, Art. “Part III: Maximum Length Sequences,” http://www.silcom.com/~aludwig/
March 2001
Peterson, W., W., Error Correcting Codes, MIT Press, Cambridge, MA, 1961