日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

瞬时频率估计方法

發(fā)布時(shí)間:2025/3/15 编程问答 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 瞬时频率估计方法 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

關(guān)于瞬時(shí)頻率估計(jì),前面雖說暫時(shí)放一下,但心中始終還是念念不忘,因?yàn)檫@是一道繞不過去的坎。在網(wǎng)上多次搜索、了解其現(xiàn)狀。感覺是關(guān)注這件事的人很多,方法很多,但問題也很多。在網(wǎng)上能找到的方法,簡(jiǎn)單歸結(jié)如下:

?

相位差分法

相位建模法

Teager能量算子法

跨零點(diǎn)法

求根估計(jì)法

反余弦法

時(shí)頻分布法(譜峰檢測(cè)法?)

Shekel方法

Teager-Kaiser方法

解析信號(hào)法(HHT法)

?

????其中有些只適用于單分量信號(hào)估計(jì),有些可適用于多分量信號(hào)估計(jì)。由于單分量信號(hào)是多分量信號(hào)的特例,所以后者包括前者。

?

????這些方法,有些我目前只能找到其名字,找不到原理論述;有些可以找到原理論述,但絕大多數(shù)方法都找不到現(xiàn)成的程序(收費(fèi)網(wǎng)站內(nèi)情況未知)。可以說,這些方法大多都只是用來寫寫文章、做做腦保健操而已,實(shí)際使用的人很少。如網(wǎng)上找到的一則“反余弦法瞬時(shí)頻率估計(jì)”程序(見“附一”),它把分析信號(hào)的幅值都“規(guī)一化”了,因此它只能處理理想中的“平穩(wěn)信號(hào)”,不能處理現(xiàn)實(shí)中的“非平穩(wěn)信號(hào)”。

?

????比較起來,現(xiàn)在使用解析信號(hào)法(HHT)估計(jì)瞬時(shí)頻率的人是最多的,大有“眾望所歸”的趨勢(shì)。此方法就是本人在前幾篇博文中使用的方法。可是,它存在的問題,我在博文《18、關(guān)于IMF分量瞬時(shí)頻率跳變問題的研究》也說的很詳細(xì)了。?既然現(xiàn)在最流行、影響最大的瞬時(shí)頻率估計(jì)法都是這樣,因此我有理由對(duì)其它所有瞬時(shí)頻率估計(jì)方法,都感到?jīng)]有信心。

?

????解析信號(hào)法(HHT)估計(jì)瞬時(shí)頻率用的是hhspectrum函數(shù),hhspectrum函數(shù)是通過調(diào)用時(shí)頻工具箱中的instfreq函數(shù)來進(jìn)行瞬時(shí)頻率估計(jì)的。時(shí)頻工具箱中還有一個(gè)使用AR(2)模型進(jìn)行瞬時(shí)頻率估計(jì)的函數(shù)ifestar2(因?yàn)槌齾s注釋部分,程序正文很短,所以我把它也附在后面,方便閱讀。見“附二”)。

?

????現(xiàn)在來看看用ifestar2函數(shù)估計(jì)脈搏序列各IMF的瞬時(shí)頻率:

?

imfMBrd=emd(MB2917_rd);

imfMBrd=imfMBrd';

?

lx=size(imfMBrd,1);?

?

for i=1:size(imfMBrd,2)-1;

x=imfMBrd(:,i);

[fnorm,t,rejratio]=ifestar2(x);

M{i,1}=fnorm;

M{i,2}=t;

M{i,3}=rejratio;?

end

?

fid1=figure(1);

set(fid1,'position',[50,10,700,1050])

?

li=6;
lj=1;

for i=1:li
for j=1:lj
n=(i-1)*lj+j;
s(n)=subplot(li,lj,n);

?

set(s(n),'position',[0.06+(j-1)/lj,0.005+(li-0.95*(0.999^i)*i)/li,0.92/lj,0.72/li]);


plot(M{n,2},M{n,1})
xlim([0 lx+100])
title(['fnorm',int2str(n)])
end
end

?

????運(yùn)行 得

????圖30-1

?

fid2=figure(2);

set(fid2,'position',[50,10,700,1050])

?

li=7;%
lj=1;

for i=1:li
for j=1:lj
n=(i-1)*lj+j;
s(n)=subplot(li,lj,n);

?

set(s(n),'position',[0.06+(j-1)/lj,(li-0.94*(0.999^i)*i)/li,0.92/lj,0.65/li]);


plot(M{n+6,2},M{n+6,1})
xlim([0 lx+10])
title(['fnorm',int2str(n+6)])
end
end

?

????運(yùn)行得

????圖30-2

?

????可見,IMF除了第10、第13分量以外,瞬時(shí)頻率都有很嚴(yán)重的“跳變”,比HHT法更嚴(yán)重。從接近“0Hz”頻率的地方跳到“0.5Hz”附近,如果都是這樣還比較好區(qū)分,但那些比“0.25Hz”稍高的頻率,你怎么知道它是否經(jīng)過跳變呢?如果不是,那多大的頻率是由負(fù)頻跳變而來?界限在哪里?從物理意義來講,正頻率與負(fù)頻率是截然不同的頻率,一個(gè)是正向旋轉(zhuǎn)所形成,一個(gè)是負(fù)向旋轉(zhuǎn)所形成。頻率表示方法,這是人類創(chuàng)造的理論,不管現(xiàn)實(shí)如何,用“0.49Hz”來表示“-0.01Hz”,這就叫“削足適履”。

?

????以前多次講過,現(xiàn)實(shí)信號(hào)的頻率,一般情況下應(yīng)該是連續(xù)、光滑的,所以我們的頻率表示方法好不好,也應(yīng)該以此為最高準(zhǔn)則,是正頻率就表示為正頻率,是負(fù)頻率就表示為負(fù)頻率。除非能證明現(xiàn)實(shí)信號(hào)頻率的確發(fā)生了跳變,否則頻率表示當(dāng)中出現(xiàn)了“跳變”,都是不對(duì)的。
?

????下面將前面兩張圖的時(shí)間軸放大看看:

?

fid3=figure(3);

set(fid3,'position',[50,10,700,1050])

?

li=6;
lj=1;

for i=1:li
for j=1:lj
n=(i-1)*lj+j;
s(n)=subplot(li,lj,n);

?

set(s(n),'position',[0.06+(j-1)/lj,0.005+(li-0.95*(0.999^i)*i)/li,0.92/lj,0.70/li]);


stem(M{n,2},M{n,1})
xlim([850 950])
title(['fnorm',int2str(n)])
end
end

?

????運(yùn)行 得



????圖30-3

?

?

fid4=figure(4);

set(fid4,'position',[50,10,700,1050])

?

li=7;
lj=1;

for i=1:li
for j=1:lj
n=(i-1)*lj+j;
s(n)=subplot(li,lj,n);

?

set(s(n),'position',[0.06+(j-1)/lj,(li-0.94*(0.999^i)*i)/li,0.92/lj,0.60/li]);


stem(M{n+6,2},M{n+6,1})
xlim([7530 7580])
title(['fnorm',int2str(n+6)])
end
end?



????圖30-4


????可以看到,圖30-3的第1、第2分量頻率、圖30-4的第1分量頻率,都有采樣點(diǎn)上沒有頻率值的情況發(fā)生(不是“0Hz”情況哦)。其實(shí)每一個(gè)分量中都有這樣的“瞬時(shí)頻率無定義點(diǎn)”,只是因?yàn)樵谕粋€(gè)繪圖窗口將它們都繪出來不方便,所以就免了。

?

for i=1:size(imfMBrd,2)-1;

lf(i)=length(M{i,1})

lt(i)=length(M{i,2})

rj(i)=M{i,3}

end

?

lf

lt

rj

lf =

??Columns 1 through 7

?????33143?????34589?????34843?????34901?????34945?????34961?????34980

??Columns 8 through 13

?????34993?????34993?????35001?????35000?????34999?????35001


lt =

??Columns 1 through 7

?????33143?????34589?????34843?????34901?????34945?????34961?????34980

??Columns 8 through 13

?????34993?????34993?????35001?????35000?????34999?????35001


rj =

??Columns 1 through 8

???0.9469???0.9882???0.9955???0.9971???0.9984???0.9989???0.9994???0.9998

??Columns 9 through 13

???0.9998???1.0000???1.0000???0.9999???1.0000

????lf、lt是各IMF分量作了頻率估算的頻率點(diǎn)、采樣點(diǎn)長(zhǎng)度,rj是作了頻率估算的采樣點(diǎn)長(zhǎng)度占整個(gè)采樣點(diǎn)長(zhǎng)度的比例。

?

????這是由ifestar2函數(shù)中的indices = find(den>0)造成的。與“反余弦法瞬時(shí)頻率估計(jì)”一樣,它能作頻率估算的地方,它就作了估算;它無法作估算的地方,它就擱那不管了。這是什么態(tài)度嘛!

?

?

?

?

?

?

?

附一:網(wǎng)上找到的“反余弦法瞬時(shí)頻率估計(jì)”程序代碼

?

function [f,a] = faacos(data, dt)

% The function FAACOS generates an arccosine frequency and amplitude
% of previously normalized data(n,k), where n is the length of the
% time series and k is the number of IMFs.
%
% FAACOS finds the frequency by applying
% the arccosine function to the normalized data and
% checking the points where slope of arccosine phase changes.
% Nature of the procedure suggests not to use the function
% to process the residue component.
%
% Calling sequence-
% [f,a] = faacos(data, dt)
%
% Input-
%??data??- 2-D matrix of IMF components
%??dt???- time increment per point
% Output-
%??f???- 2-D matrix f(n,k) that specifies frequency
%??a???- 2-D matrix a(n,k) that specifies amplitude
%
% Used by-
%??FA

% Kenneth Arnold (NASA GSFC)??Summer 2003, Initial

%----- Get dimensions
[npts,nimf] = size(data);

%----- Flip data if necessary
flipped=0;
if (npts < nimf)
flipped=1;
data=data';
[npts,nimf] = size(data);
end

%----- Input is normalized, so assume that amplitude is always 1
a = ones(npts,nimf);

%----- Mark points that are above 1 as invalid (Not a Number)
data(find(abs(data)>1)) = NaN;

%----- Process each IMF
for c=1:nimf
%----- Compute "phase" by arccosine
acphase = acos(data(:,c));

%----- Mark points where slope of arccosine phase changes as invalid
for i=2:npts-1
prev = data(i-1,c);
cur = data(i,c);
next = data(i+1,c);

if (prev < cur & cur > next) | (prev > cur & cur < next)
acphase(i) = NaN;
end
end

%----- Get phase differential frequency
acfreq = abs(diff(acphase))/(2*pi*dt);

%----- Mark points with negative frequency as invalid
acfreq(find(acfreq<0)) = NaN;

%----- Fill in invalid points using a spline
legit = find(~isnan(acfreq));
if (length(legit) < npts)
f(:,c) = spline(legit, acfreq(legit), 1:npts)';
else
f(:,c) = acfreq;
end
end

%----- Flip again if data was flipped at the beginning
if (flipped)
f=f';
a=a';
end

end

?

?

附二 時(shí)頻工具箱中瞬時(shí)頻率估計(jì)函數(shù)ifestar2

?

function [fnorm,t,rejratio]=ifestar2(x,t);
%IFESTAR2 Instantaneous frequency estimation using AR2 modelisation.
%?[FNORM,T2,RATIO]=IFESTAR2(X,T) computes an estimate of the
%???????instantaneous frequency of the real signal X at time
%?instant(s) T. The result FNORM lies between 0.0 and 0.5. This
%?estimate is based only on the 4 last signal points, and has
%?therefore an approximate delay of 2.5 points.
%
%?X?????: real signal to be analyzed.
%?T?????: Time instants (must be greater than 4)
%?????(default : 4:length(X)).
%?FNORM : Output (normalized) instantaneous frequency.
%?T2????: Time instants coresponding to FNORM. Since the
%??algorithm can not always give a value, T2 is
%??different of T.
%???????RATIO : proportion of instants where the algorithm yields
%??an estimation
%
%?Examples :
%????????[x,if]=fmlin(50,0.05,0.3,5); x=real(x); [if2,t]=ifestar2(x);
%????????plot(t,if(t),t,if2);
%
%??N=1100; [deter,if]=fmconst(N,0.05); deter=real(deter);
%??noise=randn(N,1); NbSNR=101; SNR=linspace(0,100,NbSNR);
%????????for iSNR=1:NbSNR,
%?????????sig=sigmerge(deter,noise,SNR(iSNR));
%???[if2,t,ratio(iSNR)]=ifestar2(sig);
%?????????EQM(iSNR)=norm(if(t)-if2)^2 / length(t) ;
%????????end;
%????????subplot(211); plot(SNR,-10.0 * log10(EQM)); grid;
%????????xlabel('SNR'); ylabel('-10 log10(EQM)');
%????????subplot(212); plot(SNR,ratio); grid;
%????????xlabel('SNR'); ylabel('ratio');
%
%??See also??INSTFREQ, KAYTTH, SGRPDLAY.

%?F. Auger, April 1996.
%???????This estimator is the causal version of the estimator called
%???????"4 points Prony estimator" in the article "Instantaneous
%?frequency estimation using linear prediction with comparisons
%?to the dESAs", IEEE Signal Processing Letters, Vo 3, No 2, p
%?54-56, February 1996.
%?Copyright (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 (xcol~=1),
?error('X must have only one column');
end
x = real(x);

if (nargin == 1),
?t=4:xrow;
end;

[trow,tcol] = size(t);
if (trow~=1),
?error('T must have only one row');
elseif min(t)<4,
?error('The smallest value of T must be greater than 4');
end;


Kappa = x(t-1) .* x(t-2) - x(t??) .* x(t-3) ;
psi1??= x(t-1) .* x(t-1) - x(t??) .* x(t-2) ;
psi2??= x(t-2) .* x(t-2) - x(t-1) .* x(t-3) ;
den???= psi1 .* psi2 ;
indices = find(den>0);
arg=0.5*Kappa(indices)./sqrt(den(indices));
indarg=find(abs(arg)>1);
arg(indarg)=sign(arg(indarg));
fnorm = acos(arg)/(2.0*pi);
rejratio = length(indices)/length(t);
t = t(indices);
end

總結(jié)

以上是生活随笔為你收集整理的瞬时频率估计方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。