Spectral-Correlation

所属分类:matlab编程
开发工具:matlab
文件大小:6KB
下载次数:29
上传日期:2011-09-12 09:45:40
上 传 者holomm
说明:  Cyclic Power Spectral Density \tab\tab\tab of signals X and Y using Welch s average

文件列表:
Pack Cyclic Spectral Correlation\SCoh_W.m (5633, 2007-09-21)
Pack Cyclic Spectral Correlation\CPS_W.m (4373, 2007-09-21)
Pack Cyclic Spectral Correlation (0, 2007-09-21)

{\rtf1\ansi\ansicpg1252\deff0\deflang1036{\fonttbl{\f0\fnil\fcharset0 Courier New;}{\f1\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 CPS_W.m\tab\tab estimates the (cross) Cyclic Power Spectral Density \tab\tab\tab of signals X and Y using Welch's averaged \tab\tab\tab\tab periodogram method.\par \par SCOH_W.m\tab\tab estimates the coherence of signals X and Y using \tab\tab\tab Welch's averaged periodogram method.\par \par \par \ul\b Input and output arguments\ulnone\b0\par Both functions are used in the same way. For example\par \par Spec = CPS_W(y,x,alpha,nfft,Noverlap,Window,opt,P)\par \par returns the structure:\par Spec.S = Cyclic Power Spectrum vector\par Spec.f = vector of frequencies\par Spec.K = number of blocks\par Spec.Varduc = Variance Reduction factor\par Spec.CI = P*100% confidence interval for Spec.CPS.\par \par The input arguments nfft, Noverlap, Window and P are as in function PSD.m or PWELCH.m of Matlab. Denoting by Nwind the window length, it is recommended to use nfft = 2*NWind and Noverlap = 2/3*Nwind (hanning window) or Noverlap = 1/2*Nwind (half-sine window).\par Note : use analytic signal to avoid correlation between + and - frequencies\par (For more details, type "help CPS_W" and "help SCOH_W" at the Matlab prompt.)\par \f1\par \ul\b Usage\ulnone\b0\par \f0 CPS_W and SCOH_W operate at one cyclic frequency alpha only. In order to scan a full domain of the \{f;alpha\} plane, it is necessary to loop over alpha. The largest allowable increment of alpha (i.e. the cyclic frequency resolution) is 1/L where L is the signal length (never bypass this limit, or the results will be undersampled -- if cyclic resolution 1/L is deemed too fine with regard to computational demand, then the good solution is simply to shorten the signal length L). The following example illustrates the methodology:\par \par load x\par L = length(x);\tab\tab % signal length\par Nw = 256;\tab\tab\tab % window length\par Nv = fix(2/3*Nw);\tab\tab % block overlap\par nfft = 2*Nw;\tab\tab % FFT length\par da = 1/L;\tab\tab\tab % cyclic frequency resolution\par a1 = 51;\tab\tab\tab % first cyclic frequency bin to scan\par a2 = 200\tab\tab\tab % last cyclic frequency bin to scan\par \par C = zeros(nfft,a2-a1+1);\par S = zeros(nfft,a2-a1+1);\par for k = a1:a2;\par \tab Coh = SCoh_W(x,x,k/L,nfft,Nv,Nw,'sym',.01);\par \tab C(:,k-a1+1) = Coh.C;\par \tab S(:,k-a1+1) = Coh.S;\par \tab waitbar((k-a1+1)/(a2-a1+1))\par end\par \par alpha = (a1:a2)*da;\par figure\par imagesc(alpha,Coh.f(1:nfft/2),abs(S(1:nfft/2,:))),\par colormap(jet),colorbar,axis xy,title('Cyclic Spectral Density'),xlabel('\\alpha'),ylabel('f')\par figure\par imagesc(alpha,Coh.f(1:nfft/2),abs(C(1:nfft/2,:))),\par colormap(jet),colorbar,axis xy,title('Cyclic Spectral Coherence'),xlabel('\\alpha'),ylabel('f')\par figure\par plot(Coh.f(1:nfft/2),abs(C(1:nfft/2,[74:76])).^2,Coh.f(1:nfft/2),Coh.thres*ones(1,nfft/2),'m:')\par title('Squared magnitude Cyclic Spectral Coherence and its 1% level of significance'),ylabel('f'),legend(['\\alpha = ',num2str((74+a1)*da)],['\\alpha = ',num2str((75+a1)*da)],['\\alpha = ',num2str((76+a1)*da)])\par Coh.Varduc\par \par \par \ul\b Parameter setting\ulnone\b0\par The setting of Nw should achieve a good compromise between a fine frequency resolution 1/Nw and a statistically stable result (bias-variance trade-off). Our recommendation is to set Nw small enough so that the variance reduction factor returned by Spec.Varduc is no larger than 1/30. Values on the order of 1/100 are ideal.\par \par \ul\b Reference\ulnone\b0\par J. Antoni, "Cyclic Spectral Analysis in Practice", Mechanical Systems and Signal Processing, Volume 21, Issue 2 , February 2007, Pages 597-630.\par \par \f1\par }

近期下载者

相关文件


收藏者