bugGNU Octave - Bugs: bug #60475, [ocatave forge] (signal) buttap...

 
 

bug #60475: [ocatave forge] (signal) buttap poles have a different order

Submitter:  None
Submitted:  Thu 29 Apr 2021 12:00:45 PM UTC
   
 
Category:  Octave Package Severity:  2 - Minor
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 05 May 2021 03:25:05 PM UTC, comment #4: 

@Charles

Thank you, this was more of a question as to the differences. As you note there an order but it is not consistent.
Should there be?

Mike suggested a fix, and this was updated.

Is a better example to work through to get an understanding and improve these functions?

For your comment on cheb1ap see patch #10059

Anonymous
Wed 05 May 2021 08:41:55 AM UTC, comment #3: 

Different zero and poles ordering is not an error.
Even Matlab does not sort poles and zeros in complex conjugate pairs.
In the page following the one you cite, you have an example:

Matlab:

>> [z,p,k]=cheb1ap(4,2)

z =
     []
p =
  -0.1049 + 0.9580i
  -0.2532 + 0.3968i
  -0.2532 - 0.3968i
  -0.1049 - 0.9580i
k =
    0.1634

Note that for the same example Octave returns a complex gain, what is not very good:

>> [z,p,k]=cheb1ap(4,2)

z = [](0x1)
p =

  -0.1049 - 0.9580i
  -0.2532 - 0.3968i
  -0.2532 + 0.3968i
  -0.1049 + 0.9580i

k =  1.6345e-01 + 2.7559e-18i

Charles Praplan <charprap>
Fri 30 Apr 2021 09:22:20 AM UTC, comment #2: 

See patch

Updated p

Added
Docstring
Tests

(file #51342)

Anonymous
Thu 29 Apr 2021 08:52:43 PM UTC, comment #1: 

We can use the cplxpair function to sort and group complex conjugate pairs together. That doesn't look to be the same as the Matlab results either, but it's a worthwhile improvement.


>> p = cplxpair (p)
p =

  -0.8090 - 0.5878i
  -0.8090 + 0.5878i
  -0.3090 - 0.9511i
  -0.3090 + 0.9511i
  -1.0000 +      0i


Mike Miller <mtmiller>
Group Member
Thu 29 Apr 2021 12:00:45 PM UTC, original submission:  

https://ewh.ieee.org/r1/ct/sps/PDF/MATLAB/chapter5.pdf


[z, p, k] = buttap(5)
z =
[]
p =
-0.3090 + 0.9511i
-0.3090 - 0.9511i
-0.8090 + 0.5878i
-0.8090 - 0.5878i
-1.0000
k =
1


In Octave


[z, p, k] = buttap(5)
z = [](0x1)
p =

  -0.30902 + 0.95106i
  -0.80902 + 0.58779i
  -1.00000 + 0.00000i
  -0.80902 - 0.58779i
  -0.30902 - 0.95106i

k =  1


The values are the same for p but the order is different.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #51342:  buttap.patch added by None (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by charprap (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-30 None Attached File- Added buttap.patch, #51342
    2021-04-29 mtmiller Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low
        StatusNone Confirmed
        Release4.2.2 dev

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code