FIR or IIR filters in matlab - diyAudio
Go Back   Home > Forums > General Interest > Everything Else

Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools......

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 16th March 2004, 12:14 AM   #1
diyAudio Member
 
Join Date: Dec 2001
Location: SIUE, Illinois, USA
Default FIR or IIR filters in matlab

i have the student version of matlab. i want to know how to implent them. the equations listed online do not work at all, or the coefficient calculators don't work at all. in anycase any links to matlab code for IIR or FIR filters that is more detailed then

resample(x,1,2)

or such.

i won't post my code because it would take too long and people here generally don't reply to my posts.
__________________
if only it could be used for good, not evil...
  Reply With Quote
Old 16th March 2004, 12:56 AM   #2
hifiZen is offline hifiZen  Canada
diyAudio Member
 
hifiZen's Avatar
 
Join Date: May 2001
Location: Mountain View, CA
Did you install the Signal Processing toolbox? You'll need this, since it contains all the .m files with the dsp commands.

If so, then the MATLAB HelpDesk contains complete descriptions of the commands, with syntax examples and so forth.
__________________
- Chad.
  Reply With Quote
Old 16th March 2004, 02:48 AM   #3
diyAudio Member
 
Join Date: Dec 2001
Location: SIUE, Illinois, USA
actually, no, i meant how would you program in the algorithms, the FIR and IIR equations without using simple 1 line commands. i'd like to have an understanding for the actual DSP moreso then just the usage of it.

right now i'm using the FIR online java calculator, but i don't know how to fix it so i get any type of real response.
__________________
if only it could be used for good, not evil...
  Reply With Quote
Old 16th March 2004, 03:59 AM   #4
diyAudio Member
 
sianturi's Avatar
 
Join Date: Apr 2002
Location: Fontenay-le-Fleury, France
Hello Chris,

Maybe this doesn't help you with your matlab problem, but if you want to have a "feel" on how a real dsp works with IIR or FIR filter, you could look at Rulph Chassaing's book:

Digital Signal Processing with C and the TMS320C30.

My book was published in 1992, with ISBN 0-471-55780-3.
I bought it at amazon.com. Dunno if there is another updated/revised version.

It is a very good book, and it gives you a detailed insight on how real time processing works. The explanation is also very straightforward. As the name of the book implies, it only dealt with Texas Instrument's dsp chips.

Regards,
__________________
The Great Saiyaman
Siapa bertelinga hendaklah ia mendengar... (Mat 13:9)
  Reply With Quote
Old 16th March 2004, 05:31 AM   #5
diyAudio Member
 
Join Date: Dec 2001
Location: SIUE, Illinois, USA
ok, i'll make it simple:
http://www.dsptutor.freeuk.com/IIRFi...iltDes102.html
make a filter with a cutoff of 4khz, sampling rate 22khz.

i can't do it. all i get is a gain of 150 and a random cutoff frequency.

i tried using 1500hz on the 4000hz max assuming it would be near the right value but it was way off. trying 500hz on the 4000hz scale was about the same, and 3500hz on the 4000hz scale diverged.

a and b are defined from the site online:


o = length(a);
x = 0.*(1);
y = 0.*(1);
l = length(wavIn);


for n = 1:l;

%shift in a value for x
for m = 1o-1);
x(o-m+1) = x(o-m);
end
x(1) = wavIn(n);

% preform the accumulation
h = sum(b.*x) + sum(a.*y);
wavOut(n) = h;

%shift in a value for y
for m = 1o-1);
y(o-m+1) = y(o-m);
end
y(1) = h;

end
__________________
if only it could be used for good, not evil...
  Reply With Quote
Old 16th March 2004, 05:32 AM   #6
diyAudio Member
 
Join Date: Dec 2001
Location: SIUE, Illinois, USA
the oh smiley is : o
the sad smiley is : (
__________________
if only it could be used for good, not evil...
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matlab mikeks Everything Else 3 2nd May 2007 08:30 PM
Matlab eag The Lounge 1 10th March 2006 05:19 PM
Matlab-based triode modelling software Radames Tubes / Valves 1 16th September 2005 08:36 PM
Matlab or Mathematica -- which is your preference? rif Everything Else 7 11th May 2004 06:34 AM
Modeling speakers in Matlab? Serow Multi-Way 0 7th December 2002 10:22 PM


New To Site? Need Help?

All times are GMT. The time now is 12:29 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2