Post Go back to editing

SigmaDSP Internal Oscillator Quality

Category: Software

This is a question that came in on the YouTube channel video where I talked about the digital levels of the internal oscillators. I am copying it here so the answer is available for all SigmaDSP users.

Question:

Do these oscillators have a perfect digital representation of like a sine wave or is there some additional distortion? I am not talking about the added distortion of the output DAC, but pure digital domain.

  • Hello,

    The internal oscillator blocks in the SigmaDSP cores produce a 24 bit 0dBFS sine wave. The part contains a 2048 point sine and 2048 point cosine tables in ROM. The software uses these tables to create the sine wave outputs. The points between the ROM table points are interpolated. This produces a very good representation and high quality sine wave but it is not perfect. There will be some errors introduced by the process of calculating the exact points. There will be round off errors when figuring out how many points are needed for certain frequency based on the sampling rate. These numbers so not always divide nicely so there will be some errors introduced at the end/start of every cycle.  

    I setup an experiment using an ADAU1452. I took the oscillator block and sent it directly out of the serial port. No level changes. I used I2S so it is 24 bit audio. I did not set the DSP into the 32 bit mode. TheI2S signal I sent to the Audio Precision serial digital input so no converters are involved at all. Then I captured some FFTs to see the distortion. 

    The SigmaStudio project is setup to run the DSP core at 48kHz fs. The serial port of course is setup for 48kHz and the DSP is sending the LRCLK, BCLK and MCLK to the Audio Precision serial interface. 

    Here are the results. 

    1kHz sine wave at 0dBFS in the core. (remember this is 0dBFS for the 24 bit audio)

    You can see some aliasing up at ~15kHz and 17kHz but it is -130dB below the 0dBFS fundamental. 

    To test where these tones are coming from I lowered the level of the oscillator by -10dB in the SigmaStudio program and the distortion went down accordingly:

    Changing the oscillator to 10kHz you can see the alias tone is now at 6kHz. 

    Changing the oscillator to 5kHz the tone changed to 11kHz. 

    At 100Hz I get a tone at around 13kHz

    With a 2kHz signal I get a 14kHz and 18kHz tone. 

    So I tried to skew it to a non-evenly divisible number. 2002Hz. Then I got this result.

    A tone at 18kHz and very small ones at around 5.8kHz and 9.8kHz. 

    So these all must be byproducts of the interpolation of the number of steps and step size required at this sample rate and interpolation from the sine table. 

    In short the representation is very good but certainly not perfect. We ( Analog Devices) has some precision products for generating low distortion oscillators costing many times this solution. This is not a trivial thing to try to do. 

    I hope this helps. 

    Here is a link to my video on levels: https://youtu.be/2fyAYNRuLmc

    Thanks,

    Dave T

  • Hello All, 

    Let me expand on this some. I got some more questions off-line about this. 

    Here were the settings I used for the FFT. Equiripple window and 8,192 point FFT with an averaging of four sweeps. 

    Having some fun here... I first did this. I added another sine wave and delayed it by 180 degrees rather than invert it. 

    The resulting FFT is this: (rather empty)

    Next I took the difference and then lowered the level by -6.50dB like this:

    The result was pretty much the same as the single 1kHz oscillator FFT you see in my last post.

    Then I used the signal invert instead of delaying the phase by 180 degrees and got the same results. 

    So it does not seem like this is being generated in the DSP in such a way that you can cancel the distortion. 

    I tried all the different windowing choices and the tones were in all of them that had resolution down that low. 

    I increased the FFT size to the max of 32,768 taps only made it a nice tight spike but the tones are still there. 

    the tones still show up with a 256 tap FFT. 

    I also tried no averaging and the tones are still there. 

    I was not able to get rid of them. I did not try filtering with the Sigma300.

    Moving on to the ADAU1701, the Sigma100 core. The Sigma200 core should have similar results but I will not test that today. 

    They both are 5.23 format DSP cores. 

    I will not show a screenshot of the program. It is the same in that I take the oscillator and send it out of the digital output. 

    I am using the ADAU1401 larger eval board because the digital serial output is not available on the MINIZ. If I had designed that board I would have brought it out to a header... 

    The results are as I suspected I would see. The distortion components are there and are higher most likely due to the difference in the precision of the core. 

    This is a 1kHz tone coming out of the core at 0dBFS going digital into the Audio Precision. 

    Same tones we saw with the Sigma300 but they are around 30dB higher. I would have expected four bits because it is 32 bits core verses a 28 bit core however, we do add one bit onto the bottom on the Sigma300 so that might make the difference. with a five bit difference I would expect 30dB. 

    Next I thought I would try to filter the oscillator output. I kept it simple. I used the default settings for the most part. 

    I dropped in a double precision 2nd order Peaking filter. This did make quite a difference. 

    Here is the SigmaStudio program showing the settings and filter response.

    The distortion went down to what we saw with the Sigma300

    I increased the Q up to a setting of 4. This brought down the distortion even further.

    Overall, this is not bad and some good options. 

    Now, for some fun. I will look at the analog output through the converters. This is with the filtered oscillator.

    This is pretty much at digital zero which is not the place to measure a DAC. It is right on its edge.

    The two channels are on top of each other and not very different.

    When I lower the output by 1dB so it is -1dBFS going to the DAC it looks a little better.

    But you can see that any converter will swamp this distortion we were seeing in the digital domain. 

    This is enough. It took me all day to write this in between many other tasks. 

    Dave T