function tfrqview(tfr,sig,t,method,p1,p2,p3,p4,p5);
%TFRQVIEW Quick visualization of time-frequency representations.
% TFRQVIEW(TFR,SIG,T,METHOD,P1,P2,P3,P4,P5) allows a quick
% visualization of a time-frequency representation.
%
% TFR : time-frequency representation (MxN).
% SIG : signal in time. If unavailable, put sig=[] as input
% parameter. (default : []).
% T : time instants (default : 1:N).
% METHOD : name of chosen representation (default : 'TYPE1').
% See the TFR* files for authorized names.
% TYPE1 : the representation TFR goes in normalized
% frequency from -0.5 to 0.5 ;
% TYPE2 : the representation TFR goes in normalized
% frequency from 0 to 0.5.
% P1...P5 : optional parameters of the representation : run the
% file TFRPARAM(METHOD) to know the meaning of P1..P5
% for your method.
%
% When you use the 'save' option in the main menu, you save all your
% variables as well as two strings, TfrQView and TfrView, in a mat
% file. If you load this file and do eval(TfrQView), you will restart
% the display session under tfrqview ; if you do eval(TfrView), you
% will obtain the exact layout of the screen you had when clicking on
% the 'save' button.
%
% Example :
% sig=fmsin(128); tfr=tfrwv(sig);
% tfrqview(tfr,sig,1:128,'tfrwv');
%
% See also TFRVIEW, TFRSAVE, TFRPARAM.
% F. Auger, September 1994, July 1995
% O. Lemoine, Oct 1995, May-July 1996.
% Copyright (c) 1996 by CNRS (France).
%
% ------------------- CONFIDENTIAL PROGRAM --------------------
% This program can not be used without the authorization of its
% author(s). For any comment or bug report, please send e-mail to
% f.auger@ieee.org
comp=computer;
% Tests on the input arguments
if nargin<1,
error('At least one parameter required');
end
[tfrrow,tfrcol]=size(tfr);
if nargin==1,
sig=[]; t=1:tfrcol; method='type1';
elseif nargin==2,
t=1:tfrcol; method='type1';
elseif nargin==3,
method='type1';
end
[trow,tcol] = size(t);
if (trow~=1),
error('T must only have one row');
end;
if (tfrcol~=tcol),
error('T must have as much elements as tfr has columns');
end;
method=upper(method);
[Nsig,Ncol]=size(sig);
if Ncol>2,
error('SIG must have less than two columns');
end
% Computation of Nf2, the number of interresting points in frequency
method=upper(method);
if strcmp(method,'TFRWV' ) | strcmp(method,'TFRPWV' ) | ...
strcmp(method,'TFRSPWV' ) | strcmp(method,'TFRCW' ) | ...
strcmp(method,'TFRZAM' ) | strcmp(method,'TFRBJ' ) | ...
strcmp(method,'TFRBUD' ) | strcmp(method,'TFRGRD' ) | ...
strcmp(method,'TFRRSPWV') | strcmp(method,'TFRRPWV' ) | ...
strcmp(method,'TFRRIDB' ) | strcmp(method,'TFRRIDH' ) | ...
strcmp(method,'TFRRIDT' ) | strcmp(method,'TFRASPW' ) | ...
strcmp(method,'TFRDFLA' ) | strcmp(method,'TFRSPAW' ) | ...
strcmp(method,'TFRRIDBN') | strcmp(method,'TFRUNTER') | ...
strcmp(method,'TFRBERT' ) | strcmp(method,'TFRSCALO') | ...
strcmp(method,'TYPE2' ),
Nf2=tfrrow;
elseif strcmp(method,'TFRPMH' )| strcmp(method,'TFRRPMH' )| ...
strcmp(method,'TFRSP' )| strcmp(method,'TFRRSP' )| ...
strcmp(method,'TFRPPAGE')| strcmp(method,'TFRRPPAG')| ...
strcmp(method,'TFRMHS' )| strcmp(method,'TFRRGAB' )| ...
strcmp(method,'TFRMH' )| strcmp(method,'TFRMMCE' )| ...
strcmp(method,'TFRRMSC' )| strcmp(method,'TFRPAGE' )| ...
strcmp(method,'TFRGABOR')| strcmp(method,'TFRRI' )| ...
strcmp(method,'TFRMSC' )| strcmp(method,'TYPE1' )| ...
strcmp(method,'TFRSTFT' ),
Nf2=tfrrow/2;
else
error('Unknown representation. Use type1 or type2');
end;
% Computation of freq (vector of frequency samples)
if strcmp(method,'TFRASPW' ) | strcmp(method,'TFRSCALO') | ...
strcmp(method,'TFRDFLA' ) | strcmp(method,'TFRSPAW' ) | ...
strcmp(method,'TFRUNTER') | strcmp(method,'TFRBERT' ),
freq=eval(['p',num2str(nargin-4)]); % last input argument is freqs.
else
freq=(0.5*(0:Nf2-1)/Nf2);
end
% Initialization of the current figure
zoom off; clf;
set(gcf,'Resize','On','NextPlot','Add');
% Initialization of the variables
if exist('options.mat'),
load options
else
threshold=5.0;
linlogtfr=0;
linlogspec=1;
levelnumb=6;
colmap=1;
display=1;
layout=1;
iscolorbar=0;
isgridsig=0;
isgridspe=0;
isgridtfr=0;
issig=0;
isspec=0;
end
choice=4;
Grid=1;
displayold=1;
fs=1.0;
if ((layout>=2 & layout<=4) & sig==[]),
layout=1;
end
% Initialization of the axes
axcb = axes('Units','normal','Visible','off','Box','On');
axsig = axes('Units','normal','Visible','off','Box','On');
axspec = axes('Units','normal','Visible','off','Box','On');
axtfr = axes('Units','normal','Visible','off','Box','On');
if comp(1:2)=='PC',
set(axsig ,'fontsize',10);
set(axspec,'fontsize',10);
set(axtfr ,'fontsize',10);
end
set(gcf,'UserData',[axcb axsig axspec axtfr]);
% Test of analycity
if sig~=[],
for k=1:Ncol,
spec(:,k)=abs(fft(sig(min(t):max(t),k))).^2; Nsp=length(spec);
spec1=sum(spec(1:Nsp/2,k));
spec2=sum(spec(Nsp/2+1:Nsp,k));
if spec2>spec1/10,
disp('Be careful : the signal is not analytic!');
end
end
end
% Test of reality
if (Ncol==2 & ~isreal(tfr)),
disp('Cross distribution. As the result is complex, we display the real part.');
tfr=real(tfr);
end
while choice~=12,
axes(axtfr); % The current axis is the tfr axis
if (display~=7 & choice~=2 & choice~=3 & choice<8), % Call to tfrview
linlog=linlogtfr+2*linlogspec;
if choice==4,
access=3;
else
access=1;
end
state=issig+2*iscolorbar;
isgrid=isgridsig+2*isgridspe+4*isgridtfr;
param = [display,linlog,threshold,levelnumb,Nf2,layout,access,state,fs,isgrid];
map=colormap;
if (nargin<=4),
tfrview(tfr,sig,t,method,param,map);
elseif (nargin==5),
tfrview(tfr,sig,t,method,param,map,p1);
elseif (nargin==6),
tfrview(tfr,sig,t,method,param,map,p1,p2);
elseif (nargin==7),
tfrview(tfr,sig,t,method,param,map,p1,p2,p3);
elseif (nargin==8),
tfrview(tfr,sig,t,method,param,map,p1,p2,p3,p4);
elseif (nargin==9),
tfrview(tfr,sig,t,method,param,map,p1,p2,p3,p4,p5);
end;
elseif (display==7), % keep in mind the last value of display
display=displayold;
end
if (linlogtfr==0), % Lin/log scale of the tfr
linlogstr='Change to a logarithmic scale';
else
linlogstr='Change to a linear scale';
end;
% Main menu
choice=menu ('TFRQVIEW MENU :',...
'Change the display mode',...
'Change the display layout',...
'Change the color map',...
'Change the sampling frequency',...
'Change the threshold',...
linlogstr,...
'Change the number of levels',...
'Grid',...
'Save',...
'Save options',...
'Print',...
'Close');
if ((choice==9 | choice==11) & comp(1:2)~='PC'),
if exist('workdir.mat'),
load workdir;
else
Path=pwd;
str1=[' The current directory is ',Path];
disp(str1); disp('');
continue=0;
while continue==0,
continue=1;
str2=' Name of the directory (with full path) on which the files will be saved : ';
disp(str2);
PathWorkDir=input(' > ','s');
if (exist(PathWorkDir)~=2),
rep=input(' This directory doesn''t exist. Do you want to create it (y/n) ? ','s');
if upper(rep)=='Y',
eval(['!mkdir ',PathWorkDir]);
else
continue=0;
end
end
end
if PathWorkDir(length(PathWorkDir))~='/',
PathWorkDir=[PathWorkDir,'/'];
end
save workdir PathWorkDir;
end
end
if (choice==1), % Change the display mode
display=menu('DISPLAY MODE :',...
'Contour',...
'Imagesc',...
'Pcolor',...
'Surf',...
'Mesh',...
'Cancel');
elseif (choice==2)
没有合适的资源?快使用搜索试试~ 我知道了~
FRFTl滤波、结合仿射变换图像加密代码
共34个文件
m:34个
需积分: 12 20 下载量 60 浏览量
2016-06-08
09:24:19
上传
评论 1
收藏 31KB RAR 举报
温馨提示
汇总FRFT一维、二维代码,一些FRFT对LFM滤波,一种仿射变换和2Dfrft加密算法
资源推荐
资源详情
资源评论
收起资源包目录
FRFT.rar (34个子文件)
Disfrst.m 1KB
jisuanfrftduichirplvbo.m 2KB
shiftud.m 176B
fangshe.m 1KB
PSNR.m 2KB
Disfrft.m 2KB
SNR_Detection.m 357B
fmlin.m 2KB
jisuan.m 2KB
DFPei.m 3KB
jisuanchirpjieshubianbuchang.m 1KB
frft2d.m 367B
magicreplace.m 7KB
replacemagicfun.m 6KB
jisuanbogaosixing.m 1KB
WMembed.m 2KB
tfrwv.m 4KB
nwcrop.m 193B
frft2.m 360B
jisuanbozishixingX.m 1KB
LFMtest1.m 2KB
jisuantu1.m 835B
jisuantu2junfangwuchaX.m 3KB
centralcrop.m 226B
jisuanchirpcanshu.m 2KB
jisuan2frft.m 730B
Disfrct.m 2KB
jisuantu3jiami.m 2KB
addnoise.m 203B
frft.m 1KB
jisuanXchuozhongzhilvboX.m 1KB
tfrqview.m 17KB
jisuantuX123X.m 2KB
jisuanbojuchixing.m 2KB
共 34 条
- 1
资源评论
LA12306
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功