Next Article in Journal
Integration of Direction Fields with Standard Options in Finite Element Programs
Next Article in Special Issue
Cost-Effective Analysis of Control Strategies to Reduce the Prevalence of Cutaneous Leishmaniasis, Based on a Mathematical Model
Previous Article in Journal / Special Issue
Solution of Optimal Harvesting Problem by Finite Difference Approximations of Size-Structured Population Model
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Simple Spectral Observer

by
Lizeth Torres
1,*,
Javier Jiménez-Cabas
2,
José Francisco Gómez-Aguilar
3 and
Pablo Pérez-Alcazar
4
1
Cátedras CONACYT, Instituto de Ingeniería, Universidad Nacional Autónoma de México, 04510 Ciudad de México, México
2
Departamento de Ciencias de la Informática y Electrónica, Universidad de la Costa, Barranquilla, Colombia
3
Cátedras CONACYT, Centro Nacional de Investigación y Desarrollo Tecnológico, Tecnológico Nacional de México, 62490 Cuernavaca, México
4
Facultad de Ingeniería, Universidad Nacional Autónoma de México, 04510 Ciudad de México, México
*
Author to whom correspondence should be addressed.
Math. Comput. Appl. 2018, 23(2), 23; https://doi.org/10.3390/mca23020023
Submission received: 3 March 2018 / Revised: 9 April 2018 / Accepted: 10 April 2018 / Published: 1 May 2018
(This article belongs to the Special Issue Optimization in Control Applications)

Abstract

:
The principal aim of a spectral observer is twofold: the reconstruction of a signal of time via state estimation and the decomposition of such a signal into the frequencies that make it up. A spectral observer can be catalogued as an online algorithm for time-frequency analysis because is a method that can compute on the fly the Fourier Transform (FT) of a signal, without having the entire signal available from the start. In this regard, this paper presents a novel spectral observer with an adjustable constant gain for reconstructing a given signal by means of the recursive identification of the coefficients of a Fourier series. The reconstruction or estimation of a signal in the context of this work means to find the coefficients of a linear combination of sines a cosines that fits a signal such that it can be reproduced. The design procedure of the spectral observer is presented along with the following applications: (1) the reconstruction of a simple periodical signal, (2) the approximation of both a square and a triangular signal, (3) the edge detection in signals by using the Fourier coefficients, (4) the fitting of the historical Bitcoin market data from 1 December 2014 to 8 January 2018 and (5) the estimation of a input force acting upon a Duffing oscillator. To round out this paper, we present a detailed discussion about the results of the applications as well as a comparative analysis of the proposed spectral observer vis-à-vis the Short Time Fourier Transform (STFT), which is a well-known method for time-frequency analysis.

1. Introduction

The term spectral observer was proposed by Hostetter in his pioneering work [1] to name the algorithm that permits the recursive calculation of the Fourier Transform (FT) of a band-limited signal via state estimation. Since the presentation of such a work, several designs of spectral observers with improved features have been proposed either to deal with noise [2], disturbances, lack of data [3] or to estimate other parameters such as frequency [4]. The main goals of a spectral observer are both the estimation of a given signal and the transformation of such a signal to the frequency domain by means of the recursive identification of the coefficients of a Fourier series [5]. The estimation of a signal in the context of this work means to find the coefficients of a linear combination of functions—sines a cosines functions in our case—that approximates a signal of interest such that it can be reconstructed [6]. Spectral observers are useful in a wide number of applications, e.g., for determining the source of harmonic pollution in power systems [7], for the simulation of the sea surface [8], for fault diagnosis in motors [9,10] or in vibrating structures, such as aerospace and mechanical structures, marine structures, buildings, bridges and offshore platforms.
A spectral observer can be catalogued as an online algorithm to compute the Fourier Transform (FT) during a time window which slides along the signal, i.e., an algorithm to compute the Short Time Fourier Transform (STFT). Therefore, a spectral observer can be used for the time-frequency analysis of frequency variant signals.
The observer that we propose in this contribution is designed from a dynamical system which is constructed from the N derivatives of a n-th order Fourier series.
To perform the estimation, the observer solely requires: (1) The measurement of the signal to be approximated, s ( t ) , which actually is used to compute the observation error e ( t ) = s ( t ) y ^ ( t ) , where y ^ ( t ) is the observer output, (2) A frequency step ω = 2 π / T , where T is a predefined period. The estimation provided by the observer are both the reconstruction of the original signal and the Fourier coefficients to compute the signal frequency components.
This paper is organized as follows: Section 2 presents the core of the proposed method which is the formulation of the spectral observer from the Fourier series. Section 3 presents some examples with test results of the proposed method utilized in different applications. In Section 4 the main results are discussed. Finally, in Section 5 some concluding thoughts are given.

2. The Proposed Method

To construct the proposed observer, we formulate a dynamical synthetic system in state space representation by considering, firstly, that a given signal expressed as s ( t ) can be approximated by a Fourier series, and secondly, that the Fourier series is the first state of the system and the rest of the states are the N first-order derivatives of the Fourier series expressed by Equation (1), where n is the series order.
y ( t ) = a 0 2 + k = 1 n a k cos ( k ω t ) + b k sin ( k ω t ) ,
where a 0 , a 1 , b 1 , , a n , b n are the Fourier coefficients and ω is the fundamental angular frequency of the signal to be estimated.
In this work, we assume that the signal s ( t ) to be approximated has not a constant component (offset) or that this offset is removed by an online algorithm prior to be processed by the spectral observer. For this reason, we remove the term a 0 from Equation (1) such that the series for approximating the time function s ( t ) can be expressed as follows
y ( t ) = k = 1 n a k cos ( k ω t ) + b k sin ( k ω t ) .
If the order of the Fourier series is n = 1 , we need to formulate a dynamical system with N = 2 states, each one to recover each coefficient ( a 1 and b 1 ). Thus, the two first states are the Fourier series and its first derivative.
ν 1 ( t ) = y ( t ) = a 1 cos ( ω t ) + b 1 sin ( ω t ) , ν 2 ( t ) = y ˙ ( t ) = ω a 1 sin ( ω t ) + ω b 1 cos ( ω t ) .
where ν i are the states of the synthetic system. Consequently, the dynamical system that results from the change of coordinates, gives:
ν ˙ 1 ( t ) = ν 2 ( t ) , ν ˙ 2 ( t ) = ω 2 ν 1 ( t ) ,
which basically is the dynamical model of a harmonic oscillator. Now, what happens if the order of the Fourier series increases? If the order increases to n = 2 , then N = 4 , since we need to recover four coefficients.
ν 1 ( t ) = y ( t ) = a 1 cos ( ω t ) + b 1 sin ( ω t ) + a 2 cos ( 2 ω t ) + b 2 sin ( 2 ω t ) , ν 2 ( t ) = y ˙ ( t ) = ω a 1 sin ( ω t ) + ω b 1 cos ( ω t ) 2 ω a 2 sin ( 2 ω t ) + 2 ω b 2 cos ( 2 ω t ) , ν 3 ( t ) = y ¨ ( t ) = ω 2 a 1 cos ( ω t ) ω 2 b 1 sin ( ω t ) 4 ω 2 a 2 cos ( 2 ω t ) 4 ω 2 b 2 sin ( 2 ω t ) , ν 4 ( t ) = y ( 3 ) ( t ) = ω 3 a 1 sin ( ω t ) ω 3 b 1 cos ( ω t ) + 8 ω 3 a 2 sin ( 2 ω t ) 8 ω 3 b 2 cos ( 2 ω t ) , ν ˙ 4 ( t ) = y ( 4 ) ( t ) = ω 4 a 1 cos ( ω t ) + ω 4 b 1 sin ( ω t ) + 16 ω 4 a 2 cos ( 2 ω t ) + 16 ω 4 b 2 sin ( 2 ω t ) .
The dynamical system is then formulated as in Equation (5) which, after some algebraic manipulations, it becomes
ν ˙ 1 ( t ) = ν 2 ( t ) ; ν ˙ 2 ( t ) = ν 3 ( t ) , ν ˙ 3 ( t ) = ν 4 ( t ) , ν ˙ 4 ( t ) = 4 ω 4 ν 1 ( t ) 5 ω 2 ν 3 ( t ) ,
in ν -coordinates.
By generalizing Equation (5) for order n, we obtain the following dynamical system:
ν ˙ 1 ( t ) = ν 2 ( t ) , ν ˙ 2 ( t ) = ν 3 ( t ) , = , ν ˙ N ( t ) = ( 1 ) n ( mod 2 ) ω 2 n 1 2 2 n n 2 n A k 1 A ω 1 ν ( t ) ,
where N = 2 n , A ω and A k are expressed by Equations (8) and (9), respectively.
A ω 1 0 0 0 0 0 0 ω 0 0 0 0 0 0 ω 2 0 0 0 0 0 0 ω 3 0 0 0 0 0 0 ( 1 ) ( m ( mod 4 ) m ( mod 2 ) ) / 2 ω m 0 0 0 0 0 0 ( 1 ) ( 2 n ( mod 4 ) 2 ) / 2 ω 2 n 1 ,
A k 1 0 1 0 1 0 0 1 0 2 0 n 1 0 4 0 n 2 0 0 1 0 8 0 n 3 1 0 2 2 n 2 0 n 2 n 2 0 0 1 0 2 2 n 1 0 n 2 n 1 .
Before presenting the state observer for system (7), it is necessary to analyze its observability conditions. A dynamical system is said to be observable if it is possible to determine its initial state by knowledge of the input and output over a finite time interval. In this way, a state observer or state estimator is a system that estimates the internal states of a system from the measurement of its inputs and outputs. To verify is a linear systems is observable, the observability rank condition can be used, which is defined in the net lines.
Observability rank condition. A system
ν ˙ ( t ) = A ( t ) ν ( t ) y ( t ) = C ν ( t )
is said to satisfy the observability rank condition if ν ( t ) , rank O ( ν ( t ) ) = N , where N is the state dimension of (10) and O ( ν ( t ) ) is the observability matrix defined as
O ( ν ( t ) ) = ( C C A C A 2 C A ( N 1 ) ) T .
Thus, according to the definition, the observability matrix for system (7), which in fact can be set as system (10) with
A = 0 1 0 0 0 0 1 0 1 γ 1 ( ω ) γ n ( ω ) ,
and C = [ 1 , 0 , , 0 ] , has full rank. Therefore, since system (7) is observable, a spectral observer can be designed as follows:
ν ^ ˙ ( t ) = A ν ^ ( t ) + K ( y ( t ) C ν ^ ( t ) ) , y ^ ( t ) = C ν ^ = ν ^ 1 .
where “ ^ ” means estimation, y ^ ( t ) is the estimated signals and A is given by (12), with constant coefficients expressed by γ i ( ω ) . The gain of the state observer K, involved in the correction term of Equation (13), can be calculated as K = S 1 C T , where S is the unique solution of the following algebraic Lyapunov equation:
λ S A T S S A + C T C = 0
and λ is a parameter that can be used to tune the convergence rate of the observer. A numerical solution for solving Equation (14) for a particular but common case is provided in [11].
The Fourier coefficients can be recovered from the new coordinates by the relation c ^ k = Ω ( t ) ν ^ ( t ) , where c ^ k = [ a ^ 1 b ^ 1 a ^ n b ^ n ] T and
Ω ( t ) = ( ω t ) ( ω t ) ( 2 ω t ) ( 2 ω t ) ( n ω t ) ( n ω t ) ω ( ω t ) ω ( ω t ) 2 ω ( 2 ω t ) 2 ω ( 2 ω t ) n ω ( n ω t ) n ω ( n ω t ) ω 2 ( ω t ) ω 2 ( ω t ) 4 ω 2 ( 2 ω t ) 4 ω 2 ( 2 ω t ) n 2 ω ( n ω t ) n 2 ω ( n ω t ) ω Γ ( ω t ) ω Γ ( ω t ) 2 Γ ω Γ ( 2 ω t ) 2 Γ ω Γ ( 2 ω t ) n Γ ω Γ ( n ω t ) n Γ ω Γ ( n ω t )
Notice that cos , sin and Γ n 1 . Check Figure 1 to see a schema of the estimation.
Before presenting some possible applications of the spectral observer it is important to highlight an important point. Notice that matrix A of the spectral observer depends on the fundamental frequency ω . This means that this variable must be known. In case we want to approximate a periodic signal with a known fundamental frequency, we just need to use it in matrix A. In case we want to fit a periodic signal with unknown fundamental frequency or a non-periodic signal, we must assume, as in the Fourier Transform deduction from the Fourier series, that the period of the signal tends to infinity, which means that the fundamental frequency tends to zero. As a consequence of this assumption, ω should be chosen sufficiently small or according to the desired precision in the recovery of the frequency components. In other words ω is the frequency step that determines the resolution of the discretized frequency domain, such that we have to choose ω thinking how close we want the frequency components.

3. Application Examples

This section presents five examples of possible applications of the spectral observer, which were conceived such that the reader can be able to reproduce them.

3.1. Example 1: A Simple Example

Let be the signal s ( t ) = 4 cos ( t ) + sin ( t ) + 2 cos ( 2 t ) + 5 sin ( 2 t ) . It is obvious that the series order to reproduce the signal is n = 2 , then the order of system (7) for the conception of the observer should be N = 4 . Figure 2 shows the estimation of the coefficients that was performed by the observer with a gain λ = 8 , which actually was initialized with ν ^ ( 0 ) = 0 . The step time to perform the estimation in Simulink was Δ t = 0.005 [s] and the used solver was ODE3.

3.2. Example 2: Reconstruction of Basic Signals

This example aims to show the estimation of the coefficients for basic signals such as square and sawtooth waves. The first signal to be estimated is a square wave with angular frequency ω = 1 [rad/s]. The observer was tuned with λ = 15 . The order of the series was set n = 2 , i.e., N = 4 . The frequency step was set ω = 5 [rad/s]. The step time to perform the estimation in Simulink was set Δ t = 0.01 [s] and the used solver was ODE3. Figure 3 shows the signal reconstruction performed by the spectral observer and the estimated coefficients. Firstly, notice that the coefficients do not converge towards a constant value; the reason for this is the number of coefficients used to approximate the signal, which is not enough to represent each harmonic that composes it. Even though the coefficients are not constant, the signal is estimated. Notice too that all the coefficients change abruptly at each discontinuity. This feature can be used for edge detection as will be seen in the next example.
Both the observer and conditions that were used to reconstruct the square wave were used to reconstruct the sawtooth signal shown in Figure 4. Notice that the convergence time is less than one second and the coefficients become greater at the discontinuities.
To end this example, we made several simulations to show how the parameter λ determines the convergence period of the estimation. Figure 5 shows the estimation of the square signal with different values of λ . Notice that the bigger its value, the faster is the convergence.

3.3. Example 3: Edge Detection by Using the Fourier Coefficients

Edge detection and the detection of discontinuities are important in many fields. In image processing, for example, one often needs to determine the boundaries of the items of which a picture is composed, [12] or in applications that utilize time-domain reflectometry (TDR), which is a measurement technique used to determine the characteristics of transmission lines by observing reflected waveforms. TDR analysis begins with the propagation of a step or impulse of energy into a system and the subsequent observation of the energy reflected by the system. By analyzing the magnitude, duration and shape of the reflected waveform, the nature of the transmission system can be determined. TDR is a common method used to localize faults in transmission lines—such a leaks in pipelines or faults with small impedance in wires—because faults in transmission lines cause discontinuities in the reflected waveforms. For this reason, methodologies to detect discontinuities are required in order to localize the nature and position of the faults.
In order to shows how the spectral observer (13) can be used to detect discontinuities in a function, we present the following example: Let us consider s ( t ) = sign ( sin ( 0.5 t ) ) 0.05 sign ( sin ( 2 t ) ) , which is plot in Figure 6a. The aim of this test is to detect the discontinuities in the principal signal with period T = 2 [s]. To identify the discontinuities, the coefficients provided by the spectral observer are used to calculate the following indicator function:
r k = ln a ^ k 2 + b ^ k 2
The observer to perform the estimation was tuned with λ = 15 . The order of the series was set n = 2 , i.e., N = 4 . The frequency step was set ω = 1 [rad/s]. The step time to perform the estimation in Simulink was set Δ t = 0.01 [s] and the used solver was ODE3.
Figure 6a shows s ( t ) and its reconstruction y ^ ( t ) . Figure 6b shows the index r 1 ( t ) and r 2 ( t ) that becomes greater at the discontinuities indicating where they are.

3.4. Example 4: Fitting Complex Signal: The Bitcoin Price

Bitcoin is the longest running and best known cryptocurrency in the world. It was released as open source in 2009 by the anonymous Satoshi Nakamoto. Bitcoin serves as a decentralized medium of digital exchange, with transactions verified and recorded in a public distributed ledger (the blockchain) without the need for a trusted record keeping authority or central intermediary. Hereafter, we will use the proposed spectral observer for fitting the historical Bitcoin market close data every 1000 [min]. The records were downloaded from the website: https://www.kaggle.com/neelneelpurk/bitcoin/data.
The observer to perform the estimation was tuned with λ = 1 . The order of the series was set n = 20 , i.e., N = 40 . The frequency step was set ω = 10 [rad/s]. The step time to perform the estimation in Simulink was set Δ t = 0.01 [s] and the used solver was ODE8.
In Figure 7, the Bitcoin fitting performed by the spectral observer is shown. Figure 8 shows the estimated coefficients which are not constant and look as if they were enveloped by exponential functions. In order to have a model that represents the behavior of the Bitcoin in the specified interval, we can fit each coefficient by means of polynomials after calculating the natural logarithm of each one. In Figure 9, ln ( | a 1 | ) is plotted versus a cubic polynomial calculated to interpolate it.
ln ( | a 1 | ) = 1.2 × 10 9 t 3 + 1.5 × 10 6 t 2 0.0021 t 1.4 ,
We can perform the same procedure for each coefficient to obtain a series with the following form:
y ^ ( t ) = e | ( α c 1 t 3 + β c 1 t 2 + γ c 1 t + δ c 1 ) | cos ( ω t ) + e | ( α s 1 t 3 + β s 1 t 2 + γ s 1 t + δ s 1 ) | sin ( ω t ) + e | ( α c 2 t 3 + β c 2 t 2 + γ c 2 t + δ c 2 ) | cos ( 2 ω t ) + e | ( α s 2 t 3 + β s 2 t 2 + γ s 2 t + δ s 2 ) | sin ( 2 ω t ) + + e | ( α c n t 3 + β c n t 2 + γ c n t + δ c n ) | cos ( n ω t ) + e | ( α s n t 3 + β s n t 2 + γ s n t + δ s n ) | sin ( n ω t )
where α c k , β c k , γ c k , δ c k , α s k , β s k , γ s k , δ s k are the coefficients of the polynomial that approximates the natural logarithms of the coefficients.

3.5. Example 5: Estimation of the Input Force on a Duffing Oscillator

One of the advantages of the proposed spectral observer is its structure, which is a chain of integrators expressed in state-space representation. Such a structure permits to couple the observer to dynamic models, also expressed in state variables, that represent physical systems for control or estimation purposes. With this in mind, we present an example to show how the spectral observer can be coupled to the model of a given system, even with nonlinear structure such as the Duffing oscillator, in order to estimate an exogenous input affecting its behavior.
The Duffing oscillator is expressed by the following equation:
x ¨ ( t ) + δ x ˙ ( t ) + α x ( t ) + β x 3 ( t ) = u ( t )
where x ( t ) is the displacement, which is assumed as available in this example, x ˙ ( t ) is the velocity and x ¨ ( t ) is the acceleration. In addition, δ , α and β are parameters, which in this example are assumed to be known. Finally, u ( t ) is an external force, which is unknown and can be estimated by using our proposed observer. To achieve this goal, the following steps need to be executed.
Step 1. Equation (18) must be set in state-space representation. To execute this step, we define x 1 ( t ) = x ( t ) and x 2 ( t ) = x ˙ ( t ) as the state variables, such that we obtain the following equation system:
x ˙ 1 ( t ) = x 2 ( t ) , x ˙ 2 ( t ) = δ x 2 ( t ) α x ( t ) β x 3 ( t ) + u ( t ) , y ( t ) = x 1 ( t ) .
If the Liénard transform [13] is applied to system (18) in order to set it in a more appropriate form for estimation purposes [14], it becomes
x ˙ 1 ( t ) = x 2 ( t ) δ x 1 ( t ) , x ˙ 2 ( t ) = α x 1 ( t ) β x 1 3 ( t ) + u ( t ) ,
Step 2. Since u ( t ) is unknown and needs to be estimated, we propose its estimation by using a spectral observer with n = 1 . Therefore, we coupled in cascade equation system (18) with equation system (4) as follows:
x ˙ 1 ( t ) = x 2 ( t ) δ x 1 ( t ) , x ˙ 2 ( t ) = α x 1 ( t ) β x 1 3 ( t ) + ν 1 ( t ) , ν ˙ 1 ( t ) = ν 2 ( t ) , ν ˙ 2 ( t ) = ω 2 ν 1 ( t ) , y ( t ) = x 1 ( t ) ,
where ν 1 ( t ) = u ( t ) , i.e., it is the force to be estimated.
System (21) can be set in the following form:
x ˙ 1 ( t ) x ˙ 2 ( t ) ν ˙ 1 ( t ) ν ˙ 2 ( t ) ξ ˙ ( t ) = 0 1 0 0 0 0 1 0 0 0 0 1 0 0 ω 2 0 A x 1 ( t ) x 2 ( t ) ν 1 ( t ) ν 2 ( t ) ξ ( t ) + δ y ( t ) α y ( t ) β y 3 ( t ) 0 0 , φ ( ξ ( t ) )
y ( t ) = [ 1 0 0 0 ] ξ ( t ) = C ξ ( t ) = x 1 ( t ) ,
which according to [15] is uniformly observable. Therefore, a state observer expressed as ξ ˙ ^ ( t ) = A ξ ( t ) ^ + φ ( ξ ( t ) ^ ) + K ( x 1 ( t ) ξ ^ 1 ( t ) ) can be designed for system (22), where K can be calculated by means of Equation (14).
For the simulation, the paramaters of the Duffing oscillator were set: α = 1 , β = 1 and δ = 0 . 3 ; and their initial conditions were set x ( 0 ) = [ 1 5 ] . The force applied to the oscillator was u ( t ) = 2 cos ( 2 t ) + 5 sin ( 2 t ) + 4 sin ( 0.5 t ) . The observer was tuned with λ = 10 , ω = 1 [rad/s] and their initial conditions were fixed as ξ ^ ( 0 ) = [ 0 0 0 0 ] . Finally, the used solver was ODE 3 with a step time Δ t = 0.01 [s]. The results of the estimation are shown in Figure 10, which particularly presents a comparison between the force and its estimation. Notice that the estimation converges to the force in 1 [s].

4. Comparative Analysis Vis-à-Vis the STFT

A spectral observer can be used to determine the frequency content of local sections of a signal as it changes over time. The classic technique for performing this task is the Short Time Fourier Transform, which is the Fourier Transform with a suitable chosen windowing function. Ensuing, we present an example to compare the results of using the STFT with the results provided by the spectral observer. For this purpose, we used the MATLAB © codes created by Hristo Zhivomirov to compute STFT and its inverse [16]. The signal analyzed was
s ( t ) = 0 0 t < 100 [ s ] sin ( 10 π t ) 0 t < 300 [ s ] 0 300 t < 400 [ s ] sin ( 4 π t ) 400 t < 600 [ s ] 0 600 t < 700 [ s ]
sampled at 1000 [Hz]. To compute the STFT by using the code of Zhivomirov, the following parameters were set: τ w = 2 8 [s] as the window length, h = τ w / 4 [s] as the hop size and n f f t = 2 10 as the number of FFT points. The tuning of the spectral observer was done by setting n = 10 , λ = 1 , ω = π [rad/s] and ν ^ ( 0 ) = 0 . The solver used for the numerical solution was ODE4 (Runge-Kutta) with a fixed step size Δ t = 0.01 [s]. The spectrograms that were produced by the STFT and the spectral observer, respectively, are presented in Figure 11. To construct the observer spectrogram, we computed de magnitude of each harmonic by means of the following equation:
| A k | = a k + b k .
On the one hand, since n = 10 , the resulting vector containing the magnitude of each harmonic was A = [ A 1 A 2 A 3 A 4 A 5 A 6 A 7 A 8 A 9 A 10 ] . On the other hand, since the angular frequency step was chosen ω = π [rad/s], the resulting frequency vector was f = [ 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 ] [Hz]. Then, the spectrogram resulted of plotting f versus A.
Notice that the spectrogram generated by using the spectral observer presents a better frequency resolution with respect to the spectral observer. This fact can be better appreciated in Figure 12. However, this does not mean that the observer’s performance is superior, since it is well known that the frequency resolution can be improved by widening the time window length of the STFT, even if this widening implies a decreasing of the time resolution. In the case of the spectral observer, the frequency resolution is adjusted by manipulating the parameter λ .
It is necessary to point out here that both the frequency resolution and the time resolution do not only depend on the parameters τ and λ , also the parameters h y n f f t used in the STFT algorithm and ω and n used in the spectral observer, play an important factor; nevertheless, the adjustment of these parameters directly affects in the computational burden and the amount of data to be processed.

5. Results and Discussion

We have introduced an algorithm to reconstruct signals at the same time that their frequency components are calculated: a new spectral observer. In order to show its applicability, we have presented some examples, which in addition, have allowed us to glimpse some advantages and disadvantages of its use. Firstly, we found the following benefits: (1) The structure of the observer, as a chain of integrators, is very adequate for control and parameter estimation purposes; (2) The signal is progressively incorporated at each iteration; (3) The operations required for the observer implementation are with real numbers, which simplifies its programming in single-board computers; (4) The gain of the observer can be easily computed by means of a simple numerical algorithm; (5) The convergence of the observer is exponential, this means that the convergence period can be adjusted by means of a unique parameter λ , which is a clear advantage with respect to other well-known algorithms such as the proposed in [17], where the convergence period cannot be manipulated by a unique parameter. However, there are some drawbacks that we have found for the proposed observer. (1) The computational cost can be high for a small frequency resolution; (2) The algorithm must be complemented with a methodology to choose ω and λ in order to obtain the best estimation.
To conclude the discussion, it is necessary to emphasize that the spectral observer is an algorithm that, like the STFT, can be used to perform a frequency-time analysis of a frequency varying signal by computing the Fourier Transform (FT) during time intervals. However, there are some differences to remark. (a) The STFT requires operations with complex numbers, the spectral observer does not; (b) The spectral observer computes the FT and its inverse at the same time, which is a clear bonus, because in case of using a recursive STFT we only get the FT, if we want to recover the reconstructed signal, we must compute the Inverse Short Fourier Transform.

6. Conclusions

In this paper, we presented the design of a novel spectral observer, which can be used to approximate periodical and non-periodical signals via state estimation. To design the spectral observer, we constructed a synthetic system in state space representation from the Fourier series. We presented some application examples to reconstruct periodical signals but also a well-know non-periodical one such as the price of the Bitcoin from its genesis. Some important aspects were not discussed in this article that require a deeper analysis, such as a comparison between the computational burden of the spectral observer and that of the Fourier Transform or an analysis of the spectral observer vis-à-vis perturbations and noise. These aspects must be treated in a continuation of this research work.

Author Contributions

Lizeth Torres conceived the spectral observer presented in this article. Javier Jiménez-Cabas and José Francisco Gómez-Aguilar conceived, designed and performed the simulation tests. Pablo Pérez-Alcazar advised the rest of the authors. All the authors wrote the paper.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A. MATLAB CODES

Appendix A.1. Symbolic Computation of Matrix Aω

syms  w t
n=10; %Order of the Fourier Series
for k=1:2*n;
    Aw(k,k)=((-1)^((mod(k-1,4)-mod(k-1,2))/2))*w^(k-1);
end
		  

Appendix A.2. Symbolic Computation of Matrix Aω

syms  w t
n=10; %Order of the Fourier Series
for k=1:n
    for m=1:n
    Ak(2*m-1,2*k-1)=k^(2*m-2);
    Ak(2*m,2*k)=k^(2*m-1);
    end
end
           

Appendix A.3. Symbolic Computation of Matrix Ω

syms  w t
n=10; %Order of the Fourier Series
for k=1:n
    for m=2:2*n
O(1,(2*k)-1)=cos(k*w*t);
O(1,(2*k))=sin(k*w*t);
O(m,(2*k)-1)=diff(O(m-1,2*k-1),’t’);
O(m,(2*k))=diff(O(m-1,2*k),’t’);
    end
end
           

References

  1. Hostetter, G.H. Recursive discrete Fourier transformation. IEEE Trans. Acoust. Speech Signal Proc. 1980, 28, 184–190. [Google Scholar] [CrossRef]
  2. Bitmead, R.R.; Tsoi, A.C.; Parker, P.J. A Kalman filtering approach to short-time Fourier analysis. IEEE Trans. Acoust. Speech Signal Proc. 1986, 34, 1493–1501. [Google Scholar] [CrossRef]
  3. Orosz, G.; Sujbert, L.; Peceli, G. Spectral observer with reduced information demand. In Proceedings of the 2008 IEEE Instrumentation and Measurement Technology Conference, Victoria, BC, Canada, 12–15 May 2008; pp. 2155–2160. [Google Scholar]
  4. Na, J.; Yang, J.; Wu, X.; Guo, Y. Robust adaptive parameter estimation of sinusoidal signals. Automatica 2015, 53, 376–384. [Google Scholar] [CrossRef]
  5. Bitmead, R.R. On recursive discrete Fourier transformation. IEEE Trans. Acoust. Speech Signal Proc. 1982, 30, 319–322. [Google Scholar] [CrossRef]
  6. Torres, L.; Gómez-Aguilar, J.; Jiménez, J.; Mendoza, E.; López-Estrada, F.; Escobar-Jiménez, R. Parameter identification of periodical signals: Application to measurement and analysis of ocean wave forces. Digit. Signal Proc. 2017, 69, 59–69. [Google Scholar] [CrossRef]
  7. Dash, P.K.; Khincha, H. New algorithms for computer relaying for power transmission lines. Electr. Mach. Power Syst. 1988, 14, 163–178. [Google Scholar] [CrossRef]
  8. Houmb, O.; Overvik, T. Some applications of maximum entropy spectral estimation to ocean waves and linear systems response in waves. Appl. Ocean Res. 1981, 3, 154–162. [Google Scholar] [CrossRef]
  9. Blödt, M.; Chabert, M.; Regnier, J.; Faucher, J. Mechanical load fault detection in induction motors by stator current time-frequency analysis. IEEE Trans. Ind. Appl. 2006, 42, 1454–1463. [Google Scholar] [CrossRef]
  10. Benbouzid, M.E.H.; Vieira, M.; Theys, C. Induction motors’ faults detection and localization using stator current advanced signal processing techniques. IEEE Trans. Power Electron. 1999, 14, 14–22. [Google Scholar] [CrossRef]
  11. Busawon, K.; Farza, M.; Hammouri, H. A simple observer for a class of nonlinear systems. Appl. Math. Lett. 1998, 11, 27–31. [Google Scholar] [CrossRef]
  12. Engelberg, S. Edge detection using Fourier coefficients. Am. Math. Mon. 2008, 115, 499–513. [Google Scholar] [CrossRef]
  13. Liénard, A. Étude des oscillations entretenues. Revue Générale de l’Électricité 1928, 23, 901–912. [Google Scholar]
  14. Torres, L.; Verde, C.; Vázquez-Hernández, O. Parameter identification of marine risers using Kalman-like observers. Ocean Eng. 2015, 93, 84–97. [Google Scholar] [CrossRef]
  15. Hammouri, H. Uniform observability and observer synthesis. In Nonlinear Observers and Applications; Besançon, G., Ed.; Springer: Berlin, Germany, 2007; pp. 35–70. [Google Scholar]
  16. Zhivomirov, H. Short-Time Fourier Transformation (STFT) with Matlab Implementation. Available online: https://www.mathworks.com/matlabcentral/fileexchange/45197-short-time-fourier-transformation--stft--with-matlab-implementation (accessed on 27 April 2018).
  17. Kušljević, M.D.; Tomić, J.J. Multiple-resonator-based power system Taylor-Fourier harmonic analysis. IEEE Trans. Instrum. Meas. 2015, 64, 554–563. [Google Scholar] [CrossRef]
Figure 1. Schema of the reconstruction of a signal by using the spectral observer.
Figure 1. Schema of the reconstruction of a signal by using the spectral observer.
Mca 23 00023 g001
Figure 2. Example 1. Estimated coefficients.
Figure 2. Example 1. Estimated coefficients.
Mca 23 00023 g002
Figure 3. Example 2. (a) Square wave reconstruction and (b) Estimated coefficients.
Figure 3. Example 2. (a) Square wave reconstruction and (b) Estimated coefficients.
Mca 23 00023 g003
Figure 4. Example 2. (a) Triangular wave reconstruction and (b) Estimated coefficients.
Figure 4. Example 2. (a) Triangular wave reconstruction and (b) Estimated coefficients.
Mca 23 00023 g004
Figure 5. Variations of parameter λ .
Figure 5. Variations of parameter λ .
Mca 23 00023 g005
Figure 6. Example 3. (a) Signal reconstruction and (b) Estimated coefficients.
Figure 6. Example 3. (a) Signal reconstruction and (b) Estimated coefficients.
Mca 23 00023 g006
Figure 7. Example 4. Bitcoin fitting.
Figure 7. Example 4. Bitcoin fitting.
Mca 23 00023 g007
Figure 8. Example 4. Estimated coefficients.
Figure 8. Example 4. Estimated coefficients.
Mca 23 00023 g008
Figure 9. Example 4. log | a 1 | vs. interpolation.
Figure 9. Example 4. log | a 1 | vs. interpolation.
Mca 23 00023 g009
Figure 10. Example 5. Force estimation.
Figure 10. Example 5. Force estimation.
Mca 23 00023 g010
Figure 11. (a) STFT spectrogram (b) Spectral observer spectrogram.
Figure 11. (a) STFT spectrogram (b) Spectral observer spectrogram.
Mca 23 00023 g011
Figure 12. (a) STFT spectrogram (b) Spectral observer spectrogram.
Figure 12. (a) STFT spectrogram (b) Spectral observer spectrogram.
Mca 23 00023 g012

Share and Cite

MDPI and ACS Style

Torres, L.; Jiménez-Cabas, J.; Gómez-Aguilar, J.F.; Pérez-Alcazar, P. A Simple Spectral Observer. Math. Comput. Appl. 2018, 23, 23. https://doi.org/10.3390/mca23020023

AMA Style

Torres L, Jiménez-Cabas J, Gómez-Aguilar JF, Pérez-Alcazar P. A Simple Spectral Observer. Mathematical and Computational Applications. 2018; 23(2):23. https://doi.org/10.3390/mca23020023

Chicago/Turabian Style

Torres, Lizeth, Javier Jiménez-Cabas, José Francisco Gómez-Aguilar, and Pablo Pérez-Alcazar. 2018. "A Simple Spectral Observer" Mathematical and Computational Applications 23, no. 2: 23. https://doi.org/10.3390/mca23020023

Article Metrics

Back to TopTop