modulateFlip.m 461 B

12345678910111213141516171819
  1. % [HFILT] = modulateFlipShift(LFILT)
  2. %
  3. % QMF/Wavelet highpass filter construction: modulate by (-1)^n,
  4. % reverse order (and shift by one, which is handled by the convolution
  5. % routines). This is an extension of the original definition of QMF's
  6. % (e.g., see Simoncelli90).
  7. % Eero Simoncelli, 7/96.
  8. function [hfilt] = modulateFlipShift(lfilt)
  9. lfilt = lfilt(:);
  10. sz = size(lfilt,1);
  11. sz2 = ceil(sz/2);
  12. ind = [sz:-1:1]';
  13. hfilt = lfilt(ind) .* (-1).^(ind-sz2);