Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Equipment & Tools From test equipment to hand tools

Digital Distortion Compensation for Measurement Setup
Digital Distortion Compensation for Measurement Setup
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 20th October 2018, 11:35 AM   #11
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
All I want to try is calculating e.g. 4th order transfer polynom for the whole loop based on 4 measured harmonics and see what it does. ESS does something in their ES9028/38 line - the datasheet defines a register for second and third harmonic reduction. I know there is no scope for a major improvement.

I want to test it in python, with pre-recorded data. If it does not work - even that would be a result to learn from .
  Reply With Quote
Old 20th October 2018, 01:45 PM   #12
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
PRR: Thanks a lot for your hint. I asked my friend at the university math department. He will try to get it, hopefully the library has subscribed to this historic IEEE section.
  Reply With Quote
Old 21st October 2018, 01:31 AM   #13
PRR is offline PRR  United States
diyAudio Member
 
PRR's Avatar
 
Join Date: Jun 2003
Location: Maine USA
> my friend at the university math department

Excellent. In his office, old IEEE papers probably pop right up. I believe IEEE typically licenses the full archive to the full university network. If not whole-campus, your friend surely knows how to get math papers, and the same should work for IEEE.
  Reply With Quote
Old 21st October 2018, 07:00 AM   #14
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
For low-order harmonic distortion you can distinguish between the DAC and the ADC by measuring with and without an attenuator between DAC and ADC, although loading effects might mess up the results.

I mean, suppose you design a practically distortion-free resistor network that has two attenuation settings (0 dB and something else, for example) and that when sourced by the DAC and loaded by the ADC has input and output impedances that are independent of the attenuation settings. Suppose the Taylor series that describe the DAC's and ADC's non-linearity have no terms above the third. The n-th harmonic with n = 2 or 3 is then proportional to the n-th power of the signal level, while the n-th harmonic distortion is almost proportional to the n-1st power, because it is normalized to the fundamental. Hence, the ADC's distortion changes when the attenuation is switched, while the DAC's doesn't.

I wrote "almost" because the third-order term in the Taylor series also changes the fundamental level a bit. For fourth and higher order, things get more complicated because the fourth-order term also causes second-harmonic distortion.

Last edited by MarcelvdG; 21st October 2018 at 07:03 AM.
  Reply With Quote
Old 21st October 2018, 08:21 AM   #15
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Very interesting. Ideally the goal would be calibrating/compensating both outputs and inputs, not only the overall loop. Your proposal would enable (to some precision, as everything here) to identify these two contributions to the overall loop distortion.

Thanks a lot for your proposal. If the principle with nonlinearities compensation turns out effective/working, this would definitely be the next step.

For my measurement workstation I am planning a PC-controlled calibration circuit (originally only for the virtual balanced configuration), adding a switchable divider into the loop would be simple.
  Reply With Quote
Old 26th October 2018, 11:37 PM   #16
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
An internal soundcard of a large noisy dual-xeon workstation, stereo loop out -> in with a 2m coiled thinnie.

Measured by Arta running in linux + wine.
  • The first screenshot shows performance of the actual hardware - loop hw out -> hw in.
  • The second screenshot is virtual balanced setup made from two channels where each has its DC offset and linear gain calibrated/compensated.
  • The third screenshot is virtual balanced setup, each hw channel is compensated with a fifth-order polynomial calculated to cancel out static non-linearities.

The transfer polynomials are configured in a modified alsa route plugin (listed from 0th - 5th order, the plugin supports up to 10 orders):

Code:
pcm.symmetric_in {
         type route
         slave {
                 pcm "hw:0"
                 channels 2
         }
         ttable {
                 0.0 { polynom [-3.2787e-05   4.9206e-01   2.5843e-05   1.4382e-04   8.1172e-05   2.0301e-05 ] }
                 0.1 { polynom [ 6.7723e-06  -4.9254e-01  -1.1393e-06  -1.8654e-04  -9.9866e-05   3.8831e-05 ] }
                 1.0 { polynom [-3.2787e-05   4.9206e-01   2.5843e-05   1.4382e-04   8.1172e-05   2.0301e-05 ] }
                 1.1 { polynom [ 6.7723e-06  -4.9254e-01  -1.1393e-06  -1.8654e-04  -9.9866e-05   3.8831e-05 ] }
         }
}
The coefficients are calculated by a script in Octave.

The principle is actually very simple - the polynomial is calculated as best-fitting transformation from a wave recorded in calibration to a precise sine wave, generated directly in octave. Frequency of the incoming wave is known (since we have both ends of the measurement chain under control), phase shift of the recorded wave is measured with fft (just a few periods of samples produce very precise phase value for the first harmonic). Surprisingly simulations in octave and the actual measured performance are rather coherent.

The calibration holds only for a very limited range of frequencies and amplitude levels. I think that many not be a problem for measurements, it is possible to fully automate the whole process with several signal relays and resistors (my next goal).

All the scripts and route plugin patches will be posted on github within a few days, any improvements/patches/suggestions are very welcome. It will take some time before the scripts get robust enough to allow reliable automated calibration.

I will compile the plugin for my measurement workstation with ESI Juli to test a decent soundcard in a cleaner environment. Simulations in octave with pre-recorded Juli output are positive :-)

It seems to work :-)
Attached Images
File Type: png hw-single-ended.png (13.8 KB, 130 views)
File Type: png virtual-balanced.png (13.8 KB, 127 views)
File Type: png polynom-calibrated.png (14.0 KB, 128 views)

Last edited by phofman; 26th October 2018 at 11:57 PM.
  Reply With Quote
Old 27th October 2018, 12:19 AM   #17
1audio is offline 1audio  United States
diyAudio Member
 
Join Date: Mar 2004
Location: SF Bay Area
Digital Distortion Compensation for Measurement Setup
That's impressive. You are running ARTA in Wine? Are you using ASIO or Wine implementation of Windows audio? Is it 24 bit capable? (I have seen complaints elsewhere.) Also impressive is how easy that was to implement in Linux.
__________________
Demian Martin
Product Design Services
  Reply With Quote
Old 27th October 2018, 12:24 AM   #18
MarcelvdG is offline MarcelvdG  Netherlands
diyAudio Member
 
Join Date: Mar 2003
Location: Haarlem, the Netherlands
Congratulations!
  Reply With Quote
Old 27th October 2018, 06:49 AM   #19
xx3stksm is offline xx3stksm  Japan
diyAudio Member
 
xx3stksm's Avatar
 
Join Date: Jun 2017
Location: Hokkaido(north area)
Digital Distortion Compensation for Measurement Setup
Congratulations on your success! I guess your coefficients are fixed one. Do you have a plan to make them variable? I'm sure If you want more than 120dB SFDR, you need to do some precautions to prevent temperature drift or other disturbance. DSM DAC with internal calibration can have such high SFDR but sometimes fails to have repeatability. The most effective solution for the problem is continuous calibration, where real-time FFT constantly adjust the valuables and keep high SFDR. It may work successfully though I haven't implemented such a system in real PCB. Does your system have the ability of real-time calibration? I think it's the destination to achieve excellent distortion system.
  Reply With Quote
Old 27th October 2018, 08:16 AM   #20
jan.didden is offline jan.didden  Europe
diyAudio Member
 
jan.didden's Avatar
 
Join Date: May 2002
Location: Westende Resort, BE coast
This is incredible! I was very skeptical that it could work at all, but you proved me wrong.
Bad for me, good for you ! ;-)

Jan
__________________
Cable: a potential source of trouble interconnecting two other potential sources of trouble - Erik Margan
Linear Audio pubs and articles . The SilentSwitcher now at diyaudio store SilentSwitcher. Keeping in touch with SY.
  Reply With Quote

Reply


Digital Distortion Compensation for Measurement SetupHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Baffle compensation for nearfield measurement lup31337 Software Tools 4 6th May 2016 09:33 PM
digital scopes and distortion measurement akis Equipment & Tools 5 12th October 2012 07:26 PM
Measurement setup /graph Sanon Multi-Way 3 26th July 2011 11:58 AM
Polar Measurement setup thadman Multi-Way 7 7th June 2009 07:29 PM
Help choosing measurement and modelling setup SimontY Multi-Way 65 26th April 2007 06:05 PM


New To Site? Need Help?

All times are GMT. The time now is 06:13 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki