# Portable and Highly Versatile Impedance Meter for Very Low Frequency Measurements
## 2 Materials and Methods
### Digital Signal Elaboration Software  
The fundamental operations that must be performed by the personal computer for the system in Figure 2 to operate correctly are the generation of the signals \(v_{OR}\) and \(v_{OL}\), the acquisition of the signals \(v_{IL}\) and \(v_{OR}\) and the extraction of the modulus and the phase of each sinusoidal component in each channel so that the admittance can be estimated according to Equation (16). All software was developed in C, and it is freely available as it is based on public domain libraries. For controlling the sound board, we resorted to the public domain PortAudio [40] library. For signal generation, we developed a simple library for the software implementation of sinusoidal Numerically Controlled Oscillators (NCOs), while for the analysis of the acquired signals and the extraction of the admittance of the DUT we relied on the Narrow Band (NB) estimation extension of the QLSA public domain library [35; 36]. Signal generation, acquisition, and elaboration all revolve around a PortAudio callback function for managing real time operation of the system. The callback is activated any time a new record of input data becomes available in the input buffer and a new record of output data has to be sent to the output buffer. Any time the callback is activated, N\({}_{\text{S}}\) samples are retrieved for each of the two input channels and N\({}_{\text{S}}\) samples are inserted into the output buffer for each of the two output channels. The number of samples N\({}_{\text{S}}\) is chosen as a power of 2 (typically ranging from 2\({}^{12}\) up 2\({}^{15}\)) as this simplifies the interface to the QLSA library that can only accept records with a number of samples for each channel that is a power of 2. In order to reduce the computational load for the PC, signal generation is performed by resorting to a software implementation of the approach discussed in [41] that is the basis for many modern Direct Digital Synthesis integrated circuits. We used 30-bit phase accumulators that, with a standard sampling frequency \(f_{CK}=48\) kHz for the audio board, resulted in a frequency resolution of 44.7 uHz. Values of sin(x) and cos(x) were obtained starting from a 2\({}^{16}\) locations look-up table using the 16 most significant bits of the phase accumulators for addressing the table, with the remaining 14 bits being used for linear interpolation between adjacent look-up table entries. Calculations were performed in floating point and samples were sent to PortAudio in the same format. Overall, the error in the values of sin(x) was maintained well below 1 LSB of a 24 bit DA converter with an output dynamic of \(\pm 1\) V. Two independent signal sources were implemented (DDS 1 and DDS 2 in Figure 3). The cosinusoidal outputs from the two DDSs were used to generate the records of samples to be sent to the audio board output in order to create the \(v_{OR}\) and \(v_{OL}\) signals in Equations (1) and (2). The DDS used to generate the carrier (DDS 1) also outputs a quadrature signal that can be used in the \"carrier removal\" block in Figure 3. The role of the carrier removal block is best discussed in conjunction with the way in which QLSA is used to extract information on the impedance of the DUT from the \(v^{\prime}_{IL}\) and \(v^{\prime}_{IR}\) signals. It must be pointed out that resorting to QLSA for extracting impedance information from \(v^{\prime}_{IL}\) and \(v^{\prime}_{IR}\) is not mandatory: other numerical procedures can be implemented. However, besides the fact that QLSA, with its NB extension, is readily available, a few of its features greatly help in simplifying the measurement procedure, as we shall discuss in the next sections. As discussed in [35], QLSA is a library for simplifying the implementation of spectral analysis applications especially in the field of low frequency noise measurements. In this work, we are, however, interested in the NB extension that was mainly introduced to simplify the analysis of strongly peaked noise spectra as discussed in detail in [36].