Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!crdgw1!ge-dab!sunny!harrison From: harrison@sunny.DAB.GE.COM (Gregory Harrison) Newsgroups: comp.dsp Subject: Re: Sine curve fit algorithms Message-ID: <2320@ge-dab.GE.COM> Date: 6 Oct 89 01:43:41 GMT References: <2421@radio.oakhill.UUCP> <1989Sep28.161516.10353@rpi.edu> Sender: news@ge-dab.GE.COM Reply-To: harrison@sunny.UUCP (Gregory Harrison) Organization: GE Simulation & Control Systems Dept., Daytona Beach, FL Lines: 49 In article ted@nmsu.edu (Ted Dunning) writes: > >used to compute THD/Noise in a digitized sine wave. > >way to compute the amount of distortion present in a digitized sine > >so... the answer to the question is to computer the fourier transform, >eliminate the coefficient corresponding to the sine wave you are >interested in and compute the total power in the rest of the spectrum. > Yes, this appears to be a feasible solution to the problem, except for artifacts introduced by the DFT/FFT algorithm. The DFT (read FFT) is able to work because it assumes that the time series that is input to the DFT is periodic. In other words, it assumes that after all the input samples have been scooted into the DFT buckets for processing, that an identical waveform will occur in the same N time samples immediately following. If your sine wave has a period that exactly coincides with the number of samples in your DFT (or an integer division thereof) then the output spectrum will have a single positive (and negative) frequency component at the frequency of the input sine wave. If the sine wave does not have an integer number of periods in the input time sequence to the DFT, then a smearing will appear in the spectral characteristic. This smearing, or leakage, is due to a discontinuity in the edges of the input time sequence. Whereas a sine wave with integer periods will be continuous when the input N point sequence is lined up end to end, having a sine wave with a period that does not allow for an integer number of repetitions of the sine wave in the input buckets of the DFT will have an abrupt discontinuity at the abbutment point. The DFT calculates a spectrum that attempts to recreate this discontinuity. Therefore, the use of windows may be called for. Windowing the input sequence will squush the discontinuities at the ends of the input time sequence. The standard reference for windowing is: Harris F.J. 1978, On the use of Windows for Harmonic Analysis with the DFT, Proc IEEE, 66 (January) The idea with the Chebyschev sine wave computation may also open a possibility toward determining the THD. If a good clean sine wave, of exactly the same period and phase of the signal in question may be generated, then the difference may be taken, and the spectrum of the difference transformed to obtain the signal of which to determine the power of the harmonic distortion. Good Luck Greg Harrison My opinions are not intended to reflect those of GE.