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
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 14th January 2020, 08:44 AM   #331
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
The screenshots are from REW. The tool sits between the measurement software and the soundcard (plus the hardware calibration adapter, of course). I develop on linux where virtual sound devices are standard part of the sound subsystem. REW/Arta/Diana all run fine in linux.

Technically, the method could be built into the measurement package directly. Practically - it is quite a big piece of rather non-trivial code and the license is for open-source projects.

Currently I am working on automated calibration adapter - SW support as well as the actual adapter (hopefully PCB sent for manufacturing this week).

The first "product" stage will be the automated USB-controlled HW adapter and amd64 image of pre-configured Linux Mint, with user-supplied soundcard.

The final plan is still the fully-contained RPI-based USB audio device usable in any OS. User will plug his existing USB sound card into the RPi. The RPi4 part is coming along slow but nicely, the project has already generated a few patches in the USB audio gadget code of linux kernel, many more to follow.

Actually there are already a few un-related use-cases waiting for the generally-usable USB audio gadget code.

Last edited by phofman; 14th January 2020 at 09:11 AM.
  Reply With Quote
Old 15th January 2020, 11:37 PM   #332
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
First draft of the PCB. The 3D printed enclosure will have two separately shielded sections (copper tape) - for the controller part and for the actual calibrator. The two parts are galvanically isolated (no high-voltage protection though + still need to work on larger clearances between the relay control traces and the analog ground planes). The upper part of the enclosure will further divide the calibrator into shielded sections, to separate the voltage divider from the LP filters so that phase-difference calibration is as precise as possible.

The board is ready for dual-tone generator (single-tones from separately compensated left and right channels are mixed by resistors - to be tested) and two switchable LP filters to cover larger frequency range.

Soundcard terminals: support for soundcards with single ended or balanced inputs/outputs, configurable with jumpers.

DUT terminals:
* single-ended compensated output
* balanced input (two BNCs) - hot line compensated, cold line for common-mode rejection of ground loops.

By-passable 2nd order passive filter at the hot-line input for testing impact of wideband noise on distortion.

Status LEDs:

* PWR: 12V power for the stepper
* CTRL: communication with the software is established
* OUTPUT: output terminal to DUT is active
* INPUT: input terminal from DUT is active
Attached Images
File Type: png 1.png (150.6 KB, 118 views)
File Type: png 2.png (77.1 KB, 123 views)
File Type: png 3.png (217.2 KB, 121 views)
File Type: png 4.png (182.4 KB, 120 views)

Last edited by phofman; 16th January 2020 at 12:04 AM.
  Reply With Quote
Old 16th January 2020, 09:04 AM   #333
Fr3dJa is offline Fr3dJa
diyAudio Member
 
Join Date: Jan 2020
Hi phofman,
Very interesting project!


I would like to give a try to your software. Last git commit is from november last year. Are there significant updates not commited yet?


Still on SW side, does the the interface allow the manual calibration in a didactic way?


On hardware side, I didn't get the interest of the VD. Is it only to have the ADC in it's best working range? If not, could you please explain?


At last, one method to lower the noisefloor is to sum channels. In theory, 3 dB are gained each time a channel is added.
Do you think that alsaconf would allow synchronous summing?
  Reply With Quote
Old 16th January 2020, 12:48 PM   #334
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by Fr3dJa View Post
Hi phofman,
Very interesting project!
Thanks. The practical effect is still to be measured, but it's coming...


Quote:
I would like to give a try to your software. Last git commit is from november last year. Are there significant updates not commited yet?
Most of the new commits (not pushed to the github repo yet) are related to the automated calibration. But the octave project is just one step of the overall installation. Do you have any linux experience?


Quote:
Still on SW side, does the the interface allow the manual calibration in a didactic way?
The new calibration code will offer three adapter configurations:

a) manual switches and manual pot operation - the software waits for user clicking on OK button.

b) manual switches and stepper-actuated pot (for my situation now when the stepper just sits on top of the existing switch-based adapter) - the software waits for OK button for manual switches, then adjusts the pot automatically

c) automated relays and stepper-actuated pot, i.e. the worked-on PCB above - the software controls relays and the pot automatically


Quote:
On hardware side, I didn't get the interest of the VD. Is it only to have the ADC in it's best working range? If not, could you please explain?
Well, the VD is key part of the process. Before calibration measurements are taken, the output VD level must be very precisely aligned with output level of the LP filter so that ADC distortion profile is virtually identical for both cases. Only then can the system be described by two equations for two complex variables, solvable by nonlinear regression.

Quote:
At last, one method to lower the noisefloor is to sum channels. In theory, 3 dB are gained each time a channel is added.
Do you think that alsaconf would allow synchronous summing?
A multichannel soundcard has all channels synchronized, most soundcards (PCI as well as USB) communicate with sample frames where each frame contains one sample per each channel. The summing will occur in analog domain.

I have tested subtracting channels (A with signal - B with zeros) to eliminate DAC/USB frequency artefacts. While the elimination is quite effective, distortions of the subtracted signal proved harder to compensate, yielding worse results.

Summing is a different scenario. Actually I could try summing the 8 channels of my Xonar D2X, measuring with the EMU 0404 (after finishing the automated adapter). Thanks for the hint.
  Reply With Quote
Old 16th January 2020, 01:34 PM   #335
Fr3dJa is offline Fr3dJa
diyAudio Member
 
Join Date: Jan 2020
Quote:
Originally Posted by phofman View Post
Most of the new commits (not pushed to the github repo yet) are related to the automated calibration. But the octave project is just one step of the overall installation. Do you have any linux experience?
Yes, I am a Linux user since years, all my machines are dual boot. I can follow instructions with command lines but I will not pretend being able to do advance Linux stuff by myself.
Quote:
The new calibration code will offer three adapter configurations:

a) manual switches and manual pot operation - the software waits for user clicking on OK button.

b) manual switches and stepper-actuated pot (for my situation now when the stepper just sits on top of the existing switch-based adapter) - the software waits for OK button for manual switches, then adjusts the pot automatically

c) automated relays and stepper-actuated pot, i.e. the worked-on PCB above - the software controls relays and the pot automatically
This seems perfect for my tastes.
Quote:
Well, the VD is key part of the process. Before calibration measurements are taken, the output VD level must be very precisely aligned with output level of the LP filter so that ADC distortion profile is virtually identical for both cases. Only then can the system be described by two equations for two complex variables, solvable by nonlinear regression.

A multichannel soundcard has all channels synchronized, most soundcards (PCI as well as USB) communicate with sample frames where each frame contains one sample per each channel. The summing will occur in analog domain.

I have tested subtracting channels (A with signal - B with zeros) to eliminate DAC/USB frequency artefacts. While the elimination is quite effective, distortions of the subtracted signal proved harder to compensate, yielding worse results.

Summing is a different scenario. Actually I could try summing the 8 channels of my Xonar D2X, measuring with the EMU 0404 (after finishing the automated adapter). Thanks for the hint.
Thanks for all the explanations, and you welcome for the tip. In theory, with 8 channels you could lower the noise from the acquisition system from 24 dB! BTW, summing DACs should also lower their noise.

From the thread I had the feeling that your algorithm should be insensitive to sound card jitter, even with independant DAC and ADC. Did you confirm this by testing?
  Reply With Quote
Old 16th January 2020, 02:35 PM   #336
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
I am afraid noise in individual channels of a multichannel soundcard is not random with regards to other channels, some noise will originate from the common parts - PSU, DAC chip, etc. Summing the channels will attenuate the random noise and amplify the common artefacts.

The software supports unsynchronized DAC and ADC clocks - i.e. sampled ADC signal has slightly different frequency than the incoming digital stream to the DAC. Some parts of the algorithm are more CPU-intensive then and compensation-latency grows, because FFT can increase several times (i.e. taking more samples) when finding FFT length whose bin centers best onto the measured non-integer frequency.

But jitter has not been addressed by the distortion compensation and I think it never will (being basically a random process).
  Reply With Quote
Old 20th January 2020, 12:35 AM   #337
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Added fully-balanced -20dB attenuator at the balanced input - it took only 4 resistors, 1 status LED, and re-arranging relays to utilize the unused halves of relays in the calibration branch (the input is never active during calibration, allowing dual-role of the calibration relays). Default (no power) operation - attenuator engaged. The attenuator will be operated by a push button in the GUI interface.
Attached Images
File Type: png front.png (153.1 KB, 66 views)
File Type: png back.png (78.9 KB, 29 views)
  Reply With Quote
Old 20th January 2020, 04:50 AM   #338
1audio is offline 1audio  United States
diyAudio Member
 
Join Date: Mar 2004
Location: SF Bay Area
Digital Distortion Compensation for Measurement Setup
Nice execution. Need more on the pot. I have found that cheap pots can have pretty limiting distortion. Some (Japanese and US) are very good.
__________________
Demian Martin
Product Design Services
  Reply With Quote
Old 20th January 2020, 10:11 AM   #339
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
I am using inexpensive "bourns" from ebay. They are clones of the original, but the make looks quite decent, outside and inside (from what I saw when opening one)

orig. https://uk.farnell.com/bourns/3590s-...-2w/dp/1612611 vs. clone 10K Ohm 3590S-2-103L With 10 Turn Counting Dial Rotary Potentiometer Pot Ze | eBay

I am reasoning like this - if the pot distorted significantly, the equations would not correctly describe the circuits and the split would not work for voltage-divider and LPF paths.

It is possible the original pot would yield better results though - to be tested. The same holds for the RC filter, I will use Wima FKP2 (right now using some older axial foil cap).

The input attenuator with unused relay halves was a good placement and routing exercise last night, but fetching sensitive calibration signal and DUT output (possibly tens volts amplitude) into one tiny relay package is likely not a good idea. The two sets of relay contacts are not shielded internally.

A small angle toggle switch placed between the input BNCs may do a better job and flipping the switch is faster than clicking on a button in GUI. It will not be operated automatically at clip detection, but the detection would have a large latency anyway. A proper solution would require a dedicated relay, IMO. Maybe in next versions...

Right now I am using inexpensive silver-coated switches and the compensation seems to work OK. The gold-plated ones are quite (10x) expensive.

I should build one board with all no-compromise parts to compare the results.

Last edited by phofman; 20th January 2020 at 10:20 AM.
  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:39 AM.


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