ΣSigmaStudio Ask AI Русский Log in

ADAU1442 and high quality sine wave generation

SigmaDSP & SigmaStudio XavLNK Sep 1, 2012 00:00 5 replies Original on forum ↗
Subscribe
XavLNK Question
Sep 1, 2012 00:00

Hello,

I am currently investigating the ADAU1442 for sine wave (more generally signal) generation and signal analysis.

I have the ADAU1442 EVAL board.

I built a very simple project with the tone generator.

The measured THD+N (through SPDIF OUT) is about -93 dB. Really not impressive...

Looking at the FFT, I saw an awful amount of pikes in the frequency spectrum.

I could drastically improve things by adding a narrow band pass filter at the output of the generator that tracks the frequency of the tone.

I have now a THD+N ranging from -133 dB to -144 dB. But I am not sure it is valid for all frequencies in the audio bands.

I made 10s of measurements with frequencies that would not relate to the sampling rate (just to get a worst case).

But this is not a exhaustive audio band scan, obviously.

Is there a better way to generate a clean sine wave?

I tried to build an oscillator in an "analog" manner, just by applying positive feedback in a system and a controllable phase to define unambiguously the oscillation frequency. This is a trick that worked perfectly on a TI DSP TAS3101A.

But here, I cannot manage to get any oscillation starting. Are there special tricks to apply for that?

Note & other questions:

1. To get SPDIF OUT operational, I had to modify the board. For any reasons, the transformer was shunting the signal. I bypassed it, used a capacitive coupling and it worked. Being obliged to do that on such an expensive board is a bit of a pity.

2. When I proceed to read out from the DSP (level analysis), the USBi interface crashes all the time. I can transmit (configure blocks) but not receive. This is very annoying as I also need to use the DSP for signal analysis and sample capture. I just can't do half of the evaluation of that chip. Is there a way to solve that problem?

3. Where can I find a detailed documentation about the DSP blocks. I would like to know which registers are used for what. For the moment, I have to guess from what I see in the SigmaStudio. Not very efficient. This kind of documentation should be somewhere but I cannot find it.

Thanks for your support,

Xavier

Audio Signal Processors

adau1442

SigmaDSP Audio Processors

ADIApproved Reply
Oct 11, 2012 00:00

Hi Xavier,

Sorry that it took me a long time to respond to your message. I was going through the backlog of support requests and I found this post. I think I missed it when you originally posted your question because I was traveling on business for about a month in Asia.

The sine generation uses a lookup/interpolation method based on a hardware ROM sine table. This is obviously not the most precise way to generate a sine tone, but it's the most efficient way to do so in the SigmaDSP. I am not much of an algorithms expert, so I can't provide a lot of assistance in that regard, but some of the other DSP experts on the forum might be able to provide suggestions for an alternate way of generating a sine tone in software.

I will look at the S/PDIF output circuit with our lab technician. We used the standard application circuit from the transformer provider, Scientific Conversion ( http://www.scientificonversion.com/news.html ). Perhaps there is a flaw in the circuit. I will investigate in more detail.

The USBi should be able to read as well as write at a fairly high rate. However, the bandwidth is limited. Typically, you should be able to run one or two seven-band level detectors in SigmaStudio with no problem. However, if you start increasing the number of constant readback cells in the project, you may run into a buffer underrun situation with the USBi, which could be causing the drop-outs you're seeing. It might help to lower the number of cells in the project that are reading back. One lightweight way to do this is using the DSP readback cells set to a slower update rate. You can find more details here:

https://ez.analog.com/message/7669#7669

and here:

https://wiki.analog.com/resources/tools-software/sigmastudio/toolbox/basicdsp/dspreadback

If you need more detailed help with cells, please check our SigmaStudio documentation wiki here:

https://wiki.analog.com/resources/tools-software/sigmastudio

The toolbox section, which includes details of the cells, is here:

https://wiki.analog.com/resources/tools-software/sigmastudio/toolbox

Note that the wiki is still under construction. Let me know if you need more help with a specific cell and I will try to update the wiki with more information to answer your question.

XavLNK Reply
Oct 18, 2012 00:00

Hello Brett,

Thanks for coming back to this.

Regarding the Sine wave generation, I guess I have now a satisfactory solution.

The tone generator followed by 2 narrow band pass filters is doing a good enough job.

If I add some white noise on the LSB, the dithering effect makes it look like a perfectly clean wave.

At least clean enough for the application I am targeting.

Solved ;-)

About the USBi, it does not seem to be a bandwidth problem.

If I try to read out a value (just one, once), the USBi software driver crashes (at least, it looks like it does) and I have to unplug and replug the USB module to be able to control the demo board again. This is annoying because I need to investigate the analysis capabilities of the ADAU1442. If you can help on that point, it will be very helpful. This is currently a blocking point.

About the cells documentation, what I need is to know the function of each of the registers used to control the various parameters of the cell.

SigmaStudio generates some C header files but the function of each of the register in not documented. It is also not in the Wiki. For instance, to control the frequency of the tone generator, I had to observe the values transmitted by SigmaStudio to understand that the tone frequency is given as a ratio of the sampling frequency. There will be many DSP in my system and they will be all controlled by an embedded processor. I need to know unambiguously how to control all the cells I will use in order to develop the DSP driver C code in the controller. Not having this information makes me a bit reluctant in using the part. I am sure these information are available somewhere but I can't find it. Any help on that topic will be extremely welcome.

Best regards,

Xavier

ADIApproved Reply
Oct 22, 2012 00:00

Hi Xavier,

I'm sorry to hear you're having problems with the USBi. I have heard from some customers that the USBi often seems to lose its connection with the software at odd times, but I unfortunately haven't been able to observe this myself, so it is difficult to debug. When you say you're reading just one value, do you mean using a "DSP Readback" cell? That's a simple 4 byte read, so it's really difficult to see how that would make the software hang.

For the sine tone generator, the value generated is very simple. The "increment" parameter maps linearly to the frequency. A frequency of 0 Hz maps to the value 0, and a frequency of the sample rate divided by 2 maps to the value 1 (in 5.23 format).

So, for a 48 kHz sample rate, the parameter should be 0 for 0 Hz, and 1 for 24 kHz. You can then extrapolate that for 12 kHz, the value should be 0.5, and for 6 kHz, the value should be 0.25.

So, parameter value = ( frequency / (sample rate / 2) )... stored in memory in 5.23 format.

You can see more about number formats here, if you need help: https://ez.analog.com/thread/4460

Note that the sine generator won't let you set the frequency to 0 Hz. It will only go down to 0.01 Hz.

Also, you shouldn't set it all the way up to half of the sample rate, because of the way the sine table lookup method works.

The practical range of the sine generator (at a 48 kHz sample rate) is 0.01 Hz to 23999 Hz.

XavLNK Reply
Oct 24, 2012 00:00

Hello Brett,

I completely uninstall the full software package, including the USB drivers and reinstalled everything.

The USB link is now more stable. Not perfect yet but sometimes usable.

I managed to do some DSP Readback.

Is there a way the ADAU1442 can capture a collection of contiguous samples to be able to display a wave form?

As it does not seem to be possible to run FFT on that device, FFT calculation shall be done in the controller if I have access to the samples, obviously. I can't afford to lose some samples during the capture.

Can I store samples in the DSP memory and proceed to burst data read through I2C or SPI or shall I read sample by sample (which may be difficult, not to say impossible)?

About the average or RMS level read, the accuracy is given by the 5.23 format, right?

This gives me a theoretical read accuracy of -138.5 dBFs.

With the proper filtering, I should be able to give some valid THD+N figures, right?

The description you give about the tone generator corresponds to my observations.

The question is: where can I find this kind of information for all the cells that are usable in the DSP code?

It will be more than necessary to write the controller code.

Best regards,

Xavier

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin