DSPRelated.com
Forums

IIR filter frequency response

Started by Dani September 9, 2004
Peter Nachtwey wrote:

snip
> > Tim, your site is getting better all the time. That takes a lot of effort.
Thanks. I justify it by claiming that it's marketing.
> > Axlq, you have got to get Mathcad. That is what I use. I am pretty sure > that is what Tim uses to make his excellent web pages. At least get a > decent math package. It will allow you to experiment and learn faster.
I desperately need to get a Mathcad upgrade because I'm on a new machine, I've lost my old disks, and I can't install it on this machine! The ads for Mathmatica, Maple and Mathcad all match; I haven't used the other two so I can't vouch for them but they all address the same market (and Mathcad uses, at least until recently, the Maple symbolic engine). I'm currently using Scilab (a _very good_ free Matlab replacement). It won't do symbolics, but it makes pretty graphs, crunches huge matrices with happy abandon, and has all sorts of nifty control and signal processing stuff built in which are only available as extra toolboxes under Matlab. There are a few Mathcad-like applications for free, but I haven't been impressed enough to download one; Mathcad is worth the $$$ if you can swing it, but if you just can't you may want to google a bit.
> > I use least squares system identification to find the coefficients for the > difference equation. From that I can calculate poles and zeros in the z > and s domain. I get the feed forwards by inverting the model. Then I use > pole placement to calculate the PID gains. Sometime I will have to > investigate the Gain and Phase technique Tim uses. It is always good to > have more arrows in your quiver. I like my technique because it is safe and > works well with big saw/steel mill type systems while loaded and step inputs > or sine waves aren't required. > > Peter Nachtwey > > >
So far I've been able to run sine-wave sweeps on my systems, so I haven't been pushed to using least-squares identification. If you can't use a step input, how do you stimulate the system to get sufficient excitation for the system ID? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
"axlq" schrieb
> > Axlq, you have got to get Mathcad. That is what I use. I > > am pretty sure that is what Tim uses to make his excellent > > web pages. At least get a decent math package. It will > > allow you to experiment and learn faster. > > I know, I know. I can't afford it. >
GNU Octave at www.octave.org is free (GPL software) and an excellent Matlab clone. It requires only your effort to download and install it. The learning effort is minimal and can also be applied to Matlab. Regards Martin
"Rune Allnor" schrieb
> > Sorry if this seems a bit too lame, but I was wondering if > > someone might possibly tell me how to calculate the > > frequency response of an IIR filter having only it's > > coefficients. > > > > Thanks > > I learned the method just this week, from a thread here. :) > > If A=[a0,a1,...,aN]are the numerator coefficients > and B=[b0,b1,...,bM]are the denominator coefficients > in your transfer function, then > > H(w)=fft(A)./fft(B); > > in matlab lingo. This is just about the only instance where I > would use spectral division. >
My method is based on physics (I have a mechanical engineering background): - take a hammer and pound at the system hard and short (not too hard so as to break it, not too long so as to give a nice Dirac impulse) - then measure its frequency response Translated into Matlab / Octave: ; the system b = [0.25 0.25 0.25 0.25]; a = [ 1 ]; ; the system at rest x(1:1024)=0; ; the impulse x(10)=1; ; the response y=filter(b,a,x); ; visualization in the frequency domain plot(abs(fft(y))); The advantage is, in sw you can pound as hard and as long as you like. In reality, the system behaves quite soon in a non-linear fashion (= breaks). HTH Martin
Martin Blume wrote:

> "axlq" schrieb > >>>Axlq, you have got to get Mathcad. That is what I use. I >>>am pretty sure that is what Tim uses to make his excellent >>>web pages. At least get a decent math package. It will >>>allow you to experiment and learn faster. >> >>I know, I know. I can't afford it. >> > > GNU Octave at www.octave.org is free (GPL software) and an > excellent Matlab clone. It requires only your effort to > download and install it. The learning effort is minimal and can > also be applied to Matlab. > > Regards > Martin > > > >
Unless you want maximal compatibility with matlab scripts I would recommend Scilab -- but Octave is very good (I have both Octave and Scilab on my computer) and I haven't checked the benchmarks for very large matrices. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Martin Blume wrote:

> "axlq" schrieb > >>>Axlq, you have got to get Mathcad. That is what I use. I >>>am pretty sure that is what Tim uses to make his excellent >>>web pages. At least get a decent math package. It will >>>allow you to experiment and learn faster. >> >>I know, I know. I can't afford it. >> > > GNU Octave at www.octave.org is free (GPL software) and an > excellent Matlab clone. It requires only your effort to > download and install it. The learning effort is minimal and can > also be applied to Matlab. > > Regards > Martin
Scilab is similar. I don't know what the differences are. I find it useful, and installation was easy. http://scilabsoft.inria.fr/ Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Martin Blume wrote:

   ...

> My method is based on physics (I have a mechanical engineering > background): > > - take a hammer and pound at the system hard and short > (not too hard so as to break it, not too long so as to give > a nice Dirac impulse) > - then measure its frequency response
This is a more sophisticated version of my general trouble-shooting approach: poke it and watch how it wiggles. ... Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
I'd like to thank everybody for their marvelous replies.

Quite frankly I didn't expect so many answers and so quick so I didn't  
check the replies until now. This must be one of the best newsgroups on  
the net :)

I must read all these posts carefully before asking any further questions.

To make things clear though, I am making a system where I have the  
"filter" coefficients and need the filter's magnitude response based on  
these values.
To be honest, I'm trying to design a filterbank of BPFs and am too lazy to  
implement any of the well known algorithms (too much calculations and too  
little universality) so I decided to make a genetic algo that'd do this  
for me.
To make a long story short: the filter coefficients are the genotypes and  
the fitness function uses the filter's magnitude response to compare the  
individuals with the ideal square filter's mag response.

So far I have used two methods:
-first I tried to caluclate the response using an equation I found on a  
couple of places on the net and a book, it was loosley:  
fft(b[])./(1-fft(a[]).
-then I tried to calculate an FIR filter magnitude response from the  
impulse response of the IIR filter, but also had no luck.

Now I'll try what I found here and will keep you updated.

Thanks again yall!
On Fri, 10 Sep 2004 07:12:20 -0700, Tim Wescott
<tim@wescottnospamdesign.com> wrote:

>Martin Blume wrote: > >> "axlq" schrieb >> >>>>Axlq, you have got to get Mathcad. That is what I use. I >>>>am pretty sure that is what Tim uses to make his excellent >>>>web pages. At least get a decent math package. It will >>>>allow you to experiment and learn faster. >>> >>>I know, I know. I can't afford it. >>> >> >> GNU Octave at www.octave.org is free (GPL software) and an >> excellent Matlab clone. It requires only your effort to >> download and install it. The learning effort is minimal and can >> also be applied to Matlab. >> >> Regards >> Martin >> >Unless you want maximal compatibility with matlab scripts I would >recommend Scilab -- but Octave is very good (I have both Octave and >Scilab on my computer) and I haven't checked the benchmarks for very >large matrices.
So Octave is more compatible with Matlab scripts than SciLab? What about other compatibilities? Ease of use? Results? Speed? I too need to get up to speed with a free or low cost option (Matlab is out of the question), so I'd really like to know the limitations of SciLab, Octave and any other alternatives out there. Tony (remove the "_" to reply by email)
Tony wrote:

snip

> > So Octave is more compatible with Matlab scripts than SciLab? What > about other compatibilities? Ease of use? Results? Speed? > > I too need to get up to speed with a free or low cost option (Matlab > is out of the question), so I'd really like to know the limitations of > SciLab, Octave and any other alternatives out there. > > Tony (remove the "_" to reply by email)
Scilab, Matlab and Octave are equally cryptic to use. Scilab, IMHO, has the best help (but no printed matter to read). It also has a newsgroup which isn't very responsive (at least to my questions). -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
"Martin Blume" <mblume@socha.net> wrote in message news:<414158a3$0$701$5402220f@news.sunrise.ch>...
> My method is based on physics (I have a mechanical engineering > background): > > - take a hammer and pound at the system hard and short > (not too hard so as to break it, not too long so as to give > a nice Dirac impulse) > - then measure its frequency response
OK, I just did that. The table where the PC stood, sounded for quite some time afterwards. A crack opened in the top of the table, causing me to emit some words not found even in the most liberal dictionaries. Is that what's termed a 'break' statement? And what about the shrapnel from the electronics? It has to go back into the PC, right? Is that what's called 'feedback'? Rune < sorry, I just couldn't resist... ;) >