Allpass to correct phase response
Hi all, I'm fairly new to max and need some help figuring something, hopefully someone can help.
I'm a professional sound system engineer and I use Allpass filters a lot with some high-end pro audio equipment to achieve phase correction on different speaker types. I am messing around with the allpass~ object at home and cannot figure out how to set parameters right to acheive what I'm after. When I'm doing measurements, it basically looks like i'm only adding delay to my signal instead of being able to generate a phase wrap at a center frequency with a determined bandwidth. So for example if I set the delay to 1ms on the allpass I'll have my phase wrapping at 1KHz as expected but I do not want the phase to continue wrapping above it ie: 180 deg @2KHz 360deg @ 3KHz etc...
I would like to be able to achieve a single phase wrap at a specified frequency and also determine the Q of that allpass.. .
Thanks in advance.
allpass~ is basically like a combfilter. Try this with biquad~ and filtergraph~ instead. This is more or less just cut and paste from the biquad~ help file, FYI. Also, you should check out phaseshift~.
edit: also check this link, you could skim this and get a feel for the filter options available in msp
https://docs.cycling74.com/max7/tutorials/08_filterchapter01
sorry, this may be irrelevant to the original poster question, but i have a question for the original poster:
generally i avoid using filters and EQ's because they cause phase alterations.
it's interesting to hear that you use filters for phase correction. would it be possible to use a filter to "undo" phase alterations caused by another filter/EQ? or would that also "undo" the actual equalisation/filtering that was applied?
if possible, could you provide a link to an article or tutorial about this subject?
once again, sorry for hi-jacking the thread
I'm not an authority on the subject but I may be able to shed some light on it.
Think of phase shift as a super tiny time delay. When dealing with sin waves its no big deal, you can phase shift (time delay) the signal 360 degrees and it is the equivalent of a shift of 0 degrees, because the sin waves line back up perfectly. When dealing with complex signals, things aren't so simple.
Filters can cause a varying degree of positive phase shift, mainly because many filters work on the principle of using very (extremely) short delay times. You cant really 'undo' phase alterations with a filter because that would require a negative phase shift. A negative phase shift would be like traveling back in time, sort of. You can however compensate for phase alterations in a system by knowing/measuring the degree of phase shift present and delaying everything else by the same amount.
Heres an example. Imagine speaker system with two speakers: a woofer and tweeter. For one reason or another the tweeter is 90 degrees out of phase with the woofer. Perhaps because of crossover filter, or a speaker driver, or both. One could use an allpass filter on the woofer to shift its output 90 degrees while preserving the frequency response and thus line it up with the tweeter. You now have lined up the overall time delay between the two speakers.
does that make sense?
yes, very good explanation, thanks!
Generally speaking one cannot correct phase shift from EQ filters with a simple allpass filter. Outside the band range, where the filter has no effect, the phase isn't changed. It is changed inside the band range, by different amounts at different frequencies. It is possible to correct this with convolution if the signal is static. But if the signal is dynamic, the convolution needs a non-changing signal the width of the convolution window to work, and any change of the signal's frequency characteristics within the convolution window causes distortion. So it doesn't work very well.
thanks for the replies, I'll take a look at the options above but I doubt I'll be able to do what I was aiming for.