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 5th February 2019, 07:55 AM   #101
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
My project deals with static measurement signal. The initial trials with polynomial transfer functions (which is probably what ESS does) did work to some extent, but selective generation of specific harmonics at opposite phase is far more effective for the purpose. The project cannot compensate a random signal, it must measure phase of the fundamental and apply correction harmonics at correct phases. For measuring correct phase the fundamental must be stable freq for at least a second - sweep would not work either.

However, it accepts any form of signal, it just stops adding the compensation signal the moment no known fundamentals are detected. The incoming signal analysis runs continuously, at any time.

Second side-effect is generating clean harmonic signal - cleaning DAC output via the split-sides compensation, again at specific frequency.

Just for modifying the transfer curve - e.g. the modified alsa-lib route plugin nonlinear-compensation/Working_polynoms.patch at 6d031a33d23c1a0cc898cb6247515a8ec39217c2 * pavhofman/nonlinear-compensation * GitHub is usable if you know the coeffs. Again, my polynomial version was determining the coeffs for a specific harmonic signal only. Each frequency resulted in different coeffs. Perhaps some averaged version would reflect the static nonlinearity of the chain, I never tried that. Static polynomials could not rotate all harmonics exactly at -180° which made me look at a different more direct-approach technology.

But the octave/playrec combo could quite easily be used for the polynomial compensation e.g. on windows where no configurable audio layer like linux alsa exists. The principle would be similar to my project, just less complicated - no incoming signal analysis needed. Theoretically the project could be modified to calibrate polynomials and apply the averaged polynomials for a general signal. There would be many issues to solve - e.g. interpolating between calibrated/averaged coeffs for various input levels: what is immediate level of a general signal. In my case it is simple - it is the level of the fundamental obtained by FFT in the current 200ms cycle.
  Reply With Quote
Old 5th February 2019, 09:03 AM   #102
jan.didden is online now jan.didden  Europe
diyAudio Member
 
jan.didden's Avatar
 
Join Date: May 2002
Location: Westende Resort, BE coast
Quote:
Originally Posted by Markw4 View Post
it is adjustable, not just on/off. They use 16-bit signed int registers with the midpoint, zero, being no correction. They suggest the registers could be used to compensate for non-linearities in the external analog electronics. I think if you want to know more, you will have to get a data sheet and or talk to them.
Ahhh, OK, I get that. So you could for instance 'twist' the transfer curve a bit to compensate for the 2nd of a SET poweramp down stream. Hm.

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
Old 5th February 2019, 09:39 AM   #103
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
For tweaking second harmonics (SET) you can use the second chebyshev polynomial. I use them for generating distortions to the incoming signal in DISTORT mode nonlinear-compensation/config.m.example at 1af079f194b6784a1b3a439df9a2f05d802d7cc9 * pavhofman/nonlinear-compensation * GitHub

The question is what gain to apply for the polynomial.
  Reply With Quote
Old 6th February 2019, 03:56 AM   #104
xx3stksm is offline xx3stksm  Japan
diyAudio Member
 
xx3stksm's Avatar
 
Join Date: Jun 2017
Location: Hokkaido(north area)
Digital Distortion Compensation for Measurement Setup
Quote:
Originally Posted by phofman View Post
Second side-effect is generating clean harmonic signal - cleaning DAC output via the split-sides compensation, again at specific frequency.
If I understand what you mean correctly, you intentionally add opposite phase harmonics analyzed by the split-sides compensation to cancel inherent DAC harmonics at the specific frequency and amplitude, i.e., 1kHz 2Vrms. I'm sure this can work successfully. I will do try this after my environment has fixed. It's very useful technic to have a clean oscillator with arbitrary frequency and amplitude which can be locked to an external reference signal.
  Reply With Quote
Old 26th February 2019, 06:06 PM   #105
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
The software is getting forward slowly but steadily, over 260 commits GitHub - pavhofman/nonlinear-compensation: Compensation of nonlinear sound card distortions for audio measurements but still lots to go. Octave‘s GUI capabilities are rudimentary but sufficient for this task.

The next step now is coding the actual calibration process using real soundcard measurement adapter. For that either a more complete version of https://www.diyaudio.com/forums/atta...ol-diagram-png with switches and potentiometer can be hacked.

Or a proper/final version with arduino-controlled relays is designed/built/written support for in octave.

I would like to ask those experienced with soundcard adapters for comments on this plan:

DAC Side:
--------------
soundcard stereo output -> stereo opamp unit buffer with decent output power -> stereo output voltage divider (75Ohm resistance?). The voltage divider will be connected permanently, even during calibration, to keep the distortion constant. Output terminals relay-switched between divider outputs (measuring) and ground (calibration).

The output divider made of 4 DPDT relays, yielding 16 steps, 3dB each, max. attenuation -45dB. Each step for each channel pre-calibrated in software (no need for precision resistors) to allow for decent balanced output with each branch (in fact L/R channels) distortion-compensated (enabled/disabled in the GUI control panel).

ADC Side:
--------------
stereo input voltage divider (50kOhm?) -> overvoltage protection with low-leakage clamp diodes to +/-3V -> stereo opamp buffer relay-switchable gain1x/10x -> soundcard stereo input

Calibration Loop
--------------------
Loop taken from output of the output buffer -> one channel of the input voltage divider used for calibration at exact current input level -> input buffer

Distortion of the output buffer will be compensated as part of the DAC side, distortion of the input buffer will be part of the ADC side. Thus no expensive ultra-low distortion opams are needed.

Since calibration is very sensitive to input level, the voltage divider must attenuate the calibration signal to fit the measured signal level very closely. Analysis keeps measuring current level at all times, relay-based attenuator is easy to control. 9 relays = 9 bits = -51dB attenuation at step 0.1dB which is small enough as tested. Again, no precision resistors required since calibration does not require precisely defined steps (interpolation works OK) and virtually-balanced inputs will have each step of each channel automatically pre-calibrated. Regular E24 series will do.

During calibration: adapter outputs are grounded, adapter inputs are disconnected/NC.

Total number of DPDT relays about 20, assumed TQ2/5V, 20 pcs at 20USD. Octave -> arduino package -> USB port -> Arduino with built-in usb-serial adapter (2USD CH340, 5USD FT232) -> ULN2003 drivers -> relays.

Power supplies:
-------------------
Buffers: +/- voltages taken from the soundcard – solves the problem of ground loops too.

Relays: 5V max 1A total – two USB ports paralelled, one used for communication with USB-serial adapter of arduino.

Soundcard
--------------
In order to avoid any ground loops a laptop powered from batteries is preferred (even class II power brick introduces the loop through its Y-class capacitor). Thus either a good USB soundcard with no 1kHz residuals (expensive), or PCI/PCI-e (ESI Juli, Xonar Essence) with Expresscard-> PCI-e/PCI adapter (35USD) and decent generated +/- voltages from 5V of the expresscard slot.

Laptop CPU - min. i3/i5, 4 threads. Refurbished good units with expresscard slots (HP, Lenovo TP) running at 150+ USD, new battery at 50+ USD. Should allow for 3+ hours of continuous measurement on battery.

Last edited by phofman; 26th February 2019 at 06:26 PM.
  Reply With Quote
Old 27th February 2019, 07:40 AM   #106
jan.didden is online now jan.didden  Europe
diyAudio Member
 
jan.didden's Avatar
 
Join Date: May 2002
Location: Westende Resort, BE coast
If it is helpful, I can donate a SilentSwitcher for mains- and hum free power.

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
Old 27th February 2019, 03:18 PM   #107
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Jan, I very much appreciate your generous offer. Your technology is without doubt top class. For now I am thinking of something a bit cheaper as the better PCI(e) soundcards already do a decent job filtering their power supplies. The thing is I want to keep it as simple/affordable as possible.

Better soundcards usually have decent step-down regulators. A few years ago I tested noise bottom of ESI Juli put into a thin-client PC powered by a 20V power brick. There was no measurable difference when the analog part of the soundcard was powered from the PCI slot directly (i.e. the PCI +/-12V voltages were generated by some noisy onboard switched source) vs. when I cut the Juli's internal header connector leads and supplied external +/-12V from linear PSUs with a regular dual-winding transformer.

The expresscard -> PCI(e) adapter itself makes the tool more expensive, almost half price of the actual (second hand) soundcard. Maybe I will find a way to clean/improve the built-in switched supplies onboard the adapter/s.

I want to keep the digital-format adapters/soundcard/measurement adapter in a separate shielded enclosure, with the PCI(e) part in a separate compartment. A metal case + 3D printed internal structures shielded with grounded copper tape.

Last edited by phofman; 27th February 2019 at 03:24 PM.
  Reply With Quote
Old 27th February 2019, 03:56 PM   #108
jan.didden is online now jan.didden  Europe
diyAudio Member
 
jan.didden's Avatar
 
Join Date: May 2002
Location: Westende Resort, BE coast
No problem, it'll stand.

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
Old 27th February 2019, 08:12 PM   #109
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Thanks a lot.

I am attaching a simple block diagram of the planned adapter. I would like to get rid of the output buffers, good soundcards already have decent outputs. Would e.g. 300ohm output divider hooked directly to the soundcard make sense?
Attached Images
File Type: png adapter-diagram.png (47.9 KB, 124 views)
  Reply With Quote
Old 28th February 2019, 05:52 AM   #110
jan.didden is online now jan.didden  Europe
diyAudio Member
 
jan.didden's Avatar
 
Join Date: May 2002
Location: Westende Resort, BE coast
I'm not sure the soundcard would look kindly at (very) low load impedance at its output though.

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 08:33 PM
digital scopes and distortion measurement akis Equipment & Tools 5 12th October 2012 06:26 PM
Measurement setup /graph Sanon Multi-Way 3 26th July 2011 10:58 AM
Polar Measurement setup thadman Multi-Way 7 7th June 2009 06:29 PM
Help choosing measurement and modelling setup SimontY Multi-Way 65 26th April 2007 05:05 PM


New To Site? Need Help?

All times are GMT. The time now is 10:30 AM.


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