A flexible FFT algorithm for processing biomedical ... - Science Direct

0 downloads 0 Views 460KB Size Report
ABSTRACT ?%e aim was to demonstrate the possibility of usingpersonal computer PC-DOS (orgenerally MS-DOS) for real-time (or quasi real-time) biomedical ...
A flexible FFT algorithm for processing biomedical signals using a personal computer M. Cesarelli,

F. Clemente and M. Bracale

Cattedra di Elettronica Biomedica, Research Group on Medical Engineering and Rehabilitation of the National Research Council of Italy (CNR), University of Naples, Via Claudio 21, 80125 Napoli, Italy Received January 1990, accepted February 1990

ABSTRACT ?%eaim was to demonstrate thepossibilityof usingpersonal computer PC-DOS (orgenerally MS-DOS) for real-time (or quasi real-time) biomedical signalprocessing by adding a simple A/D conversion card and the mathematical coprocessor xXx87. We have realized an assembly written faSt Fourier tragorm (l+lJ routine derivedfiom a radix-4 algorithm, which is autogenerated, i.e. an algorithm modified by another algorithm running off-line according to the number of FIT points. The program is implemented as a subroutine to be called upon by high-level language in di$erent procedures. This approach reduces the computational time, which is particularly useful when many Fourier transforms on dzflerent data aways are required. Reported here are two deferent applications ofthe routine as applied to the spectral analysis of Doppler ultrasound velocimety and surjace electromyography. Keywords: Digital signal processing, spectral analysis, personal computers, Doppler velocimetry, surface EMG

INTRODUCTION The frequency

analysis of biomedical si als plays a very important role in both experimenta $ and clinical a plications. Harmonic study techniques, for exampYe, are used in Doppler velocimeters and for the evaluation of biological signals such as electromyography (EMG), electrocardiology (ECG), and electroancephalography (EEG). The processing of biomedical signals involves computing a large volume of data, and for clinical applications a very high computational speed is required. It is important to emphasize that even a short time saved in a computational routine can be useful when, as in most biomedical a plications, calculations of the spectra are repeate B on many contiguous time windows. At present, personal computers offer high performance at a low cost and furthermore, it is possible to improve these features using dedicated commercially available hardware. One can utilize either DSP expansion modules based on special processors or coprocessors, operating with a fast CPU for floatingpoint operations. The powerful multitask operating systems, such as UNIXor xENIx, are not as useful for signal processing applications as the less sophisticated PC-DOS or the more general MS-DOS’ systems. For the typical realtime problem, in fact, there is no significant speed to multi le tasking. spare to serve simultaneously, Moreover, fast real-time digital signa P processing Correspondence and reprint requests to: Prof. M. Bracale 0

1990 ButterworthHeinemann

re uires a single user operating system. 9software packages for MS-DOS systems, which perform a spectral anal sis in a short time, are commercially available. t sually they do not offer good flexibility and, in order to perform further computations, it is necessary to export data to other packages which increases execution time. The use of fast Fourier transform (FIT) subroutines which can be called upon by dedicated signal processing software, avoids this problem and for these applications it is possible to find many FFI algorithms2. With regard to programming languages, the first choice is between assembly and high-level (FORTRAN, BASIC, PASCAL, c etc.) languages. Assembly language extracts the fastest run-time erformances from a microprocessor as it provides Por the direct manipulation of processor architecture. However, it is also the most difficult programming language. Highlevel languages do not produce an object code with sufficient run-time speed for fast signal processing applications, but they are particularly convenient for developing routines for peripherical unit management. With these considerations in mind, to have a time-efficient algorithm that can be written in a short programming time, assembly computational routines should be organized as subroutines called by highlevel language programs. Our applications are implemented by combining high-level language (c and ‘compiled BASIC'for I/O data operations) with assembly language computational routines. This software runs on personal computer (PC-DOS or MS-DOS) (CPU XXXSS) with mathematical coprocessor (xXx87).

for BES

0141-5425/90/060527-04 J. Biomed. Eng. 1990, Vol. 12, November

527

FFT algoridm@r processing biomedicalsignals: M. CesareUi et al.

SYSTEM DESCRIPTION

Table

1

Computational

times for different

Hardware configuration

personal computer PC-DOS; mathematical coprocessor 8087 (or 80287,80387); graphics monitor; graphics printer; A/D board (data translation DT 28OlA).

is based on a by Morris3. is modified by an off-line algorithm according the number FFT points. is particularly useful when on different data arravs , are The program an initial table containing comnutational pointers to di?ffereni

phase givin as we1Has

Configuration

256 points

1024 points

PC CPU 8088 + 8087 Clock 4.7 MHz

450

2000

PC CPU 80286 + 80287 Clock 8 MHz

368

1840

PC CPU 80286 + 80287 Clock 10 MHz

290

1470

PC CPU 80286 + 80287 Clock 12 MHz

245

1220

PC CPU 80386 + 80387 Clock 20 MHz

44

386

for u = k - 1; the

1. 2. 3. 4. 5. 6.

one two one one one one

kernels

invoked

multiply butterfly to 8 4 0 offset

of the execution accordance with

module

in of

complex

values,

is the only

N= 4” transformaof subroutine

calls 0 multiply butterfly sub. (4k -

(= 85)

4

(=

- 1)/3

8 multiply butterfly sub. 9 multiply butterfly sub.

= k?2/4

J. Biomed.

Eng. 1990,

- 1)/3 (k -

(= + 4/3

(= 108)

(= 256)

numbers

In fact directing access to the internal of registers stack of XXX87. Operation

of among

is possible to divide

1. generation 2. routines 3. FIT

of the kernels computational

configurations

Time (ms)

The choice of general-purpose hardware for signal processing de ends strictly on the frequency range of the signal itse Pf. The fre uency of biomedical signals are within the range D 8 -15 kHz and need a maximum conversion rate of 20-30 kHz; the time window may vary from a few milliseconds to several days. Personal corn uters can satisfy these needs. They offer the possibi Pity of addressing more than 1 Mbyte RAM and, by adding mathematical coprocessors, are able to perform fast floating-point operations. Furthermore, one can add a powerful conversion board with high conversion rate. Bearing in mind all these considerations and the commercial availability, the hardware of our system comprises: 1. 2. 3. 4. 5.

hardware

whilst

RAM. compute

routine; of parameters

1 and 2 are written in high-level language 3 is written in assembly. 2) initializes in It calls the Fourier transform to on the spectra

OF BIOMEDICAL

7 sets

APF’IXATIONS

We have applied two cases: Dop ler ultrasound calculations cf on

ultrasound of 3s by

flowmeter

four-pole

in in

a commercial digitized at 20 kHz. Records in order to cover is started by

filter with a 24 dB/oct on the

slope.

FIT a&onXhmfor processing biomedical si@alr: M Cesarelli et al.

Figure 1 Spectral analysis of Doppler ultrasound signals showing common carotid measurement for a healthy subject during four cardiac cycles (spectral array)

I). Each spectrum is composed of 128 spectral bins and covers 12.5ms. Full spectral analysis is the preferred method for processing Doppler ultrasound signals5. Since frequency is proportional to velocity, and amplitude s uared is proportional to the number of moving b‘food cells, the shape of the Doppler power spectrum is related to the velocity profile. From the spectra it is possible to derive any information regarding the received scattered frequencies. The patterns of the mean (?&are 2b) and maximum (Figure 26) frequency for a common carotid signal from a healthy subject are shown. The computed mean frequency is proportional to the instantaneous mean velocity of the insonated volume. The maximum frequency represents the velocity of the

7000

H

-

300ms

Figure 3 Spectral analysis of surface EMG during sustained 60s isometric contraction of radial muscle performed at 80% of maximal voluntary contraction (spectral array). Note typical compression toward low frequencies over time

fastest moving red cells and it is a powerful aid in the diagnosis of stenosis”. Both the mean and maximum frequencies are obtained for each computed spectrum by a simple algorithm based on statistical characteristics of Doppler signals. This algorithm is a two-step decision procedure, which allows the threshold to be set independently from the o erator’s subjective judgement. A third output is tx e average power spectra on a complete cardiac cycle. Further numerical parameters may of course be computed7.

Surface

EMG

The second application of this computational system concerns the analysis of a surface EMG’. The signal is sampled for a maximum of 60 s at a sample rate of 1 kHz. The computational phase starts when the conversion stops. Temporal windows of 1 s (1024 samples) are Fourier transformed. From these data 10 power spectra are computed in 20 s. The complete spectral arra (Figure 3) is displayed in a time depending on the d uration of the test. This output allows monitoring of the frequency shift of the EMG signal to measure muscular fatigue. In fact, many investigators have discovered a shift in the frequencies toward the low range and a consistent increase in the amplitude with the muscular fatigue in the surface EMG $nal’. requested by the operator, Further computations, are : 1. median

frequency: 1,,*p(f)

df

2. mean frequency:

I f*n= O_ I kf)df

0 :

b

Time

Figure 2 Spectral parameters for Fipre frequency; b, mean frequency

7 analysis. a, Maximum

0

P(f

1df J. Biomed. Eng. 1990, Vol. 12, November

529

FIT algorithm for processing biomedical signaLs: M. Cesarelliet al.

common in athletic training, ergonomics, physical therapy, etc. Different investigations” have confirmed the effectiveness of this approach for the assessment of neuropathic and myopathic disorders.

3. skewness:

v Iom~.f-fmn~3fYf)

SKW = [

Irn (f-fmn)”P(f) v]3’2 0

CONCLUSIONS

4. kurtosis:

parameters have been shown to be related to the average conduction velocity of the muscle fibres2. Median and mean frequencies show a decrease in time during a sustained contraction; skewness and the kurtosis increase during this test (Figtlre 4). The use of the EMG signal frequency shift is

These

H

2.5s

A FIT routine to run on personal computer (MSDOS) has been developed. This software allows the use of a small computer for different biological signals in frequency domain studies using a single mathematical coprocessor (xXx87). Our algorithm allows shorter computational times and this may be fundamental when the spectrum and its parameters are required on many time windows. This usually occurs in most biomedical signal processing. The use of the above mentioned software allows the implementation of applications for biomedical signals to compute frequency parameters in real-time or quasi real-time, so that the operator can check and eventually repeat the examination. Furthermore, the use of this general-purpose system allows a simple and standard storage of the data for the provision of multi-media databases.

--

ACKNOWLEDGEMENTS This work has been supported financially by the National Research Council (CNR) and MPI. Particular thanks are due to Miss Sandra Thompson for the English revision work in the preparation of the manuscript.

150Hz

REFERENCES 1. Tompkins

2. 3.

4. 5

5. 6. I

‘d 15

7.

8. 0 :

Lll

e

l II

111111111111111111

j

Time

Figure 4 Behaviour of EMG spectral parameters during sustained 60s isometric contraction of radial muscle performed at 80% of maximal voluntary contraction. a, Contraction level; b, median frequency; c, mean frequency; d, skewness; e, kurtosis

530

J. Biomed. Eng. 1990, Vol. 12, November

9. 10.

WJ. Biomedical computing using personal computer. IEEE Eng Med Biol 1986; 61-4. Programs for Digital Signal Processing. New York: IEEE Press, 1979. Morris LR. Time efficient radix-4 fast Fourier transform. Programs for Digital Signal Processing New York: IEEE Press, 1979, 1.8.1-11. Clemente F, Cesarelli M, Bracale M. The use of personal computer for vascular ambulatory: spectrum analyzer of Doppler US signals and medical recording data base, Proc I7 Meditewanean Conf Med Biol Eng, Spain, 9- 12 September 1986. Hatle L, Angelsen B. Doppler ultrasound in cardiology, Philadelphia: Lea & Frebiger, 1982. Brown PM, Johnston KW, Kassam M, Cobbold RX. A critical study of ultrasound Doppler spectral analysis for detecting carotid diseases. Ultrasound Med Biol 1982; 8: 515-23. Bracale M, Cesarelli M, Clemente F. Detection of arterial diseases through a new interpretation of Doppler US signals, I!II Nordic Meeting Med Biol Eng, Trondheim, 28 June-l July, 1987 (a), B13. Bracale M, Cesarelli M. Surface EMG: heavy parameters for diagnosis and rehabilitation. In: Leo T, Rizzolatti G, eds. Bioingegneria della Riabiliwone. Patron, 1987 (b) (in Italian). Basmajian JV, De Luca C. Muscle Alive. Baltimore: William and Wilkins Press, 1985. Bracale M, Cesarelli M, Ragosta C. Frequency domain study of electrom ographic s@al. Rassegna di Bioingegnerik 1983; 8: 49-53 rin Italian).