## Matched filter

### vsee (view profile)

on 1 Apr 2011

How can I write a mtached filter in Matlab? I have the filter design and signal processing tool boxes.

## Products

### Honglei Chen (view profile)

on 1 Apr 2011

If you have a signal, x, then the matched filter's coefficients is given by time reverse of x, i.e., x(end:-1:1). If your signal is complex, you also need to to use complex conjugate. You can then use it just as an FIR filter. For example,

```>> x = ones(10,1);
>> b = x(end:-1:1);
>> y = filter(b,1,x);
```

vsee

### vsee (view profile)

on 1 Apr 2011

Thanks. I entered the same code that you provided. x is a column vector of 10 one's. b seems to be the same. Is b really the mirror image of x? In other words can you explain what x(end:-1:1) is doing? Thanks

Honglei Chen

### Honglei Chen (view profile)

on 4 Apr 2011

I was just giving an example. x and b are the same because x happens to be the same as its time inverse. You can replace x with a vector representing your particular signal. The key here is "end:-1:1" which flips the signal. You can also use flipud or fliplr depending on your vector's orientation.

Nuzat Alam

### Nuzat Alam (view profile)

on 3 Apr 2013

Hii i was wondering what is the impulse response of matched filter here?I think it is related to b. Do you think if i want to select a specific sample number for b, i also need to change the length of input signal x?

### Andrew Newell (view profile)

on 1 Apr 2011

Check out MATLAB Simulations for Radar Systems Design from the File Exchange.

on 15 Apr 2011

To elaborate on Honglei's answer. If the signal you are trying to design a matched filter for, is x, then --

```>> b = x(end-1:1);
>> y = filter(b,1,x);
```

mmm ssss

### mmm ssss (view profile)

on 9 Jan 2012

how can implement the same filter on image ?

how i should represent x.

### Mathuranathan Viswanathan (view profile)

on 13 Apr 2013

Hi You can try the model given here

Square Root raised Cosine - Matched filter implementation http://www.gaussianwaves.com/2011/04/square-root-raised-cosine-filter-matchedsplit-filter-implementation-2/

Regards Mathuranathan

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi