|Subject:||Re: Question on filter implementation ...|
|Date:||Thu, 30 Jan 2020 22:45:25 +0200|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2|
On Thu, Jan 30, 2020 at 2:41 PM Dr.-Ing. Dieter Jurzitza <address@hidden> wrote:
I am currently experimenting with the signal - package using i. e. butter()
and cheby1() functions.
If I do a
I get a nice and clean plot. Looks as expected. Same behavior when using
However, if I replace
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
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,
Dr.-Ing. Dieter Jurzitza 76131 Karlsruhe
Deiter: this is a known limitation, and yes we need more resolution.
@MikeDo 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));
denominator = ones(1, length(zfrequency_range));
for pole_number = 1:length(poles_vector)
denominator = denominator .* (zfrequency_range - poles_vector(pole_number));
freq_response = gain_scalar * numerator ./ denominator;
[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 = \
bfzeros, # zeros_vector,
bfpoles, # poles_vector,
bfgain, # gain_scalar,
exp_of_relative_iomegas # zfrequency_range
|[Prev in Thread]||Current Thread||[Next in Thread]|