QA40xPlot Thread

The bottom sub-window in the image shown in post 296 contains two traces: the fundamental in blue, and the residual in green.

In traditional distortion analyzers (non-fft based) the residual is electronically generated by a notch filter that removes the fundamental, leaving the harmonics plus all forms of noise. The same notch filtering can be accomplished by removing the fundamental from the fft complex result and computing the inverse fft.

Another approach, the one I use, extracts the complex values of the harmonics from the fft complex result and convolves a cosine series for the frequencies of the harmonics, producing the equivalent inverse fft.

1 Like

this function will be very useful, we can clear to see harmonic distortion waveform. It is recommended to display at most H2, H3, H4, and H5. If the option for customer configuration is available, such as only selecting to display H2 or H3, this would be more helpful.

Absolutely agree with the residual THD being an available option for display. Ever since my first THD meter, I have had a scope attached to the output to display distortion residual after the notch/scaling amplifier- it’s incredibly useful for biasing AB amplifiers etc.

The QA40x software has a residual display which I use.

I am wondering when we will be able to set an actual measurement bandwidth, not just the upper frequency?

@MichaelT

  1. The version number is shown at the top of the window when you start the program, along with the configuration file name if one is loaded at startup.
  2. I checked and they all seem consistent. Each test has its own settings except for a few shared things like amplifier load. When you switch from mV to dBV it changes definition and in the tests with two generators they do it in synch. Um, they are still voltage even when the units change. The units pulldown/label specifies the units.
  3. No, and the generator units currently do not save to file so you are just out of luck there. I consider it a defect and noted a bit back that it would get fixed after the ThD vs Amplitude upgrade (which is 1.2.3). I haven’t rushed because I just always type in volts but I’ll push it up on the list. The fix will be to stop keeping the unit and digits in synch and instead do it like I do in the Amp sweep where you can change the unit setting but the number entered doesn’t change. Then it can be saved/loaded trivially and you can get the default of dBV.
  4. I’ll take that as a request. Most of what you’re looking for is on the display on the left, but not on the chart. I personally don’t like them on the chart since they cover stuff and I usually use the test info title/heading to just type anything I need on-chart or at worst the test info description and leave the window up.
  5. Yeah, I just edited the start/stop code this morning, adding an accelerator is pretty easy.

@lhquam, @adams_leo , and @restorer-john well you all seem to want this, though I’m not as convinced, but I’ll see about doing something. Let me see if there’s a standard implementation somewhere.

Mark

PS I’ve removed the top line which seemed post-holiday. Upgrading QA40xPlot is a pleasure.

1 Like

Yes, everything is fun, until it isn’t. Your work is most appreciated.

1 Like

I have created a zip file containing Python3 code for computing and displaying residual waveforms. I have not found a way to attach it to a post is this thread.

The code contains one simple modification to PyQa40x/src from GitHub - QuantAsylum/PyQa40x: Python library for bare-metal interface to QA40x hardware (including calibration) and some additional functions, described in the file README-LHQ.

The primary test is to run ‘python3 residuals/spectrum-residual-test.py’.

thanks for you sharing this codes.

I just downloaded all main zip and can not find spectrum-residual-test.py file. should be missing push to git? or you mean just run the PyQa40x_thdn.py code?

I didn’t realize that I could push a file into the git repository.
There are multiple files involved. I was hoping for an easy way to make available my zip file for people interested in the harmonic residual calculation without disturbing the git repository.

I have repackaged the residual code in a single file requiring no modifications to PyQa40x.

How would you suggest making it available? I suppose it could be inserted into a posting.

This is awesome! Thank you for this.

1 Like

How can I lock spectrum y-axis dBr scale’s 0 point to a certain level? Easy to do with the original software but is that not available with QA40xPlot?

I tried to put the residual code into a post, but lines beginning with # were corrupted by stripping off the # and showing the line is large bold text.

Does this forum have any way to attach zip files to posts?

redownload and it run successfully.thanks

@timoj when you pick dBR on the Y axis it gives a choice of three options for the zero point. Either max signal level, signal level at a frequency, or given offset.

@LHQuam I don’t know a way to attach a zip file. Also, if you want a thread about residuals using python with QA40x could you please start a separate forum thread and not busy this thread? I am planning on doing residual in a soon release but this thread is already very long and long discussions of how to use your Python code is best done elsewhere. Thank you.

In my example case an external device is outputting 1kHz tone and has volume adjustment. I want to check its volume steps in dBs. With the original soft I can lock dBr to one volume step’s level and then adjust the device’s volume and check how the other steps go in the dBr range vs. the first one.

But with QA40xPlot, dBr always adjusts to the new value. Or am I missing something obvious?

I just released 1.2.4, which now (supposedly) comes with a new “Whats New” option (in the Command Menu) but unfortunately missed one step and the file itself isn’t being delivered. That’s fixed for next release but anyway, here’s the What’s New:

v 1.2.4 Jan 13, 2026

Risk Summary

The gain curve math updates are problematic. QA40xPlot uses gain curves for auto-attenuation of IMD, Amplitude and Frequency sweeps, and Response. The unit of measure changes on amplitude (voltage) selection runs through every test and should work ok but now that they save/load with configuration there could be issues.

Fixup selection of Transparent in color picker

Transparent color is used as an indicator to use the default color from the color palette for these chart lines so it should be easy to select. This fixes requiring setting it twice to stick.

Improve gain curve frequency selection

The gain curve algorithm, which calculates required attenuation in sweep tests, did some band limiting out of the audio range that could cause issues when testing high frequency response. It now uses at least your specified frequency range for the gain curve test.

Add a continuous mode Run button to the Response/Gain/Crosstalk/Impedance tests

Particularly when using Chirp, which runs quickly, support repeating these tests, which allows for tuning circuits.

Swap Start to Run for spectrum, imd, and scope tests

This makes Run and Start more consistent for the tests. Run == run repeatedly whereas Start = run once

Add F5,F6,F7 accelerators for run/start/stop

Enable keyboard accelerators for run, start and stop. Use Function keys F5,F6,F7 to avoid conflicts with the left hand GUI panel choices.

Support saving and loading amplitude UOM

Untether the amplitude value from the Unit of Measure (maybe temporarily) to allow for saving the Unit.

Improve generator voltage messaging

Add a dBxx display in generator voltage to match Unit when user selects a logarithmic unit.

Upgrade esthetics of voltage unit button

Hopefully it is more obvious and esthetic.

Add Whats New file and menu option

Hi @TimoJ ,

You are right, the software recalculates the dBR reference point on each sweep. I’d recommend you use the fixed option (Add). Just set it to the 1KHz value of the first sweep and it won’t shift then. Simply run the sweep at mid-volume, note the value at 1KHz, then enter -it as the reference value on the Add option.

Also, with 1.2.4 I’ve added a Run continuous option to the Response/Gain/Impedance tests which would work pretty well here using the Frequency Response test using Chirp.

Mark

What a pleasant and welcome surprise that Mark Zachmann has joined the cast. As much as I’m excited about and appreciative of his work, and thankful for the QA403, it does suggest at least one question. Why did QA itself not develop this targeted suite of tools–or at least a user guide section–directed toward home/vintage audio measurements? This user segment seems significant, or at least not minuscule. The QA40X user documentation has expanded over the last year or so but is still at times a little impenetrable to non-engineers. More than a few QA403 posts come from home/vintage audio people trying to figure out how to use it. I’m afraid my QA403 would sitting on a shelf out in the garage if not for two or three sophisticated users generously posting their discoveries, and now Mark Zachmann.

I just started using the QA403, both with the factory software and with QA40xPlot. Both seem to work well, and feel quite a bit more intuitive to me than REW. But this could very well be mostly down to the need to manually calibrate a traditional soundcard every time one touches a knob, whereas the QA403 takes care of input and output gain in calibrated steps. The QA40xPlot autorange feature is convenient, but the manual selection in the factory software is also not that hard to use.

From REW I know that the devil is in the details regarding FFT window functions and noise and discrete signal measurements, synchronization of FFT bins and generator frequency, and measurement window and bandwidth settings. I still have to discover how these issues are handled in the factory software and in QA40xPlot. The REW manual writeups on these topics were actually quite nice, once one had found (or stumbled across) them.

One newbie comment/PSA: I noticed that even when selecting to display the right channel only, QA40xPlot seems to use the left channel gain for setting right channel input levels (e.g.when you ask for a certain amplifier power level). This can be dangerous when connecting different devices to the left and the right channel. A bit of searching discovered the channel preference setting (called ‘test channel’) near the bottom of the settings page.

I’m sure this is mentioned somewhere, but the intuitive (‘discoverable’ I think is the word Apple uses) nature of the software interface made reading the manual seem optional :wink:

Anyway, I just wanted to say a quick ‘Thank You!’ for this nice piece of software, Mark.

In reply to Buddy_Dave: I think Matt (from QA) tried to answer that in a post on the first page of this thread; he expressed hope for the emergence of a multitude of lightweight single or few-function software interfaces to the QA403, instead of including every possible functionality in a kitchensink monster app.