matlab里fno,matlab信号处理 程序哪里出错?

满意答案

00e27ab806e4881f8254fe7ae8741834.png

hensheng10a

2013.09.11

00e27ab806e4881f8254fe7ae8741834.png

采纳率:40%    等级:11

已帮助:11809人

报错上说的是tfrwv函数未定义,也就是matlab自带函数库里面没有这个函数

这个函数应该是网上某个人编的工具箱里面的一个子函数

function [tfr,t,f] = tfrwv(x,t,N,trace);

%TFRWV Wigner-Ville time-frequency distribution.

% [TFR,T,F]=TFRWV(X,T,N,TRACE) computes the Wigner-Ville distribution

% of a discrete-time signal X,

% or the cross Wigner-Ville representation between two signals.

%

% X : signal if auto-WV, or [X1,X2] if cross-WV.

% T : time instant(s) (default : 1:length(X)).

% N : number of frequency bins (default : length(X)).

% TRACE : if nonzero, the progression of the algorithm is shown

% (default : 0).

% TFR : time-frequency representation. When called without

% output arguments, TFRWV runs TFRQVIEW.

% F : vector of normalized frequencies.

%

% Example :

% sig=fmlin(128,0.1,0.4); tfrwv(sig);

%

% See also all the time-frequency representations listed in

% the file CONTENTS (TFR*)

% F. Auger, May-August 1994, July 1995.

% 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

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 (N<0),

error('N must be greater than zero');

end;

[trow,tcol] = size(t);

if (xcol==0)|(xcol>2),

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,

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<=xrow-tau)&(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;

以上函数仅供参考

00分享举报

很实用的时频分析工具箱,包括短时傅叶正反变换等,很好,很强大哦~~分享给大家,包括以下函数的源代码: % sigmerge - Add two signals with given energy ratio in dB. % % Choice of the Instantaneous Amplitude % amexpo1s - Generate one-sided exponential amplitude modulation. % amexpo2s - Generate bilateral exponential amplitude modulation. % amgauss - Generate gaussian amplitude modulation. % amrect - Generate rectangular amplitude modulation. % amtriang - Generate triangular amplitude modulation. % % Choice of the Instantaneous Frequency % fmconst - Signal with constant frequency modulation. % fmhyp - Signal with hyperbolic frequency modulation. % fmlin - Signal with linear frequency modulation. % fmodany - Signal with arbitrary frequency modulation. % fmpar - Signal with parabolic frequency modulation. % fmpower - Signal with power-law frequency modulation. % fmsin - Signal with sinusoidal frequency modulation. % gdpower - Signal with a power-law group delay. % % Choice of Particular Signals % altes - Altes signal in time domain. % anaask - Amplitude Shift Keyed (ASK) signal. % anabpsk - Binary Phase Shift Keyed (BPSK) signal. % anafsk - Frequency Shift Keyed (FSK) signal. % anapulse - Analytic projection of unit amplitude impulse signal. % anaqpsk - Quaternary Phase Shift Keyed (QPSK) signal. % anasing - Lipschitz singularity. % anastep - Analytic projection of unit step signal. % atoms - Linear combination of elementary Gaussian wave packets. % dopnoise - Generate complex Doppler random signal. % doppler - Generate complex Doppler signal. % klauder - Klauder wavelet in time domain. % mexhat - Mexican hat wavelet in time domain. % tftb_window - Window generation (previously window.m). % % Addition of Noise % noisecg - Analytic complex gaussian noise. % noisecu - Analytic complex uniform noise. % % Modification % scale - Scale signal using Mellin transform. % % % Processing Files % % Time-Domain Processing % ifestar2 - Instantaneous frequency estimation using AR2 modelisation. % instfreq - Instantaneous frequency estimation. % loctime - Time localization characteristics. % % Frequency-Domain Processing % fmt - Fast Mellin transform % ifmt - Inverse fast Mellin transform. % locfreq - Frequency localization characteristics. % sgrpdlay - Group delay estimation. % % Linear Time-Frequency Processing % tfrgabor - Gabor representation. % tfrstft - Short time Fourier transform. % % Bilinear Time-Frequency Processing in the Cohen's Class % tfrbj - Born-Jordan distribution. % tfrbud - Butterworth distribution. % tfrcw - Choi-Williams distribution. % tfrgrd - Generalized rectangular distribution. % tfrmh - Margenau-Hill distribution. % tfrmhs - Margenau-Hill-Spectrogram distribution. % tfrmmce - MMCE combination of spectrograms. % tfrpage - Page distribution. % tfrpmh - Pseudo Margenau-Hill distribution. % tfrppage - Pseudo Page distribution. % tfrpwv - Pseudo Wigner-Ville distribution. % tfrri - Rihaczek distribution. % tfrridb - Reduced interference distribution (Bessel window). % tfrridh - Reduced interference distribution (Hanning window). % tfrridn - Reduced interference distribution (binomial window). % tfrridt - Reduced interference distribution (triangular window). % tfrsp - Spectrogram. % tfrspwv - Smoothed Pseudo Wigner-Ville distribution. % tfrwv - Wigner-Ville distribution. % tfrzam - Zhao-Atlas-Marks distribution. % % Bilinear Time-Frequency Processing in the Affine Class % tfrbert - Unitary Bertrand distribution. % tfrdfla - D-Flandrin distribution. % tfrscalo - Scalogram, for Morlet or Mexican hat wavelet. % tfrspaw - Smoothed Pseudo Affine Wigner distributions. % tfrunter - Unterberger distribution, active or passive form. % % Reassigned Time-Frequency Processing % tfrrgab - Reassigned Gabor spectrogram. % tfrrmsc - Reassigned Morlet Scalogram time-frequency distribution. % tfrrpmh - Reassigned Pseudo Margenau-Hill distribution. % tfrrppag - Reassigned Pseudo Page distribution. % tfrrpwv - Reassigned Pseudo Wigner-Ville distribution. % tfrrsp - Reassigned Spectrogram. % tfrrspwv - Reassigned Smoothed Pseudo WV distribution. % % Ambiguity Functions % ambifunb - Narrow band ambiguity function. % ambifuwb - Wide band ambiguity function. % % Post-Processing or Help to the Interpretation % friedman - Instantaneous frequency density. % holder - Estimate the Holder exponent through an affine TFR. % htl - Hough transform for detection of lines in images. % margtfr - Marginals and energy of a time-frequency representation. % midscomp - Mid-point construction used in the interference diagram. % momftfr - Frequency moments of a time-frequency representation. % momttfr - Time moments of a time-frequency representation. % plotsid - Schematic interference diagram of FM signals. % renyi - Measure Renyi information. % ridges - Extraction of ridges. % tfrideal - Ideal TFR for given frequency laws. % % Visualization & backup % plotifl - Plot normalized instantaneous frequency laws. % tfrqview - Quick visualization of time-frequency representations. % tfrview - Visualization of time-frequency representations. % tfrparam - Return the paramaters needed to display (or save) a TFR. % tfrsave - Save the parameters of a time-frequency representation. % % % Other % disprog - Display progression of a loop. % divider - Find dividers of integer such that product equals integer. % dwindow - Derive a window. % integ - Approximate integral. % integ2d - Approximate 2-D integral. % izak - Inverse Zak transform. % istfr1 - returns true if a distribution is Cohen's class type 1 (spectrogram) % istfr2 - returns true if a distribution is Cohen's class type 2 (Wigner-Ville) % istfraff - returns true is a distribution is an affine class member % kaytth - Kay-Tretter filter computation. % modulo - Congruence of a vector. % movcw4at - Four atoms rotating, analyzed by the Choi-Williams distribution. % movpwdph - Influence of a phase-shift on the interferences of the pWVD. % movpwjph - Influence of a jump of phase on the interferences of the pWVD. % movsc2wv - Movie illustrating the passage from the scalogram to the WVD. % movsp2wv - Movie illustrating the passage from the spectrogram to the WVD. % movwv2at - Oscillating structure of the interferences of the WVD. % odd - Round towards nearest odd value. % sigmerge - Add two signals with given energy ratio in dB. % zak - Zak transform. % griffitc - Test signal example C of Griffiths' paper. % lambdak - Evaluate lambda function for Affine Wigner distribution. % umaxbert - Determination of the maximum value of u for Bertrand distribution. % umaxdfla - Determination of the maximum value of u for D-Flandrin distribution. % umaxunte - Determination of the maximum value of u for Unterberger distribution.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值