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

📄 linear_const34.m

📁 MATLAB Code for Optimal Quincunx Filter Bank Design Yi Chen July 17, 2006 This file introduces t
💻 M
字号:
function [Aeq, beq] = linear_const34(A1c, A2c, Np, Nd)
% linear constrains on the first two lifting steps for filter banks with
% more than two lifting steps
% Aeq*[p' u'] = beq
% Copyright (c) 2006 Yi Chen

format short

p_coeff = A1c;
u_coeff = A2c;

%     linear constraints
%     predict filter    
sizep = size(p_coeff);
[cp, bp] = solv_quin(sizep(2)/2, sizep(1)/2, Nd);

%     update filter    
sizeu = size(u_coeff);
[cu, bu] = solv_quin(sizeu(2)/2, sizeu(1)/2, Np);

%     combine them together
cp1 = [cp zeros(length(cp(:,1)),length(cu(1,:)))];
cu1 = [zeros(length(cu(:,1)),length(cp(1,:))) cu];
%     linear equality
beq = [-bp; 0.5*bu];
Aeq = [cp1; cu1];

if [size(p_coeff) size(u_coeff)] == [4 4 2 2]
    Aeq = [Aeq;
        0 0 0 0 1 0 0 0 0 0;
        0 0 0 0 0 0 0 1 0 0]; 
    beq = [beq; 0; 0];
end
if [size(p_coeff) size(u_coeff)] == [4 4 4 4]
    Aeq = [Aeq;
        0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0;
        0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0;
        0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0;
        0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1]; 
    beq = [beq; 0; 0; 0; 0];
end
if [size(p_coeff) size(u_coeff)] == [6 6 2 2]
    A_temp = zeros(6, 20);
    A_temp(1,7) = 1;
    A_temp(2,12) = 1;
    A_temp(3,13) = 1;
    A_temp(4,14) = 1;
    A_temp(5,17) = 1;
    A_temp(6,18) = 1;
    Aeq = [Aeq; A_temp];
    beq = [beq; 0; 0; 0; 0; 0; 0];
end
if [size(p_coeff) size(u_coeff)] == [6 6 4 4]
    A_temp = zeros(8, 26);
    A_temp(1,7) = 1;
    A_temp(2,12) = 1;
    A_temp(3,13) = 1;
    A_temp(4,14) = 1;
    A_temp(5,17) = 1;
    A_temp(6,18) = 1;
    A_temp(7,23) = 1;
    A_temp(8,26) = 1;
    Aeq = [Aeq; A_temp];
    beq = [beq; zeros(8,1)];
end
if [size(p_coeff) size(u_coeff)] == [6 6 6 6]
    A_temp = zeros(12, 36);
    A_temp(1,7) = 1;
    A_temp(2,12) = 1;
    A_temp(3,13) = 1;
    A_temp(4,14) = 1;
    A_temp(5,17) = 1;
    A_temp(6,18) = 1;
    A_temp(7,7+18) = 1;
    A_temp(8,12+18) = 1;
    A_temp(9,13+18) = 1;
    A_temp(10,14+18) = 1;
    A_temp(11,17+18) = 1;
    A_temp(12,18+18) = 1;
    Aeq = [Aeq; A_temp];
    beq = [beq; zeros(12, 1)];
end

⌨️ 快捷键说明

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