# sparsifying an ECG signal using wavelet

I have an ECG signal, and want to sparsify it using wavelet (DWT) in Matlab. In some paper they use Daubechies wavelet (DB4) with 8-tap filters. but i don't know how to extract the wavelet coefficients and plot a figure like this:

tnx.

• Welcome to SE.DSP. Why do you want to sparsify an ECG? How would you measure that? Why do you want to use a DWT? Those plot are probably produce with Matlab, concatenating coefficients for low to high pass. – Laurent Duval Aug 20 '17 at 19:42
• thank you very much. I'm working on a compressive sensing project, and need to find a sparsifying base for the ECG signal. i used the DCT but the result wasn't so satisfactory. In fact there is some Dictionary learning method but need some straightforward methods for this problem. – Salman Aug 20 '17 at 20:52
• "I need to" <-- is not a reason. Can you give us a technological or mathematical motivation for the sparsification? What you need to do depends on why you do it. – Marcus Müller Aug 20 '17 at 21:09
• dear Marcus Müller, tnx for your comment. As I told, i'm working on a compressive sensing project that aim to compress the ECG signals. based on many papers the ECG signals is sparse in some basis like DCT and DWT. I want to know how it is possible to use Wavelet to sparsifying the ECG signals. This is all i want and said. tnx again – Salman Aug 20 '17 at 21:33

load ecgData;