- 28th January 2009, 02:47 #1

- Join Date
- Jan 2009
- Posts
- 2
- Helped
- 0 / 0
- Points
- 699
- Level
- 5

## convolution in matlab without using conv

hi!

i am suppose to design a low pass filter(lpf) using any window methods without uisng built-in functions in matlab. and the output should be a frequency response of the filter.

i could find coefficients of window(simply by substituting the formula for one of the windows) but designing the lpf without using the built-in functions has been very irritating !!

if anyone could help me concerned with this i will be very thankful!!!

thank you!

- 28th January 2009, 17:49 #2

- Join Date
- Mar 2005
- Location
- USA
- Posts
- 1,324
- Helped
- 274 / 274
- Points
- 11,440
- Level
- 25

## fir filter without matlab function

baladrg1987,

Any good book on digital signal processing or digital filters will show the technique. Also, see:

.

http://ocw.mit.edu/NR/rdonlyres/070A...4D/0/lec09.pdf

Regards,

Kral

1 members found this post helpful.

- 28th January 2009, 21:12 #3

- Join Date
- Mar 2006
- Posts
- 276
- Helped
- 47 / 47
- Points
- 4,306
- Level
- 15

## matlab built filter from coeff

This is a typical project to give you some hands-on experience with digital FIR filters. If you have some feeling with the theory, you should be able to do this :

- Rectangular frequence response (store in an vector)

- inverse dft on it

- apply window

there the filter is.

The frequency response is the opposte :

- take the filter coeficients

- apply dft

- 28th January 2009, 21:12

- 29th January 2009, 02:43 #4

- Join Date
- Jan 2009
- Posts
- 2
- Helped
- 0 / 0
- Points
- 699
- Level
- 5

## how to apply a filter in matlab

thank you mr.kral and svhb!

- 29th January 2009, 13:07 #5

- Join Date
- Jun 2008
- Posts
- 52
- Helped
- 4 / 4
- Points
- 1,839
- Level
- 9

## matlab filter function

Originally Posted by**svhb**

Please i want some help in using fdatool in matlab. I designed my filter but don't know how to apply it to my signal.

I do export the filter as an object or to workspace or as an SOS matrix, or even as an m-file. But i can't apply this filter to my original signal.

How can i get that.

Or if u suggest any other method for me to design a BPF and apply it to my signal.

I've really got confused.

Thanks in advance.

- 30th January 2009, 21:14 #6

- Join Date
- Mar 2006
- Posts
- 276
- Helped
- 47 / 47
- Points
- 4,306
- Level
- 15

## dft filter in matlab

For a FIR-filter : if you have your filter coeficients, you use concolution to apply it to your signal. (this is basically how the filter works).

Code:w = conv(u,v) convolves vectors u and v. Algebraically, convolution is the same operation as multiplying the polynomials whose coefficients are the elements of u and v.

- 30th January 2009, 21:14

- 16th February 2009, 11:27 #7

- Join Date
- Jun 2008
- Posts
- 52
- Helped
- 4 / 4
- Points
- 1,839
- Level
- 9

## matlab programs of dft without builtin function

Originally Posted by**svhb**

so, which function should i use to apply the filter to my signal.

I've used the function

filter(num,den,x) %%% where x=my data signal

but i have no result.

The code that u've written of using conv(u,v)

I think it can't work coz my coefficients r 2 vectors, num & den

and i want to apply it on my signal x

but, the conv function have just 2 arguments.

Is there any other function that works for my num & den coefficients.

Please... help

And, sorry for interruption.

- 16th February 2009, 20:50 #8

- Join Date
- Mar 2006
- Posts
- 276
- Helped
- 47 / 47
- Points
- 4,306
- Level
- 15

## matlab built in functions code

Num and den are the coeficients for the polynomials defining A and B in

H(Z) = B(Z)/A(Z)

When the coeficients of A are zero, except the first one, you made a FIR filter, and just divide all coeficient from B with a0. This is the impulse respone of the filter, and is finite (Finite Impluse Response filter). You can use these coeficients to do a convolution with your input signal.

When there are other coeficients than the first one of A are nonzero, you made an IIR filter (Infinite Impulse response filter). You can find the impulse respone by dividing the polynomials A and B, and you will see it never ends (but the results become smalleer and smaller, I hope). Because the impulse response never ends, it's inpractical to do with convolution.

If you look at how a digital filter works, it will be not to difficult to apply the filter to any input signal.

- 17th February 2009, 02:56 #9

- Join Date
- Feb 2006
- Posts
- 16
- Helped
- 0 / 0
- Points
- 1,364
- Level
- 8

## calculate the inverse of a fir filter in matlab

Originally Posted by**svhb**

- 17th February 2009, 19:33 #10

- Join Date
- Mar 2006
- Posts
- 276
- Helped
- 47 / 47
- Points
- 4,306
- Level
- 15

## matlab code without inbuilt functions

indeed it needs to be the discrete version of the transform, with DFT, I mean Discrete Fourrier Transform.

- 25th February 2009, 23:46 #11

- Join Date
- Dec 2006
- Location
- Malaysia
- Posts
- 1,142
- Helped
- 395 / 395
- Points
- 19,911
- Level
- 34

## using a filter as window matlab

thanks to svhb

- 27th February 2009, 04:36 #12

- Join Date
- May 2008
- Location
- Pakistan
- Posts
- 401
- Helped
- 52 / 52
- Points
- 4,634
- Level
- 16

## convolution matlab without using conv

get ur transfer function from coefficent of filters by using tf(z,p) then multiply it wuth ur input

- 10th March 2009, 23:04 #13

- Join Date
- Dec 2006
- Location
- Malaysia
- Posts
- 1,142
- Helped
- 395 / 395
- Points
- 19,911
- Level
- 34

## filters without using matlab function

see this file will help you too much