# CWT for filtering / feature extraction

I had asked a question last night in regards to how to process my data (Noise rejection / feature extraction) but I have a more specific question now that I hope someone can answer.

As mentioned in my other post, I have a microphone based sensor to detect muscle activity in the lower leg during walking, however the data is contaminated by the thud made during heel strike. As both the muscle contraction and heel strike noise are pretty reproducible on each stride I was hoping I could use some sort of feature extraction method to filter my data.

I've been using CWT and I believe they could do what I intend based on my current results. I've been playing around with specific wavelets but the symlets 7 seems to be giving the best results. My hope is that the coefficients obtained by CWT will vary based on whether they're noise or contraction information.

All processing is done in MATLAB. I've obtained the CWT simply by:

CWTcoeffs = cwt(data, 1:128, 'sym7');


and the corresponding coefficients of noise/useful data seem to do what I want, but now trying to use this information to remove what I don't want is proving difficult.

I've also seen a MATLAB function of scal2frq which I hope to use to provide more frequency specific results. As I know, very roughly, what frequency bands I'm interested in I want to use this function to change the CWT scale, but not completely sure how. I believe it's done by:

 s = [6, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 100];
scale = scal2frq(s, 'sym7', 1/fs);
CWTcoeffs = cwt(data, scale, 'sym7');


Which does produce results, but I'm not sure if it's correct.

Basically what I'm asking is if this method seems plausible, and if so how might I use the results to damp or remove the noise I'm not interested in.

Thank you!

EDIT: I should probably add some data! Here is someone walking in a straight line for 50 steps: https://www.dropbox.com/sh/jeoa8ll1leq8kbn/8jlEzbbW0R

• I don't know that a CWT is the tool you want to filter the signal. CWT is good to visually represent features, but will be difficult to use to reconstruct the filtered signal. A DWT may be useful. A DWT is designed to keep coefficient data from each scale distinct so the signal can be reconstructed with the inverse transform. Success depends on how distinct the characteristics of the noise are from the desired signal. If the 2 signals have a lot in common, they will contribute to the same coefficients and you won't be able to separate them. – user2718 Apr 10 '14 at 22:19
• If the "thud" is largely spectrally distinct from the desired signal, you may try a filter with a pass band that is a rough inverse of the thud. A properly centered bandpass filter may work. – user2718 Apr 10 '14 at 22:37
• @BZ thanks for your response. Aside from DWT is there anything else you'd recommend for this application? The thud unfortunately contains many frequencies and simple bandpass filtering has proven useless. – ritchie888 Apr 11 '14 at 8:14
• If I had a technique for your application, I would post as an answer. I know a bit about Wavelet theory. Noise or interference suppression is a tricky subject. Often I have seen adaptive approaches for this. Here is a crude example. You need a model for the "thud" and the "transmission path" of the thud. You generate the thud. The transmission path is modeled as a linear adaptive filter. You have a feedback mechanism that adjusts the filter so the time representation of the synthesized thud matches the actual thud. You subtract the filtered generated thud from the receive signal. – user2718 Apr 11 '14 at 13:36
• Take a look at this: dspalgorithms.com/aspt/asptnode34.html . I don't know if you can adjust one of the approaches for your application, but I think it is worth checking out. My description above is a little off. The thud isn't generated, it is sensed with another microphone. – user2718 Apr 11 '14 at 13:36