在时频分析工具箱里面,有个计算WVD的tfrwv函数,这个函数关键部分本人看不懂,请大家帮个忙.
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:英语作业 时间:2024/08/08 17:00:23
在时频分析工具箱里面,有个计算WVD的tfrwv函数,这个函数关键部分本人看不懂,请大家帮个忙.
function [tfr,t,f] = tfrwv(x,t,N,trace) %x是线性调频信号
%TFRWV\x05Wigner-Ville time-frequency distribution.
%\x05[TFR,T,F]=TFRWV(X,T,N,TRACE) computes the Wigner-Ville distribution
%\x05of a discrete-time signal X,
%\x05or the cross Wigner-Ville representation between two signals.
%
%\x05X :signal if auto-WV,or [X1,X2] if cross-WV.
%\x05T :time instant(s) (default :1:length(X)).
%\x05N :number of frequency bins (default :length(X)).
%\x05TRACE :if nonzero,the progression of the algorithm is shown
%\x05 (default :0).
%\x05TFR :time-frequency representation.When called without
%\x05 output arguments,TFRWV runs TFRQVIEW.
%\x05F :vector of normalized frequencies.
%
%\x05Example :
%\x05 sig=fmlin(128,0.1,0.4); tfrwv(sig);
%
%\x05See also all the time-frequency representations listed in
%\x05the file CONTENTS (TFR*)
%\x05F.Auger,May-August 1994,July 1995.
%\x05Copyright (c) 1996 by CNRS (France).
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License,or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not,write to the Free Software
% Foundation,Inc.,51 Franklin St,Fifth Floor,Boston,MA 02110-1301 USA
if (nargin == 0),
error('At least one parameter required');
end;
[xrow,xcol] = size(x);
if (nargin == 1),
t=1:xrow; N=xrow ; trace=0;
elseif (nargin == 2),
N=xrow ; trace=0;
elseif (nargin == 3),
trace = 0;
end;
if (N2),
error('X must have one or two columns');
elseif (trow~=1),
error('T must only have one row');
elseif (2^nextpow2(N)~=N),
fprintf('For a faster computation,N should be a power of two\n');
end;
tfr= zeros (N,tcol);
if trace,disp('Wigner-Ville distribution'); end;
for icol=1:tcol,%这个for循环看不懂
ti= t(icol); taumax=min([ti-1,xrow-ti,round(N/2)-1]);
tau=-taumax:taumax; indices= rem(N+tau,N)+1;
tfr(indices,icol) = x(ti+tau,1) .* conj(x(ti-tau,xcol));
tau=round(N/2);
if (ti=tau+1),
tfr(tau+1,icol) = 0.5 * (x(ti+tau,1) * conj(x(ti-tau,xcol)) + ...
x(ti-tau,1) * conj(x(ti+tau,xcol))) ;
end;
if trace,disprog(icol,tcol,10); end;
end;
tfr= fft(tfr);
if (xcol==1),tfr=real(tfr); end ;
if (nargout==0),
tfrqview(tfr,x,t,'tfrwv');
elseif (nargout==3),
f=(0.5*(0:N-1)/N)';
end;
function [tfr,t,f] = tfrwv(x,t,N,trace) %x是线性调频信号
%TFRWV\x05Wigner-Ville time-frequency distribution.
%\x05[TFR,T,F]=TFRWV(X,T,N,TRACE) computes the Wigner-Ville distribution
%\x05of a discrete-time signal X,
%\x05or the cross Wigner-Ville representation between two signals.
%
%\x05X :signal if auto-WV,or [X1,X2] if cross-WV.
%\x05T :time instant(s) (default :1:length(X)).
%\x05N :number of frequency bins (default :length(X)).
%\x05TRACE :if nonzero,the progression of the algorithm is shown
%\x05 (default :0).
%\x05TFR :time-frequency representation.When called without
%\x05 output arguments,TFRWV runs TFRQVIEW.
%\x05F :vector of normalized frequencies.
%
%\x05Example :
%\x05 sig=fmlin(128,0.1,0.4); tfrwv(sig);
%
%\x05See also all the time-frequency representations listed in
%\x05the file CONTENTS (TFR*)
%\x05F.Auger,May-August 1994,July 1995.
%\x05Copyright (c) 1996 by CNRS (France).
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License,or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not,write to the Free Software
% Foundation,Inc.,51 Franklin St,Fifth Floor,Boston,MA 02110-1301 USA
if (nargin == 0),
error('At least one parameter required');
end;
[xrow,xcol] = size(x);
if (nargin == 1),
t=1:xrow; N=xrow ; trace=0;
elseif (nargin == 2),
N=xrow ; trace=0;
elseif (nargin == 3),
trace = 0;
end;
if (N2),
error('X must have one or two columns');
elseif (trow~=1),
error('T must only have one row');
elseif (2^nextpow2(N)~=N),
fprintf('For a faster computation,N should be a power of two\n');
end;
tfr= zeros (N,tcol);
if trace,disp('Wigner-Ville distribution'); end;
for icol=1:tcol,%这个for循环看不懂
ti= t(icol); taumax=min([ti-1,xrow-ti,round(N/2)-1]);
tau=-taumax:taumax; indices= rem(N+tau,N)+1;
tfr(indices,icol) = x(ti+tau,1) .* conj(x(ti-tau,xcol));
tau=round(N/2);
if (ti=tau+1),
tfr(tau+1,icol) = 0.5 * (x(ti+tau,1) * conj(x(ti-tau,xcol)) + ...
x(ti-tau,1) * conj(x(ti+tau,xcol))) ;
end;
if trace,disprog(icol,tcol,10); end;
end;
tfr= fft(tfr);
if (xcol==1),tfr=real(tfr); end ;
if (nargout==0),
tfrqview(tfr,x,t,'tfrwv');
elseif (nargout==3),
f=(0.5*(0:N-1)/N)';
end;
![在时频分析工具箱里面,有个计算WVD的tfrwv函数,这个函数关键部分本人看不懂,请大家帮个忙.](/uploads/image/z/8705840-32-0.jpg?t=%E5%9C%A8%E6%97%B6%E9%A2%91%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%E7%AE%B1%E9%87%8C%E9%9D%A2%2C%E6%9C%89%E4%B8%AA%E8%AE%A1%E7%AE%97WVD%E7%9A%84tfrwv%E5%87%BD%E6%95%B0%2C%E8%BF%99%E4%B8%AA%E5%87%BD%E6%95%B0%E5%85%B3%E9%94%AE%E9%83%A8%E5%88%86%E6%9C%AC%E4%BA%BA%E7%9C%8B%E4%B8%8D%E6%87%82%2C%E8%AF%B7%E5%A4%A7%E5%AE%B6%E5%B8%AE%E4%B8%AA%E5%BF%99.)
工作台面采用独特的注塑成型,强度更高,光洁的表面处理更容易拭擦油污,把手采用软胶整体注塑加工,更加符合人机工程--注塑面板可承受台虎钳作业
在时频分析工具箱里面,有个计算WVD的tfrwv函数,这个函数关键部分本人看不懂,请大家帮个忙.
有个函数里的语句看不懂求大神分析
下图是个工具箱,下半部分是一个宽20cm,长40cm,高25cm的长方体,上半部分是圆柱的一半,请计算这个工具箱的体积和
在看二次函数的题 有个变形看不懂
lagrange 函数在Matlab的哪个工具箱中
请详细解释下MATLAB工具箱中sim函数的用法,
matlab自己编写的函数可以包含工具箱函数吗
函数极限例题如下图:虽然此题有分析 但是我还是看不懂,请各位同学老师 在此感恩不尽.主要不能理解的是题中分析
matlab里面有没有只要小数部分的函数命令
怎样使用Matlab工具箱函数
求MATLAB工具箱函数汇总
我是个六年级的小学生,现有一道不会做的数学题,网上搜索的答案都是函数,看不懂,请大家帮忙解答好吗