DSPRelated.com
Forums

DSP Implementation Woes

Started by Unknown January 30, 2008
http://s188.photobucket.com/albums/z...t=envelope.jpg

I am using a real-time DSP chip and I get a modulated continous output
which I am unsure if it a biproduct of the DAC process.

If I sample at just fractionally above the Nyquist rate, I obtain a
discrete sequence that is described (without loss of any generality)
that is similar to the linked image. When this sequence is
resynthesised at the output of the DAC, a modulated continuous
waveform is obtained that is directly congruent with the shape of the
discrete sequence. The interpolation doesn't seem to be able to
resolve the reconstructed continuous time sinsuoid again.

I am aware that the 'ideal' analytical interpolation is taken over an
infinite summation and as such this is not physically realizable. Is
this the effect that I am witnessing in this practical application?


Any comments on this sort of sequence would be great. It has a
discrete frequency of about 0.9 pi.

Thanks...
Brendan
My apologies for the bad link....it is actually:

http://s188.photobucket.com/albums/z65/liznbren/stuff/?action=view&current=envelope.jpg

Thanks....
Brendan
>My apologies for the bad link....it is actually: > >http://s188.photobucket.com/albums/z65/liznbren/stuff/?action=view&current=envelope.jpg > >Thanks.... >Brendan >
> If I sample at just fractionally above the Nyquist rate,
That is the problem right there, and what you are seeing is aliasing. Take a look at the applet on this page: http://cnx.org/content/m11448/latest/ Put in an input frequency of 4200 Hz, turn on the "Sample points", and turn off the "Input signal". You will see a similar result. To avoid aliasing you need to sample signals at or below the Nyquist rate.
pompano wrote:
>> My apologies for the bad link....it is actually: >> >> http://s188.photobucket.com/albums/z65/liznbren/stuff/?action=view&current=envelope.jpg >> >> Thanks.... >> Brendan >> > >> If I sample at just fractionally above the Nyquist rate, > > That is the problem right there, and what you are seeing is aliasing. > > Take a look at the applet on this page: > http://cnx.org/content/m11448/latest/ > > Put in an input frequency of 4200 Hz, turn on the "Sample points", and > turn off the "Input signal". You will see a similar result. > > To avoid aliasing you need to sample signals at or below the Nyquist rate.
Pompano, I think you confuse "below" and "above". In any case, observe that there are more than two samples per cycle of the sampled waveform. That part is OK. Brendan, Your discrepancy is only apparent. You must not simply plot the sample points and connect them. You need to feed the samples to a reconstruction filter and plot its continuous-time output. The reconstruction filter is a low-pass filter, and the more closely the sample clock approaches the minimum that theory allows, the more stringent are the requirements on it. When the rates are very different, a simple first-order hold (connecting the dots) suffices. You have chosen a rate ratio that requires a more sophisticated filter than that. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Jerry,

Thanks for your response.

Indeed, it was assumed that the DAC was NOT producing a FOH
implementation and was using a fully fledged Sinc( ) interpolator (or
as close to the ideal LPF as possible). However, it has come to my
knowledge that this might indeed be the case for this DSP chip below a
given sampling frequency. In which case the FOH implementation is
totally insufficient for this situation.

I will investigate this practicality tomorrow and see what happens if
I push the chip to use the LPF implementation and see if at slightly
below the Nyquist rate the output works as I would expect it to within
a legitimate tolerance.

Thanks again for your valued input! I'll keep you posted on the
results.

-Brendan



>pompano wrote: >>> My apologies for the bad link....it is actually: >>> >>>
http://s188.photobucket.com/albums/z65/liznbren/stuff/?action=view&current=envelope.jpg
>>> >>> Thanks.... >>> Brendan >>> >> >>> If I sample at just fractionally above the Nyquist rate, >> >> That is the problem right there, and what you are seeing is aliasing. >> >> Take a look at the applet on this page: >> http://cnx.org/content/m11448/latest/ >> >> Put in an input frequency of 4200 Hz, turn on the "Sample points", and >> turn off the "Input signal". You will see a similar result. >> >> To avoid aliasing you need to sample signals at or below the Nyquist
rate.
> >Pompano, > >I think you confuse "below" and "above". In any case, observe that there
>are more than two samples per cycle of the sampled waveform. That part >is OK. > >Brendan, > >Your discrepancy is only apparent. You must not simply plot the sample >points and connect them. You need to feed the samples to a >reconstruction filter and plot its continuous-time output. > >The reconstruction filter is a low-pass filter, and the more closely the
>sample clock approaches the minimum that theory allows, the more >stringent are the requirements on it. When the rates are very different,
>a simple first-order hold (connecting the dots) suffices. You have >chosen a rate ratio that requires a more sophisticated filter than that. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >����������������������������������������������������������������������� >
Haha whoops! I definitely did confuse "above" and "below". Actually I somehow read "sample at just fractionally above the Nyquist rate" as the "signal Nyquist rate above the sampling Nyquist frequency". I guess that will teach (remind) me to read more carefully. In essence I confused the terms Nyquist rate and Nyquist frequency. Thanks for the clarification, Joe
On Wed, 30 Jan 2008 12:01:21 -0800, brendan_online wrote:

> http://s188.photobucket.com/albums/z...t=envelope.jpg > > I am using a real-time DSP chip and I get a modulated continous output > which I am unsure if it a biproduct of the DAC process. > > If I sample at just fractionally above the Nyquist rate, I obtain a > discrete sequence that is described (without loss of any generality) > that is similar to the linked image. When this sequence is resynthesised > at the output of the DAC, a modulated continuous waveform is obtained > that is directly congruent with the shape of the discrete sequence. The > interpolation doesn't seem to be able to resolve the reconstructed > continuous time sinsuoid again. > > I am aware that the 'ideal' analytical interpolation is taken over an > infinite summation and as such this is not physically realizable. Is > this the effect that I am witnessing in this practical application? > > > Any comments on this sort of sequence would be great. It has a discrete > frequency of about 0.9 pi. >
As Jerry said, the closer you get to Nyquist the more stringent your filtering requirements are. The Nyquist rate is a theoretical upper limit of the "don't ever get close to this" sort, rather than the "nestle up as close as you can" sort. This article may help: http://www.wescottdesign.com/articles/Sampling/ sampling.html. -- Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
On 2008-01-31, brendan_online@hotmail.com <brendan_online@hotmail.com> wrote:
> I push the chip to use the LPF implementation and see if at slightly > below the Nyquist rate the output works as I would expect it to within > a legitimate tolerance.
If you sample at 100Hz and try to produce a 49Hz output, there will be an image at 51Hz. You have met the theoretical limit, but now you need an analog filter that passes enough 49Hz and blocks enough 51Hz to meet your needs. If you increase the sample rate to 200Hz, the image moves up to 151Hz and now you can use a much simpler filter. I'm not sure what you mean by "push the chip". Look up "reconstruction filter". -- Ben Jackson AD7GD <ben@ben.com> http://www.ben.com/
Hi Ben,

I was *told* that this chip supports several discrete clock
frequencies....namely 8,16,24,32,44.1,96 KHz, and it doesn't use a Low-
pass interpolation/reconstruction filter at the lower clock
frequencies. My problems are occurring at 8KHz. The 'modulation'
envelope is having an effect when trying to reconstruct a sinusoid at
about 3.4KHz. It's not too dissatisfactory at this point, but by 3.6+
KHz there is alot of harmonic distortion from what I desire.

In fact, at 8KHz the reconstruction looks of zero-order-hold type.

So when I said 'push the chip', I simply meant to clock it up to 96KHz
and see if the signal fidelity of a discrete sinusoid at a discrete
frequency of about 0.8pi is any better.

Thanks again,
Brendan




Okay let me state what I know about the hardware now.

There is a fixed LPF of bandwidth 48KHz, as the maximum sampling
frequency is 96KHz. This is fixed, even though the DSP chip support
the clock frequencies that I previously listed.

As such, the effects of the ZOH at the DAC are seldom mitigated, and
one closes in the vicinity of the Nyquist frequency this 'beating'
effect dominates.

I think this explains it, or so.

-Brendan