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

📄 bianal2.m

📁 这是伯克里wavelet transforms一书中的例子的代码
💻 M
字号:
function bian=bianal2(data,lpf,hpf)
%bianal2(data,lpf,hpf) performs a 1 level analysis 
%on the data using the filter bank defined by lpf and
%hpf. lpf and hpf are assumed to be HSS and so the 
%extension is symmetric and has twice the length of
%the original. The subbands are also of unequal length.
%
%This routine is used by analh.
%
%Author: Ajit S. Bopardikar
%Copyright (c) 1998 by Addison Wesley Longman, Inc.
%

  l = length(data); %Get the data length
  ll = length(lpf); %lowpass filter length
  lh = length(hpf); %highpass filter length

  le = ll/2; %extension length for low pass
  he = lh/2; %extension length for high pass

  extl = [data(le:-1:1) data data(l:-1:l-le+1)];%extension for lowpass 
  exth = [data(he:-1:1) data data(l:-1:l-he+1)];%extension for highpass
  al = conv(extl,lpf); %lowpass subband
  ah = conv(exth,hpf); %highpass subband

  if (le/2 ~= round(le/2)) %if the center is odd     
     bian = al(ll:2:ll+l); %downsampled lowpass subband
     bian = [bian ah(lh+2:2:lh+l-1)]; %unequal length subbands
  else   %if center is even
     bian = al(ll+1:2:ll+l); %downsample lowpass subband
     bian = [bian ah(lh+1:2:lh+l-1)]; %equal length subbands
  end; %endif

⌨️ 快捷键说明

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