spectral assignment

7
1) Broadband 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB W elche periodogram 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB YW-AR 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB LS-AR 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB M YW ARMA(4,4)M=n 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB M YW ARMA(8,8)M=n 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB M YW ARMA(4,4)M=2n 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB M YW ARMA(8,8)M=2n 0 0.5 1 1.5 2 2.5 3 -100 0 100 frequency(rad) dB LS ARM A(4,4)K=2n Matlab Code: clc clear all close all a=[1,-1.3817,1.5632,-0.8843,.4096];% coefficients of given sequence b=[1,0.3544,0.3508,0.1736,.2401]; N=256; [h,w]=freqz(b,a,N); gt = randn(1,N); y = filter(b,a,gt); % to generate Welche periodogram M=32; phi =welchse(y,bartlett(M),M/2,2*N); phiw1 = 10* log(phi); % to generate YW-AR(8) [a1,sigy2]=yulewalker(y,8); [h1,w1] = freqz(1,a1,N); phi1 = sigy2 * abs([h1].^2); phiy1 = 10* log(phi1);

description

MYW ARMA has reasonable accuracy if the zeros of B(z) are well inside the unit circle, and may be inaccurate estimates in those cases where the poles and zeroes of modulus close to one, correspond to narrowband signals. the covariance sequence of narrow band signals decays very slowly, as we know the more concentrated signals is in frequency ,usually more expended in time. the information in the higher lag covariance of the signals that can be exploited to improve the accuracy.if the noise sequence is known, then least squares method can be preferred.

Transcript of spectral assignment

Page 1: spectral assignment

1) Broadband

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dBWelche periodogram

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

YW-AR

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

LS-AR

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(4,4)M=n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(8,8)M=n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(4,4)M=2n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(8,8)M=2n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

LS ARMA(4,4)K=2n

Matlab Code:

clcclear allclose alla=[1,-1.3817,1.5632,-0.8843,.4096];% coefficients of given sequenceb=[1,0.3544,0.3508,0.1736,.2401];N=256;[h,w]=freqz(b,a,N);gt = randn(1,N);y = filter(b,a,gt); % to generate Welche periodogramM=32;phi =welchse(y,bartlett(M),M/2,2*N);phiw1 = 10* log(phi);% to generate YW-AR(8)[a1,sigy2]=yulewalker(y,8);[h1,w1] = freqz(1,a1,N);phi1 = sigy2 * abs([h1].^2);phiy1 = 10* log(phi1); % to generate LS AR[a2,sigl2]=lsar(y,8);[h2,w2] = freqz(1,a2,N);phi2 = sigy2 * abs([h2,w2].^2);

Page 2: spectral assignment

phi21 = 10* log(phi2);%MYW ARMA (4,4) M=n[a3,gam]= mywarma(y,4,4,4);phiMA=2*real(fft(gam,N))-gam(1);phiAR=abs(fft(a3,N)).^2; phi3=phiMA./phiAR;phi31 = 10* log(phi3);%MYW ARMA (8,8) M=n[a4,gam1]= mywarma(y,8,8,8);phiMA1=2*real(fft(gam1,N))-gam1(1);phiAR1=abs(fft(a4,N)).^2; phi4=phiMA1./phiAR1;phi41 = 10* log(phi4);%MYW ARMA (4,4) M=2n[a5,gam2]= mywarma(y,4,4,8);phiMA2=2*real(fft(gam2,N))-gam2(1);phiAR2=abs(fft(a5,N)).^2; phi5=phiMA2./phiAR2;phi51 = 10* log(phi5);%MYW ARMA (8,8) M=2n[a6,gam]= mywarma(y,8,8,16);phiMA3=2*real(fft(gam,N))-gam(1);phiAR3=abs(fft(a6,N)).^2; phi6=phiMA3./phiAR3;phi61 = 10* log(phi6); % to generate LS ARMA[a7,b7,sigls2]=lsarma(y,4,4,8); aw=abs(fft(a7,N)).^2;bw= abs(fft(b7,N)).^2; phi7 = sigls2 * [bw/aw];phi71 = 10* log(phi7); % to plot the graphs using subplot.subplot(4,2,1),plot(w,phiw1(1:N)),axis([0,pi,-100,100]),grid on, xlabel('frequency(rad)'), ylabel('dB'), title('Welche periodogram'); subplot(4,2,2),plot(w,phiy1(1:N)),axis([0,pi,-100,100]),grid on, xlabel('frequency(rad)'), ylabel('dB'), title('YW-AR'); subplot(4,2,3),plot(w,phi21(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('LS-AR'); subplot(4,2,4),plot(w,phi31(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(4,4)M=n'); subplot(4,2,5),plot(w,phi41(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(8,8)M=n'); subplot(4,2,6),plot(w,phi51(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(4,4)M=2n'); subplot(4,2,7),plot(w,phi61(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(8,8)M=2n'); subplot(4,2,8),plot(w,phi71),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('LS ARMA(4,4)K=2n');2)Narrow Band

Page 3: spectral assignment

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

Welche periodogram

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

YW-AR

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

LS-AR

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(4,4)M=n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(8,8)M=n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(4,4)M=2n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

MYW ARMA(8,8)M=2n

0 0.5 1 1.5 2 2.5 3-100

0

100

frequency(rad)

dB

LS ARMA(4,4)K=2n

Matlab Code:

clcclear allclose alla=[1,-1.3817,1.5632,-0.8843,.4096];% coefficients of given sequenceb=[1,0.3544,0.3508,0.1736,.2401];N=256;[h,w]=freqz(b,a,N);gt = randn(1,N);y = filter(b,a,gt); % to generate Welche periodogramM=32;phi =welchse(y,bartlett(M),M/2,2*N);phiw1 = 10* log(phi);% to generate YW-AR(8)[a1,sigy2]=yulewalker(y,8);[h1,w1] = freqz(1,a1,N);phi1 = sigy2 * abs([h1].^2);phiy1 = 10* log(phi1); % to generate LS AR

Page 4: spectral assignment

[a2,sigl2]=lsar(y,8);[h2,w2] = freqz(1,a2,N);phi2 = sigy2 * abs([h2,w2].^2);phi21 = 10* log(phi2);%MYW ARMA (4,4) M=n[a3,gam]= mywarma(y,4,4,4);phiMA=2*real(fft(gam,N))-gam(1);phiAR=abs(fft(a3,N)).^2; phi3=phiMA./phiAR;phi31 = 10* log(phi3);%MYW ARMA (8,8) M=n[a4,gam1]= mywarma(y,8,8,8);phiMA1=2*real(fft(gam1,N))-gam1(1);phiAR1=abs(fft(a4,N)).^2; phi4=phiMA1./phiAR1;phi41 = 10* log(phi4);%MYW ARMA (4,4) M=2n[a5,gam2]= mywarma(y,4,4,8);phiMA2=2*real(fft(gam2,N))-gam2(1);phiAR2=abs(fft(a5,N)).^2; phi5=phiMA2./phiAR2;phi51 = 10* log(phi5);%MYW ARMA (8,8) M=2n[a6,gam]= mywarma(y,8,8,16);phiMA3=2*real(fft(gam,N))-gam(1);phiAR3=abs(fft(a6,N)).^2; phi6=phiMA3./phiAR3;phi61 = 10* log(phi6); % to generate LS ARMA[a7,b7,sigls2]=lsarma(y,4,4,8); aw=abs(fft(a7,N)).^2;bw= abs(fft(b7,N)).^2; phi7 = sigls2 * [bw/aw];phi71 = 10* log(phi7); % to plot the graphs using subplot.subplot(4,2,1),plot(w,phiw1(1:N)),axis([0,pi,-100,100]),grid on, xlabel('frequency(rad)'), ylabel('dB'), title('Welche periodogram'); subplot(4,2,2),plot(w,phiy1(1:N)),axis([0,pi,-100,100]),grid on, xlabel('frequency(rad)'), ylabel('dB'), title('YW-AR'); subplot(4,2,3),plot(w,phi21(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('LS-AR'); subplot(4,2,4),plot(w,phi31(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(4,4)M=n'); subplot(4,2,5),plot(w,phi41(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(8,8)M=n'); subplot(4,2,6),plot(w,phi51(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(4,4)M=2n'); subplot(4,2,7),plot(w,phi61(1:N)),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('MYW ARMA(8,8)M=2n');

Page 5: spectral assignment

subplot(4,2,8),plot(w,phi71),axis([0,pi,-100,100]),grid on,xlabel('frequency(rad)'), ylabel('dB'), title('LS ARMA(4,4)K=2n');

1)For broadband spectrum, AR using YW and Least Square method are resembles same.

for Narrow band spectrum, LS-AR spectrum lags down to negative, where as YW-AR has positive response. in general YW-AR is an better estimate when compared to LS-AR.

Yule walker method estimating AR parameters is based on true covariance elements replaced by sample covariance. whereas LS estimator based on least squares minimization criterion(linear prediction).

- The autocorrelation method of least Squares AR estimation is Equivalent to the Yule-Walker method.

2)MYW ARMA has reasonable accuracy if the zeros of B(z) are well inside the unit circle, and may be inaccurate estimates in those cases where the poles and zeroes of modulus close to one, correspond to narrowband signals. the covariance sequence of narrow band signals decays very slowly, as we know the more concentrated signals is in frequency ,usually more expended in time. the information in the higher lag covariance of the signals that can be exploited to improve the accuracy.

if the noise sequence is known, then least squares method can be preferred.

3)M the constant which determine the amount of over determinationM> n is called the over determined modified YW estimate.

choosing M>n does not always improve the accuracy of AR coefficient estimates. if the poles and zeroes are not close to the unit circle, choosing M>n can make the accuracy worse. when the ACS decays slowly to zero .

4) In these two ARMA models, (n,m) are the AR model order and MA model order.

spectra with both sharp peaks and deep nulls can't be modelled by either AR or MA equations of reasonably small orders .where the ARMA model, pole zero model are useful.

the MA estimate used in MYW ARMA spectral estimator, is not sure of having numerator is positive for all w values, which may lead to negative ARMA spectral estimates. modified YW ARMA spectral estimator relies on AR parameter estimation. which improve estimation accuracy if N is sufficiently large.

whereas LS algorithm is modified to estimate the parameters in MA models ,simply by skipping over the estimation of AR parameters.

for these broad band and narrow band sequences, by increasing the model order its having variance is getting better.

5)By comparison of plots of YW-AR ,LS-AR MYW-ARMA and LS- ARMA

Page 6: spectral assignment

MYW-ARMA is an better estimate , with suitable order and M=n. it has better variance and signals peaks with true spectrum.