PHASE GRAPH LINES
Reading the phase vs frequency response graph across horizontal axis from left (eg. 20Hz) to right (eg. 20,000Hz) with vertical axis phase +180 degrees at top, 0 degrees in centre, and –180 degrees at the bottom…
Flat horizontal line on 0 degrees = your two signals are in perfect sync at all frequencies. Hooray. However, that doesn’t mean they’re both “perfect” – oh no! – flat line doesn’t mean they’ve suffered no phase distortion anywhere, in fact they could both have been equally badly phase skewed by your D/A and A/D converter chains going along into your FFT analyser, but the transfer function graph just shows the relative phase difference between them, which, if they’ve both been skewed equally, it won’t show up on the A vs B graph because there’s no relative difference.
Flat horizontal line at 180 degrees = your signals are in perfect sync at all frequencies but with inverted polarity. But as above it just means you have a match, not that they’re intrinsically perfect and devoid of phase distortion.
Graph sloping downwards (going from left to right) means transfer function “output” (test signal) comes later after the “input” (reference signal). For a simple fixed time delay such as latency, if graph’s frequency Hz has linear horizontal axis, then you get a dead straight line slope gradient which repeats as it has to cross over the +180/-180 degree border and wraps around for each successive repeat beyond 180 degrees, but for pure time delay, these are evenly spaced and the Gradient of the slope proportional to the delay. However MOST graphs show frequency Hz with a logarithmic horizontal axis, so then you get a gradually increasing gradient where the bass is gentle slope, midrange steeper, and treble very, very steep with lots of wrap-arounds. This is NORMAL look for a logarithmic Hz graph with a fixed time delay. A fixed delay like this means zero relative phase shift. At each given frequency the slope is proportional to the delay, but they’re not all the same anymore because the axis is logarithmic. You can work out the ratio of the difference in freq to the difference in phase degrees to calculate the time delay. A good book for this subject is Chapter 10, of Bob McCarthy “Sound Systems: Design And Optimization”
Graph sloping upwards (going from left to right) means transfer function “output” (test signal) is ahead of the “input” (reference signal), which typically implies that you’ve added too much compensation digital delay to your reference signal….
MEASURING PHASE WITH FFT ANALYSER
Because obviously sending test signal round a loop via output DAC, through amplifier, loudspeaker driver, a few feet of air (speed of sound approx 1 foot per millisecond), into Earthworks measuring mic, mic preamp, A/D converter, USB interface, Windows computer, etc. is bound to add considerable overall latency delay, you must take this into account with dual channel FFT analyser transfer function measurements.
If you don’t take that delay offset into account when running FFT software A vs B transfer function comparison, you’ll see a massive downwards slope with hundreds of wrap-arounds more and more intensely climbing into high freqs, because the output test signal coming back from the loop is at least something like 300 samples (7 milliseconds) or so behind the duplicate reference signal which you’re feeding directly into FFT also. So you add delay to reference to compensate, and watch the screen as the wrap-arounds unfold till you’re down to a fairly flat curve, and that’s probably the closest you can get to synchronizing your files for the FFT analysis benefit. Any relative freq vs phase shifts are then easier to observe in the graph shape. If you over correct, adding too much delay, the graph swings upwards more and more, meaning the reference input is lagging behind the test signal output.
Experimenting with FFT software on live audio input is the easiest way to see and understand the real behaviour of the phase vs frequency graphs, and FFT software can usually switch between log and linear Hz scales, and make things clear.
I can recommend “Visual Analyser” as the best free download FFT software for Windows, unless you’ve already bought SMAART or something.... There are also iPad apps like StudioSixDigital AudioTools, etc. Something like the MiniDSP USB Streamer can help you get clean high quality digital audio into your computer without going through a nasty computer soundcard's A/D converters.
WHY DOES PHASE SHIFT ANYWAY ?
Phase shift makes sense, just like frequency response and EQ makes sense…
Phase shift occurs in simple analogue filter circuits because they use capacitors to impede low frequencies but conduct high frequencies, and inductors to impede high frequencies while conducting low frequencies. eg. HPF for instance is an RC circuit with capacitor and resistor. At low freqs capacitor charges up so fast it’s in phase with the AC voltage, up to the point where it impedes the current fully, so at AC voltage maximum peak there is no current flowing through. At high freqs the slow capacitor charging time means it lags behind the AC voltage, but when AC supply voltage reduces to minimum zero, current can most easily flow back opposite direction from charge stored in capacitor and so the current flow actually peaks when the voltage crosses zero line, and then it gets increasingly impeded in other direction by the negative voltage again and so on. So the peak current flow pattern is 90 degrees out of phase with the AC voltage’s peak sinusoidal pattern. We’re not simply talking about domestic AC mains at 50Hz fixed freq, but alternating audio signal voltages containing all different frequencies which are an overall Fourier sum of all those frequencies they contain, for which all those different phase shifts are relevant, so the capacitor HPF filter which has that HPF shape impeding low frequencies also shows that phase response shape across those same frequencies. Plotted on a graph, the phase response is the first derivative of amplitude response, mathematically speaking. These basic textbook analogue filters are recreated digitally within DSP by using the same mathematical formulae so they behave in the same way (digital IIR filters) with the same phase shifts. More complicated DSP formulae can create more complicated filter behaviour such as FIR filters with lots of taps. (The taps represent the number of mathematical coefficients of the very complex polynomial equation that defines the filter shape.)
Phase shift occurs in speakers because they also build up energy in resonances at various frequencies which takes time and their mechanical / kinetic motion behaviour vs input signal voltage has similar minimum phase relationship to the applied signal voltage, and the maths would prove this – but very complicated with lots of Theile / Small parameters, etc.
Vents also have phase shift because the resonance takes time to build up and to die away. Linearising phase via digital FIR processing doesn’t stop that physics from happening, it just allows you to move the build-up of that energy to begin earlier until all your energy peak centres are time-aligned together in sync, for constant group delay across bandwidth, looking at where the energy peaks, but each freq resonance decay (and pre-ring with FIR) will still be there, and you’ll see it on a waterfall graph, but at least they all occur in unison and it feels more correct.
Group delay is just another way of plotting phase response as millisecond delay vs frequency, which is perhaps an easier way to visualize it, because delay is viewed in real-world units like milliseconds, rather than “phase degrees” which requires more abstract thought, compounded by wrap-arounds, relativity and logarithmic graphs.
Impulse response is another way of viewing this information which is even more abstract to visualise how you’re deviating from the target.
The target is only an optimal correction for a given loudspeaker, though…
eg. You can’t make a vented cabinet have the impulse response of a closed box, but you can get the bulk of the vented cabinet’s energy peak (which would have lagged far behind in the low bass) to occur at time “t” alongside all the other freqs, using OpenDRC with rePhase generated FIR filter. If you want a perfect speaker, you’ll still have to buy the best components with high BL factor, lightweight moving mass cone, high linear xmax, etc. and have a very rigid, well damped cabinet and class A or AB amplifier with good damping factor, etc. There’s no such thing as a free lunch. You can’t just FIR correct any cheap crappy speakers and make them sound like Dynaudio Consequence, because although they’d be nominally flat and phase coherent, they won’t get a faster rise time or damping, or higher output capacity where they otherwise bottom out or have cone break-up modes. The group delay and phase response might be a straight line, but then that speaker is optimised perhaps, but not eradicated of all its inherent physical limitations, and those will still be subject to physics, and its weaknesses or indeed qualities will be there in what you hear.