octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #63636] Cheby1 - imaginary residual in gain va


From: anonymous
Subject: [Octave-bug-tracker] [bug #63636] Cheby1 - imaginary residual in gain variable errors zp2tf
Date: Mon, 9 Jan 2023 16:04:37 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?63636>

                 Summary: Cheby1 - imaginary residual in gain variable errors
zp2tf
                 Project: GNU Octave
               Submitter: None
               Submitted: Mon 09 Jan 2023 09:04:35 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: gregory.white@ni.com
             Open/Closed: Open
                 Release: 7.1.0
         Discussion Lock: Any
        Operating System: Microsoft Windows
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 09 Jan 2023 09:04:35 PM UTC By: Anonymous
This is a simple problem, so I embedded the test file cheby1_gain_error.m:

function cheby1_gain_error
% cheby1_gain_error - shows complex residual in cheby1 gain causes error in
zp2tf.
n = 5
rp = 10*log10(2)
[z,p,k] = cheb1ap(n,rp)
[num_lp, den_lp] = zp2tf(z, p, k)

% >> which cheby1
% 'cheby1' is a function from the file
C:\engineer\Octave-7.1.0\mingw64\share\octave\packages\signal-1.4.1\cheby1.m
% Line 115 is:
% gain = prod (-pole);
% Because of the method of computing "prod()", an imaginary residual is a 
% possible result for the real axis zero (n is odd).
% While careful construction of the roots and then the computation of gain 
% with those roots can avoid this, the brute force of enforcing real() upon 
% prod() is likely a sufficient solution. Use
% gain = real (prod (-pole));
% instead for line 115.






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Date: Mon 09 Jan 2023 09:04:35 PM UTC  Name: cheby1_gain_error.m  Size: 761B  
By: None

<http://savannah.gnu.org/bugs/download.php?file_id=54204>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63636>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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