DSPRelated.com
Forums

Relationship of Basis Functions and Sampling Rate

Started by hrh1818 October 5, 2009
According to Steven Smith's book Chapter 9 page 174 "Digital Signal
Processing"  a sine wave  with a frequency exactly equal to a basis
function will have a sharp peak and no spectral leakage.  Whereas a
sine wave with a frequency between two basis functions will have
spectral leakage. If one knows ahead of time the frequencies at which
peaks will occur in a spectrum, say a CFL's current, how should one
choose the sampling rate?  Does the data need to be processed with a
window to minimize spectral leakage before performing a DFT if the
sampling rate is an integer multiple of the fundamental and its
harmonics?

Howard
On Mon, 05 Oct 2009 08:18:08 -0700, hrh1818 wrote:

> According to Steven Smith's book Chapter 9 page 174 "Digital Signal > Processing" a sine wave with a frequency exactly equal to a basis > function will have a sharp peak and no spectral leakage. Whereas a sine > wave with a frequency between two basis functions will have spectral > leakage. If one knows ahead of time the frequencies at which peaks will > occur in a spectrum, say a CFL's current, how should one choose the > sampling rate? Does the data need to be processed with a window to > minimize spectral leakage before performing a DFT if the sampling rate > is an integer multiple of the fundamental and its harmonics? > > Howard
For a perfectly periodic signal* the DFT is exact, and no windowing is necessary. You need windowing because the DFT 'expects' a periodic, and gives confusing results when handed a signal with discontinuities at the ends. So, if you have a perfectly periodic signal then all of your basis functions will be perfect harmonics of the fundamental, and a DFT will be exact**. So windowing will be the _wrong_ thing to do, instead of recommended. * Or one that exists on a timeline that is circular, if and only if that statement suppresses the inevitable flame war. ** Barring numerical difficulties. Put that flame thrower _away_. -- www.wescottdesign.com
hrh1818 wrote:
> According to Steven Smith's book Chapter 9 page 174 "Digital Signal > Processing" a sine wave with a frequency exactly equal to a basis > function will have a sharp peak and no spectral leakage. Whereas a > sine wave with a frequency between two basis functions will have > spectral leakage. If one knows ahead of time the frequencies at which > peaks will occur in a spectrum, say a CFL's current, how should one > choose the sampling rate? Does the data need to be processed with a > window to minimize spectral leakage before performing a DFT if the > sampling rate is an integer multiple of the fundamental and its > harmonics?
Your use of "basis function" shows that you need to go back and do more reading. The condition for no leakage is more stringent than you suppose. The samped waveform must include an integer number of cycles of each of its components frequencies. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
On Oct 5, 11:18&#4294967295;am, hrh1818 <hr...@att.net> wrote:
> According to Steven Smith's book Chapter 9 page 174 "Digital Signal > Processing" &#4294967295;a sine wave &#4294967295;with a frequency exactly equal to a basis > function will have a sharp peak and no spectral leakage. &#4294967295;Whereas a > sine wave with a frequency between two basis functions will have > spectral leakage. If one knows ahead of time the frequencies at which > peaks will occur in a spectrum, say a CFL's current, how should one > choose the sampling rate? &#4294967295;Does the data need to be processed with a > window to minimize spectral leakage before performing a DFT if the > sampling rate is an integer multiple of the fundamental and its > harmonics? > > Howard
To minimize spectral leakage I (and many other people) use a flat top window http://www.diracdelta.co.uk/science/source/f/l/flattop%20window/source.html# It will give you the correct magnitude answer no matter where the signal frequency is respective to the basis functions frequencies. The downside is resolution is lost. As long as you keep that in mind when looking at the results, it is a very useful window if you need precise magnitude measurements.
On 5 Okt, 17:18, hrh1818 <hr...@att.net> wrote:
> According to Steven Smith's book Chapter 9 page 174 "Digital Signal > Processing" &#4294967295;a sine wave &#4294967295;with a frequency exactly equal to a basis > function will have a sharp peak and no spectral leakage. &#4294967295;Whereas a > sine wave with a frequency between two basis functions will have > spectral leakage. If one knows ahead of time the frequencies at which > peaks will occur in a spectrum, say a CFL's current, how should one > choose the sampling rate?
One doesn't care. One selects the sampling rate such that the Nyquist sampling criterion is satisfied with some margin, and goes on from there. If one wants a particular resolution of the spectrum, one selects a duration of the observation such that the time-bandwidth product plays in your favour.
>&#4294967295;Does the data need to be processed with a > window to minimize spectral leakage before performing a DFT if the > sampling rate is an integer multiple of the fundamental and its > harmonics?
There might be reasons to do that, but there are no such requirements what the DFT is concerned. Rune
On Oct 5, 9:27 am, joepierson <gkicomput...@yahoo.com> wrote:
> On Oct 5, 11:18 am, hrh1818 <hr...@att.net> wrote: > ... > To minimize spectral leakage I (and many other people) use a flat top > window > > http://www.diracdelta.co.uk/science/source/f/l/flattop%20window/sourc... > > It will give you the correct magnitude answer no matter where the > signal frequency is respective to the basis functions frequencies. The > downside is resolution is lost. As long as you keep that in mind when > looking at the results, it is a very useful window if you need precise > magnitude measurements.
Flattop windows can give accurate amplitude response for tones with high SNR that are well separated from other tones. That is not what is usually meant by 'reducing leakage' as other bin responses don't go to zero. Actually, all windows have 'leakage' but if you have a single sine wave with an integer number of cycles in a rectangular window and calculate a DFT with the same size as the window, one bin will sample the peak of the sine wave's frequency response and the rest of the bins will sample zeros of the 'leakage function'. If you zero extend and calculate a DFT of twice the length of the window, half the bins will have the same response as the original DFT and half will have non- zero responses sampling the 'leakage function' between it's zeros. Dale B. Dalrymple
Rune Allnor wrote:
> On 5 Okt, 17:18, hrh1818 <hr...@att.net> wrote: >> According to Steven Smith's book Chapter 9 page 174 "Digital Signal >> Processing" a sine wave with a frequency exactly equal to a basis >> function will have a sharp peak and no spectral leakage. Whereas a >> sine wave with a frequency between two basis functions will have >> spectral leakage. If one knows ahead of time the frequencies at which >> peaks will occur in a spectrum, say a CFL's current, how should one >> choose the sampling rate? > > One doesn't care. One selects the sampling rate such that the > Nyquist sampling criterion is satisfied with some margin, and > goes on from there. If one wants a particular resolution of > the spectrum, one selects a duration of the observation such > that the time-bandwidth product plays in your favour. > >> Does the data need to be processed with a >> window to minimize spectral leakage before performing a DFT if the >> sampling rate is an integer multiple of the fundamental and its >> harmonics? > > There might be reasons to do that, but there are no such > requirements what the DFT is concerned. > > Rune
There may be a "requirement" related to SNR. That's why we sometimes clock with a tachometer - so that the samples are tied to the rotational position of a machine. This yields higher SNR of tonals than if one uses an arbitrary clock. That's pretty much the same idea. If the clock is arbitrary then the spectral leakage may add to the apparent SNR as certainly does wow and flutter, jitter, etc. If the clock is "locked" to the signals then there is no wow, flutter or jitter and spectral leakage can usually be eliminated and the SNR can be better - particularly at higher resolutions I should think. I don't like saying "basis functions" when one means a sinusoid in particular. There are others including sincs, etc. So, it's best to say what you mean. Fred
Tim Wescott <tim@seemywebsite.com> wrote:
< On Mon, 05 Oct 2009 08:18:08 -0700, hrh1818 wrote:
 
<> According to Steven Smith's book Chapter 9 page 174 "Digital Signal
<> Processing"  a sine wave  with a frequency exactly equal to a basis
<> function will have a sharp peak and no spectral leakage.  Whereas a sine
<> wave with a frequency between two basis functions will have spectral
<> leakage. If one knows ahead of time the frequencies at which peaks will
<> occur in a spectrum, say a CFL's current, how should one choose the
<> sampling rate?  Does the data need to be processed with a window to
<> minimize spectral leakage before performing a DFT if the sampling rate
<> is an integer multiple of the fundamental and its harmonics?

Use a PLL and lock onto a multiple of the fundamental.  
 
< For a perfectly periodic signal* the DFT is exact, and no windowing is 
< necessary.  You need windowing because the DFT 'expects' a periodic, and 
< gives confusing results when handed a signal with discontinuities at the 
< ends.

If the signal and DFT have the same period.  It seems that the OP
has cases where that isn't true.  It should be easier to fix that
than to fix the DFT.

-- glen 
Fred Marshall <fmarshallx@remove_the_xacm.org> wrote:
(snip)
 
< I don't like saying "basis functions" when one means a sinusoid in 
< particular.  There are others including sincs, etc.  So, it's best to 
< say what you mean.

The basis functions of the Fourier transforms are sinusoids.

There is, for example, the Fourier-Bessel transform used in 
cylindrical coordinates which has sinusoids for some variables
and bessel functions for the radial basis functions.

-- glen
On Mon, 05 Oct 2009 18:42:09 +0000, glen herrmannsfeldt wrote:

> Tim Wescott <tim@seemywebsite.com> wrote: < On Mon, 05 Oct 2009 08:18:08 > -0700, hrh1818 wrote: > > <> According to Steven Smith's book Chapter 9 page 174 "Digital Signal > <> Processing" a sine wave with a frequency exactly equal to a basis > <> function will have a sharp peak and no spectral leakage. Whereas a > sine <> wave with a frequency between two basis functions will have > spectral <> leakage. If one knows ahead of time the frequencies at which > peaks will <> occur in a spectrum, say a CFL's current, how should one > choose the <> sampling rate? Does the data need to be processed with a > window to <> minimize spectral leakage before performing a DFT if the > sampling rate <> is an integer multiple of the fundamental and its > harmonics? > > Use a PLL and lock onto a multiple of the fundamental. > > < For a perfectly periodic signal* the DFT is exact, and no windowing is > < necessary. You need windowing because the DFT 'expects' a periodic, > and < gives confusing results when handed a signal with discontinuities > at the < ends. > > If the signal and DFT have the same period.
Hmm. I was thinking that _real hard_, but I didn't get it on the page...
> It seems that the OP has > cases where that isn't true. It should be easier to fix that than to > fix the DFT.
Agreed. -- www.wescottdesign.com