Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Hi, I am working on Kalman filter please help me in correcting the program code...

Status
Not open for further replies.

Pravitha

Newbie level 2
Joined
Jan 31, 2017
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
20

Code Visual Basic - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
clc; 
clear all; 
close all; 
load handel.mat
filename = 'handel.wav';
[x, fs]=audioread('handel.wav');
 
 p=20; % order taken in papera
 
 lp=p;
 lp1=lp+1;
 [a g]=lpc(x,p); % finding lpc , prediction filter polynomial a , p is the order p=15
 I = eye(lp,lp);
 i= zeros(lp,1);
 
 
 ppi = [i I];
 pi =[ppi;a];
 xf=x(1:p+1);
 
 G=zeros(1,p);
 G=[G,1]';
 u=sqrt(.1)*rand(size(x)); % adding a random Gaussian noise eqn  noissy
  H=zeros(1,p);
 H=[H,1];
 y1=x+ u;
 no=y1; 
 NN=length(x);
Q= 0.000001;
 XX = zeros (lp1, NN);
 P = 10*eye (lp1,lp1);
 y=y1;
 R=.1;
sound(x,Fs )
pause(size(x,1)/Fs);
sound(no,Fs)
pause(size(no,1)/Fs);
i=1;w=.00001*randn(21,1);
x_k=x(1:lp+1,1);
p_k=x_k;
 for k=lp+2:NN
pravi=pi*p_k+Q;
Pk=pi*P*pi'+G*Q*G';
Kk=Pk*H'*(inv(H*Pk*H'+R));
p_k=pravi+Kk*(y(k-1)-H*pravi);
I=eye(lp1,lp1);
Pk_k=(I-(Kk*H))*Pk;
M(i)=Pk_k(1,1);
kavi=p_k;
kavi1(i:lp+i)=kavi;
i=i+1;
 end
 kavi2=kavi1';
 sound(kavi2,Fs)
figure;
plot(kavi2,'r')
hold on
% x=x(1:lp1)
plot(x,'g- ')  
legend('estimated' , 'input ')
figure;
plot(x,'g'); 
title ('ORIGINAL SIGNAL'); 
 axis([0,200,-1,1])
hold on
plot(no,'r'); 
title ('Noisy Speech Signal'); 
axis([0,200,-1,1])
hold on
plot(kavi2); 
title ('ESTIMATED SIGNAL'); 
axis([0,200,-1,1])

 
Last edited by a moderator:

Hi,

No error description?
--> Unlikely to get good help.

Klaus
 

Hi,

No error description?
--> Unlikely to get good help.

Klaus

Hi,
program has some logical errors.Estimated output is not matching with input.And there is difficulties in applying the audio samples in kalman equations.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top