You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: testFECGExtractionByEKF.m
    path of file: ./repos/OSET/matlab/tests/fetal-ecg
    
    the code of the file until where you have to start completion: % Test program for fetal ECG cancellation using EKF and EKS
%
% Dependencies: The baseline wander and ECG filtering toolboxes of the Open Source ECG Toolbox
%
% Sample code for testing naive maternal template subtraction technique
%
% Reza Sameni (C)
% Email: rsameni@shirazu.ac.ir
% Web: www.sameni.info
%
% Crated 2007
% Modified June 2018


%/////////////////////////////////////////////////////////////////////////
clc
clear;
close all;

%/////////////////////////////////////////////////////////////////////////
% initialization
fs = 1600;          % sampling rate
N = 16000;           % segment length
n0 = 1;             % start of segment
t = (0:N-1)/fs;     % time vector
L = 6;              % no. of channels

%/////////////////////////////////////////////////////////////////////////
% abdominal leads
load('CC20060830_ch_ab1');
data = ch_ab1(n0:n0+N-1);      clear ch_ab1;

% ref
    
function
InovWlen = ceil(.5*fs);                 % innovations monitoring window length
tau = [];                               % Kalman filter forgetting time. tau=[] for no forgetting factor
gamma = .7;                             % observation covariance adaptation-rate. 0<gamma<1 and gamma=1 for no adaptation
RadaptWlen = ceil(fs/2);                % window length for observation covariance adaptation

[Xekf,Phat,Xeks,PSmoothed,ak] = EKSmoother(y,X0,P0,Q,R,Wmean,Vmean,Inits,InovWlen,tau,gamma,RadaptWlen,1);  % The EKF and EKS

ECG_ekf = Xekf(2,:);                       % the ECG extracted by the EKF method
ECG_eks = Xeks(2,:);                       % the ECG extracted by the EKS method

Denoised_ekf = data - Xekf(2,:)-bsline;   % the denoised signal (Maternal ECG removed), by EKF
Denoised_eks = data - Xeks(2,:)-bsline;   % the denoised signal (Maternal ECG removed), by EKS

%//////////////////////////////////////////////////////////////////////////
% Display Results
% figure;
% plot(t,ref);
% hold on;
% plot(t,-peaks*100,'r');
% grid;
% legend