FIR or IIR filters in matlab

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
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.
 
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.
 
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,
 
ok, i'll make it simple:
http://www.dsptutor.freeuk.com/IIRFilterDesign/IIRFiltDes102.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:eek:);
y = 0.*(1:eek:);
l = length(wavIn);


for n = 1:l;

%shift in a value for x
for m = 1:(o-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 = 1:(o-1);
y(o-m+1) = y(o-m);
end
y(1) = h;

end
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.