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

📄 upsampling_2d.m

📁 MATLAB Code for Optimal Quincunx Filter Bank Design Yi Chen July 17, 2006 This file introduces t
💻 M
字号:
function [y, ny] = upsampling_2d(x, nx, M)
% upsampling of a two-dimensional sequence
% input:  x -- original sequence
%        nx -- index of the elements in x at the upperleft corner
%         M -- an integer sampling matrix
% output: y -- upsampled sequence
%        ny -- index of the elements in y at the upperleft corner
% Copyright (c) 2006 Yi Chen

nx0 = nx(1):size(x,1) + nx(1) - 1; nx1 = nx(2):size(x,2) + nx(2) - 1; 
[nx1, nx0] = meshgrid(nx1, nx0);

ny0 = M(1,1)*nx0 + M(1,2)*nx1;
ny1 = M(2,1)*nx0 + M(2,2)*nx1;

ny(1) = min(min(ny0));
ny(2) = min(min(ny1));

ly0 = max(max(ny0)) - min(min(ny0)) + 1;
ly1 = max(max(ny1)) - min(min(ny1)) + 1;
y = zeros(1, ly0*ly1);

iy = reshape(ny0-ny(1)+1+ly0*(ny1-ny(2)), [1, prod(size(x))]);
y(iy) = x(1:prod(size(x)));
y = reshape(y, [ly0, ly1]);

[y, ny] = reduce_size(y, ny, 0);

⌨️ 快捷键说明

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