Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Relationship of Basis Functions and Sampling Rate

There are 20 messages in this thread.

You are currently looking at messages 0 to 10.


Relationship of Basis Functions and Sampling Rate - hrh1818 - 2009-10-05 11:18:00

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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - Tim Wescott - 2009-10-05 11:41:00



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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - Jerry Avins - 2009-10-05 11:51:00

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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - joepierson - 2009-10-05 12:27:00

On Oct 5, 11:18=A0am, hrh1818 <hr...@att.net> wrote:
> According to Steven Smith's book Chapter 9 page 174 "Digital Signal
> Processing" =A0a sine wave =A0with a frequency exactly equal to a basis
> function will have a sharp peak and no spectral leakage. =A0Whereas 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? =A0Does 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.


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - Rune Allnor - 2009-10-05 12:33:00

On 5 Okt, 17:18, hrh1818 <hr...@att.net> wrote:
> According to Steven Smith's book Chapter 9 page 174 "Digital Signal
> Processing" =A0a sine wave =A0with a frequency exactly equal to a basis
> function will have a sharp peak and no spectral leakage. =A0Whereas 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.

>=A0Does 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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - Dale Dalrymple - 2009-10-05 13:19:00

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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - Fred Marshall - 2009-10-05 14:33:00

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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - glen herrmannsfeldt - 2009-10-05 14:42:00

Tim Wescott <t...@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 
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - glen herrmannsfeldt - 2009-10-05 15:01:00

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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Relationship of Basis Functions and Sampling Rate - Tim Wescott - 2009-10-05 18:25:00

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

> Tim Wescott <t...@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
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | 2 | next