A computer implemented method for generating a binary spectrally sparse sequence excitation signal with energy concentrated at preselected discrete frequencies for measuring and monitoring of a complex transfer function of a Sample Under Test SUT, the method comprising the steps of: providing a signal parameter set, said signal parameter set comprising a set of frequencies B, a set of amplitudes A wherein each amplitude of said set of amplitudes A corresponds to one frequency of said set of frequencies B, a set of initial phase shift PH for said frequencies B, and a signal length p; providing a reference signal Rp for determining transition instance Ti between two discrete values, providing a signal quality set, comprising an expected amplitude spectrum Aexp of the binary spectrally sparse sequence and an accepted inaccuracy level EPS describing accepted differences of amplitudes A of said binary spectrally sparse sequence from said signal parameter set; iteratively calculating a binary sequence, comprising the steps of calculating a template signal Tp as sum of sine waves according to said signal parameter set, determining the transition instances Ti by comparing said reference signal Rp and said template signal Tp, compiling said binary sequence SSS, calculating signal spectral properties, namely an amplitude spectrum As and a phase spectrum PHs for said binary sequence SSS, comparing said signal spectral properties against said signal parameter set and said signal quality set; storing said binary sequence SSS or its descriptive parameters when quality criteria defined by said signal quality set are met, extracting subset As and PHs and updating signal parameter set A, PH when loop end criteria are not met, and converting said binary sparse spectral sequence by a digital to quantity converter into a physical quantity and applying said physical quantity as an excitation signal to said Sample Under Test, receiving from said Sample Under Test a response signal corresponding to said physical quantity, converting by a quantity to digital converter said response signal to a digital data record and calculating said Complex Transfer Function of said Sample Under Test from said excitation signal and said response signal, wherein said physical quantity selected from a group consisting of electrical current, voltage, a combination of current and voltage, and pressure, tension, force, and temperature. providing a signal parameter set, said signal parameter set comprising a set of frequencies B, a set of amplitudes A wherein each amplitude of said set of amplitudes A corresponds to one frequency of said set of frequencies B, a set of initial phase shift PH for said frequencies B, and a signal length p; providing a reference signal Rp for determining transition instance Ti between two discrete values, providing a signal quality set, comprising an expected amplitude spectrum Aexp of the binary spectrally sparse sequence and an accepted inaccuracy level EPS describing accepted differences of amplitudes A of said binary spectrally sparse sequence from said signal parameter set; iteratively calculating a binary sequence, comprising the steps of calculating a template signal Tp as sum of sine waves according to said signal parameter set, determining the transition instances Ti by comparing said reference signal Rp and said template signal Tp, compiling said binary sequence SSS, calculating signal spectral properties, namely an amplitude spectrum As and a phase spectrum PHs for said binary sequence SSS, comparing said signal spectral properties against said signal parameter set and said signal quality set; storing said binary sequence SSS or its descriptive parameters when quality criteria defined by said signal quality set are met, extracting subset As and PHs and updating signal parameter set A, PH when loop end criteria are not met, calculating a template signal Tp as sum of sine waves according to said signal parameter set, determining the transition instances Ti by comparing said reference signal Rp and said template signal Tp, compiling said binary sequence SSS, calculating signal spectral properties, namely an amplitude spectrum As and a phase spectrum PHs for said binary sequence SSS, comparing said signal spectral properties against said signal parameter set and said signal quality set; storing said binary sequence SSS or its descriptive parameters when quality criteria defined by said signal quality set are met, extracting subset As and PHs and updating signal parameter set A, PH when loop end criteria are not met, and converting said binary sparse spectral sequence by a digital to quantity converter into a physical quantity and applying said physical quantity as an excitation signal to said Sample Under Test, receiving from said Sample Under Test a response signal corresponding to said physical quantity, converting by a quantity to digital converter said response signal to a digital data record and calculating said Complex Transfer Function of said Sample Under Test from said excitation signal and said response signal, wherein said physical quantity selected from a group consisting of electrical current, voltage, a combination of current and voltage, and pressure, tension, force, and temperature.