DSPRelated.com
Forums

FFT Questions.....

Started by Todd January 7, 2004
I have had some experience with the DFT, and realize that the fft
produces the same results, only faster.  I understand the whole
concept of resolution, that if 128 samples are taken at 10kHz, there
are only 128 possible frequencies (all equally spaced from 0 to 10k)
that can be absolutely determined. Is there an algorithm that performs
a second fft of the same original signal, but over only the frequency
bands that the current transforms resolution can't determine?

Can you perform an fft over a range of freqencies not including 0Hz?
"Todd" <muirt@purdue.edu> wrote in message
news:9494fac.0401071154.59914297@posting.google.com...
> I have had some experience with the DFT, and realize that the fft > produces the same results, only faster. I understand the whole > concept of resolution, that if 128 samples are taken at 10kHz, there > are only 128 possible frequencies (all equally spaced from 0 to 10k) > that can be absolutely determined. Is there an algorithm that performs > a second fft of the same original signal, but over only the frequency > bands that the current transforms resolution can't determine? > > Can you perform an fft over a range of freqencies not including 0Hz?
128 samples taken at 10kHz, if the samples are real (not complex), will yield 128 frequency samples and the real part of the result will be even and the imaginary part of the result will be odd. So, there's some redundancy in the result. So, 65 frequency samples will be unique (from zero to 5kHz) and 63 samples will be complex conjugates of the 2nd through the 64th. The first sample (at 0Hz) and the 65th sample (at 5kHz)are unique and not repeated anywhere (until you envision the 129th sample point at 10kHz which matches the first sample at 0Hz). There are implementations of the FFT that are sometimes called a "real" FFT that use a generally complex FFT algorithm and pack half of the real time samples in the location for "real" values and half of the real time samples in the "imaginary" values. Take a look at the Goertzel algorithm for a limited range of frequencies. Fred
Todd wrote:
> I have had some experience with the DFT, and realize that the fft > produces the same results, only faster. I understand the whole > concept of resolution, that if 128 samples are taken at 10kHz, there > are only 128 possible frequencies (all equally spaced from 0 to 10k) > that can be absolutely determined. Is there an algorithm that performs > a second fft of the same original signal, but over only the frequency > bands that the current transforms resolution can't determine? > > Can you perform an fft over a range of freqencies not including 0Hz?
Well, as Fred wrote, if your input is real only (no imaginary parts) you can take a 256 point real FFT for double the resolution. You could also frequency shift your input signal by half a bin (in your case shift by 10kHz/256) but this results in a complex time sequence, and you'll have to take a complex 128 point FFT - this won't be much faster (if any) than just taking a real 256 point FFT. Regards, Andor
Hi,
> that can be absolutely determined. Is there an algorithm that performs > a second fft of the same original signal, but over only the frequency > bands that the current transforms resolution can't determine?
resampling is insertion zeros in original consequence, up to needing resolution. Cheers
Andor Bariska <andor@nospam.net> wrote in message news:<3ffd18e1$1@pfaff2.ethz.ch>...
> Todd wrote: > > I have had some experience with the DFT, and realize that the fft > > produces the same results, only faster. I understand the whole > > concept of resolution, that if 128 samples are taken at 10kHz, there > > are only 128 possible frequencies (all equally spaced from 0 to 10k) > > that can be absolutely determined. Is there an algorithm that performs > > a second fft of the same original signal, but over only the frequency > > bands that the current transforms resolution can't determine? > > > > Can you perform an fft over a range of freqencies not including 0Hz? > > Well, as Fred wrote, if your input is real only (no imaginary parts) you > can take a 256 point real FFT for double the resolution.
...provided those added 128 entries in the input to the FFT are data points, and not zeros as in zero padding. Rune
h3vic@yahoo.com (Vic) wrote in message news:<f130a3b8.0401080424.6dda019b@posting.google.com>...
> Hi, > > that can be absolutely determined. Is there an algorithm that performs > > a second fft of the same original signal, but over only the frequency > > bands that the current transforms resolution can't determine? > resampling is insertion zeros in original consequence, up to needing resolution. > > Cheers
Im not really sure what you mean by that, could you elaborate? I want to develop an application that can determine all harmonic content of a musical instrument. So instead of an algorithm that has a range of 20kHz, with a resolution of 1Hz, I was thinking about using a much larger resolution over the entire 20k, say 156.25 Hz for 256 samples at 40kHz. Then another algorithm would look over the 156.25Hz wide bands between the original bins, also with 256 samples, for an effective resolution of 1.22Hz, but only in "interbin" bands where harmonic content exists, but didnt fall exactly on a bin.
Hi Todd

Here is another option to consider.

If your signals frequency content is not polluted by other nearby 
signals of similar amplitude and frquency you can use interpolation to 
increase the apparent resolution of an FFT.  For example, the FFT 
spectrum analyzer demo that comes with the VC33 DSK will resolve 0.02Hz 
changes in a 1KHz signal sampled at 48KHz and with an FFT size of only 
2048. This has worked so well that crystal stability has become an 
issue, and by cirtue of being a low cost board, not likely to be improved.

On the other hand, if you are trying to isolate one musical instrument 
amongst many you will have too many signals occupying the center and 
just as importantly adjacent bins.  In this case you would need more FFT 
bins or a different method altogether.

Hope this helps,

Best regards,
Keith Larson

Todd wrote:
> h3vic@yahoo.com (Vic) wrote in message news:<f130a3b8.0401080424.6dda019b@posting.google.com>...
> I want to develop an application that can determine all harmonic > content of a musical instrument. So instead of an algorithm that has a > range of 20kHz, with a resolution of 1Hz, I was thinking about using a > much larger resolution over the entire 20k, say 156.25 Hz for 256 > samples at 40kHz. Then another algorithm would look over the 156.25Hz > wide bands between the original bins, also with 256 samples, for an > effective resolution of 1.22Hz, but only in "interbin" bands where > harmonic content exists, but didnt fall exactly on a bin.
+--------------------------------------------------------------+ | Keith Larson | | Member Group Technical Staff | | Texas Instruments Incorporated | | | | 281-274-3288 | | k-larson2@ti.com | |--------------------------------------------------------------+ | TMS320C3x/C4x/VC33 Applications | | | | TMS320VC33 | | The lowest cost and lowest power 500 &#4294967295;w/Mflop | | floating point DSP on the planet! | | | | Web: focus.ti.com/docs/toolsw/folders/print/tmdsdsk33.html | | Code: www-s.ti.com/sc/psheets/sprc147/sprc147.zip | +--------------------------------------------------------------+
Actually, the one instrument would be sampled by itself, not in chorus
with other instruments. Im not looking to identify the instruments out
of a mixed recording. What Im looking for is the complete harmonic
structure of an instrument. Then eventually, I want to study the
harmonic content as it relates to forming the aural tone of different
unique instruments.  But what is crucial is capturing amplitude,
phase, and frequency of all harmonics that could possibly effect the
sound.
Todd wrote:

> Actually, the one instrument would be sampled by itself, not in chorus > with other instruments. Im not looking to identify the instruments out > of a mixed recording. What Im looking for is the complete harmonic > structure of an instrument. Then eventually, I want to study the > harmonic content as it relates to forming the aural tone of different > unique instruments. But what is crucial is capturing amplitude, > phase, and frequency of all harmonics that could possibly effect the > sound.
The harmonic content of a struck or plucked string depends not only on how hard the string is played, but also on how long it has had to decay. Not all overtones decay at the same rate. It's not at all simple. Jerry -- "I view the progress of science as ... the slow erosion of the tendency to dichotomize." Barbara Smuts, U. Mich. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins <jya@ieee.org> wrote in message news:<4000812b$0$6751$61fed72c@news.rcn.com>...
> Todd wrote: > > > Actually, the one instrument would be sampled by itself, not in chorus > > with other instruments. Im not looking to identify the instruments out > > of a mixed recording. What Im looking for is the complete harmonic > > structure of an instrument. Then eventually, I want to study the > > harmonic content as it relates to forming the aural tone of different > > unique instruments. But what is crucial is capturing amplitude, > > phase, and frequency of all harmonics that could possibly effect the > > sound. > > The harmonic content of a struck or plucked string depends not only on > how hard the string is played, but also on how long it has had to decay. > Not all overtones decay at the same rate. It's not at all simple. > > Jerry
Alright, the harmonics all have different ADSR (Attack Decay Sustain and Release) windows then? If thats the case then, doing the whole algorithm for finding all harmonics over time would allow you to see the different responses over time, which would differntiate unique instruments. But I still believe that there is an instrument-defining pattern in discrete sections of the sound. If you record one note of an instrument for 3 seconds, then with a wave editor, loop only some of that recording, say, from 1.5 seconds to 2.0 seconds the defining characteristics of that sound are still evident. So really, on the grandest scale, what im looking for is an application to recognize unique patterns, but i need to look for different patterns than what i orignially proposed.