zmodfb.m

来自「Rotating shafts experience a an elliptic」· M 代码 · 共 54 行

M
54 行
字号
function [Bout,x,y]=zmodfb(y,Fs,NFFT,TD)%[B,x,y]=zmodfb(y,Fs,NFFT)%% compute the forward/backward Campbell/specgtrogram%% INPUT:%	y	(n x 2) each column is measured from a different sensor%                          ///////%                          __%                         |s1|   y(:,1)%                         |__|%                          __%                        /    \    ________|/%                       |      |   | s2    |/   y(:,2)%                        \____/    --------|/%%    Fs		Sampling frequnecy%%   OUTPUT:%		B 	spectrogram/Campbel diagram%		x	x-axis coordinate vector  (time or Speed)%		y	y-axis coordinate vector  (frequency [Hz])%%  use:%		imagesc(x,y,20*log(abs(B))), colormap(jet)% 	   to obtain a plot%% by: 	I. Bucher% Date	6-Sep-95if nargin<2, Fs=1000; endif nargin<3, NFFT=[]; end % i.e. automatic selection of NFFT[B1,F,x]=specgram(y(:,1),NFFT,Fs);[B2 ]=specgram(y(:,2),NFFT);[n m]=size(B1);B=[flipud(B1-i*B2) ; B1(2:n,:)+i*B2(2:n,:)];ny=2*n-1; y=([0:ny-1]/(ny-1) - 0.5)*(Fs);if nargout<1,    if nargin>3        surf(x,(y(:)),(abs(((B)))))        shading interp          figure(gcf)    else   newplot;   imagesc(x,(y(:)),20*log10(abs(((B)))))      colormap(jet)   figure(gcf)endelse,   Bout=B;end 

⌨️ 快捷键说明

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