Odd peak at the end of the response after vector multiplication

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
237
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Dear John,

The bottom response in purple is the vector multiplication (A * B trace arithmetic) of the top two responses and creates that odd peak at 24,000 Hz. The original sweep was 0 to 24kHz so I'm guessing it's some sort of an overflow error due to end of data there. I cannot find a way to get rid of it.

I have tried:

* trimming an impulse response is not possible (you can export it trimmed as measurement but lose impulse property when you import back)
* tried a notch filter but EQ goes only up to 22kHz
* some HF tail manipulation is possible but only with a minimum/excess phase copy
* tried merging it with various flat target response shapes (blended or not)


Your help (or anyone else's with some info) is much appreciated.


(and my compliments for the zoom capture capability you've added in the latest version)
 

Attachments

  • REW Snapshot.jpg
    REW Snapshot.jpg
    217.4 KB · Views: 18
  • zoomed.jpg
    zoomed.jpg
    148.1 KB · Views: 11
Last edited:

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
237
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
L0 is smoothed, FD windowed actual measurement (L). "Filters L0" is measurement generated from L0's EQ filters. L0-EP is excess phase of L0. The problematic multiplication "L_Correction" is the result of "Filters L0" x "Inverted L0-EP"

Thanks
 

Attachments

  • Left.zip
    13.8 MB · Views: 4

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
237
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Could you attach the mdat file for the responses, please?
John,

just figured if I select "replicate data outside range" option while creating excess phase then the inversion of EP and its vector multiplication all come out normal (without a tail peak). So may be this should not be optional?
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,212
The basic problem is that several of the operations involve division of the responses (even the excess phase generation is a division, measurement divided by min phase version of the measurement in essence). That is inherently problematic, since few responses are suitable for division. The FFT by its nature has zero phase at DC and Nyquist, responses may have phase that differs significantly from zero near those extremes producing phase discontinuities. Measured responses will also typically be near zero magnitude at the frequency extremes, thanks to the action of ADC anti-alias filters and the physical limits of the components, creating further numerical problems in those regions when the denominator in the division becomes very small. Your L0 measurement isn't helped by being inverted and t=0 being about 120 us offset from where it should be (despite REW's incorrect zero delay estimate for that response), but those are minor issues overall. The basic concept of dividing by an excess phase response is flawed and will produce impulse responses with numerical issues, the apparent frequency response will be highly sensitive to the windowing applied to the IR and may only have the desired appearance when the windows are rectangular and span the full IR. If the IR is exported and used in a convolution engine the results are likely to differ from the trace arithmetic predictions. A better approach to phase correction is probably to use something like rePhase and limit the frequency range of the phase corrections.
 

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
237
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Thank you for the detailed and valuable information. I am trying to stay in REW throughout. You cannot do vector arithmetic in rephase and you cannot import (or export) impulses. I plan to use it for filter linearization at the end.

There were various smoothing and FWD steps before convolving the inverse EP of the original measurement with EQ filter response which were not in the .mdat I shared above. And the correction doesn't go beyond Schroeder's x 4. I am using EQ APO and testing results almost immediately after calculating in REW. The differences are frequently quite minor (within 0.5 db) and not more than a few (in PS and FDW version of course!). I also achieve almost zero pre-ringing that way even if I go for narrow Qs in the deep bass area. Rectangular windowing idea is interesting. What would be the window size you suggest?
 
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,212
A problem with division or inversion is that the resulting IR is no longer causal, so it isn't sufficient to just window a period after the peak and a little before. When using the invert operations REW automatically sets the IR window to cover the entire span of the impulse response, that is usually needed to get a meaningful result. You will probably have noticed the glitches in the unsmoothed excess phase response, which should be flat at 0 dB. They are a consequence of not setting the window to span the full IR. I'll do that for the next build, but it doesn't change the underlying issues with trying to correct phase by inverting a response. Even though you are limiting your filter corrections, the phase correction is full range, there isn't a way to limit the frequency span of the inversion of the excess phase. As an aside, rather than inverting the excess phase and multiplying it by the filter response you could just divide the filter response by the excess phase, provided windows are set to the full span of the IR for the excess phase and the result of the division. What are you using to apply the final correction?
 

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
237
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
Equalizer APO, open source free convolver for PC - no Mac :(
I export impulses directly to EQ APO's config folder, save the new configuration and following REW measurements run convolved, works perfectly with rePhase wav files and most (EQ wavs work perfectly, divisions introduce huge delays) REW wavs and avoid "instant mode".
Eventually I use finalized correction impulses in Roon DSP

Equalizer Apo.png
 
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,212
A cleaner way to handle this might be to provide a regularisation option for the divide and inversion arithmetic operations. That would allow mixed phase responses to be inverted or divided without excessive boosting of notches in the response. Here is an example of a response, an inverse produced with a 1% regularisation factor, and the predicted result of applying that inverse (all offset for clarity). The result has zero phase from about 27 Hz to 22 kHz and the inverse IR needs about 250 ms of pre-peak window to achieve the full LF correction. I can send you a link to a test build with the regularisation feature if you'd like to try that.

52640
 

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
237
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
John,


You are right as always. I repeated the whole process for Left speaker with rectangular windows, FDW, smoothing, replicated data etc. There are glitches in the curve even in the 20-200 Hz area although the PA smoothed final results look almost identical throughout. So even if we could produce a trimmed EP (and we cannot) the method is flawed. It's a pity though because sound really improves in actual listening. Look at the impulse, GD and step graphs, all far superior to the original. I could never achieve that (first step peak higher than the original for instance) with EQ + phase equalization.
A cleaner way to handle this might be to provide a regularisation option for the divide and inversion arithmetic operations. That would allow mixed phase responses to be inverted or divided without excessive boosting of notches in the response. Here is an example of a response, an inverse produced with a 1% regularisation factor, and the predicted result of applying that inverse (all offset for clarity). The result has zero phase from about 27 Hz to 22 kHz and the inverse IR needs about 250 ms of pre-peak window to achieve the full LF correction. I can send you a link to a test build with the regularisation feature if you'd like to try that.

View attachment 52640
Would be great!!!
 

Attachments

  • IR Window.png
    IR Window.png
    5.8 KB · Views: 7
  • Impulse Response.png
    Impulse Response.png
    39.9 KB · Views: 9
  • Group Delay.png
    Group Delay.png
    80.9 KB · Views: 6
  • Step Response.png
    Step Response.png
    65.5 KB · Views: 7
  • SPL.png
    SPL.png
    64.4 KB · Views: 6

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Messages
237
Location
Germany
More  
Preamp, Processor or Receiver
Marantz SR6015
Main Amp
Rotel Michi X3
Computer Audio
Intel NUC
DAC
Oppo 205
Universal / Blu-ray / CD Player
Oppo 205
Front Speakers
Focal Kanta 2
Center Channel Speaker
Linn
Surround Speakers
Focal Dome Flax
Surround Back Speakers
Focal Dome Flax
Front Height Speakers
Focal Dome Flax
Rear Height Speakers
Focal Dome Flax
Subwoofers
Focal Air
Video Display Device
LG 65 3D OLED
Streaming Subscriptions
TIDAL, ROON
A cleaner way to handle this might be to provide a regularisation option for the divide and inversion arithmetic operations. That would allow mixed phase responses to be inverted or divided without excessive boosting of notches in the response. Here is an example of a response, an inverse produced with a 1% regularisation factor, and the predicted result of applying that inverse (all offset for clarity). The result has zero phase from about 27 Hz to 22 kHz and the inverse IR needs about 250 ms of pre-peak window to achieve the full LF correction. I can send you a link to a test build with the regularisation feature if you'd like to try that.

View attachment 52640
I would love to!!!
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,212
I repeated the whole process for Left speaker with rectangular windows, FDW, smoothing, replicated data etc
Full span rectangular windows are only needed for the results of excess phase generation, inversion or (depending on the divisor characteristics) division. The test build I sent already takes care of applying such windows where needed and produces cleaner excess phase responses, but regularised division is much less sensitive.
 
Top Bottom