FAST FOURIER TRANSFORM SYSTEM AND METHOD

Abstract: A Fast Fourier Transform system respectively method includes an automatic gain control section for controlling the amplitude of the signal from which the Fast Fourier Trans­ form is calculated. Means (46, 48) for detecting adder overflows occurring during butterfly operations are coupled to means (50, 52,54,56) for counting the number of detected overflows. If the number of overflows occurring in a pass of butterfly operations exceeds a given value, the amplitude of the signal is reduced. If the number of overflows occurring in a pass of butterfly operations falls below a given value, the amplitude of the signal is increased. The increase in the amplitude of the signal is inhibited if a calculation of the variance of the FFT spectrum of the signal from the 0th, lst and 2nd moments indicates that the signal is a noise signal.

Description: The present invention relates to Fast Fourier Transform systems, and to a method of controlling the amplitude of input signals applied to a Fast Fourier Transform system. The Discrete Fourier Transform, DFT, can be used to analyze the frequency (spectral) components of an analog wave. The amplitude of the wave is sampled in the time domain at a rate f s until N samples have been obtained and computations are made in accordance with the equations below so as to derive the amplitude of spectral components at each of N frequencies. According to the sampling theorem, the highest positive frequency component of a signal for which the amplitude may be unambiguously determined by sampling is f s /2. In the DFT, the frequencies of the analyzed components are separated from each other by f s /N. In the equation, k is the frequency index and n is the time index. (2) W N = e -j (2π/N) By substituting (2) into (1), we obtain The total number of computations required for a complete analysis is proportional to N² so as to become excessive for reasonable values of N. By using a Fast Fourier Transform, FFT, the number of computations required to derive from N input samples the amplitude of N frequency components is reduced from N² calculations to NlogN calculations. This is accomplished by noting that all values of the factor W N kn are not unique. If k equals l in equation (3), it can be seen that as n varies from 0 to N, the factor e -j (2π/N)kn is a vector of unit length that rotates through 360 degrees in discrete steps of 2π/N; and if k equals 2, the vector rotates through two revolutions in discrete steps of 4π/N. Thus, as the values of k increase, so do the number of revolutions and the angular size of the steps. Therefore, for any value of k, all the vector positions correspond to a position of the vector when k equaled one so that these values can be used over and over again instead of being computed each time. There are many ways in which an FFT system can perform the required computations, but a generally recognized method uses what is known as "butterfly" operations that are performed on each of different groups of a given number of successive samples. When all samples have been subjected to a butterfly operation, a first pass has been completed. If there are N samples, there will be N outputs from the butterfly operations of the first pass. A second pass of butterfly operations is then performed on different groups of the N butterfly outputs from the first pass. When all the N outputs have been subjected to a butterfly operation, the second pass is completed. If the given number of samples or outputs subjected to each butterfly operation is n, then the number of passes P is determined by the expression n P =N. The number n is known as the radix for the FFT. By way of example, if n=2 and N=8, three passes will be required. The number of butterfly operations in each pass is N/n so that, in this example, each pass would have four butterfly operations. Each butterfly operation is performed by means of at least one adder so that if the amplitude of the wave being analyzed is too large, adder overflow may occur due to the limitation of finite word-size that is carried in hardware, and thereby incorrect amplitude may be produced for the N frequencies. The butterfly operation also requires the use of some suitable multiplying means but the multiplication operation presents no overflow because the |W N | multiplicand is always equal to or less than unity. FFTs can be used in both continuous and pulsed Doppler apparatus for the purpose of analyzing the frequency content of the Doppler signals. In a pulsed Doppler system, pulses of a few cycles of a wave at carrier frequency w c are transmitted by a transducer into a region containing structures for which it is desired to determine velocities. Because each structure may have a different velocity, the frequency of the reflections from the various structures may differ from w c by an amount depending on the absolute value of the velocity. The envelope of the reflected wave after N pulses is the analog wave to be examined. It is sampled at the Nyquist rate with respect to the highest frequency above w c that is of interest. If only absolute values of velocity are to be determined, the samples are uniformly spaced and are called "real" samples, but if the direction of each velocity is to be determined as well, each real sample is followed by an "imaginary" sample that is spaced from it by the duration of one-quarter of a cycle of w c . Fladung and Mergler (Transactions on Industrial Electronics and Control Instrumentation, Vol. IECI-25, No. 4, November 1978, pages 322-326) disclose a Fast Fourier Transform system having an input to which a signal to be analyzed may be applied, digital sampling means coupled to said input, means coupled to said sampling means for providing sequential samples in a predetermined order at respective outputs thereof, means coupled to said outputs for performing a plurality of passes of butterfly operations, means coupled to said latter means for detecting at least one of the overflows that may occur during each of the butterfly operations of at least one pass, and means for counting the number of detected overflows occurring in at least one pass. This disclosure corresponds to the introductory portion of claim 1. According to a first aspect of the invention there is provided a Fast Fourier Transform system having an input to which a signal to be analyzed may be applied digital sampling means coupled to said input, for providing digital samples means coupled to said sampling, means for providing sequential digital samples in a predetermined order at respective outputs thereof, means coupled to said outputs for performing a plurality of passes of butterfly operations, means coupled to said latter means for detecting at least one of the overflows that may occur during each of the butterfly operations of at least one pass, and means for counting the number of detected overflows occurring in at least one pass, characterized by means for reducing the amplitude of a signal applied to said input when the number of overflows occurring in a pass is greater than a given value, and means for increasing the amplitude of a signal applied to said input when the number of overflows occurring in the last pass in which overflows are counted is less than a given value. Furtheron, the invention provides a method according to claim 10. The invention provides an efficient FFT system that is suitable for medical use. The present invention is concerned with increasing the amplitude accuracy of the spectral components that are determined in the FFT process. In the claimed Fast Fourier Transform systems and methods, the amplitude of the analog wave or the amplitude of the samples in analog or digital form is reduced by means of an automatic gain control (AGC) system respectively process when the overflows occurring in at least some of the butterfly operations indicate that the accuracy of the results obtained is below an acceptable level. A number of different relationships between the reduction in amplitude and the overflows can be used, e.g., the amplitude can be progressively reduced as the number of butterfly operations in a single pass that have at least one overflow increases or the amplitude can be reduced after each pass in which the number of butterfly operations having at least one overflow exceeds a given value for that pass. In either of these cases, the numbers of overflows rather than the number of butterfly operations having at least one overflow can be used. In the second case, the changes in amplitude that are made should take into account the fact that overflows occurring in an early pass have a greater adverse effect on the amplitude of the N frequencies than overflows occurring in a later pass so that the given number of allowable overflows for successive passes should increase with correspondingly larger gain reductions for earlier passes. Up to this point, all discussion has centered on decreasing amplitude, but any AGC system must also have the ability to increase the gain as the amplitude of the signal decreases. In an analog system, this function may be carried out by permitting a capacitor across which an AGC voltage is developed to discharge, but in a digital system controlled by a microprocessor, information has to be given to the processor which will cause it to increase the gain. This can be provided by selecting a minimum number of overflows that are to occur in the last pass involved in the AGC system and increasing the gain to a predetermined value whenever the number of overflows is equal to or less than the minimum. The minimum number can be selected so that the corresponding error in the amplitude of the N frequencies is insignificant. Instead of having separate means for performing each butterfly operation, one means can be used. The incoming samples are buffered and the inputs of the single butterfly means can be successively connected to receive different groups of samples. The outputs of the means for each butterfly operation of one pass are stored and used as inputs for the butterfly means during the next pass. Such a gain control system operates in a satisfactory manner except when the input signal is random noise rather than an analog wave, in which event no overflows occur in the butterfly operations so that the amplitude of the samples applied to the FFT are continually increased. When the AGC system is being used in apparatus for measuring the velocity distribution of blood flow wherein a sound to which the operator listens is produced in response to the analog wave to indicate velocity, the sound becomes very loud and the screen presenting a plot of spectral distribution becomes full scale whenever the transducer is not in firm contact with the patient's body. Whereas these effects are to be expected before the transducer is first placed in contact with the body, it is a source of considerable annoyance for them to occur every time the position of the transducer is changed. In accordance with a preferred arrangement of this invention, therefore, means are provided for preventing the AGC sytem from increasing the amplitude of the input samples of the FFT when the input signal is noise. There are a number of ways of performing this function, but in general they operate in response to the frequency content of the input signal. When it is the desired wave, its component frequencies lie in a narrower band, i.e., they are not broad band and have a spectral signature that is discernable from noise because noise yields a nearly flat amplitude distribution. One way of recognizing this difference is to compare the amplitude of a frequency to the carrier frequency with the amplitude of a frequency that is above or below the carrier frequency and still within the expected amplitude ditribution. When the ratio is above a given value, the signal can be treated as a desired signal; and when it is below the given value, the signal can be treated as noise. In accordance with still another preferred arrangement of this invention, the signal is cosidered to be the desired signal if its variance is less than a given value and considered to be noise if its variance is greater than the given value. It can be shown that the variance can be expressed as follows. wherein the 0th moment is the integral under the power spectrum. Exemplary embodiments incorporating and illustrating the principles of the invention will now be described in detail with reference to the accompanying drawings. FIGURE 1 is a flow chart illustrating one of many decimation-in-frequency sequences of FFT computations that may be used in on FFT in which N=8; FIGURE 2 is a flow chart illustrating one of many decimation-in-time sequencies of FFT computations that may be used in an FFT in which N=8; FIGURE 3 is a block diagram of a Doppler system utilizing an automatic gain control operating in accordance with the principles of this invention; FIGURE 4 is a flow chart illustrating one way in which the processor of an AGC system employing this invention and in which N=8 may operate; and FIGURES 5, 6 and 7 are flow charts respectively indicating how the 0th, 1st and 2nd moments may be calculated. In order to obtain a more concrete idea of what is meant by butterfly operations and passes, reference is now made to FIGURE l which is a flow chart illustrating one sequence of computations for an FFT system in which N=8. In this and other flow charts of the sequence of computations for an FFT, the values at the base of an arrow are considered to flow along it, and when two arrowheads meet, the values for these arrows are added. The presence of W N raised to some power along an arrow means that what is at the base of the arrow is multiplied by that factor. When there is a minus sign along the arrow, it means that the value at its base is multiplied by -1. Eight successive samples S(0) through S(7) of the analog wave for which the amplitude of eight frequencies are to be determined are applied to the eight input nodes n i 0 through n i 7 of the flow chart in normal order as indicated. For the particular FFT illustrated, the amplitude of the eight frequencies F(0) through F(7) respectively appear at the output nodes of the flow chart in bit-reversed order. Such a transform is called a "decimation in frequency", DIF. FIGURE 2 illustrates an analagous flow chart in which the samples are applied to the input nodes in bit-reversed order and the amplitude of the frequencies occur in natural order at the output nodes. This is called a "decimation in time", DIT. If the input samples are real, i.e., not complex, and are equally spaced, then the amplitude of the frequency F(0) represents DC and the amplitude of the frequencies F(1) through F(7) are for frequencies from DC+f s /N to F(7) in increments of f s /N. It should be noted that F(5) through F(7) are above Nyquist and, as such, are aliased. If the FFT is being used in a Doppler system to determine velocity of reflectors, such a system will not yield any information as to whether a reflector is moving toward or away from the source; but if the samples are complex, i.e., in pairs spaced by 90 degrees of the carrier frequency, the spectral components F(0) through F(4) are positive frequencies, DC through 4f s /N, from which the velocities toward the source can be determined and frequencies F(5) through F(7) are negative frequencies from which the velocities away from the source can be determined. If complex samples are used, the first sample of each pair is the real component, the second sample is the imaginary component, and all the mathematical operations indicated in flow charts such as shown in FIGURES l and 2 have to be carried out for all samples as complex. For the sake of simplicity, the invention will be explained using real samples only but it will be understood that it can be used when complex input samples are used. Examination of FIGURE l shows that the value of the sample S(0) applied to the input node n i 0 is added at a node n₁ (not shown in the drawing) to the value of the sample S(4) that is applied to the input node n i 4 and that the value of S(4) is inverted and added to the value of the sample S(0) at a node n₂. The value at the node n₂ is then multiplied by W N ⁰. These operations are all that are required for a butterfly operation B 0l . The name "butterfly" is used because the arrows used to indicate the operations form a geometric shape something like a butterfly, and the designation of each butterfly operation is at the intersection of these arrows. Similar operations are performed in a butterfly operation B₀₂ with the values of the samples S(l) and S(5) so as to derive their sum at a node n₃, their difference at a node n₄, and the product of the difference and W N ¹. The values of the samples S(2) and S(6) are involved in a butterfly operation B₀₃ where the multiplier of the difference is W N ² and the values of the samples S(3) and S(7) are involved in a butterfly operation B₀₄ where the multiplier of the difference is W N ³. The butterfly operations B 0l through B₀₄ constitute a pass P₀. The next pass P₁ is comprised of butterfly operations B₁₁, B₁₂, B₁₃ and B₁₄ that operate on different pairs of outputs of the butterfly operations of the pass P₀, e.g., B₁₁ operates on the value at the node n₁ that was determined in B 0l and the value at a node n₅ that was determined in B₀₃. The third pass is comprised of butterfly operations B₂₁, B₂₂, B₂₃ and B₂₄ in which the multipliers of the subtracted values are all W N ⁰. Thus, the first pass P₀ is completed when all the sample values are involved in a butterfly operation and all subsequent passes such as P l and P₂ are completed when all the outputs of a previous pass are involved in a butterfly operation. After the third pass P₂, the amplitude of the frequencies F(0) through F(7) appear in bit-reversed order at the output nodes n o0 through n o7 respectively. FIGURE 2 illustrates a sequence of operations for an FFT wherein the values of the samples S(0) through S(7) are applied to the input nodes n i0 through n i7 in bit-reversed order and the amplitude of the N frequencies F(0) through F(7) appear at the output nodes n o0 through n o7 in natural order. This type of operation is known as a "decimation in time", DIT. It is believed that the indicated butterfly operations and passes are self-explanatory. Note that the multiplication by various powers of W N occurs prior to a butterfly operation rather than after it as in FIGURE l. In FIGURES l and 2, each butterfly operation has had two inputs and two outputs, but it is possible that butterfly operations could have more inputs and outputs. In any event, the terms representing the amplitude of any particular frequency component that are derived by following the sequence of operations of a flow chart will be the same as the terms resulting from the application of equation (l). Reference is now made to the block diagram of FIGURE 3 illustrating Doppler apparatus for analyzing the flow of blood and in which the amplitude of the signal applied to the FFT employed is controlled in accordance with this invention. Clock pulses for the apparatus, as well as timing pulses for various functions it is to perform, are provided by a timer 6. One set of timing pulses is applied to a transmitter 8 that outputs a series of keying pulses in response to each timing pulse that are respectively applied via a transceiver l0 to different crystals (not shown) of a transducer l2 that is held against a patients body. Each crystal produces several cycles of ultrasonic pressure waves of a carrier frequency w c , and the pressure waves from all of the crystals form a beam having a wavefront that moves in a direction determined by the relative timing of the keying pulses. When the pressure waves impinge on discontinuities in acoustic impedance such as are provided by blood particles, a portion of their energy is reflected back to each crystal, causing them to produce corresponding electrical waves. Because the pressure waves reflected from any particle arrive at the crystals at respectively different times, the resulting electrical waves are not in phase, but they can be made cophasal by introducing a proper delay for each crystal. The electrical waves can then be summed in an analog manner. These functions are performed in a receiver 14. The receiver 14 also reduces the frequency of the electrical waves to an intermediate value. If the discontinuity is moving toward the transducer 12, the frequency of the corresponding summed waves will be greater than w c . When blood flow is being analyzed, the summed wave has frequency components respectively corresponding to the velocities of many blood particles, and because some of the particles may be moving toward the transducer 12 and some may be moving away from it, the summed wave may have frequency components greater than w c as well as components that are less than w c . After undesired high frequencies are eliminated from the intermediate frequencies by a filter l6, the summed signal is applied to a sample-and-hold device 18 that is activated by signals from the timer 6 only when the summed signal corresponds to reflections from discontinuities within the range of interest. The reflection from the walls of the artery can undesirably contribute to the summed signal, but because the velocity with which the walls move is very small with respect to the velocities of the blood particles, the contribution can be eliminated by the insertion of a band pass filter 20 that prevents the low frequencies associated with the wall movement from passing through it. The signal at the output of the filter 20 is the analog wave that is to be analyzed for frequency content by the FFT. At some point in the path of the summed signal, preferably after the filter 20, means 22 is provided for varying the amplitude of the summed signal under the control of signals provided in accordance with this invention. The gain controlled summed signal may be applied to an audio processing circuit 23 that produces an audio signal varying in frequency in the same manner as the Doppler reflections; but in any event, it is applied to digitizing means comprised of a sample-and-hold device 24 having its output coupled to an analog-to-digital converter 26, both of which are controlled at a Nyquist rate by the timer 6. The purpose of the sample-and-hold device 24 is to maintain a constant value for a sufficiently long time to permit the analog-to-digital converter 26 to operate in a satisfactory manner. Each of the samples for the range selected by the sample-and-hold device that appear at the output of the A/D converter 26 are applied to sequential addresses in a buffer memory 28 and are read therefrom under the control of an address decoder 30 that is synchronized with the timing pulses that activate the A/D converter 26. A Fourier transform assumes that the wave being analyzed is continuous, but in an FFT, N samples are assumed to be continuous so that sample 0 becomes concatenated with the sample N-1. If the sinusoidal components of the summed analog wave are integral with a period during which the N samples occur, no harm is done; but if, as is the usual case, they are not integral therewith, there are discontinuities between the last sample N-1 of the period and the first that introduce frequency components on either side of the frequency of the sinusoid. Such frequencies are an error and are referred to as "spectral leakage". In order to reduce this leakage, the samples read from the buffer 28 are applied to a time window 32 that weights the N samples such that the amplitude of the samples at the beginning of a time window gradually increases from zero and the amplitude of the samples at the end of the time window gradually decreases to zero. After passing through the time window 32, the N samples are applied to a cache memory 34 and are read therefrom and applied to a means 36 for performing a butterfly operation on successive pairs as required by the particular FFT sequence employed. If the sequence shown in FIGURE 1 is being used, the first pair of samples would be S(0) and S(4). As each butterfly operation of the first pass is completed, its outputs are stored in the cache memory 34 at an address determined by the address decoder 30 so as to be available for application to the inputs of the butterfly operation means 36 during the next pass. After the last pass is completed, the values in the cache memory 34 are the relative amplitude or spectrum of the N frequencies in the order determined by the particular FFT sequence used. The means 36 for performing a butterfly operation is herein shown as being comprised of an adder 38 having inputs respectively connected to the outputs of the cache memory 34, an adder 40 having one input connected to one of the outputs of the cache memory 34 and its other input connected via a 2's complement device 42 which serves to invert the polarity of the signal applied to it to the other output of the cache memory. The output of the adder 38 is connected to the cache memory 34 for temporary storage therein and the output of the adder 40 is coupled via a multiplier 43 to the cache memory 34 for temporary storage therein. The multiplier 43 serves to multiply the output of the adder 40 with a suitable power of W N that is supplied by a W N ROM 44 at an appropriate time determined by a pulse from the timer 6. Because the multiplier 43 is at the output of the adder 40, the configuration shown is for DIF FFT sequence such as shown in FIGURE l; but if the sequence of FIGURE 2 were used, the multiplier 43 would be connected between the 2's complement device 42 and the input of the butterfly device 36 and before the signal split to adder 38. In order to detect overflows occurring during a butterfly operation, the sign inputs and carry bits of the adders 38 and 40 are applied to a PAL or ROM 46 which is so constructed as to provide a signal at one output thereof when the adder 38 overflows and a signal at another output thereof when the adder 40 overflows. These outputs are respectively connected to inputs of an OR gate 48, and its output is connected to a counter 50. If the outputs of the PAL or ROM 46 are not latched, a signal indicating an overflow in the adder 38 will reach the OR gate 48 before a signal indicating an overflow in the adder 40 because of the delay introduced by the 2's complement device 42 so that each signal, if present, will cause the output of the OR gate 48 to change state. The counter 50 is cleared at the end of each pass so that its count will equal the total number of overflows that have occurred during the pass. If the outputs of the PAL or ROM 46 are latched, a signal indicating an overflow in the adder 38 will reach the OR gate 48 at the same time as a signal indicating an overflow in the adder 40, even though the signals were formed at different times. In this case, the count at the output of the counter 50 will equal the number of butterfly operations in which at least one of the adders 38 and 40 overflowed. The following means are provided for placing the overflow count of the counter 50 for each pass in a respectively different latch. In sequences having three passes, such as those in FIGURES l and 2, three latches 52, 54 and 56 are required. During each of the passes P₀, P₁ and P₂, a different number is supplied to a 1 of n decoder 58 so as to cause it to respectively enable the latches 52, 54 and 56. At the end of each pass, the timer 6 supplies a pulse to the clear terminal of the counter 50 so as to reset it to zero and cause it to load its count into the latch that is enabled. Accordingly, when the FFT sequence is completed, the counts in the latches 52, 54 and 56 correspond to the number of overflows respectively occurring in the passes P₀, P₁ and P₂ if the outputs of the PAL 46 are not latched or to the number of butterfly operations in each pass having at least one overflow if the outputs of the PAL 46 are latched. A processor 60 coupled so as to read the latches 52, 54 and 56 is programmed so as to produce a digital signal corresponding to the desired gain. This signal is coupled via a digital-to-analog converter 61 to the gain control means 22. The processor 60 can be a ROM or any equivalent means. Reference is now made to the flow chart of FIGURE 4 for an illustration of one way in which the processor 60 may operate for an FFT sequence having three passes. At the start, the gain is set at an initial value, box 62. The amplitude of the N frequencies in the spectrum provided by the cache memory 34 are supplied to the processor 60 so that it can calculate the variance, VAR, of the signal. The details of this calculation will be discussed at a later point by reference to the flow charts of FIGURES 5, 6 and 7. All overflows from the latches 52, 54 and 56 are read, box 64. The number, n₀, of overflows in the latch 52 is compared with an arbitrarily chosen number P₀MAX, box 66. If n₀ exceeds P₀MAX, a digital signal is generated, box 68, that when applied to the D/A converter 61 will cause the amplitude control device 22 to make an arbitrarily selected reduction in gain of Δ₀. If, however, n₀ is less than P₀MAX, the number of overflows, n₁, in the latch 54 is compared with an arbitrarily chosen number P₁MAX, box 70. If n₁ exceeds P₁MAX, a digital signal is generated, box 72, that when applied to the D/A converter 61 will cause the amplitude control device 22 to make an arbitrarily selected reduction in gain of Δ₁. If, however, n₁ is less than P₁MAX, the number of overflows n₂ in the latch 56 is compared with an arbitrarily chosen number P₂MAX, box 74. If n₂ exceeds P₂MAX, a digital signal is generated, box 76, that when applied to the D/A converter 61 will cause the amplitude control device 22 to make an arbitrarily selected reduction in gain of Δ₂. If, however, n₂ is less than P₂MAX, n₂ is compared with an arbitrarily chosen number P₂MIN that is less than P₂MAX, box 78. If n₂ is less than P₂MIN, a signal is generated, box 80, that when applied to the D/A converter 61 will cause the amplitude control device 22 to make an arbitrarily chosen increase in gain of Δ₂' which may be the same as or different from Δ₂. If any of n₀, n₁ and n₂ are respectively greater than P₀MAX, P₁MAX and P₂MAX, there is no need to perform the comparison of n₂ with P₂MIN indicated by thebox 78 because in such circumstances the amplitude of the samples applied to the FFT is too large and not too small so that whichever ones of the reduction in gain, Δ₀, Δ₁ and Δ₂, are indicated may be applied directly to the D/A converter 61 as indicated by the dashed lines. If, however, none of n₀, n₁ and n₂ are respectively greater than P₀MAX, P₁MAX and P₂MAX, the comparison of n₂ with P₂MIN must be made, box 78, so as to increase the gain by Δ₂', box 80. The gain is increased in increments of Δ₂' until one of the reductions in gain of Δ₀, Δ₁ and Δ₂ occurs. Ideally, the AGC in final steady state should oscillate by +Δ₂' and -Δ₂. This description of operation of the invented automatic gain control system does not take into account the effect of variance. Whereas this is not necessary, an input signal that is essentially noise, such as that which occurs when a transducer is not in contact with a patient's body, will cause no overflows so that the number of overflows in the last pass, P₂ in this example, will always be less than P₂MIN, box 78, and cause an incremental increase in gain of Δ₂', box 80. On each loop, then, the gain is increased by Δ₂' until maximum gain is achieved. This can cause the audio processor 60 to output an excessively loud and annoying sound and cause the display of the spectral distribution to become near full-scale. In order to prevent this from occurring, the variance calculation of VAR, box 63, is compared with an arbitrarily selected value of variance VAR MAX, box 82. If VAR is less than VAR MAX, the signal is not noise, and the system operates as just described; but if VAR is greater than VAR MAX, the signal is considered to be noise and the gain is not increased and is left wherever it was. The comparison of VAR with VAR MAX can be done after each determination of the gain reductions Δ₀, Δ₁ and Δ₂ and the application to the D/A converter 61 can be prevented if VAR is greater than VAR MAX. If, however, any reduction in gain such as Δ₀, Δ₁ or Δ₂ is indicated, the input signal will not be noise so that the variance can be calculated on the next loop as indicated by the dashed lines. A flow chart indicating a way in which the 0th moment can be calculated is shown In FIGURE 5. As indicated in equation (5), the 0th moment is merely the sum of all the amplitude of the N frequencies. At the start, the initial value of the 1st moment is zero, box 84. Box 86 indicates that the amplitude A n of one of the N frequencies is added to the old value, which in this case is zero. If n is not equal to N-1, box 88, one is added to the value of n so as to obtain n+1, box 90. The amplitude A n+1 of another one of the N frequencies is then added to A n , box 86. This process continues until n=N-1, at which point the output of the box 86 is the 0th moment. A flow chart indicating a way in which the 1st moment can be calculated is shown in FIGURE 6. As indicated in equation (6), the 1st moment is the sum of the products of each of the N frequencies and its respective amplitude. At the start, the initial value of the 2nd moment is zero, box 92. Box 94 indicates that the product of f n A n is added to the old value, which in this case is zero. If n is not equal to N-1, box 96, n is increased by one, box 98, and the product of the frequency f n+1 and its amplitude A n+1 is added to the old value, box 94. This continues until n=N-1, at which point the output of the box 94 is the 1st moment. A flow chart indicated a way in which the 2nd moment can be calculated is shown in FIGURE 7. The functions represented by the boxes 100, 102, 104 and 106 respectively correspond to the functions represented by the boxes 92, 94, 96 and 98 of FIGURE 6 except that a value of (f n )²A n is added to the old value of the 2nd moment until n=N-1, at which point the output of the box 102 is the 2nd moment. It is thought that one skilled in the art would have no difficulty in programming the microprocessor 60 so that it can calculate the moments as set forth above and to calculate the variance VAR in accordance with equation (4). It is also believed that one skilled in the art could easily program the microprocessor 60 to reduce the gain in proportion to the number of overflows in each pass. The description above has been for a system wherein only real samples are used so that the direction of the various velocity components is not indicated, but the invention would be equally applicable to a system employing real and imaginary samples so as to enable the direction of the velocity components to be determined. In such a system, a real sample occurs during each cycle of the carrier frequency w c and an imaginary sample occurs 90 degrees later. The complex samples would be processed in an analogous manner. If, as in FIGURES l and 2, N=8, the spectral outputs F(0) through F(4) represent five frequencies, DC through 4f s /N, indicating velocities toward the transducer and three frequencies F(5) through F(7) indicating velocities away from the transducer. If the samples applied to the FFT are real, i.e., not complex, the outputs of the FFT indicate the relative amplitude of frequencies from DC to the sampling frequency in increments of f s /N, but there is no direction information. Instead of performing a hardware FFT, a software FFT could be used while still employing the AGC concept proposed with the hardware FFT. All intermediate calculations in software would exactly parallel the hardware implementation. Of course, processing speed would be slower. However, the overflows would still be used to determine the AGC control voltage which would be applied to the signal to be transformed for controlling its level.

Claims: A Fast Fourier Transform system having an input to which a signal to be analyzed may be applied, digital sampling means (24,26) coupled to said input for providing digital samples means (28,30,32,34) coupled to said sampling means (24,26) for providing sequential digital samples in a predetermined order at respective outputs thereof, means (36) coupled to said outputs for performing a plurality of passes of butterfly operations, means (46,48) coupled to said latter means (36) for detecting at least one of the overflows that may occur during each of the butterfly operations in at least one pass, and means (50,52,54,56) for counting the number of detected overflows occurring in at least one pass, characterized by means (60,61,22) for reducing the amplitude of a signal applied to said input when the number of overflows occurring in a pass is greater than a given value, and means (60,61,22) for increasing the amplitude of a signal applied to said input when the number of overflows occurring in the last pass in which overflows are counted is less than a given value. A Fast Fourier Transform system as in claim 1, characterized in that said means (46,48) for detecting overflows detects all of the overflows occurring during each of the butterfly operations. A Fast Fourier Transform system as in claim 1 or 2, characterized in that means (63,82) are provided for preventing said means (60, 61,22) for increasing the amplitude of a signal applied to said input from operating whenever the signal applied to said input is noise. A Fast Fourier Transform system as in one of claims 1 through 3, characterized in that means (58) are provided for causing said counting means (50,52,54,56) to indicate the number of overflows occurring during a selected pass. A Fast Fourier Transform system as in one of claims 1 through 3, characterized in that means (58) are provided for causing said counting means (50,52,54,56) to separately indicate the number of overflows occurring in each of a plurality of passes, said means (60,61,22) for reducing the amplitude of a signal applied to said input reduces the amplitude when the latter number or a given pass exceeds a given value, and said means (60,61,22) for increasing the amplitude of a signal applied to said input increases the amplitude when the latter number for a pass that occurs after said given pass is less than a given value. A Fast Fourier Transform system as in one of claims 1 through 3, characterized in that means (58) are provided for causing said counting means to separately indicate the number of overflows occurring in each of a plurality of passes, said means (60,61,22) for reducing the amplitude of a signal applied to said input reduced the amplitude by a selected amount for each pass having a number of overflows that is greater than a respective value, and said means (60,61,22) for increasing the amplitude of a signal applied to said input increases the amplitude by a given amount when the number of overflows occurring in the last of said passes is less than a given value. A Fast Fourier Transform system according to claim 1, characterized in that said means (60,61,62) for increasing or reducing the amplitude of a signal applied to said input comprise, gain control means (22) for controlling the amplitude of the input signal, and processing means (60,61) for causing said gain control means to vary the gain by a predetermined amount for each pass in which the number of butterfly operations having an overflow deviates from a predetermined value, wherein the gain control means provides a given gain when uncontrolled, and the system further comprises means (63,83) to prevent the processing means increasing the gain if the signal applied to said input is noise. A Fast Fourier Transform system as in claim 7, characterised in that said control means (22) is located between said input and said digital sampling means (24,26). A Fast Fourier Transform system as in claim 7 or 8, characterized in that said means (63,82) to prevent the processing means (60,61) increasing the gain if the signal at the input is noise is comprised of means coupled to the output of the Fourier Transform system, for deriving the 0th, 1st and 2nd moments, means (63) for calculating the variance therefrom, and means (82) to prevent said processing means increasing the gain when the variance is greater than a given value. A method of controlling the amplitude of an input signal applied to a Fast Fourier Transform system, comprising the steps of; sampling the input signal to provide digital samples, providing sequential digital samples in a predetermined order in response to said digital samples, performing a plurality of passes of butterfly operations on the sequential digital samples in said predetermined order detecting and counting at least one of the overflows that may occur during each of a plurality of butterfly operations of at least one pass characterized by the steps of reducing the amplitude of the input signal when the number of overflows occurring in a pass exceeds a given value, or increasing the amplitude of the input signal when the number of overflows counted in the last pass is less than said given value.

Inventors: LEAVITT, STEVEN C.
Applicants: HEWLETT-PACKARD COMPANY
Application year: 1985
Main classification: G06F15
IPC codes: A61B8, H03G3, G06F17