From: Sam on
On Nov 26, 10:00 am, Vladimir Vassilevsky <nos...(a)nowhere.com> wrote:
> Sam wrote:
> > On Nov 25, 9:09 pm, Sam <samke...(a)gmail.com> wrote:
>
> >>For a high order filter, if I make Wn too small, I get an inexplicable
> >>gain term on the resulting filter. I am trying to use zpk form and
> >>then go to second orders sections. It works, but only sometimes.
> >>Here's an example:
>
> >>% This gives me a filter of gain 100 dB and I have no idea why?
> >>[z,p,k] = butter(n,.1);
> >>[sos,g] = zp2sos(z,p,k);
> >>Hd1 = dfilt.df2sos(sos,g);
> >>fvtool(Hd1)
>
> >>% But this gives me a gain of 0 dB, as expected
> >>[z,p,k] = butter(n,.2);
> >>[sos,g] = zp2sos(z,p,k);
> >>Hd2 = dfilt.df2sos(sos,g);
> >>fvtool(Hd2)
>
> >>Does anyone know the reason for this?
>
> >>thanks,
>
> >>-Sam
>
> > Sorry, I forgot the order of the filter. If I set
>
> > n = 24;
>
> > The first filter gives me a gain of  100 dB, the 2nd gives me a gain
> > of zero. I was under the impression all IIR filter designs should have
> > a gain of  0 dB in the passband. Is that not the case?
>
> Butterworth of the 24th order is ridiculous. You are very likely to run
> into numeric precision issues.
>
> "Matlab does all thinking for us" (TM)
>
> VLV

Why then can I design a 24th order filter with FDA tool and not have
this problem?
From: dbd on
On Nov 26, 10:39 am, Sam <samke...(a)gmail.com> wrote:
>...
>
> Why then can I design a 24th order filter with FDA tool and not have
> this problem?

How would you know if you have a problem?

Could "100dB" be considered a possible hint?

Dale B. Dalrymple
From: Sam on
On Nov 26, 4:05 pm, dbd <d...(a)ieee.org> wrote:
> On Nov 26, 10:39 am, Sam <samke...(a)gmail.com> wrote:
>
> >...
>
> > Why then can I design a 24th order filter with FDA tool and not have
> > this problem?
>
> How would you know if you have a problem?
>
> Could "100dB" be considered a possible hint?
>
> Dale B. Dalrymple

I guess I'm not making myself very clear...

I design a filter using the butter function, implement it in second
order sections DF2 form. If I do this in MATLAB, I get a filter which
inexplicably has a 100 dB gain, even though otherwise its fine. If I
design a filter with the same exact specs using FDATOOL, I get the
filter I expect without the 100 dB gain.

Why can FDATOOL do it if I can't?

-Sam
From: Rune Allnor on
On 27 Nov, 00:16, Sam <samke...(a)gmail.com> wrote:

> Why can FDATOOL do it if I can't?

Because whoever implemented FDATOOL took the time to
read up on, contemplate and investigate the principles,
algorithms and procedures used in filter design.

Rune
From: Sam on
On Nov 26, 7:46 pm, Rune Allnor <all...(a)tele.ntnu.no> wrote:
> On 27 Nov, 00:16, Sam <samke...(a)gmail.com> wrote:
>
> > Why can FDATOOL do it if I can't?
>
> Because whoever implemented FDATOOL took the time to
> read up on, contemplate and investigate the principles,
> algorithms and procedures used in filter design.
>
> Rune

So you mean to tell me that if I design a filter with exactly the same
specifications in FDATOOL as at the command line, I should simply
accept that they give different results for no apparent reason?
Because the people who wrote FDATOOL are so much more enlightened than
I?

The two filters have exactly the same frequency shape, however one has
a large gain and the other does not. I would like to understand why,
if you cannot help me to do so, you need not be rude.

thanks,

-Sam