導航:首頁 > 源碼編譯 > burg演算法matlab

burg演算法matlab

發布時間:2022-05-20 06:18:55

Ⅰ MATLAB四階五級 Runge-Kutta-Felhberg 演算法計算一階微分方程,方程系數會隨著上一步計算結果變化怎麼辦

題主給出的這種類型微分方程,是可以用四階五級 Runge-Kutta-Felhberg 演算法和ode45()函數。
ode45()函數實際上就是變步長四階五級 Runge-Kutta(龍格-庫塔)法。為了更好地回答,請題主給出具體的微分方程,以便說明問題。

Ⅱ 如何用matlab實現最大熵譜法

例如:
具體問題:matlab中burg法譜分析語句[P,f]=pburg(x,M,nfft,fs,range),文獻對M階、nffg,fs都有說明,但
是我不太明白。假如我的記錄60秒的數據,每秒100個數據點(頻率為100hz)那麼對應的M、nfft、fs應該是多少
可以使用
pburg(x,50,,6000,100,『onesided』)

Ⅲ 請問matlab中如何在功率譜密度圖中添加一條置信曲線

這么多,看都懶得看!~

Ⅳ 有誰知道杜賓演算法原理

matlab自帶有杜賓演算法的函數:levinson
有自帶的burg演算法函數:arburg,pburg

窗口打:doc spectrum.burg
就能查到Burg spectrum

在窗口打edit levinson
就能查看函數levinson的源代碼
其它類似

Ⅳ matlab中pburg函數畫出來的怎麼感覺是錯誤的

解析:
help pburg
然後,
檢查,代碼中此函數調用,格式是否正確

Ⅵ 利用Burg演算法計算AR模型的參數:arburg函數

(1)a=arburg(x,order);返回利用Burg演算法計算得到的AR模型的參數:輸入參數or-der為AR模型的階數。

(2)[a,e]=arburg(…);當輸入信號為白雜訊時,同時返回最後誤差e。

(3)[a,e,k]=arburg(…):同時返回反射系數k。

[例4-5]用Burg演算法計算AR 模型的參數。

rand(『seed』,0);a=[1 0.1 0.2 0.3 0.4 0.5 0.6];

x=impz(1,a,20)+randn(20,1)/20;

[a,e,k]=arburg(x,5)。

Ⅶ matlab提示 function [psdviaBurg, f, p] = myBurg(x, Fs, varargin) | Error: Function definitions

1、將下面函數復制保存為myBurg.m文件。就可以計算。預測誤差E 、系數a 、誤差功率psdviaBurg

function [psdviaBurg, f, p,a,E] = myBurg(x, Fs, varargin)
%MYBURG 根據burg演算法實現的AR模型功率譜計算
% psdviaBurg 根據burg演算法求出的功率譜值
% f 頻率軸參數
% p 模型階次
% a AR模型參數
%E AR模型誤差
% x 輸出信號
% Fs 采樣率
% varargin 若為數值型,則為AR模型階次
% 若為字元串,則為定階准則,AR模型階次由程序確定
%
% $Author: lskyp
% $Date: 2010.6.26
% 解析輸入參數內容
error(nargchk(3, 3, nargin)); % 該函數的輸入必須為三個個
if strcmp(class(varargin{1}), 'double')
p = varargin{1};
elseif ischar(varargin{1})
criterion = varargin{1};
else
error('參數2必須為數值型或者字元串');
end
x = x(:);
N = length(x);
% 模型參數求解
if exist('p', 'var') % p變數是否存在,存在則不需要定階,直接使用p階
[a, E] = computeARpara(x, p);
else % p不存在,需要定階,定階准則即criterion
p = ceil(N/3); % 階次一般不超過信號長度的1/3

% 計算1到p階的誤差
[a, E] = computeARpara(x, p);

% 根據誤差求解目標函數最小值
kc = 1:p + 1;
switch criterion
case 'FPE'
goalF = E.*(N + (kc + 1))./(N - (kc + 1));
case 'AIC'
goalF = N.*log(E) + 2.*kc;
end
[minF, p] = min(goalF); % p就是目標函數最小的位置,也即定階准則給出的階次

% 使用p階重新求解AR模型參數
[a, E] = computeARpara(x, p);
end
% 計算功率譜密度
[h, f] = freqz(1, a, [], Fs);
psdviaBurg = E(end)*abs(h).^2./Fs;

function [a, E] = computeARpara(x, p)
% 根據信號序列x和階次p計算AR模型參數和誤差
N = length(x);
% 初始值
ef = x; % 前向預測誤差
eb = x; % 後向預測誤差
a = 1; % 初始模型參數
E = x'*x/N; % 初始誤差
k = zeros(1, p); % 為反射系數預分配空間,提高循環速度
E = [E k]; % 為誤差預分配空間,提高速度
for m = 1:p
% 根據burg演算法步驟,首先計算m階的反射系數
efm = ef(2:end); % 前一階次的前向預測誤差
ebm = eb(1:end - 1); % 前一階次的後向預測誤差
num = -2.*ebm'*efm; % 反射系數的分子項
den = efm'*efm + ebm'*ebm; % 反射系數的分母項
k(m) = num./den; % 當前階次的反射系數

% 更新前後向預測誤差
ef = efm + k(m)*ebm;
eb = ebm + conj(k(m))*efm;

% 更新模型系數a
a = [a; 0] + k(m)*[0; conj(flipud(a))];

% 當前階次的誤差功率
E(m + 1) = (1 - conj(k(m))*k(m))*E(m);
end

2、例如:
參考論壇中的例子。
randn('state', 1);
x = randn(100, 1);
y = filter(1, [1 1/2 1/3 1/4 1/5], x);
pburg(y, 4, [], 1000);
[psd, f, p,a,E] = myBurg(y, 1000, 'FPE');
figure;
a,E
plot(f, 10*log10(psd));

結果:圖還是一樣,就補貼出來了。
a =
1.0000
0.3116
0.3647
0.2086
0.2088
0.0425

E =
1.0224 0.9859 0.9167 0.8989 0.8644 0.8629

Ⅷ matlab中AR模型的計算

[m,refl]=ar(Y,N,Approavh,Window);
%Y觀察值
%N AR模型的階數 取 實整數
%Appproach 表示計算模型的方法 'fb','ls','yw','burg','gl'

Ⅸ 在matlab中像buttord,butter,pburg這些函數是已經定義好的嗎可以直接用嗎

function varargout = pburg(x,p,varargin)
%PBURG
Power Spectral Density (PSD) estimate via Burg's method.
%
Pxx = PBURG(X,ORDER) returns the PSD of a discrete-time signal vector X
%
in the vector Pxx. Pxx is the distribution of power per unit frequency.
%
The frequency is expressed in units of radians/sample. ORDER is the
%
order of the autoregressive (AR) model used to proce the PSD. PBURG
%
uses a default FFT length of 256 which determines the length of Pxx.
%
%
For real signals, PBURG returns the one-sided PSD by default; for
%
complex signals, it returns the two-sided PSD. Note that a one-sided
%
PSD contains the total power of the input signal.
%
%
Pxx = PBURG(X,ORDER,NFFT) specifies the FFT length used to calculate
%
the PSD estimates. For real X, Pxx has length (NFFT/2+1) if NFFT is
%
even, and (NFFT+1)/2 if NFFT is odd. For complex X, Pxx always has
%
length NFFT. If empty, the default NFFT is 256.
%
%
[Pxx,W] = PBURG(...) returns the vector of normalized angular
%
frequencies, W, at which the PSD is estimated. W has units of
%
radians/sample. For real signals, W spans the interval [0,Pi] when
%
NFFT is even and [0,Pi) when NFFT is odd. For complex signals, W
%
always spans the interval [0,2*Pi).
%
%
[Pxx,F] = PBURG(...,Fs) specifies a sampling frequency Fs in Hz and
%
returns the power spectral density in units of power per Hz. F is a
%
vector of frequencies, in Hz, at which the PSD is estimated. For real
%
signals, F spans the interval [0,Fs/2] when NFFT is even and [0,Fs/2)
%
when NFFT is odd. For complex signals, F always spans the interval
%
[0,Fs). If Fs is empty, [], the sampling frequency defaults to 1 Hz.
%
%
[Pxx,W] = PBURG(...,'twosided') returns the PSD over the interval
%
[0,2*Pi), and [Pxx,F] = PBURG(...,Fs,'twosided') returns the PSD over
%
the interval [0,Fs). Note that 'onesided' may be optionally specified,
%
but is only valid for real X. The string 'twosided' or 'onesided' may
%
be placed in any position in the input argument list after ORDER.
%
%
PBURG(...) with no output arguments plots the PSD estimate in dB per
%
unit frequency in the current figure window.
%
%
EXAMPLE:
%
randn('state',1); x = randn(100,1);
%
y = filter(1,[1 1/2 1/3 1/4 1/5],x); % Fourth order AR filter.
%
pburg(y,4,[],1000);

% Uses the default NFFT of 256.
%
%
See also PCOV, PMCOV, PYULEAR, PMTM, PMUSIC, PEIG, PWELCH, PERIODOGRAM,
%
ARBURG, PRONY, SPECTRUM/BURG, DSPDATA/PSD.

% Author(s): R. Losada and P. Pacheco
%
Copyright 1988-2004 The MathWorks, Inc.
%
$Revision: 1.26.4.5 $ $Date: 2004/04/13 00:18:07 $

error(nargchk(2,5,nargin))

method = 'arburg';
[Pxx,freq,msg,units,Sxx,options] = arspectra(method,x,p,varargin{:});
error(msg);

if nargout==0,

freq = {freq};

if strcmpi(units,'Hz'),

freq = {freq{:},'Fs',options.Fs};

end

hpsd = dspdata.psd(Pxx,freq{:},'SpectrumType',options.range);

% Create a spectrum object to store in the PSD object's metadata.

hspec = spectrum.burg(p);

hpsd.Metadata.setsourcespectrum(hspec);

plot(hpsd);

else
% Assign output arguments.
varargout = {Pxx,freq,Sxx}; % Pxx=PSD, Sxx=PS
end

% [EOF] pburg.m

Ⅹ matlab中現代譜估計的burg法怎麼編寫

matlab中,現代譜估計的很多方法都可以實現。music方法用pmusic命令實現;pburg函數利用burg法實現功率譜估計;pyulear函數利用yule-walker演算法實現功率譜估計等等。

閱讀全文

與burg演算法matlab相關的資料

熱點內容
hadoop解壓縮 瀏覽:421
30歲程序員生計 瀏覽:472
蘋果iOS反編譯軟體 瀏覽:460
當一個體面的程序員是什麼體驗 瀏覽:291
聯想安裝哪個編譯器 瀏覽:446
蘋果手機如何創建app組 瀏覽:40
如何知道伺服器開通了什麼埠 瀏覽:34
動態ip地址由dhcp伺服器來分配 瀏覽:800
aes128加密c 瀏覽:396
成為插畫師pdf 瀏覽:325
奧特曼系列ol為什麼進不去伺服器 瀏覽:742
盛世伺服器怎麼開啟 瀏覽:87
編譯安卓源碼修改定位 瀏覽:200
加密上市是什麼意思 瀏覽:802
一年程序員面試 瀏覽:174
多個jpg合成pdf 瀏覽:929
pdf轉word是圖片 瀏覽:941
程序員看不懂怎麼辦 瀏覽:273
linux操作系統題 瀏覽:769
單片機無符號數加法 瀏覽:231