Simple Signals for System Identification

Event accessible for observation can be investigated by examining timeline of certain measureable values. Usually the process is referred to as time domain analysis of signals. Such a signal can be of many different origins. It could be comprised of values of electrical current or voltage, mechanical displacement or force, value of stock or popularity of politicians, reaction of the patient to medication, and essentially anything which is observable, measurable and quantifiable with reasonable accuracy. Observer will quite intuitively search for certain patterns and periods in signal if phenomena changes along the timeline. Some of them are easily detectable, such as periodic variation of the suns activity; some might appear as random fluctuations at the first glance, such as parameters of the seismic waves in Earth's crust. Of course sources of noise and other disturbances are usually omnipresent and will make matters much more difficult to observe and explain.


Introduction
Event accessible for observation can be investigated by examining timeline of certain measureable values.Usually the process is referred to as time domain analysis of signals.Such a signal can be of many different origins.It could be comprised of values of electrical current or voltage, mechanical displacement or force, value of stock or popularity of politicians, reaction of the patient to medication, and essentially anything which is observable, measurable and quantifiable with reasonable accuracy.Observer will quite intuitively search for certain patterns and periods in signal if phenomena changes along the timeline.Some of them are easily detectable, such as periodic variation of the suns activity; some might appear as random fluctuations at the first glance, such as parameters of the seismic waves in Earth's crust.Of course sources of noise and other disturbances are usually omnipresent and will make matters much more difficult to observe and explain.
It is well known already from early days of modern science that signals can be analyzed in frequency domain as well or instead of time domain analysis.It turns out that for observable events both domains can be easily interchanged or in other words transformed one into other without any loss of information, and even joint time-frequency analysis can be performed.
First known usage of what is essentially known today as fast Fourier transform (FFT) is contributed to Johann Carl Friedrich Gauss (Goldstine, 1977, as cited in Heideman et al., 1984).In 1805 Gauss describes his computationally efficient method for interpolation of the orbits of celestial bodies.Intriguingly it was almost forgotten.Few years later, in 1807, Jean Baptiste Joseph Fourier, while interested in heat propagation, claimed that any continuous periodic signal could be represented as the sum of properly chosen sinusoids during his presentation to the Academy of Sciences in Paris.That claim ignited dispute between the reviewers of his paper: Pierre-Simon Laplace, and Joseph-Louis Lagrange, and delayed the publication until 1822 (Heideman et al., 1984).Joseph-Louis Lagrange's protests were based on the fact that such an approach could not be used to represent signals with sharp corners, or in another words with discontinuous slopes, such as square waves.Dispute lasted almost hundred years until Maxime Bôcher gave a detailed mathematical analysis of the phenomenon and named it after the Josiah Willard Gibbs (Bôcher, 1906).In essence both Lagrange and Fourier were right.While it is not possible to construct signals with sharp corners from sinusoids it is possible to get so close that the difference in energy between these signals is zero.If real signals from nature are concerned instead of exact and purely Topic in general is too broad to discuss in one book or even in series of books, and many good papers and books are already written on the topic (Godfrey, 1993;Pintelon & Schoukens, 2001;etc.to name a few), however when low complexity, limited energy consumption and highly optimized measurement systems are targeted new solutions are often warranted, and some of them are briefly discussed in the following pages.So emphasis is given to properties and practical design of custom excitation signals.

General considerations
Any system has large set of different parameters, and many subsets of them to be characterized according to requirements imposed by task at hand.Sometimes they can be measured separately and sequentially one at a time, but quite often not.Bulk of system identification theory is based on an assumption that systems are linear and time invariant (LTI), which they are not.Generally certain set of measurements has to be conducted within short enough timeframe for the system to remain reasonable motionless, and with signals which will only very moderately drive system under investigation (SUT) into the non-linear region of operation.Limited magnitudes of excitation signals and the need to consider frequency spectrum of these signals very carefully are both among implications rising from the last requirement.Unfortunately there is also third factor to consider.Disturbances from surrounding world, and noise impact, can effectively render useless any and all of the measurement results, if not dealt with care.Signal to noise ratio (SNR) is often used for numeric quantification of the problem.Similarly known signal to noise and distortion ratio (SINAD) does a little better when covering the problem area and considering likely nonlinear behavior of the SUT as well.Shorter excitation time and limited excitation signal energy are always paired with lower SNR.
Therefore it is clear that whenever real systems are characterized, then choice of excitation signals is always a subject of optimization and compromise.Effectiveness of said optimization depends on level of prior knowledge.Things to consider include measurement conditions, SUT itself and the cost of the measurement.Successive approximation and adaptation can be considered when prior knowledge is limited, unless it is one of a kind or very rare event.Fortunately these very rare cases are indeed rare, and furthermore there is usually at least some amount of general prior knowledge available.
Real objects and systems are seldom fully homogenous and isotropic; therefore several measurements from different locations might be warranted for sufficient characterization of the SUT.Possibility of sequential in time measurements from different locations depends largely on time variance of the parameters of the system.Such a variance could be caused by slow ageing, rapid decay, and fast spatial movement of the SUT relative to the measurement system, as well as by modulation of some of the parameters of the SUT with outside signals.Ideally variance should be excluded by taking readings from different locations simultaneously and rapidly enough.One way to achieve this is to conduct measurements at several slightly differing frequencies.In this case system properties between different points can be separated, and values will not vary much due to almost identical frequencies: Fig. 1.System identification in case of two simultaneous excitation signal with slightly differing frequencies f 1 , and f 2 , injected from different points Similar but different task is accomplished when system properties at vastly different frequencies are of interest.Again sequential in time measurements can be considered, but in case of fast variations in system properties simultaneous multifrequency measurement is essential: Fig. 2. System identification in case of two excitation waveforms with highly differing frequencies f 1 , and f 2 , injected from the same point In even more complex cases multisite and multifrequency measurement are needed simultaneously.Question arises whether it is possible to optimize such a complex measurement by applying different signals and processing methods.Following matter discusses some suitable signals with increasing complexity.For comparison both waveform and frequency content of these signals is given.
Frequency response of any system is comparison of the magnitudes and phases of the output signal spectral components with the input signal components in real world measurement situations.It is best viewed as complex function of frequency.Instead of magnitudes and phases it is often useful to represent the result in Cartesian coordinates.Link is straightforward: ω , then using simple trigonometric product-to-sum identity it is possible to write: And: From those equations it is clear that if double frequency component and factor of two is disregarded, then first equation can be viewed as giving real part of the complex response, and second equation an imaginary part.When response on only few frequencies is needed, then such a multiplication is often preferred signal processing method both in analog and digital domains.Of course it should be complemented with low pass filtering in order to remove 2ω component.If other than sinusoidal signals are used for excitation and reference, then more frequency components should be considered when calculating response.As long as the reference signal is kept sinusoidal result of the multiplication is still faithful representation of the complex response of the system at the frequency of the reference signal.Some scaling is needed though, due to the fact that magnitude of the fundamental frequency component of the non-sinusoidal signal is different from the magnitude of said signal itself.Unfortunately quite often the reference waveform is far from sinusoidal.Square wave is preferred simply because multiplication of two functions will be replaced by simple signed summing.In analog signal processing domain it will enable to use simple switches instead of sophisticated, error prone, and power hungry multipliers.Same is true in digital domain, where multiply accumulate operation can be replaced with simpler accumulation.Also in this case system response is correct if excitation signal is kept sinusoidal, and in addition to that the system is truly linear.Last part requires very careful analysis, since appearing higher harmonics might coincide with reference signal harmonics, and after multiplication became undistinguishable from the true response.Still, SINAD of the response will degrade even if system can be considered sufficiently linear.If nothing else, then noise will leak into the result, at frequencies which will coincide with higher harmonics of the reference signal.Therefore methods which enable reduction of higher harmonics in reference signal, while keeping it reasonable simple for signal processing, are of utmost importance.

Square waves for measurement at single frequency
First the simplest and spectrally worse signal is examined.It is square wave signal or signal which can be described as the sign of sin( ) t ω : 25 0,5 0,75 1 1,25 1,5 1 It can be viewed as signal with fundamental frequency ω having higher harmonics on odd multiplies of ω.If multiplication of the system response signal with orthogonal references is chosen as signal processing means, and these reference signals are not sinusoids, then all the members of the Fourier series of the response signal are multiplied with all the members of the Fourier series of the reference signals, i.e. not only fundamental components of the signal, but also all higher harmonics.Therefore if those members of the Fourier series coincide in frequency, then the results of multiplication will be added together and become undistinguishable.The measurement is no longer conducted on single well defined frequency, but instead produces results also on all higher harmonics.As it was discussed above it could be largely ignored, if during signal processing multiplication is conducted with sinusoidal signals, unfortunately it is often accomplished with the same rectangular signal instead, and energy form higher harmonics is summed together.Also spectral impact due to non-linearity of the object (or apparatus) cannot be separated from desired response signal anymore.Worst case impact of the coinciding spectral components summed eventually all together can be seen on Fig. 5 with dotted line.
There is another way of looking at how the errors appear (Kuhlberg, Land, Min, & Parve, 2003), by considering phase sensitivity characteristics of the synchronous demodulator (SD).They are easy to draw by varying phase shift φ between two signals.For simple square waves such a characteristic is presented on Fig. 6.For comparison it is drawn together with ideal circle which appears when two sinusoids are multiplied.135791 1 1 3 1 5 1 7 1 9 2 1 2 3 2 5 2 7 2 9 3 1 order of the harmonic impact of the harmonic n in dB Fig. 5. Worst case relative impact of the higher harmonics to the multiplication result compared to the level of first harmonic in dB.Case of ordinary square wave (dotted line), simple shortened square wave (white boxes), and multilevel shortened square wave (black boxes) (Annus, Min, & Ojarand, 2008) Im Fig. 6.Quality of synchronous demodulation in case of square wave signals (bold line).For clarity only one quarter is shown From the Fig. 6 the magnitude error can be easily computed, as the difference between two lines, and Fig. 7. shows this relative magnitude error when square waves are used instead of sinusoids.
Relative magnitude errors of such magnitude as shown in Fig. 7 are generally unacceptable.Not to mention large (several degrees) phase errors in addition to the magnitude error.Only in very specific cases is measurement with pure square waves useful, such as measurement of electrical bioimpedance in implanted pacemakers, where energy constraints are severe.
Fortunately there is very simple method for reducing errors introduced by higher harmonics.Let's consider sum of two square waves with same frequency and amplitude, one of them shifted in phase by β degrees, and another -β degrees.Such a double shift is preferable, since resulting function is again odd.In signal processing odd functions are more natural, because negative time is usually meaningless, and signals start at t=0.Care must be taken that in many mathematical textbooks, and more importantly in different programs, even functions are considered instead.Should the summary phase shift 2β be equal to the half period or odd multiply of half periods of any of the higher harmonic, then such a harmonic will be eliminated from the signal, since sum of two equal sinusoids with 180 degree shift is zero.Such an operation is essentially comb filtering.Main difference of the resulting signal compared with simple square wave is in appearing third level with zero value, so it is reasonable to call them shortened square waves.More generally spectrum of these signals can be derived from Fourier series: Two of these shortened square waves are of special interest.In order to remove 3rd and 5th harmonics from the signal (as they cause most significant errors) 18 degree and 30 degree shifts are useful.First of them is void of 5th, 15th, etc. harmonics, and second 3rd, 9th, 15th etc. harmonics.It means that impact of these harmonics is drastically reduced.Both of these three level signals with amplitude A are shown on Fig. 8.The third level does not introduce 0 . 18, and 30 degree shortened signals with amplitude A (Min, Kink, Land, & Parve, 2006) much added complexity from signal generation or processing point of view.Both generation with digital logic, and also synchronous rectification with CMOS switches is straightforward (Min, Kink, Land, & Parve, 2006).If one of them is used as excitation signal and other as rectifying reference, then the result will be much cleaner spectrally when compared to simple square waves, Fig. 5 white rectangles.These two waveforms were chosen, because complete elimination of certain harmonics was desired.Due to that quality of synchronous demodulation is drastically improved, as it can be seen on Fig.If complete elimination of some of the harmonics is not pursued, then arbitrary shift between component square waves is allowed.One possible optimization approach would be to find shortened square wave where minimal energy is leaked into higher harmonics.Relative dependence of the energy of the higher harmonics from shortening angle can be seen on Fig. 11:  Such a signal could be used for excitation as well as for synchronous demodulator.Since curve is relatively flat around minimum then shortening angels between 22 and 24 degrees produce almost equally good results.Obvious choice for real system identification task would be 22,5 degrees.Compared with previously discussed pair of shortened square waves generation of such a signal requires much lower clock frequency.When 18 and 30 degree shortening is required, then the clock frequency must be at least 30 times higher than the frequency of the resulting signal.With 22,5 degree shortened signal only 8 times higher clock is required.It allows either better energy efficiency by lowering the system clock, or alternatively allows usage of higher frequency signals at the same clock rate.An added benefit is, that noise leakage into result is lower, then in case of 18 and 30 degree shortened pair.
While performing considerably better than simple square waves these shortened signals are far from ideal sinusoid.Could the same summing procedure produce further improvement without much added complexity, if more square waves are added together?The answer is yes.It is enough to add third member into palette consisting already from two square waves shortened by 18 and 30 degrees, namely square wave shortened by 42 degrees.By combining these three signals promising results can be achieved.Three interesting and still simple signals are considered as combinations of previously mentioned summed signals.
First and perhaps most obvious is a sum of 18, 30, and 42 degrees shortened square wave signals with signs 1,-1, and 1. Resulting waveform is on Fig. 14, and spectrum of this waveform is on Fig. 15 (Annus, Min, & Ojarand, 2008).It is much cleaner compared to ordinary square wave.-1, and 1 (Annus, Min, & Ojarand, 2008) If on the other hand excitation is also shortened square wave, then following pair of signals is suggested (Annus, Min, & Ojarand, 2008).First of them is sum of all three components with coefficients 1,1, and 1, Fig. 16.Spectrum of this summed signal is on Fig. 17 Where m is the total number of approximation levels, and q = 0, 1, 2, …, m is the approximation level number.Spectral composition of these approximated harmonic functions can be found according to the following equation: Where k h is the number of the higher harmonic, which exist in the spectra, and i=1,2,3,… If two such signals with number of levels m 1 and m 2 are multiplied, then coinciding harmonics can be found according to: Where j=1,2,3,… If two waveforms with m=3, and m=4 are considered, then first coinciding harmonics are 47 th , 49 th , 95 th , 97 th , 143 rd , 145 th , etc.As with shortened square waves clock frequency should be relatively high, and furthermore these waveforms are relatively sensitive to level errors, which prohibit usage of higher m values, and manifest itself in reappearing higher harmonics.

Square waves for multifrequency measurement
If system parameters vary with frequency, as they usually do, single frequency measurement is not enough to fully describe object under test.In complex cases, like measuring electrical properties of biological specimens, sweeping over wide frequency band may be warranted.Sweeping on the other hand is slow, and prohibits examination of faster changes in object under investigation, since transfer function of dynamic system is time dependent.Measurements must be as short as possible to avoid significant changes during the analysis and, at the same time, as long as possible for enlarging the excitation energy and improving signal to noise ratio.
Chirp signals can be considered to remedy those shortcomings.They will mentioned here only briefly, since more comprehensive overview is in different chapter.Chirp signals, i.e. multi-cycle sine wave based signals in which the frequency increases ('up-chirp') or decreases ('down-chirp') continuously as a function of time, are widely used in radar and sonar applications, acoustic, ultrasonic, optical and seismological studies.The main advantage of chirp signals is their well-defined frequency range and predetermined power spectral density and good crest factor.Rectangular chirps can be used to further simplify signal generation and processing.Moreover, the rectangular waveform has the minimal possible value crest factor (ratio of a peak value to a root-mean-square level) of 1. Two signals are viewed here briefly: binary chirp and ternary chirp (Min et al., 2012).Binary or signum chirp is defined as signum of the sinusoidal counterpart.For linear chirps: Where T is duration of the chirp signal, 0 tT ≤ ≤ , and B is bandwidth of the signal.It has crest factor of 1, and it means that energetically the signum chirp is two times more powerful than sinusoidal chirp.Waveform of the binary chirp can be seen on Fig. 22. Third level can be introduced by comparing sinusoidal chirp with two levels instead of one as it is done in case of binary chirp (Fig. 23).Fig. 22. NRZ or non-return-to-zero binary rectangular chirp pulse (Min et al., 2012) Fig. 23.Return to zero (RZ) ternary rectangular chirp pulse (Min et al., 2012) Instead of chirp signals other waveforms can be considered as well.A widely used method is to generate a pseudo-random maximum length sequence (MLS).Spectrum of the MLS signal follows a square(sin(x)/x) law.Signal processing is usually accomplished by taking circular cross-correlation of the output signal with the excitation MLS.MLS and chirp have however one serious disadvantage -their energy is distributed equally, or almost equally, over the whole frequency band of interest.Therefore, the power spectral density A 2 /Hz is comparatively low.
In practice, there is seldom a need to measure at all of the frequencies within the bandwidth simultaneously, except perhaps when system under test is highly resonant.Usually it is enough to know the parameters at several arbitrarily spaced frequencies separately.Therefore, it is reasonable to concentrate the energy of the excitation signals to frequencies of interest instead of using uniform energy distribution over full measurement bandwidth.That can be achieved by summing up several sinusoids: 1 () s i n ( 2) Unfortunately while single sinusoid is technically feasible signal, and can be reproduced quite accurately, it becomes increasingly costly to use simultaneously many sinusoidal signals.
There is another drawback associated with simultaneous use of multiple sinusoidal signals -crest factor.With single sinusoid the crest factor is 2 1,414 ≈ .By summing two or more sinusoidal signals together the crest factor can take many different values, generally bigger then 1,414.Why is crest factor so important?Two reasons are worth considering: nonlinear behavior of the object under investigation, and dynamic range of the measurement apparatus itself.Real objects can rarely be described as linear.It means that different excitation levels do not produce linearly dependent responses.For practical purposes measurement signals are usually kept within narrow range of amplitudes where object behaves approximately linearly.It is clear that such an approximation is better the narrower the range is kept.In worst case high energy pulses can even permanently alter or destroy the object under investigation, and that is certainly not acceptable when performing measurements for example on living human tissue.Also dynamic diapason of the apparatus is limited.From the lower side the limit is set by omnipresent noise signal.If the measurement signal is completely buried in the noise and cannot be restored any more the Interestingly almost all the parameters of the multisinusoidal signal can be improved considerably by simplifying it drastically (Annus et al., 2011).Such a signal is derived from the original multisinusoidal signal by detecting its zero crossings: 1 (() ) s i n ( 2) Clearly multifrequency binary signal is easier to generate then multisinusoidal signal, and has far superior crest factor of 1. Minor drawback can be seen on Fig. 26, where spectrum of such a signal is shown.So called " snow" lines appear between the wanted frequency components, and roughly 30% of the total energy is lost for measurement:   Useful spectral components in binary multifrequency signal contain 1,34927 times more energy than in case of optimized multisine, or 4,32933 times more than the multisine above without optimization.At first glance there is another drawback, since magnitudes of useful components are not exactly equal anymore.Fortunately said magnitudes can be easily equalized by iteratively manipulating magnitudes of the components of the original multisinusoidal signal.Residual error is generally well below one percent.Furthermore almost arbitrary magnitudes of spectral components can be achieved (Fig. 28).

Conclusion
With some minor drawbacks it is possible to construct relatively simple square wave signals in order to replace more sophisticated sinusoidal or arbitrary waveforms when system identification is warrantied.Simplest square wave nevertheless might not be sufficiently good measurement signal.By adding few more levels situation can be improved considerably.These signals can be used to replace single sinusoids, chirps, and arbitrary sums of sinusoids.Generally it is a good idea to choose best signal for given identification task.Some choices are shown, and reasoning behind theme given.

Fig. 3 .
Fig. 3. Complex number with unity magnitude in polar and Cartesian coordinates If sinusoidal signal with frequency ω, magnitude A and relative phase φ compared to reference signal is multiplied by orthogonal set of reference sinusoids, i.e. sin( ) t ω and Fig. 4.An odd square wave, with frequency / 2 1 f Hz ω π = = Fourier series of this square wave function will contain only sinusoidal members, since function is odd, i.e. () ( ) fx f x − =−:

Fig. 7 .
Fig. 7. Relative magnitude error when square wave signals are used during synchronous demodulation

Fig. 9 .
Fig. 9. Quality of synchronous demodulation in case of shortened square wave signals bold line, compared with sinusoidal signals dashed line 3

Fig. 25 .
Fig. 25.Typical binary multifrequency signal with eleven components and random phases

Fig. 26 .
Fig. 26.Spectrum of binary multifrequency signal with ten components and random phases Truth is revealed when spectrum of optimized multisine is drawn together with spectrum of the binary counterpart:

Fig. 27 .
Fig. 27.Magnitudes of spectral lines in binary multifrequency signal (grey squares) together with spectrum of multisinusoidal signal (black squares)

Fig. 28 .Fig. 29 .
Fig. 28.Magnitude control example When two level comparison is introduced instead, then energy leakage into unwanted components can be reduced.Such a ternary multifrequency signal can be seen on Fig. 29.