Azzera filtri
Azzera filtri

the main pf cose is pahse estimate and analyze the performance but why i get a fixed plotting point etheir the values must be changed

3 visualizzazioni (ultimi 30 giorni)
%phase astimation using monte carlo
clear all
close all
clc
%signal model x(n)=Acos(2pif0n+thetha)+w(n)
phase=0.785;
A=1;
sigma=0.1;
f0=0.035;
SNR=[-20:5:10]
% SNR=(A^2/2*(sigma^2))
m=length(SNR);
b=zeros(1,m);
mse=zeros(1,m);
var=zeros(1,m);
mat=zeros(5,1);
for m=1:length(SNR)
M=5;
for i=1:M;%M realisations
s=A*cos(2*pi*f0*i+phase);
% w=wgn(1,5,5)
w=randn(size(s));
x(i)=s+w %signal model
y1=sum(x(i)*sin(2*pi*f0*i))
y2=sum(x(i)*cos(2*pi*f0*i))
phasehat(i)=-atan(y1/y2)%MlE phase estimation
end
% mat(i,:)=phasehat
%compute bias
b(m)=(1/M)*sum(mean(phasehat(i))-phase)
%mean square error
mse(m)=mean((phasehat(i)-phase)^2)
%variance
var(m)=1/M*(sum((phasehat(i))-(1/M*sum(phasehat(i))))^2)
end
figure(1)
scatter(SNR,b)
title('ploting bias')
xlabel('SNR')
ylabel('bias')
figure(2)
scatter(SNR,10*log(mse))
title('ploting mse-mean square error')
xlabel('SNR')
ylabel('mean square error')
figure(3)
scatter(SNR,var)
title('ploting varance')
xlabel('SNR')
ylabel('variance')

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by