Initial Testing of the Tool - pavhofman/nonlinear-compensation GitHub Wiki
Starting from GUI
- Starting the whole tool with
bin/start.shscript - All processes are manageable from UI of the control octave script.
- The menu allows editing Playback and Capture config files.
- Playback, Capture, and UI (Ctrl) processes can be restarted via UI menu, as well as corresponding logs can be viewed.
- Shutting down the whole tool:
Control->Quit All CleanSine Processeswill quit the loop in the startup script and cleanly shutdown the tool.
Configuration
Example Config Files
cd ~/work/nonlinear-compensation/conf
cp configPlay.example.conf configPlay.conf
cp configRec.example.conf configRec.conf
Audio Device Selection
Playback/Capture->List Available Deviceslists names and IDs of available devices for each side. Only closed/not yet used devices are listed.- Copy leading part the device name up to hw:XX alsa ID (which can change at every boot) to the corresponding config file via
Playback/Capture->Edit Config File. The device selection works with substring, please make sure the leading part of the name is unique among all device names listed. Example:
Correct playRecConfig.recDevice or playDevice string for the analog output/input would be 'Infrasonic Quartet: ICE1724 ('.... ID 9: Name: Infrasonic Quartet: ICE1724 (hw:3,0); API: ALSA; 2 channels ID 10: Name: Infrasonic Quartet: ICE1724 IEC958 (hw:3,1); API: ALSA; 2 channels ... - Only the "physical" device name is configured, the other device is left at 'octave_loop' (configured already in
.asoundrc). - If the tool is started with
start.sh, the corresponding-side process will start automatically after proper device is configured in the config file (the script runs a while loop checking all the three processes are running)
Default setup
- Left channel DAC OUT
- Left channel ADC IN for analysis/compensation, right channel ADC IN for reference measurements
Changing the channels requires modifying constants PLAY_CH_ID and ANALYSED_CH_ID defined in consts.m.
Starting Manually
Alternative option is starting each process independently:
- Open a terminal, start the control/UI process:
cd ~/work/nonlinear-compensation/octave/
octave mainCtrl.m
-
The UI screen should start up, with both playback and record panels empty - the control process recieves no data yet.
-
Open another terminal, start the playback-bridge process:
cd ~/work/nonlinear-compensation/octave/
octave mainPlay.m
- Hint: Shortcut Ctrl+N in the terminal starts a new one with the same working directory
- You should see the playback status in UI window - either no signal available (REW generator is OFF), or parameters of the signal generated by REW
- Open another terminal, start the capture-bridge process:
cd ~/work/nonlinear-compensation/octave/
octave mainRec.m
- You should see the capture status in UI window - either no signal available (soundcard outputs are not connected to inputs - no physical loopback present), or parameters of the signal captured by the soundcard
Updating to the Latest Version
- Info about current version:
About->View GIT Version - Updating:
About->Update to the Latest GIT Version
Signal Generator
The tool has a built-in signal generator, on both playback and capture sides. The generator is used by automated transfer measurement and during split-calibration. However, you can use it at any time:
Playback/Capture->Generate- Enter one or two frequencies for the first (left) channel. Note: Levels are absolute (not decibels), so that negative values can be used for generating symmetric signal.
- If values for second channel are not entered, the values from first channel are used. If you want no signal in one of the channels, enter some frequency and put 0 amplitude.
- The generator params can be changed in any time.
- Stopping the generator:
Playback/Capture->Stop Generating
Joint-Sides Calibration
First try the joint-sides compensation. This mode is not suitable for production measurement, but good for testing the setup works correctly.
- Connect analog loopback
- Make sure REW generator is running, or generate some signal on playback
- Run
Joint-Sides->Calibrate Joint-Sides (Single Run) - The calibration will start, showing current averaging run.
- After calibration collects enough runs for averaging, it computes the averaged profile and stores to cal files in directory
data/
Joint-Sides Compensation
Joint-sides compensation can be performed on playback OR capture side, using the same profile. Since it's "joint-sides", run only on one side at a time :-)
Playback->Compensate Joint-SidesorCapture->Compensate Joint-Sides- If the corresponding calibration files are found, the code loads them and start compensating. UI shows amplitude levels of each compensated harmonic frequency
- The distortion lines should basically disappear in REW spectrum (enable averaging (linear, exponential) to zoom into the noise).
- The red arrows on the plot show calibration levels stored in the calfile, green arrows show current signal levels
- The compensation distortions are interpolated between the calibrated levels to fit the current signal. For loopback calibration/compensation the levels are identical (unless the generating signal is changed after the calibration).
Checking with Distortion Generator
You can check sensitivity to harmonic distortions with built-in distortion generator.
- Start the compensation, check in REW the signal is clean
Playback/Capture->Distort- Enter the requested distortion levels for each harmonic. Please note: unlike in the generator window, the distortion levels are entered in decibels (e.g. -120)
- After REW averaging you should see the distortion at required levels and frequencies
- Stopping the distortion generator:
Playback/Capture->Stop Distorting
Split-Sides Calibration/Compensation
Measuring Transfers of Calibration Paths
Joint Sides->Re-Measure LPF/VD Transfer
Calibrating/Calculating Playback-Side Distortions
Playback->Split-Calibrate/Compensate Playbackor pushbuttonSplit-Calib Playback- The calculation requires transfer profiles for every harmonic frequency. If transfers are not measured (or too old data), the task re-measures the transfers first.
Calibrating/Compensating the Remaining Capture-Side Distortions
Capture->Calibrate/Compensate Capture at Current Level/Calibrate/Compensate Capture at Range around Current Levelor pushbuttonExact-Calib Capture. The tasks will calibrate/compensate joint-sides if the playback side is not currently compensating.