hi..i really need a help..im a final year student..im still new with matlab..i need to design a filter to eliminate noise in speech processing..im using kalman filter..plizz help me..i really need a help..plizz somebody help me give the coding
The simpliest Kalman may look like this (I use it for sensors processing):
Code:
function Array_FK = Simple_Kalman_fcn(Array, Q, R)
len = size(Array,1);
cur_state = Array(1);
cur_cov = 0;
Array_FK = zeros(len,1);
for i = 1:1:len
x = cur_state;
P = cur_cov + Q;
K = P/(P + R);
cur_state = x + K*(Array(i) - x);
cur_cov = (1 - K)*P;
Array_FK(i) = cur_state;
end
Input - Array - this is your data vector. Output - Array_FK - the vector of the same length.
Parameter R - variance og your noise. You may estimate it in the following way: for example, first 1000 samples of your speech data is silence (noisy). Then R = var(Array(1:1000));
Parameter Q you adjust manually to get a result that you will like.