views:

171

answers:

2

If I have a simple low-pass filter, e.g.

filt = fir1(20, 0.2);

and a matrix with a list of numbers (a signal), e.g. [0.1, -0.2, 0.3, -0.4] etc, how do I actually apply the filter I've created to this signal?

Seems like a simple question but I've been stuck for hours. Do I need to manually calculate it from the filter coefficients?

+1  A: 

The filter function is what you need.

I believe help filter or doc filter will get you on your way.

kigurai
+3  A: 

Here you go:

filter(filt, 1, mysignal);

will do the trick. Since this is an FIR filter, the A parameter (the second parameter) is set to 1.

Justin Peel

related questions