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: waveSingleRec.m
    path of file: ./repos/iptutorials/MASTER_mispa/TUT.IMG.wavelets/matlab
    
    the code of the file until where you have to start completion: function approx = waveSingleRec(a, d, lr, hr)
% 1D wavelet reconstruction at one scale
% a: vector of approximation
% d: vector of details
% lr: low pass filter defined by wavelet
% hr: high pass filter defined by wavelet
%
% This is Mallat algorithm.
% NB: to avoid side effects, the convolution function does not use the

    
function approx = waveSingleRec(a, d, lr, hr)
% 1D wavelet reconstruction at one scale
% a: vector of approximation
% d: vector of details
% lr: low pass filter defined by wavelet
% hr: high pass filter defined by wavelet
%
% This is Mallat algorithm.
% NB: to avoid side effects, the convolution function does not use the
% 'same' option

approx = zeros(1, length(a)*2);
approx(1:2:end