Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

design of filter without using built-in functions in matlab

Status
Not open for further replies.

baladrg1987

Newbie level 2
Newbie level 2
Joined
Jan 28, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
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!
 

Kral

Advanced Member level 4
Advanced Member level 4
Joined
Mar 28, 2005
Messages
1,319
Helped
280
Reputation
558
Reaction score
84
Trophy points
1,328
Location
USA
Activity points
13,401
fir filter without matlab function

baladrg1987,
Any good book on digital signal processing or digital filters will show the technique. Also, see:
.
**broken link removed**
Regards,
Kral
 

svhb

Full Member level 5
Full Member level 5
Joined
Mar 7, 2006
Messages
276
Helped
48
Reputation
96
Reaction score
30
Trophy points
1,308
Activity points
3,026
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
 

baladrg1987

Newbie level 2
Newbie level 2
Joined
Jan 28, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
how to apply a filter in matlab

thank you mr.kral and svhb!
 

eng_shady00

Member level 2
Member level 2
Joined
Jun 9, 2008
Messages
52
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,631
matlab filter function

svhb said:
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


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.
 

svhb

Full Member level 5
Full Member level 5
Joined
Mar 7, 2006
Messages
276
Helped
48
Reputation
96
Reaction score
30
Trophy points
1,308
Activity points
3,026
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.
 

eng_shady00

Member level 2
Member level 2
Joined
Jun 9, 2008
Messages
52
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,631
matlab programs of dft without builtin function

svhb said:
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.

Now, I've exported my BPF's coefficients in the workspace of matlab as num, den.
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.
 

svhb

Full Member level 5
Full Member level 5
Joined
Mar 7, 2006
Messages
276
Helped
48
Reputation
96
Reaction score
30
Trophy points
1,308
Activity points
3,026
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.
 

xie.qiang

Junior Member level 1
Junior Member level 1
Joined
Feb 19, 2006
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,405
calculate the inverse of a fir filter in matlab

svhb said:
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

For your information, for the response of filter, I do respectly a bit disagree with you while by using inverse DFT instead of DTFT, for the former is disceret frequency response while the latter is the correct continuous period discrete time fourier transform.
 

svhb

Full Member level 5
Full Member level 5
Joined
Mar 7, 2006
Messages
276
Helped
48
Reputation
96
Reaction score
30
Trophy points
1,308
Activity points
3,026
matlab code without inbuilt functions

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

Aya2002

Advanced Member level 4
Advanced Member level 4
Joined
Dec 12, 2006
Messages
1,140
Helped
184
Reputation
376
Reaction score
117
Trophy points
1,343
Location
Iraq
Activity points
8,006
using a filter as window matlab

thanks to svhb
 

xulfee

Advanced Member level 1
Advanced Member level 1
Joined
May 27, 2008
Messages
401
Helped
45
Reputation
100
Reaction score
14
Trophy points
1,298
Location
Pakistan
Activity points
2,904
convolution matlab without using conv

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

Aya2002

Advanced Member level 4
Advanced Member level 4
Joined
Dec 12, 2006
Messages
1,140
Helped
184
Reputation
376
Reaction score
117
Trophy points
1,343
Location
Iraq
Activity points
8,006
filters without using matlab function

see this file will help you too much
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top