⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 synth21.m

📁 本代码经过本人多次调试运行过
💻 M
字号:
function sy = synth21(sub,lpf,hpf)
%synth1(sub, lpf, hpf) takes the one level subband decomposed 
%image and reconstructs it using the filter bank made up of 
%lpf and hpf. Orthonormal filter bank with circular extension. 
%upsampling algorithm-courtsey: Dinesh Nadarajah.
%
%This routine is used by the routine synth2d for the reconstruction
%of a wavelet decomposed image.
%
%Author: Ajit S. Bopardikar
%Copyright (c) 1998 by Addison Wesley Longman, Inc.
%

  [m,n] = size(sub); %determine the size of the subband image
  l = length(lpf); %length of the filter
  
  ll =  sub(1:m/2,:)'; %Isolate the lowpass columns
  hh =  sub(m/2+1:m,:)'; %Isolate the highpass columns

  ll = [ll(:,m/2-l/2+1:m/2) ll]; %circular extension
  hh = [hh(:,m/2-l/2+1:m/2) hh]; %circular extension
  
  %here starts upsampling
  
  [r,c] = size(ll);  
  upl = zeros(r,2*c);
  uph = zeros(r,2*c);

  upl(:,1:2:2*c) = ll;
  uph(:,1:2:2*c) = hh;

  %here ends upsampling
  
  %upl = upsamp(ll,2); %upsample by 2
  %uph = upsamp(hh,2); %upsample by 2

  sync = conv2(upl,lpf)+conv2(uph,hpf); %synthesis of columns
  sync = sync(:,l+1:l+m)'; %this finishes the column synthesis
  
  ll =  sync(:,1:n/2); %Isolate the lowpass row
  hh =  sync(:,n/2+1:n); %Isolate the highpass rows

  ll = [ll(:,n/2-l/2+1:n/2) ll]; %circular extension
  hh = [hh(:,n/2-l/2+1:n/2) hh]; %circular extension
  
  %here begins upsampling

  [r,c] = size(ll);  
  upl = zeros(r,2*c);
  uph = zeros(r,2*c);

  upl(:,1:2:2*c) = ll;
  uph(:,1:2:2*c) = hh;

  %here ends upsampling
    
  %upl = upsamp(ll,2); %upsample by 2
  %uph = upsamp(hh,2); %upsample by 2

  sy = conv2(upl,lpf)+conv2(uph,hpf); %synthesis of rows
  sy = sy(:,l+1:l+n); %this finishes the row synthesis
  
    
  
      
  
  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -