function [sm] = mps(s) % [sm] = mps(s) % create minimum-phase spectrum sm from complex spectrum s sm = exp( fft( fold( ifft( log( clipdb(s,-100) )))));The clipdb and fold utilities are listed and described in §H.10 and §H.9, respectively.
Note that mps.m must be given a whole spectrum in ``FFT buffer format''. That is, it must contain positive-frequency values followed by negative frequency values and be a power of 2 in length.
The mps function works well as long as the desired frequency response is smooth. If there are any zeros on the frequency axis (``notches''), the corresponding minimum-phase impulse response will be time aliased because the corresponding exponentials in the cepstrum never decay. To suppress time-aliasing to some extent, the desired frequency response magnitude is clipped to 100 dB below its maximum. Time aliasing can be reduced by interpolating desired frequency response s to a higher sampling density (thereby increasing the time available for exponential decay in the cepstral domain). However, for pure notches (zeros right on the unit circle), no amount of oversampling will eliminate the time aliasing completely. In principle, to avoid time aliasing in the cepstrum, such a desired spectrum must be smoothed before taking the log and inverse FFT. Such smoothing corresponds to moving the zeros slightly away from the unit circle.