Vous êtes sur la page 1sur 6

Harmonic analysis of sampled signals with very high

frequency resolution
Blind

AbstractThe FFT algorithm tends to be outperformed by stationary data sequence, estimate how the total power is
parametric spectral analysis when the structure of the studied distributed over frequency. A nonparametric approach is
signal is known a priori. What wasnt known before, is that the supposed to divide the bandwidth into discrete sections and
Fourier series decomposition is a universally valid parametric somehow filter each, for an estimate of the power each division
model. In this paper a parametric spectral analysis using Fourier
has. In contrast to that method, the parametric approach
series decomposition as a universal model is studied. It comes as no
surprise that the frequency resolution of a 5 milliseconds signal can postulates a model and fits it to the data. So far these models
be as high as the one obtained with FFT from a 100 milliseconds where application specific. When the data misfits the model, the
signal. result is not much of a spectral estimation. So the focus has
shifted back to the nonparametric approach. However, a
I. INTRODUCTION universally valid parametric model is expected to outperform
In most situations where FFT is used, the frequency resolution nonparametric approach.
is an important limitation, and the available sampling rate is The Fourier series decomposition is well known, equation 1:

f ( x) c a n cos(nx) bn sin(nx)
higher than needed. Examples that come to mind are: radar,
sonar, reflectometry, telecommunications and seismology. For (1)
n 1 n 1
example in music, the shortest duration of a sound is around 20
milliseconds. FFT resolution for that duration is 50 Hz. Between The coefficients of a Fourier series are computed using
the 440 Hz A sound, and next musical note B, there are only 26 convolution. Convolution can be seen as a form of filtering.
Hz. Extracting the sheet music from a sound recording by means Filtering each spectrum component and displaying the result is
of FFT is surely difficult. As mentioned before, high sampling basically what a nonparametric spectral analysis does.
rates are available. Mathematically, a set of unknowns can be Sometimes the FFT algorithm result is considered
determined from an equally sized set of equations. Due to FFT synonymous with frequency spectrum, though it isnt. For one
particular properties, a higher sampling rate produces more thing, the convolution of the signal with discrete frequencies is
results in the higher frequency domain. Thus the resolution is not exactly the same with filtering a narrow bandwidth. This is
kept the same. why the spectrum will never be continuous. Zero padding doesnt
A solution for this problem was offered by parametric spectral change that and DTFT doesnt change that. It can be made a sum
analysis. Assuming a parametric model of the signal is known, of very close discrete components, but never continuous.
the problem reduces to estimation of the parameters. It does offer Another problem of the FFT algorithm is this: The function in
better results than FFT when it can be applied. The need for an a equation 1 is supposed to be periodic,
priori knowledge of the structure of the signal is the main () = ( + ) (2)
problem of this approach. In the example above, a parametric For simplicity, o signal of a sinusoid of unknown frequency is
model for music would be needed. considered. The period of the sinusoid is 1 . This sinusoid
There is currently no solution for better frequency resolution will never satisfy equation 2! But the FFT result from analyzing
than FFT when the sampled signal has unknown frequency the sinusoid will always do! The Fourier series components will
spectrum. The proposed solution for this problem consists of follow the studied sine curve for T seconds. Then they will draw
using a universally viable parametric model. In this paper it is again the same shape. This is anything but the input signal, yet
shown that the Fourier series decomposition can be used as a the FFT algorithm is useful in so many applications. The FFT
parametric model for any signal. In FFT algorithm, the resolution algorithm output mimics the power spectral density of a signal so
is limited because correlation is used for estimation of the well! There is also the Gibbs phenomenon, appearing when the
parameters of the Fourier series. The correlation depends on periodicity condition is satisfied. But the FFT algorithm is still
orthogonality and orthogonality depends on the length of the usable.
studied signal. The proposed method starts from the same The Fourier series in equation 1 is somehow deterministic. The
parametric model, but instead of using convolution (filtering, higher frequencies are usually so small they can be approximated
which means nonparametric spectral analysis), it uses with zero. And what is left is a parametric model. As shown
decomposition in a set of linearly independent vectors above, it is not mathematically valid for all signals. But it
(parametric method, or if preferred, subspace method). approximates any signal with enough accuracy for a lot of
applications.
II. THE FOURIER SERIES AS A UNIVERSALLY VALID Dealing with higher frequencies caused by windowing
PARAMETRIC MODEL (virtual, but still windowing) can be done in two ways: first way,
According to [1], the essence of spectral estimation problem is they are modeled as random noise, and a least squares
captured in the following formulation: From a finite record of a optimization used. The second option is to use a deterministic
approach (system of equations), and use some extra frequency So far it is supposed that the samples are conveniently
components just for dealing with windowing. distributed in time, so as to yield a system of equations with a
unique solution. That isnt very hard to do. Trigonometric
III. PROPOSED METHOD functions used above are nonlinear functions, which should yield
a system of equation with a unique solution.
The approach used here is with a system of linear equations. The chosen Fourier series have an associated virtual window,
The signal is simply assumed to consist of a sum of sinusoids rectangular by default. If a different window is desired, it can be
according to the Fourier series. The frequencies go up as far as applied to the set of sampled data. The window coefficients must
the number of equations doesnt grow larger than the number of be computed considering the used Fourier series coefficients. As
samples. The sinusoids in the system of equations are shifted in the signal is fitted to the middle of the virtual period, only the tip
time, so that the sampled signal fits right in the middle of the of the window coefficients will be used.
virtual period. By virtual period is meant the period implied by
the chosen Fourier series. That is because Gibbs phenomenon
and aliasing are more accentuated at the ends, where model
(Fourier series) discontinuities take place. The solution to the
system of equations will not have to fit the sampled set of data
where ripples are, but to a set of Fourier components.
The method starts with picking a periodic spectrum, unrelated
to the acquisition time. The studied signal is simply supposed to
be composed of the Fourier series of an arbitrary acquisition time.
Let the number of those picked frequencies be k= (m-1)/2, where
m is the number of samples. A system of equations is created
using rectangular notation for allegedly known frequencies as in
equations (3), (4), (5).
AX B (3) Figure 1. Nuttall coeffcients for an example given later.

Where A has the form (m=2*k): IV. NUMERICAL EXAMPLE


The matrix in equation (4) is an ill-conditioned dense matrix.
sin(1 (t1 t0 )) ... sin(k (t1 t0 )) cos(1 (t1 t0 )) ... cos(k (t1 t0 )) c It will quickly degenerate because of cumulating round-off error.
sin(1 (t2 t0 )) ... sin(k (t2 t0 )) cos(1 (t2 t0 )) ... cos(k (t2 t0 )) c In order to properly draw a relevant graph for the obtained
... ... .... ... ... ... .. spectrum a rather large number of equations must be used.
Computing the inverse of such a matrix can consume large
sin(1 (tm t0 )) ... sin(k (tm t0 )) cos(1 (tm t0 )) ... cos(k (tm t0 )) c
resources. Once the inverse is computed, a harmonic analysis is
(4) performed by a simple matrix multiplication. So a large matrix
X has the unknown amplitudes of sinuses and cosines and is can be computed (a slow process) and later used for fast and
actually the decomposition result: efficient spectral analysis.
x In mathematics there has been made significant progress in this
direction. The result obtained by G. Beliakov and Y.
x Matiyasevich [2] is worth mentioning. The determinant of a
... square matrix of 12000x12000 size with precision of 32768 bits
was computed in 7 days. The coefficients of that matrix were for
X x1' (5) Riemanns zeta function, but it was still an ill-conditioned matrix.
x ' The method used for the result above was Gaussian
2
elimination. The authors noticed that a Dodgson method
... optimized for dealing with zeros on the main diagonal was
equivalent with Gaussian elimination. The cost of Gaussian
c'
elimination is known so optimizations could be made to fit the
And B is the matrix of sampled data. The omega represents the available RAM. The computer used consisted of Intel E5-2670
frequencies of the chosen Fourier series decomposition. The t processors and the number of processes was 144. The computer
indexed from 1 to m represents the time when the samples were could process even larger matrices, but the loss of accuracy
taken. The 0 term is artificial, it is computed so that the set of became significant.
samples fall in the middle of the virtual window. The Rumps method [3] of inverting arbitrarily ill-conditioned
The continuous component cannot be computed by averaging matrices might also prove useful since it does converge rapidly
the sampled signal. It must be included as c in the system of with single or double precision. Rump showed that the result of
equations. Thats because each virtual period has its own an ill-conditioned matrix does not produce useless numbers.
continuous components, even if the signal consists of the same They can be further processed to reach a relevant result. The
sinusoid. method works for matrices with a condition number up to 2 if
the precision of the software is . The drawback is that it is
slower than the Gaussian elimination. It is mentioned here In Fig.3, a signal of 165 Hz sine and 145 Hz cosine is sampled
because in Matlab the precision cannot be changed, so the over 2.5 milliseconds, with result displayed in Fig.4.
accuracy must be improved. The two possibilities are mentioned
as reference about current practical limitations in implementing
the proposed harmonic analysis.
The examples given did not use any of the complex methods
mentioned above. They were obtained with plain Maple code,
without any speed or memory tuning.
The system of equations was designed for a periodicity of 0.1
seconds. In the given examples a 64 points matrix was used. The
precision was set to 500 digits. The studied frequencies increased
from 10 Hz to 640 Hz in steps of 10 Hz. It is obvious that a signal
with frequency components multiple of ten would produce an
ideal result, so this case wasnt even considered.
In Fig. 2 is presented the spectral analysis of a signal consisting
of two sinusoids (actually they are one sine and one cosine) of
frequencies 65 Hz and 141 Hz. They were sampled over 5
milliseconds.
The 65 Hz component presents an error resembling the
scalloping loss, or picket fence. The 141 Hz component is
closer to the assumed frequency of 140 Hz and it looks more Figure 4. The spectral analysis result of two sinusoids, of 165 Hz and 145 Hz
natural. sampled over 2.5 ms.

The large low frequencies component deals with


discontinuities, as seen in Fig.5. Actually the result in Fig.4 can
be called pseudo spectrum. The resulting frequency components
follow the original signal samples. The problem is at the ends. As
seen from Fig. 5, except at the ends the signal is well recomposed.

Figure 2. The spectral analysis of two sinusoids of 141Hz and 65 Hz sampled


over 5ms.

Figure 5. The sinusoids in Fig. 4 displayed in time domain for 0.1 seconds

In Fig. 6 are displayed the first components of a signal


consisting frequencies 165 Hz and 125 Hz. The figure offers
insight into how the matrix decomposition deals with the
discontinuities at the end. If the analyzed spectrum has the
maximum frequency of one fourth of the whole matrix, the low
frequency components have reasonably low amplitudes. The rest
of the frequencies help dealing with discontinuities, since they
Figure 3. The sum of two frequencies, 145Hz and 165Hz, over 2.5 ms
are not exactly zero, and are used for exactly matching the resolution analog to digital converter or filtering low resolution
sampled points. samples with high accuracy.
In Fig.7 a signal of 195Hz sine and 145 Hz cosine was sampled
for 250 microseconds. The result using Nuttall window is in Fig.
8.

Figure 8. The harmonic analysis result for Fig.7 signal using Nuttall window.

V. CONCLUSION
Figure 6. First three components only, of a recomposed signal(165Hz and 125
Hz), compared with a 35 Hz sinusoid.
It was shown that Fourier series spectral components can be
used as a universally valid parametric model. Virtual windows
can also be applied to the sampled signal. The same set of
samples can be decomposed in different discrete Fourier series
components by changing the matrix coefficients. As seen in
simulations, the higher frequency components should be reserved
for dealing with discontinuities. Windowing can help in using a
bit higher components, but as a safety measure only one fourth of
the spectrum is to be used, the rest is for absorbing
discontinuities.
In order to bring this method to daily practice, there is more
work to be done. The mathematical methods for efficient
computing of inverse matrix must be perfected. Also filtering of
the samples with higher precision should be studied, in order to
achieve significant progress from current spectral analysis tools.
REFERENCES
[1] Petre Stoica and Randolph Moses, Spectral analysis of signals, Pretince
Hall, New Jersey 2005
Figure 7. The sum of 195 Hz sine and 145 Hz cosine sampled over 250us. [2] Gleb Beliakov and Yuri Matiyasevich, A Parallel Algorithm for
Calculation of Large Determinants with High Accuracy for GPUs and MPI
clusters ariXiv.1308.1536v2,Accessed August 2013.
When practically using this method, the sampling resolution
[3] Shinichi Oishi, Kunio Tanabe, Takeshi Ogita and Siegfried M. Rump,
becomes a limiting factor. Sampling a signal with 24 bits Convergence of Rumps Method for Inverting Arbitrarily Ill-Conditioned
precision, and then feeding the data to an inverse matrix Matrices, J. Comput. Appl. Math., 205(1):533-5
computed with 500 digits precision will produce unexpected
results. The precision difference is actually white noise going up
to the sampling frequencies. Noise within accepted bandwidth
would be no different than signal within the same limits. If noise
or signal goes beyond that limit the result is more or less
corrupted. Currently analog to digital converters rarely use 32 bit
precision, or even 24 bit. That is because the dynamic range is
limited by noise caused by a simple resistor for example. It is
interesting to know which is better: implementing a high
-1.033053996425488e-15,...
-1.920857676449142e-16,...
-3.377060358237652e-17,...
ANNEX (the maximum nr pages is 8, but I suppose for short papers it is 4) -5.599377319827470e-18,...
For lack of space, I include the following MATLAB code: It has the result of a -8.731157934944592e-19,...
Maple transformation matrix, for a signal of 165 and 125 Hz. The -1.276368959981432e-19,...
coefficients were copied by hand. After zeroing the ends of the recomposed
signal, and applying FFT algorithm, the two peaks were clearly -1.743152566714968e-20,...
distinguishable. I didnt include the MATLAB figure because anyone has -2.215343762053593e-21,...
a MATLAB and can run this code. This ANNEX is not part of the paper, -2.608277066601072e-22,...
but a proof for something supposed to be obvious. -2.830410059283170e-23,...
-2.814172462345034e-24,...
-2.545854451621604e-25,...
clear all; -2.078250826810697e-26,...
close all; -1.515600957554501e-27,...
clc; -9.752287831081385e-29,...
-5.450445122644063e-30,...
result = [-0.013603284173087,... -2.591886852770068e-31,...
-0.026918280444452,... -1.019611816677199e-32,...
-0.039709146143548,... -3.185452438580327e-34,...
-0.051846570435810,... -7.409831169177920e-36,...
-0.063368872630423,... -1.140792752871209e-37,...
-0.074565708814549,... -8.718487101151557e-40,...
-0.086126451075061,... 2.9580588350388555,...
-0.099472694486687,... 2.8575264353908220,...
-0.117667633462888,... 2.6983841160118653,...
-0.148549102266171,... 2.4921577010789502,...
-0.220513665819995,... 2.2530070369634933,...
-0.588279248876218,... 1.9961892498623635,...
0.5316437362363939,... 1.7366163510099028,...
0.1685463494206935,... 1.4877943216479369,...
0.1106892834367238,... 1.2615138711258125,...
0.1505947632073310,... 1.0692774443785960,...
-0.071892390439913,... 0.9312435237727971,...
-0.011632662345119,... 0.9907033419152672,...
-0.003386185881873,... 0.2647791311716764,...
-0.001161228792522,... 0.4014472955667636,...
-0.000426400380360,... 0.4441087083737266,...
-0.000161261972413,... 0.8169462483013445,...
-0.000061557834309,... -0.477979824051944,...
-0.000023431927479,... -0.089659171545463,...
-0.000008823315057,... -0.029196217813092,...
-0.000003268079798,... -0.010927023921677,...
-0.000001185617832,... -0.004300614322359,...
-4.198917379357528e-7,... -0.001719586639071,...
-1.447714709538291e-7,... -0.000686605993293,...
-4.848126197516607e-8,... -0.000271052341005,...
-1.573717209718052e-8,... -0.000105118995804,...
-4.942469387595465e-9,... -0.000039871201266,...
-1.499294809034748e-9,... -0.000014741930928,...
-4.385863401269635e-10,... -0.000005299602774,...
-1.235291633186243e-10,... -0.000001848429118,...
-3.344727237763723e-11,... -6.243682296077721e-7,...
-8.692755310848543e-12,... -2.039163885943882e-7,...
-2.165095789118899e-12,... -6.429662585142330e-8,...
-5.159609152880844e-13,... -1.954498381720595e-8,...
-1.174477730853298e-13,... -5.720037197429761e-9,...
-2.549128933639619e-14,... -1.609498640969338e-9,...
-5.265528713393464e-15,... -4.348292360196462e-10,...
-1.126364473153643e-10,... size(result)
-2.793487026585333e-11,... recomposed=zeros(1,4678);
-6.623224987247548e-12,... for t=1:4678
-1.498855848590649e-12,... temp = result(1,129);
-3.232117396073838e-13,... for i=1:64
-6.629326191024203e-14,... temp = temp +
-1.290815801700147e-14,... result(1,i).*sin(2*pi*(10*i)*t*dt) +
-2.380995086232540e-15,... result(1,i+64)*cos(2*pi*(10*i)*t*dt);
-4.151029513282942e-16,... end
-6.822802783944240e-17,... recomposed(1,t)=temp;
-1.054318622213890e-17,... end
-1.527005214600792e-18,... plot(recomposed)
-2.065693593110008e-19,... size(recomposed)
-2.5998775968139910e-20,... for i=1:300
-3.0309134228640735e-21,... recomposed(1,i)=0;
-3.2562252465701192e-22,... recomposed(1,length(recomposed)-i)=0;
-3.2048498579085449e-23,... end
-2.8697066013524878e-24,... Y=abs(fftshift(fft(recomposed)));
-2.3185231590287706e-25,... figure()
-1.6733134028864992e-26,... plot(Y)
-1.0654997759655217e-27,...
-5.8926986415215823e-29,...
-2.7728068164475364e-30,...
-1.0793196673572400e-31,...
-3.3365093466710976e-33,...
-7.6795088833592683e-35,...
-1.1698682505827973e-36,...
-8.8466827774108918e-39,...
1.49622187124608365]
%recompose the graph
dt = 0.1/4678;

Fig extra, spectral analysis result obtained in Maple for 165 Hz


and 125 Hz signal, which later was moved to MATLAB and
analysed with FFT algorithm

Vous aimerez peut-être aussi