Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP

Discussion Groups

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

Codec - sant...@isac.ernet.in - Oct 4 15:18:00 2005



Hi,
I am using the talkthru program supplied with the EZK-lite (ADSP-21062) board
to output a low frequency sine wave and its phase in the two output codec
ports. I see a distorted phase, which i expect to be perfect sawtooth signals
with its magnitude proportional to the phase. Can anyone help me out to fix it.
The problem seems to be more severe at low frequencies than high...
Looking for your sugesstions..
regards,
SS




(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: Codec - Jon Harris - Oct 5 21:07:00 2005

By the phase, I assume you mean some pointer variable you are incrementing
through a table of sine values (like a DDS)? That would make sense if you are
expecting a sawtooth. (Normally, the phase of a sine wave is also a sine wave
since derivative of sine is cosine.)

Anyway, is the sine wave clean? How low is the frequency? Keep in mind that
the audio CODEC won't pass signals all the way down to DC. It probably cuts
out around 20Hz or so due to DC blocking caps on the outputs (I don't know the
specifics of the 21062 board, but I am guessing based on other experience.) So
if your sawtooth is too low in frequency, the DC blocking caps will start to
distort it. You can model this as a first order high-pass filter. If you have
Matlab or similar, run a sawtooth through a first order HP and look at the
distortion (primarily due to the phase shift of the HP filter).

For example, with a 100 Hz sawtooth, there is noticeable distortion with a 20
Hz HP filter and pretty extreme distortion with a 50 Hz HP filter. So I am
guessing that is what you are seeing.

If you really need to pass low-frequency signals, it _may_ be possible to
modify the hardware to remove the DC blocking caps, or at least increase their
value significantly to pass more low frequencies. Keep in mind that many DACs
have a DC offset on their outputs, so a cap is probably necessary if you are
using for audio purposes (as opposed to just connecting it to an oscilloscope).

--- santanu@sant... wrote:

> Hi,
> I am using the talkthru program supplied with the EZK-lite (ADSP-21062) board
>
> to output a low frequency sine wave and its phase in the two output codec
> ports. I see a distorted phase, which i expect to be perfect sawtooth
> signals
> with its magnitude proportional to the phase. Can anyone help me out to fix
> it.
> The problem seems to be more severe at low frequencies than high...
> Looking for your sugesstions..
> regards,
> SS

__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com





(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: Codec - Jon Harris - Oct 6 16:07:00 2005

Trying to pass <5Hz signals using audio hardware will probably be quite
difficult. Your best bet is to modify the hardware or choose a DAC board that
is made for DC-coupled output. "The proper tool for the proper job" as the
saying goes.

If this is not an option, you can try to compensate digitally, though I'm not
sure how well this will work. The first step is to measure the frequency
response of your sound card output. Sweep a sine wave from say 50 Hz down to 1
Hz and plot its magnitude (and ideally phase as well). This should tell you
what the hardware is doing to your signal. Hopefully it is pretty close to a
1st order HP filter with a 3dB cut-off somewhere below 20 Hz. Next, design a
filter to compensate. Since you have Matlab, you can use that to model your
problem, putting in the measured response and trying different filter to
compensate. You might try a low shelving filter with a fairly large boost. In
a quick experiment, I was able to get some improvement from that, though it
wasn't perfect.

I would expect to made modest improvements, not construct a perfect sawtooth.
At some point, you will be limited by dynamic range of the DAC--you can't just
boost the low frequencies infinitely since the DAC will saturate.

--- santanu sarma <sarma_santanu@sarm...> wrote:

> Thanks for your reply. Just to elaborate your point, I
> want to process a resolver sensor output, rotating at
> low frequencies (<5 Hz). I am computing the tangent of
> the shaft angle from sin and cosine envelops of the
> resolver output form a look-up table, and want to put
> it out. Low frequency sin or cos output is not
> dstorted but shows phase shift. Same is also the cas
> when i try the windows built in sound card using
> MAtlab data acquistion toolbox..
> Can some preprocessig be done to solve this without
> changing the hardware..
>
> --- Jon Harris <jon_harris7@jon_...> wrote:
>
> > By the phase, I assume you mean some pointer
> > variable you are incrementing
> > through a table of sine values (like a DDS)? That
> > would make sense if you are
> > expecting a sawtooth. (Normally, the phase of a
> > sine wave is also a sine wave
> > since derivative of sine is cosine.)
> >
> > Anyway, is the sine wave clean? How low is the
> > frequency? Keep in mind that
> > the audio CODEC won't pass signals all the way down
> > to DC. It probably cuts
> > out around 20Hz or so due to DC blocking caps on the
> > outputs (I don't know the
> > specifics of the 21062 board, but I am guessing
> > based on other experience.) So
> > if your sawtooth is too low in frequency, the DC
> > blocking caps will start to
> > distort it. You can model this as a first order
> > high-pass filter. If you have
> > Matlab or similar, run a sawtooth through a first
> > order HP and look at the
> > distortion (primarily due to the phase shift of the
> > HP filter).
> >
> > For example, with a 100 Hz sawtooth, there is
> > noticeable distortion with a 20
> > Hz HP filter and pretty extreme distortion with a 50
> > Hz HP filter. So I am
> > guessing that is what you are seeing.
> >
> > If you really need to pass low-frequency signals, it
> > _may_ be possible to
> > modify the hardware to remove the DC blocking caps,
> > or at least increase their
> > value significantly to pass more low frequencies.
> > Keep in mind that many DACs
> > have a DC offset on their outputs, so a cap is
> > probably necessary if you are
> > using for audio purposes (as opposed to just
> > connecting it to an oscilloscope).
> >
> > --- santanu@sant... wrote:
> >
> > > Hi,
> > > I am using the talkthru program supplied with the
> > EZK-lite (ADSP-21062) board
> > >
> > > to output a low frequency sine wave and its phase
> > in the two output codec
> > > ports. I see a distorted phase, which i expect
> > to be perfect sawtooth
> > > signals
> > > with its magnitude proportional to the phase. Can
> > anyone help me out to fix
> > > it.
> > > The problem seems to be more severe at low
> > frequencies than high...
> > > Looking for your sugesstions..
> > > regards,
> > > SS
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com





(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: Codec - Bernhard Holzmayer - Oct 7 1:59:00 2005

Jon Harris wrote this:
> Trying to pass <5Hz signals using audio hardware will probably be quite
> difficult.  Your best bet is to modify the hardware or choose a DAC board
> that is made for DC-coupled output.  "The proper tool for the proper job"
> as the saying goes.

Working with an EZ-Lite-Board (ADI, 21161), I did remove the capacitors,
since I had to work down to 0.3 Hz.
It worked perfectly well, __but__ I had to compensate the DC-bias of the
OP inputs, which I did by an additional differential input stage.

This solution was able to handle DC signals, though the ADC wasn't specified.
I found that most Sigma-Delta ADCs in fact do treat DC voltages well, except
for that DC bias which you have to compensate.
Another issue is that the input impedance is quite low and may dynamically
change.
If an additional input stage decouples this, you'd not suffer from that. > If this is not an option, you can try to compensate digitally, though I'm
> not sure how well this will work.  The first step is to measure the
> frequency response of your sound card output. Sweep a sine wave from say 50
> Hz down to 1 Hz and plot its magnitude (and ideally phase as well).  This
> should tell you what the hardware is doing to your signal.  Hopefully it is
> pretty close to a 1st order HP filter with a 3dB cut-off somewhere below 20
> Hz.  Next, design a filter to compensate.  

I tried this (before removal of the caps).
At first glance, it worked (as you indicate above).
However, since I had to implement IIR filters of higher order behind (1Hz HPF
@48kS/s), I found that this compensation was very poor.
Obviously the input HPF isn't so stable, that you can compensate its phase
well enough. I guess that this comes from the caps' noise and/or temperature
dependence.
If you work below 1 Hz, this means that the slightest air breeze passing the
circuit will modify the filter characteristics quick enough to introduce so
ugly phase distortions that you'll probably not be able to cope with.

If you do such a compensation, it should certainly be a sort of "intelligent"
algorithm, which is able to track the filter characteristics.

It would also help, if you were able to reduce bandwidth and sampling rate.
You'll certainly not get much more than 80dB of dynamic range with this
method.

> Since you have Matlab, you can
> use that to model your problem, putting in the measured response and trying
> different filter to compensate. You might try a low shelving filter with a
> fairly large boost. In a quick experiment, I was able to get some
> improvement from that, though it wasn't perfect.

If you need high bandwidth and therefore have to use high sampling rate
(48kS/s or higher), be aware that this requires very high precision when
calculating the filter coefficients.
Matlab isn't good enough to do this job, if you want to design filters below
5Hz. You might face very awkward behaviour of the filters, especially if you
try to apply IIR HPFs..
This is an intrinsic problem of the Matlab calculation routines which are
optimized for speed, not for precision.
You'll probably not suffer from that as long as the relation between filter
frequency and sampling rate is higher than 0.0001. > I would expect to made modest improvements, not construct a perfect
> sawtooth. At some point, you will be limited by dynamic range of the
> DAC--you can't just boost the low frequencies infinitely since the DAC will
> saturate.

That's correct.
If you remove the caps, you'll have to always guarantee low amplitudes, so
that DCoffset+amplitude doesn't exceed the range of the ADC.
If you compensate digitally, your signal amplitude will fade when frequency is
low, and amplification will reduce the resolution.

If you don't need high bandwidth, decimation techniques can help to increase
your resolution. I guess most of typical audio ADCs will provide such a good
conversion result that you can gain >100dB of dynamic range,
which should be enough for most applications.

Bernhard

----------------------------------------------------------------------------
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser Mail ist nicht gestattet.
Ueber das Internet versandte E-Mails koennen leicht unter fremden Namen
erstellt oder manipuliert werden. Aus diesem Grunde bitten wir um
Verstaendnis, dass wir zu Ihrem und unserem Schutz die rechtliche
Verbindlichkeit der vorstehenden Erklaerungen und Aeusserungen
ausschliessen.

This E-mail may contain confidential and/or privileged information. If
you are not the intended recipient or have received this E-mail in
error, please notify the sender immediately and destroy this E-mail. Any
unauthorized copying, disclosure or distribution of the material in this
E-mail is strictly forbidden.
E-mails via Internet can easily be prepared or manipulated by third
persons. For this reason we trust you will understand that, for your own
and our protection, we rule out the legal validity of the foregoing
statements and comments.




(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

State machine - rama raju - Oct 7 8:29:00 2005

Dear members,

  I want to implement state machine using C language. Suppose I am having 16-bit Microcontroller, having 2 timers, one push button, 2 leds.

  

  State 1     power on initialization.& wait for push button press, if it finds push button press goto state2, else same state.

 State2:  flash led1 (500ms on 500 ms off timer1 ISR will take care) for 10 sec, next state=State3

 State3: flash led2(250 ms on &750ms off timer2 ISR will take care) for 1 min

Next_state=State2.

           &nb sp;           

I am requesting you to guide in this regard.

Thanking you

With regards,

svsrr

 



Jon Harris <j...@yahoo.com> wrote:
Trying to pass <5Hz signals using audio hardware will probably be quite
difficult. Your best bet is to modify the hardware or choose a DAC board that
is made for DC-coupled output. "The proper tool for the proper job" as the
saying goes.

If this is not an option, you can try to compensate digitally, though I'm not
sure how well this will work. The first step is to measure the frequency
response of your sound card output. Sweep a sine wave from say 50 Hz down to 1
Hz and plot its magnitude (and ideally phase as well). This should tell you
what the hardware is doing to your signal. Hopefully it is pretty close to a
1st order HP filter with a 3dB cut-off somewhere below 20 Hz. Next, design a
filter to compensate. Since you have Matlab, you can use that to model your
problem, putting in the measured response and trying different filter to
compensate. You might try a low shelving filter with a fairly large boost. In
a quick experiment, I was able to get some improvement from that, though it
wasn't perfect.

I would expect to made modest improvements, not construct a perfect sawtooth.
At some point, you will be limited by dynamic range of the DAC--you can't just
boost the low frequencies infinitely since the DAC will saturate.

--- santanu sarma wrote:

> Thanks for your reply. Just to elaborate your point, I
> want to process a resolver sensor output, rotating at
> low frequencies (<5 Hz). I am computing the tangent of
> the shaft angle from sin and cosine envelops of the
> resolver output form a look-up table, and want to put
> it out. Low frequency sin or cos output is not
> dstorted but shows phase shift. Same is also the cas
> when i try the windows built in sound card using
> MAtlab data acquistion toolbox..
> Can some preprocessig be done to solve this without
> changing the hardware..
>
> --- Jon Harris wrote:
>
> > By the phase, I assume you mean some pointer
> > variable you are incrementing
> > through a table of sine values (like a DDS)? That
> > would make sense if you are
> > expecting a sawtooth. (Normally, the phase of a
> > sine wave is also a sine wave
> > since derivative of sine is cosine.)
> >
> > Anyway, is the sine wave clean? How low is the
> > frequency? Keep in mind that
> > the audio CODEC won't pass signals all the way down
> > to DC. It probably cuts
> > out around 20Hz or so due to DC blocking caps on the
> > outputs (I don't know the
> > specifics of the 21062 board, but I am guessing
> > based on other experience.) So
> > if your sawtooth is too low in frequency, the DC
> > blocking caps will start to
> > distort it. You can model this as a first order
> > high-pass filter. If you have
> > Matlab or similar, run a sawtooth through a first
> > order HP and look at the
> > distortion (primarily due to the phase shift of the
> > HP filter).
> >
> > For example, with a 100 Hz sawtooth, there is
> > noticeable distortion with a 20
> > Hz HP filter and pretty extreme distortion with a 50
> > Hz HP filter. So I am
> > guessing that is what you are seeing.
> >
> > If you really need to pass low-frequency signals, it
> > _may_ be possible to
> > modify the hardware to remove the DC blocking caps,
> > or at least increase their
> > value significantly to pass more low frequencies.
> > Keep in mind that many DACs
> > have a DC offset on their outputs, so a cap is
> > probably necessary if you are
> > using for audio purposes (as opposed to just
> > connecting it to an oscilloscope).
> >
> > --- s...@isac.ernet.in wrote:
> >
> > > Hi,
> > > I am using the talkthru program supplied with the
> > EZK-lite (ADSP-21062) board
> > >
> > > to output a low frequency sine wave and its phase
> > in the two output codec
> > > ports. I see a distorted phase, which i expect
> > to be perfect sawtooth
> > > signals
> > > with its magnitude proportional to the phase. Can
> > anyone help me out to fix
> > > it.
> > > The problem seems to be more severe at low
> > frequencies than high...
> > > Looking for your sugesstions..
> > > regards,
> > > SS
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/adsp/

<*> To unsubscribe from this group, send an email to:
a...@yahoogroups.com

<*


Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with voicemail



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: State machine - Evan Park - Oct 9 14:18:00 2005

have you looked at the blink demo code in your VisualDSP directory?
That will give you an idea of where to start

On 10/7/05, rama raju <student_svs@stud...> wrote: >
> Dear members,
>
> I want to implement state machine using C language. Suppose I am having
> 16-bit Microcontroller, having 2 timers, one push button, 2 leds. >
> State 1 power on initialization.& wait for push button press, if it
> finds push button press goto state2, else same state.
>
> State2: flash led1 (500ms on 500 ms off timer1 ISR will take care) for 10
> sec, next state=State3
>
> State3: flash led2(250 ms on &750ms off timer2 ISR will take care) for 1
> min
>
> Next_state=State2. >
> I am requesting you to guide in this regard.
>
> Thanking you
>
> With regards,
>
> svsrr >
> Jon Harris <jon_harris7@jon_...> wrote:
> Trying to pass <5Hz signals using audio hardware will probably be quite
> difficult. Your best bet is to modify the hardware or choose a DAC board
> that
> is made for DC-coupled output. "The proper tool for the proper job" as the
> saying goes.
>
> If this is not an option, you can try to compensate digitally, though I'm
> not
> sure how well this will work. The first step is to measure the frequency
> response of your sound card output. Sweep a sine wave from say 50 Hz down to
> 1
> Hz and plot its magnitude (and ideally phase as well). This should tell you
> what the hardware is doing to your signal. Hopefully it is pretty close to a
> 1st order HP filter with a 3dB cut-off somewhere below 20 Hz. Next, design a
> filter to compensate. Since you have Matlab, you can use that to model your
> problem, putting in the measured response and trying different filter to
> compensate. You might try a low shelving filter with a fairly large boost.
> In
> a quick experiment, I was able to get some improvement from that, though it
> wasn't perfect.
>
> I would expect to made modest improvements, not construct a perfect
> sawtooth.
> At some point, you will be limited by dynamic range of the DAC--you can't
> just
> boost the low frequencies infinitely since the DAC will saturate.
>
> --- santanu sarma wrote:
>
> > Thanks for your reply. Just to elaborate your point, I
> > want to process a resolver sensor output, rotating at
> > low frequencies (<5 Hz). I am computing the tangent of
> > the shaft angle from sin and cosine envelops of the
> > resolver output form a look-up table, and want to put
> > it out. Low frequency sin or cos output is not
> > dstorted but shows phase shift. Same is also the cas
> > when i try the windows built in sound card using
> > MAtlab data ac! quistion toolbox..
> > Can some preprocessig be done to solve this without
> > changing the hardware..
> >
> > --- Jon Harris wrote:
> >
> > > By the phase, I assume you mean some pointer
> > > variable you are incrementing
> > > through a table of sine values (like a DDS)? That
> > > would make sense if you are
> > > expecting a sawtooth. (Normally, the phase of a
> > > sine wave is also a sine wave
> > > since derivative of sine is cosine.)
> > >
> > > Anyway, is the sine wave clean? How low is the
> > > frequency? Keep in mind that
> > > the audio CODEC won't pass signals all the way down
> > > to DC. It probably cuts
> > > out around 20Hz or so due to DC blocking caps on the
> > > outputs (I don't know the
> > > specifics of the 21062 board, but I am guessing
> > > based on other experience.) So
> > > if your sawtoot! h is too low in frequency, the DC
> > > blocking caps will start to
> > > distort it. You can model this as a first order
> > > high-pass filter. If you have
> > > Matlab or similar, run a sawtooth through a first
> > > order HP and look at the
> > > distortion (primarily due to the phase shift of the
> > > HP filter).
> > >
> > > For example, with a 100 Hz sawtooth, there is
> > > noticeable distortion with a 20
> > > Hz HP filter and pretty extreme distortion with a 50
> > > Hz HP filter. So I am
> > > guessing that is what you are seeing.
> > >
> > > If you really need to pass low-frequency signals, it
> > > _may_ be possible to
> > > modify the hardware to remove the DC blocking caps,
> > > or at least increase their
> > > value significantly to pass more low frequencies.
> > > Keep in mind that many DACs
> > > have a DC offset on ! their outputs, so a cap is
> > > probably necessary if you are
> > > using for audio purposes (as opposed to just
> > > connecting it to an oscilloscope).
> > >
> > > --- santanu@sant... wrote:
> > >
> > > > Hi,
> > > > I am using the talkthru program supplied with the
> > > EZK-lite (ADSP-21062) board
> > > >
> > > > to output a low frequency sine wave and its phase
> > > in the two output codec
> > > > ports. I see a distorted phase, which i expect
> > > to be perfect sawtooth
> > > > signals
> > > > with its magnitude proportional to the phase. Can
> > > anyone help me out to fix
> > > > it.
> > > > The problem seems to be more severe at low
> > > frequencies than high...
> > > > Looking for your sugesstions..
> > > > regards,
> > > > SS >
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com >
>
> ________________________________
> Yahoo! Messenger NEW - crystal clear PC to PC calling worldwide with
> voicemail >
> ________________________________




(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )