ebook img

A New Method for Signal and Image Analysis: The Square Wave Method PDF

2.6 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview A New Method for Signal and Image Analysis: The Square Wave Method

A New Method for Signal and Image Analysis: The Square Wave Method 5 Osvaldo Skliar∗ Ricardo E. Monge† Sherry Gapper‡ 1 0 January 6, 2015 2 n a J Abstract 4 A brief review is provided of the use of the Square Wave Method ] (SWM) in the field of signal and image analysis and it is specified how A results thus obtained are expressed using the Square Wave Transform N (SWT), in the frequency domain. To illustrate the new approach intro- . duced in this field, the results of two cases are analyzed: a) a sequence s of samples (that is, measured values) of an electromyographic recording; c [ and b) the classic image of Lenna. 1 Mathematics Subject Classification: 94A12, 65F99 v Keywords: signalandimageanalysis,SquareWaveMethod(SWM),Square 0 Wave Transform (SWT). 8 6 0 1 Introduction 0 . 1 It was previously shown how a new method, the Square Wave Method (SWM), 0 for the analysis of signals depending on one variable [1] can be presented in the 5 frequency domain by using a mathematical tool called Square Wave Transform 1 : (SWT) [2] [3]. The SWM was then generalized quite naturally and directly for v image analysis [4]. i X The objectives of this paper are the following: r a 1. ToprovideabriefreviewoftheuseoftheSWMfortheanalysisofsignals and specify the relations existing between a) the sampling frequency f , s with which the successive values of recordings of biomedical signals (such as those of an electrocardiogram, electromyogram or electroencephalo- gram) are measured, and b) the frequencies f ,f ,...,f , corresponding 1 2 n respectivelytothedifferenttrainsofsquarewavesS ,S ,...,S obtained 1 2 n using the SWM; ∗[email protected];EscueladeInform´atica,UniversidadNacional,CostaRica. †[email protected]; Escuela de Ciencias de la Computaci´on e Inform´atica, Universidad deCostaRica,CostaRica. ‡[email protected];UniversidadNacional,CostaRica. 1 2. Toindicatehowitalsoispossibletopresentinthefrequencydomainusing the SWT, the results of the analysis of images obtained with the SWM. The application of the SWM in the field of signal and image analysis is exemplified with the results of an analysis of a) a sequence of samples (that is, measuredvaluesfromanelectromyographicrecording);andb)theclassicimage of Lenna, using the SWT [5]. 2 Analysis of a Function of One Variable Consider a function of time (t), in the interval ∆t, satisfying the conditions of Dirichlet [6]: f(t)=(6−t)(2cos(2π4t)+5cos(2π6t)) 0≤t≤4s (1) Suppose that the time interval in which the function characterized in equa- tion(1)willbeanalyzed(∆t=4s)hasbeendividedinto18equalsub-intervals. In this case, it will be seen that function (1) can be approximated in ∆t, using the sum of the parts corresponding to ∆t of 18 trains of square waves. These trains of square waves will be called S ,S ,S ,...,S ; the “S” being based on 1 2 3 18 the word “square” in the expression “train of square waves”. If∆thasbeendividedinto100equalsub-intervals,theapproximationtothe function(1)ininterval∆twillbecarriedoutbyaddingthepartscorresponding to ∆t of 100 trains of square waves: S ,S ,S ,...,S . In general, if ∆t is 1 2 3 100 divided into any natural number n of equal sub-intervals, the approximation in ∆t to function (1) will be obtained by adding the parts corresponding to ∆t of n trains of square waves: S ,S ,S ,...,S . The Square Wave Method 1 2 3 n (SWM) described in this section makes it possible to determine those trains of square waves unambiguously. Therefore, each S (where i = 1,2,...,n) of i those trains of square waves will be characterized by a specific frequency f i (i.e., considerationisgiventothenumberofwavesinthetrainofsquarewaves, whichiscontainedintheunitoftime1s)andaparticularcoefficientC ,whose i absolute value is the amplitude of the corresponding train. The function f(t) specified in (1) is shown in figure 1. 2 Figure 1: f(t)=(6−t)(2cos(2π4t)+5cos(2π6t)) 0≤t≤4s. Forthecaseconsideredhere,n=18,adescriptionwillbeprovidedbelowof how the frequencies f (where i=1,2,...,18) and the values of the coefficients i C (where i=1,2,...,18) corresponding to the different trains of square waves i S (where i=1,2,...,18) are determined; see figure 2. i 3 Figure 2: How to apply the SWM to the analysis of the function represented in figure 1. (See indications in text.) Thefirstrowoffigure2(withcoefficientsC )representshalfasquarewave, 1 the first semi-wave of the train of square waves S . The frequency of S (i.e., 1 1 f ) is clearly equal to the number of square waves per unit of time (1 s). To 1 obtain f , the part of S which occupies ∆t (the half-wave) is divided by ∆t. 1 1 1 1 1 f = 2 = 2 = s−1 1 ∆t 4s 8 Tocomputef ,notethat∆tisoccupiedbythesumofthathalf-waveofthe 2 trainofsquarewavesS andthefraction 1 ofthesecondsemi-waveofthefirst 2 17 square wave of S . That fraction is represented by the symbol C in the second 2 2 row of figure 2. Thus the following value is obtained for f : 2 1 +(cid:0) 1 · 1(cid:1) 1(cid:0)1+ 1 (cid:1) 1 18 1 (cid:18) 18 (cid:19) 1(cid:18) 18 (cid:19) f = 2 17 2 = 2 17 = · 17 = = s−1 2 ∆t ∆t 2 ∆t 2∆t 18−1 8 18−1 Tocomputef ,notethat∆tisoccupiedbythesumofthathalf-waveofthe 3 trainofsquarewavesS andthefraction 2 ofthesecondsemi-waveofthefirst 3 16 square wave of S . This fraction (in the third row of figure 2) is represented by 3 4 the sequence of symbols −C −C . Therefore, the following value is obtained 3 3 for f : 3 1 +(cid:0) 2 · 1(cid:1) 1(cid:0)1+ 2 (cid:1) 1 (cid:18) 18 (cid:19) 1(cid:18) 18 (cid:19) f = 2 16 2 = 2 16 = = s−1 3 ∆t ∆t 2∆t 18−2 8 18−2 Witha precision of7decimalplaces, thevalues aregivenbelow notonlyfor f , f ,f , but also for those corresponding to f ,f ,...,f ,f . 1 2 3 4 5 17 18 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.1250000s−1 1 2∆t 18−0 8 18−0 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.1323529s−1 2 2∆t 18−1 8 18−1 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.1406250s−1 3 2∆t 18−2 8 18−2 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.1500000s−1 4 2∆t 18−3 8 18−3 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.1607143s−1 5 2∆t 18−4 8 18−4 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.1730769s−1 6 2∆t 18−5 8 18−5 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.1875000s−1 7 2∆t 18−6 8 18−6 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.2045455s−1 8 2∆t 18−7 8 18−7 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.2250000s−1 9 2∆t 18−8 8 18−8 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.2500000s−1 10 2∆t 18−9 8 18−9 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.2812500s−1 11 2∆t 18−10 8 18−10 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.3214286s−1 12 2∆t 18−11 8 18−11 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.3750000s−1 13 2∆t 18−12 8 18−12 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.4500000s−1 14 2∆t 18−13 8 18−13 5 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.5625000s−1 15 2∆t 18−14 8 18−14 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =0.7500000s−1 16 2∆t 18−15 8 18−15 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =1.1250000s−1 17 2∆t 18−16 8 18−16 (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1 =2.2500000s−1 18 2∆t 18−17 8 18−17 Observe that any of the 18 values of f , where i=1,2,...,18, can be com- i puted with the following equation: (cid:18) (cid:19) (cid:18) (cid:19) 1 18 1 18 f = = s−1; i=1,2,...,18 i 2∆t 18−(i−1) 8 18−(i−1) In general, if the interval ∆t, whose value, of course, may be different from 4 s, is divided into n equal sub-intervals, the frequencies corresponding to each of the n trains of square waves are as follows: (cid:18) (cid:19) 1 n f = s−1; i=1,2,...,n (2) i 2∆t n−(i−1) It has been explained how to compute each f corresponding to each S , i i where i=1,2,...,18, for the case of the approximation to f(t) specified in (1) when dividing ∆t into 18 equal sub-intervals (n=18). Indications will now be given on how to compute the C for each S . i i The vertical arrow pointing down at the right of figure 2 indicates how to add the terms corresponding to each of the 18 sub-intervals of ∆t. Thus, to obtain the values of the coefficients C ,C ,..., C and C , corresponding to 1 2 17 18 S ,S ,...,S andS ,thefollowingsystemoflinearequationsmustbesolved. 1 2 17 18 6 C +C +C +C +C +C +C +C +C +C  CCCCCCCC111111111+++++++++−+++++++CCCCCCCCCCCCCCCCC2211121212221122111111111+++++++++++++++−−CCCCCCCCCCCCCCCCC33333333311111111++++++++22222222+++++−−−+CCCCCCCC444444444CCCCCCCCC++++++++1111111133333333CCCCCCCC+++−+−+−−555555555CCCCCCCCC++++++++1111111144444444CCCCCCCC+++−−−−+−666666666++++++++CCCCCCCCC11111111CCCCCCCC55555555777777777+++−−−−−−++++++++CCCCCCCCCCCCCCCCC1111111188888888866666666++++++++−−++−−−−−CCCCCCCCCCCCCCCCC9999999991111111177777777+++++++++−−−−−−−−CCCCCCCCCCCCCCCCC1111111110000000001111111188888888 =========VVVVVVVVV12567834 11 12 13 14 15 16 17 18 9 (3) C +C +C +C +C +C +C +C +C −C CCCCCCCC111111111+−++++++−−−−++−+−CCCCCCCCCCCCCCCCC1121222111221212211111111+++++++−−+−−−−+−−CCCCCCCCCCCCCCCCC33333333311111111++−−++−+22222222−−−−+++++CCCCCCCC444444444CCCCCCCCC−−++++++1111111133333333CCCCCCCC−+++−−−+−555555555CCCCCCCCC−+−+++−−1111111144444444CCCCCCCC+−−+−++−+666666666−−−+−+++CCCCCCCCC11111111CCCCCCCC55555555777777777−−−−++−−−−−+−−−−+CCCCCCCCCCCCCCCCC1111111188888888866666666+−+−+−+−+++−−−+++CCCCCCCCCCCCCCCCC9999999991111111177777777−+−+−−−−+−−+−+++−CCCCCCCCCCCCCCCCC1111111110000000001111111188888888 =========VVVVVVVVV1111111121045637 11 12 13 14 15 16 17 18 18 7 Intheprecedingsystemoflinearalgebraicequations(3),V ,V ,...,V and 1 2 17 V arethevaluesforf(t)asspecifiedin(1)atthemidpointsofthefirst,second, 18 third, ..., seventeenth and eighteenth sub-intervals, respectively, of interval ∆t, in which f(t) is analyzed. It follows that the values V (where i=1,2,3,...,17 i and18)canbecomputedgiventhatf(t)hasbeenspecifiedin(1). Thesevalues are as follows: V =−34.5484836 V =−25.7897131 1 10 V =30.6666667 V =22.6666667 2 11 V =−16.0256827 V =−11.7202754 3 12 V =−6.9904692 V =−5.0546469 4 13 V =49.0000000 V =35.0000000 5 14 V =−6.5602864 V =−4.6244642 6 15 V =−14.1121683 V =−9.8067610 7 16 V =25.3333333 V =17.3333333 8 17 V =−26.7629098 V =−18.0041393 9 18 Each of the 18 values of V , where i=1,2,...,18, has been computed with i a precision of seven decimal digits. The18unknownsofthesystemsofequationsspecifiedin (3)areC ,C ,..., 1 2 C , and C . Thus |C | refers to the amplitude of the train of square waves S , 17 18 i i where i = 1,2,...,18. The (constant) value of each positive square semi-wave of the train of square waves S is |C | and the (constant) value of each negative i i square semi-wave of that S is −|C |. i i The system of equations (3) has been solved by using LAPACK [7], and the following results were obtained for the unknowns: C =117.12980 C =4.03101 1 10 C =50.27631 C =−85.68506 2 11 C =−210.98830 C =12.88482 3 12 C =−53.27896 C =8.51973 4 13 C =9.35088 C =60.38772 5 14 C =12.58025 C =−69.86421 6 15 C =61.27212 C =28.08997 7 16 C =49.80105 C =−9.26140 8 17 C =12.81335 C =−32.60758 9 18 The trains of square waves S ,S ,S ,...,S and S have been shown for 1 2 3 17 18 interval ∆t in figures 33.1, 33.2, 33.3, ..., 33.18, respectively. 8 (3.1): S1(t) (3.2): S2(t) Figure 3 9 (3.3): S3(t) (3.4): S4(t) Figure 3 10

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.