Coherent averging

KSTR

New Member
Thread Starter
Joined
Jun 7, 2019
Messages
49
The new coherent averaging feature is great.
I'd have a few suggestions, though:
  1. apply some sort of smothing/averaging to the actual graphic output which is very rough/bouncy
  2. it doesn't work with imported data (drag&drop in the RTA window)? That would be nice as I often work with offline data -- one of the reasons is that I seldom get REW to collect or even output data without glitches or dropouts, whereas external playback-while-recording works perfectly even at 768kHz. And any glitch spoils averaging, of course. Haven't tracked that down, though. Hardware & OS setup (w10) sure seems capable enough.
  3. more options to tell REW which base frequency (and phase) to use : with synced freq and record-while-playback, the frequency is known and doesn't need to be estimated from the largest component (REW does use that shortcut already) but the phase is also locked and doesn't need to be measured, right? Currently I need to apply some minimum level for the base distance frequency in the two-tone IMD with coherent averaging (see below) so that REW can extract the phase to lock on (which it does amazingly well even with that carrier down at -120dBFS). So with sync'd FFT freq and generator on, the algorithm could use the direct data values rather than measuring them (also for imported data). This would be useful for measurements with notch filter applied to suppress the fundamental where measuring the phase of the fundamental could lead to problems, from freq drifts in the filter, given the steep slopes of the phase response around the design frequency whereas phases of harmonics sport only little change.
  4. Btw, the -150dBFS min generator level is a bit high for my needs, I'd like to cover the whole 24bit level range (incl. sub-levels with dithering), so something -200dBFS-ish. Or maybe just add a mute button (turn off the actual stream but still use the user input data as if it were on).

Other suggestions (in the "nice-to-have" category for user convenience):
  1. allow input of FFT bin number rather than absolute frequency at all places where it could make sense, and also use it for display values (including the RTA itself). Application, for example: setting up coherent averaging for 2-tone IMD which requires the two frequencies to be placed at exact multiples of the base distance frequency. Say, a 1.0kHz+1.1kHz twin-tone, which requires exact 100Hz multiples. With FFT synced freq's the 100Hz will be something odd and it is hard to dial in the proper test frequencies to hit the required FFT bins.
  2. level readout in the trace legend of the RTA (and elsewhere) : when zoomed in so that bins are visible (with "use bars" options on), make the readout the true value of the bin, regardless of where the curser is positioned on the bin. Actually, restricting the cursor movement to land on bin centers only would afford that automatically. That is, cursor movement/readout should follow display granularity which is discrete with "use bars" on, whereas when using interpolated display it is continuous.
  3. dBc scaling is missing in the SPL&Phase and AllSPL panels. dBc is very convenient to compare distortion distribution at various levels, no need to shift the plots manually for the fundamentals alle to be at 0dB.
  4. some way of sorting the traces in a multi-trace display (allSPL), so that the plot order can be defined. Currently one has to save the measurement and load them in the required bottom to top order manually

And a new feature suggestion, quite related to the coherent averaging, dropping non-synced content by sqrt(N) :
True time-domain averaging (sequence length restricted to FFT sizes would do, though arbitray size would be even better), with an extra parameter for it. After averaging, use two repeated blocks of that data for input of the FFT analyzer (or whatever number of repeats required to get a >= 2*FFT size input data length, in case of arbitrary record sizes). With magnitude averaging on and maxiumum overlap this gives a very smooth spectrum noise floor. I currently do this offline but it would be nice to have it integrated into REW (if I manage to get the glitching issues resolved, that is).
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,392
The coherent averaging feature is part of the harmonic distortion analysis. REW has two ways of determining the fundamental:

  1. If the signal generator is playing a sine wave that frequency is used. It doesn't actually have to be the source of what is being captured, so this provides a way of forcing REW to use a specific frequency
  2. If the signal generator is not playing then the frequency of the largest peak in the input is used. If the input is after a notch filter that can still be made to work work by using the notch frequency response as a cal file to restore (approximately) the fundamental. The next beta build has an option to specify the original pre-notch level of the fundamental to obtain correct relative measures for the harmonics.


apply some sort of smothing/averaging to the actual graphic output which is very rough/bouncy
The output is already an average, and for the non-harmonic components it is an ever-reducing value. On a dB scale the variations are still clearly visible but they are of course variations around an ever smaller value. I don't think there is a meaningful way to smooth the output, or that smoothing would provide any benefit, but I'm open to suggestions.

it doesn't work with imported data (drag&drop in the RTA window)
It does for me. If you have problems with a specific file I'll happily look at it.

more options to tell REW which base frequency (and phase) to use : with synced freq and record-while-playback, the frequency is known and doesn't need to be estimated from the largest component (REW does use that shortcut already) but the phase is also locked and doesn't need to be measured, right?
No, phase is not known, it will have some offset depending on the relative timing of replay and capture and can have one of several values depending on the FFT overlap.

Currently I need to apply some minimum level for the base distance frequency in the two-tone IMD with coherent averaging (see below) so that REW can extract the phase to lock on (which it does amazingly well even with that carrier down at -120dBFS). So with sync'd FFT freq and generator on, the algorithm could use the direct data values rather than measuring them (also for imported data).
I guess "distance frequency" was an autocorrect from difference frequency? The signal generator trick mentioned above could be used to lock to that.

Btw, the -150dBFS min generator level is a bit high for my needs, I'd like to cover the whole 24bit level range (incl. sub-levels with dithering), so something -200dBFS-ish. Or maybe just add a mute button (turn off the actual stream but still use the user input data as if it were on).
I have set the minimum to -180 dB for the next beta.

allow input of FFT bin number rather than absolute frequency at all places where it could make sense, and also use it for display values (including the RTA itself). Application, for example: setting up coherent averaging for 2-tone IMD which requires the two frequencies to be placed at exact multiples of the base distance frequency. Say, a 1.0kHz+1.1kHz twin-tone, which requires exact 100Hz multiples. With FFT synced freq's the 100Hz will be something odd and it is hard to dial in the proper test frequencies to hit the required FFT bins.
I'll put that on the todo list to think about

level readout in the trace legend of the RTA (and elsewhere) : when zoomed in so that bins are visible (with "use bars" options on), make the readout the true value of the bin, regardless of where the curser is positioned on the bin.
That's a bug, I have fixed it for the next beta

dBc scaling is missing in the SPL&Phase and AllSPL panels. dBc is very convenient to compare distortion distribution at various levels, no need to shift the plots manually for the fundamentals alle to be at 0dB.
I have made a change for the next beta so that the dBr axis option has the same effect

some way of sorting the traces in a multi-trace display (allSPL), so that the plot order can be defined. Currently one has to save the measurement and load them in the required bottom to top order manually
Traces can be dragged and dropped to different positions in the list. Select a measurement, then click on it and drag it to where you want it.

And a new feature suggestion, quite related to the coherent averaging, dropping non-synced content by sqrt(N) :
True time-domain averaging (sequence length restricted to FFT sizes would do, though arbitray size would be even better), with an extra parameter for it. After averaging, use two repeated blocks of that data for input of the FFT analyzer (or whatever number of repeats required to get a >= 2*FFT size input data length, in case of arbitrary record sizes). With magnitude averaging on and maxiumum overlap this gives a very smooth spectrum noise floor. I currently do this offline but it would be nice to have it integrated into REW (if I manage to get the glitching issues resolved, that is).
I'm not clear why synchronous averaging in the time domain should give any better result than coherent averaging?
 
Top Bottom