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

📄 buildfg.m

📁 Sparse Signal Representation using Overlapping Frames (matlab toolbox)
💻 M
字号:
function Fg=BuildFg(F,G)% BulidFg   Build the Fg matrix from F vector and G matrix 
%           (Fg for type 'g' correspond to F for type 'b' and 'o')
% Fg(n,k,p)=sign*F(q)  <==>  G(n,k,p)=sign*q     and
% Fg(n,k,p)=0          <==>  G(n,k,p)=0 
%
% Fg=BuildFg(F,G);% -----------------------------------------------------------------------------------
% Arguments:
%   Fg        - the general frame Fg, size NxKxP.
%   F         - a vector of all the different variables in F, size Qx1
%   G         - the "mapping" from F to Fg, Fg(n,k,p)=sign*F(q) <==> G(n,k,p)=sign*q 
%               size NxKxP
% -----------------------------------------------------------------------------------
% Note that if G is sparse then Fg will be sparse

%----------------------------------------------------------------------
% Copyright (c) 1999.  Karl Skretting.  All rights reserved.
% Hogskolen in Stavanger (Stavanger University), Signal Processing Group
% Mail:  karl.skretting@tn.his.no   Homepage:  http://www.ux.his.no/~karlsk/
% 
% HISTORY:  dd.mm.yyyy
% Ver. 1.0  27.04.1999  KS: Function made
% Ver. 1.1  18.06.1999  KS: May use three dimensional G and Fg
% Ver. 1.2  10.03.2000  KS: may have negative values in G
% Ver. 1.3  09.01.2001  KS: changed name to BuildFg (from BuildF)
% Ver. 1.4  27.11.2002  KS: moved from ..\Frames to ..\FrameTools%----------------------------------------------------------------------
Mfile='BuildFg';
Display=1;          % should this function display status messsages

if (nargin ~= 2)
   error([Mfile,': wrong number of arguments, see help.']);
end

[N,K,P]=size(G);
Q=size(F,1);
if max(abs(G(:)))>Q
   error([Mfile,': G has too large values.']);
end

G=G(:);
[n1]=find(G>0);
[n2]=find(G<0);
Fg=G;                  % makes Fg sparse if G is sparse
Fg(n1)=F(G(n1));
Fg(n2)=-F(-G(n2));
Fg=reshape(Fg,N,K,P);

return

⌨️ 快捷键说明

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