[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question on filter implementation ...
From: |
Dr.-Ing. Dieter Jurzitza |
Subject: |
Re: Question on filter implementation ... |
Date: |
Sat, 01 Feb 2020 17:54:49 +0100 |
Hello Sergei,
thank you for this detailled explanation - will test in the next week. And
thanks to everyone else who responded to my question!
This is a great list - knowing the limitations it is not a big deal to take
care of them accordingly.
Best
Dieter
Am Donnerstag, 30. Januar 2020, 21:45:25 CET schrieb Sergei Steshenko via Help
list for GNU Octave:
> On 30/01/2020 22:32, Doug Stewart wrote:
> > On Thu, Jan 30, 2020 at 2:41 PM Dr.-Ing. Dieter Jurzitza
> >
> > <address@hidden <mailto:address@hidden>> wrote:
> > Dear listmembers,
> > I am currently experimenting with the signal - package using i. e.
> > butter()
> > and cheby1() functions.
> >
> > If I do a
> > [b a]=butter(2,0.0208333);
> > [H W]=freqz(b,a,48000);
> > sig=20*log10(abs(H));
> > semilogx(sig)
> >
> > I get a nice and clean plot. Looks as expected. Same behavior when
> > using
> > cheby1 ....
> >
> > However, if I replace
> > [b a]=butter(2,0.0208333);
> > by
> > [b a]=butter(10,0.0208333);
> >
> > the resulting graph is a mess. Enlarging the degree of the filter
> > beyond 8
> > leads to very jumpy, noisy graphs. When I do the same in Matlab no
> > such issues
> > show. I found of the coefficients to become very small with that
> > high filter
> > degree.
> >
> > Any hints how to improve this besides not designing so steep
> > filters? Is there
> > an option to increase the internal resolution?
> > Thank you for any feedback,
> > best regards
> >
> > Dieter Jurzizta
> >
> > Deiter: this is a known limitation, and yes we need more resolution.
> >
> > @Mike
> > Do you think we could use the symbolic pkg. and VPA to calculate
> > these higher order coefficients?
>
> When you produce frequency plot, use pole-zero implementation instead of
> polynomial.
>
>
> I use the following code:
>
>
> function freq_response = eval_filter_through_zpg(zeros_vector,
> poles_vector, gain_scalar, zfrequency_range)
> numerator = ones(1, length(zfrequency_range));
>
> for zero_number = 1:length(zeros_vector)
> numerator = numerator .* (zfrequency_range -
> zeros_vector(zero_number));
> endfor
>
>
> denominator = ones(1, length(zfrequency_range));
>
> for pole_number = 1:length(poles_vector)
> denominator = denominator .* (zfrequency_range -
> poles_vector(pole_number));
> endfor
>
> freq_response = gain_scalar * numerator ./ denominator;
> endfunction
>
> ...
>
> [bfzeros, bfpoles, bfgain] = butter(zorder, lower_zcutoff);
>
> ...
>
> two_pi = 2 * pi;
>
> relative_all_freqs = (0:half_number_of_points_in_fft) /
> number_of_points_in_fft;
>
> relative_omegas = two_pi * relative_all_freqs;
> relative_iomegas = i * relative_omegas;
> exp_of_relative_iomegas = exp(relative_iomegas);
>
> ...
>
> freq_response = \
> eval_filter_through_zpg\
> (
> bfzeros, # zeros_vector,
> bfpoles, # poles_vector,
> bfgain, # gain_scalar,
> exp_of_relative_iomegas # zfrequency_range
> );
>
> --Sergei.
--
-----------------------------------------------------------
Dr.-Ing. Dieter Jurzitza 76131 Karlsruhe
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Question on filter implementation ...,
Dr.-Ing. Dieter Jurzitza <=