help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: freqz behavior


From: Tony Richardson
Subject: Re: freqz behavior
Date: Fri, 19 Jun 2020 07:30:18 -0500



On Fri, Jun 19, 2020 at 2:28 AM Augustin Lefèvre <augustin.lefevre@gmail.com> wrote:
Hello Tony,

The reason is that you are feeding complex coefficients in the second case, whereas in the first case all coefficients are real.

cf.  "octave/4.2.2/m/signal/freqz.m"




On 18/06/2020 21:57, Tony Richardson wrote:
% Poles 0.9 exp(+-j pi/4), Zero at -1
subplot(2, 1, 1)
theta_r = [-1 1]*pi/4;
a = poly(0.9*exp(j*theta_r));
b = poly(-1);
[H1 W1] = freqz(b, a);
plot(W1/pi, abs(H1))

% No poles.  Zeros at angles that are multiples of pi/4 on unit circle except at angle 0
subplot(2, 1, 2)
theta_r = [-3:-1 1:4]*pi/4;
a = 1;
b = poly(exp(j*theta_r));
[H2 W2] = freqz(b, a);
plot(W2/pi, abs(H2))
Augustin,

Thank you.  I'll note that the coefficients are theoretically real, but numerically complex (very small imag part).  I should compute the coefficients from the pole/zero conjugate pairs instead of from the individual pole/zero locations to ensure real coefficients, but I was trying to get the result using a quick-and-dirty method (never a good idea).  

Your code snippet points out that I can get consistent results by always using the "region" argument with either "whole" or "half".  Only, the "whole" option is mentioned in the help documentation, it would be more "help"ful to also mention the "half" option and/or mention that "whole" is the default if the coefficients are complex.

Tony

reply via email to

[Prev in Thread] Current Thread [Next in Thread]