Hi all, I am new to DSP and FFT, but have managed to implement Smith's FFT algorithm. I use it to analyze audio amplifier signals. I have this one particular signal, a 1kHz sine with approx an 80kHz parasitic oscillation injected only on part of the wave (approx lasting a 1/4 phase). It is sampled at 5MSa/s. When I run this through my FFT program, the 1kHz sin wave shows up fine, but not the 80kHz oscillation. Does not FFT work for these kinds of signals? My server is down right now, I will try to post a picture later on. thanks Don

# FFT not showing high frequency oscillation

Started by ●November 14, 2006

Reply by ●November 14, 20062006-11-14

The FFT essentially takes the dot product between your signal and a discrete set of complex exponentials. As long as that dot product is non-zero for one of your basis vectors in the FFT it will show up- assuming you have no noise. If you do have noise you can average the power in a number of the FFTs together to reduce the noise it has. What you actually get, given the signal you describe, I think is a SINC function centered at 80 KHz. As a result, it will have much less power than the 1 KHz Sine wave. Since the signal you have is periodic you might also try a specgram to analyze it. d1camero wrote:> Hi all, I am new to DSP and FFT, but have managed to implement Smith's > FFT algorithm. I use it to analyze audio amplifier signals. > > I have this one particular signal, a 1kHz sine with approx an 80kHz > parasitic oscillation injected only on part of the wave (approx lasting > a 1/4 phase). It is sampled at 5MSa/s. > > When I run this through my FFT program, the 1kHz sin wave shows up > fine, but not the 80kHz oscillation. Does not FFT work for these kinds > of signals? > > My server is down right now, I will try to post a picture later on. > > thanks > Don

Reply by ●November 14, 20062006-11-14

d1camero wrote:> Hi all, I am new to DSP and FFT, but have managed to implement Smith's > FFT algorithm. I use it to analyze audio amplifier signals. > > I have this one particular signal, a 1kHz sine with approx an 80kHz > parasitic oscillation injected only on part of the wave (approx lasting > a 1/4 phase). It is sampled at 5MSa/s. > > When I run this through my FFT program, the 1kHz sin wave shows up > fine, but not the 80kHz oscillation. Does not FFT work for these kinds > of signals? > > My server is down right now, I will try to post a picture later on. > > thanks > Don >Yes, the FFT does work on this type of signal. But the results may not be what you expect. Your 1kHz tone should show up as a nice big spike in the FFT, but the oscillation will be spread out. Not only because of the fact that it's not continuous, as mentioned in another response, but because it's probably not a nice solid sine wave of constant frequency -- your circuit constants must be changing if it's coming and going, so you can pretty much count on some frequency sweep as it comes in and goes away again. This means that instead of all the energy being concentrated at 80kHz it'll be spread out, possibly by quite a bit. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html

Reply by ●November 14, 20062006-11-14

Gentlemen, thanks for taking the time to respond. Unfortunately my math is a little rusty (25 yrs since university engineering, and really haven't used it much beyond the basics). So figuring if the dot product is non-zero is a bit beyond my capabilities. However, a sonogram is a distinct possibility - I will check into it. Tim, to give a better understanding at what I am looking at, here is a picture of the oscillation: http://www.cameronsoftware.com/misc/JTM45%20parasitic%20oscillation.jpg the frequency is constant but amplitude varies as well as where it appears on the waveform. Does this shed a bit more light on my issue? thanks Don

Reply by ●November 15, 20062006-11-15

d1camero wrote:> Gentlemen, thanks for taking the time to respond. Unfortunately my > math is a little rusty (25 yrs since university engineering, and really > haven't used it much beyond the basics). So figuring if the dot > product is non-zero is a bit beyond my capabilities. However, a > sonogram is a distinct possibility - I will check into it. > > Tim, to give a better understanding at what I am looking at, here is a > picture of the oscillation: > > http://www.cameronsoftware.com/misc/JTM45%20parasitic%20oscillation.jpgIt would be more useful if you could post the sampled data instead. Regards, Andor

Reply by ●November 15, 20062006-11-15

Andor wrote:> > It would be more useful if you could post the sampled data instead. >Thanks Andor, here is the sample data: http://www.cameronsoftware.com/misc/JTM45%20parasitic%20oscillation.csv

Reply by ●November 15, 20062006-11-15

d1camero wrote:> Andor wrote: > > > > It would be more useful if you could post the sampled data instead. > > > > > Thanks Andor, here is the sample data: > http://www.cameronsoftware.com/misc/JTM45%20parasitic%20oscillation.csvI get a very nice peak at 85 kHz about 50dB above the noise floor, with three clear harmonics (around 170, 255 and 340 kHz). In addition, there is a very low but distinct component at 1.4028 MHz, sticking out about 15 dB above the noise floor. You must be doing something wrong in your FFT analysis. Regards, Andor

Reply by ●November 15, 20062006-11-15

Yes, I am sure there is something wrong with my software (as I wrote it myself from Smith's book). I am not sure how to fix this. Know of any sites that have an algortihm implemented in basic or C#? One thing I am curious about: Why no large spike at 1kHz? That is the dominant frequency... Don

Reply by ●November 16, 20062006-11-16

d1camero wrote:> Yes, I am sure there is something wrong with my software (as I wrote it > myself from Smith's book). I am not sure how to fix this. Know of any > sites that have an algortihm implemented in basic or C#? > > One thing I am curious about: Why no large spike at 1kHz? That is the > dominant frequency...There is a large spike at 1kHz - I thought it was obvious, so I didn't mention it. There is lot's of FFT software available. Most of it is in C, for example http://www.fttw.org, or more at http://www.fftw.org/links.html. Regards, Andor

Reply by ●November 16, 20062006-11-16

d1camero skrev:> Yes, I am sure there is something wrong with my software (as I wrote it > myself from Smith's book). I am not sure how to fix this.The debugging of an FFT routine is very basic: Choose a signal length N = 2^p for some integer p, and set up a signal x[n] = sin(2*pi*n*m/N) + cos(2*pi*n*m/N) m < N/2 The frequency is chosen to fall exactly on a frequency bin. With this signal, the only non-zero coefficient is in bins m and N-1-m. Just remember that numerical issues cause should-be-zero coefficients to take a tiny non-zero value, < 1e-15*|C| or so for double precision floating point formats, < 1e-7*|C| in single precision, where |C| is the magnitude of the largest non-zero coefficient. With the above signal, you are looking for the following: - ONLY coefficients X[m] and X[N-1-m] are non-zero (to working precision) - The two coefficients are complex cojugates of each other - The two coefficients have magnitudes either sqrt(2) or sqrt(N*2). The latter one is a bit dodgy; FORMALLY the magnitude of the unitary DFT can be derived from the amplitude in time domain. However, most FFT implementations save a division by sqrt(N), so you often need to divide by sqrt(N) to get the "correct" magnitude. Once you get this to work for arbitrary m, your FFT works. Rune