📄 zmodfb.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -