Real-time wavelet decomposition and reconstruction for ECG feature extraction
Right now, I read the live ECG data into a 5 second buffer, and then perform the wavelet filter on the buffer (as described above). This seems rather inefficient, because I have to filter the entire buffer again when new data comes in.


You cannot avoid the filtering / reconstruction steps over the buffer with this kind of processing.


  Is it possible to implement this in a way that allows for real-time filtering of an ECG signal without buffering?
  (I.e. single value in → wavelet 'filter' → single filtered/reconstructed value out)


Yes.

For block processing, you can use the overlap add or overlap save methods which can also work straight in the time domain.

For sample-by-sample processing, you can start with the basic formula of discrete convolution:

$$ y[n] = \sum_{k=0}^{k&lt;N} x[n-k] \cdot h[k]$$

Where $y$ is the output, $x$ is the input and $h$ is the impulse response, or "filter coefficients".

To get rid of the indexing by $n$, shift the input $x$ by one sample and place the newly acquired sample in the beginning of $x$. You can do this in MATLAB with circshift. So, this would probablly look like x=circshift(x,1);x[1]=input_value.

This now leaves us with getting the $h$ coefficients. You can get those for the wavelets you are using, in MATLAB, using wfilters.

This would cover the application of 1 filter. You will have to repeatedly do this for all the levels you need for both the directions of analysis and reconstruction plus the steps of decimation / upsampling.

So, overall, denoising the ECG in such a way is very demanding. Were the typical QRS detectors (possibly with the addition of "pulse-filters") failing to provide a robust enough R-R sequence?

Hope this helps.