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

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

[Octave-bug-tracker] [bug #46440] [octave forge] (signal) missing functi


From: Tony Richardson
Subject: [Octave-bug-tracker] [bug #46440] [octave forge] (signal) missing function lp2lp
Date: Thu, 15 Apr 2021 08:24:30 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36

Follow-up Comment #9, bug #46440 (project octave):

I wrote four new LP to LP/HP/BP/BS functions that work directly with the
transfer function coefficients.  I call these lp3lp, lp3hp, lp3bp and lp3bs. 
The lp2* functions do the transformations in state-space and produce results
similar to the MATLAB functions of the same name.

If the lowpass prototype filter is described by its coefficients, the lp3*
functions appear to produce more accurate results than the lp2* functions. 
The lp3* functions rely on a new function called tftrans to do the coefficient
transformations.  It is similar to sftrans and sstrans which do
transformations in pole-zero and state-space domains.

All of the lp3* functions include demo code to illustrate their usage.

I will include the lp3* functions in this comment and the tftrans function in
the next one.

Here is a simple script to show the differences between lp2bp and lp3bp when
doing a lowpass-to-bandpass transformation on a second order lowpass
Butterworth filter.  Theoretically this should produce a fourth order bandpass
filter with all (four) zeros at the origin.  The lp2bp function creates zeros
that are slightly displaced from the origin.  Increase the value of n to see
the differences for higher order filters.

% Nth order Butterworth Lowpass
n = 2;
Wo = 1000; Bw = 200;
[b a] = butter(n, 1, "s");
[bt2, at2] = lp2bp(b, a, Wo, Bw);
[bt3, at3] = lp3bp(b, a, Wo, Bw);

[bt2' bt3']
[at2' at3']


(file #51270, file #51271, file #51272, file #51273)
    _______________________________________________________

Additional Item Attachment:

File name: lp3lp.m                        Size:2 KB
    <https://file.savannah.gnu.org/file/lp3lp.m?file_id=51270>

File name: lp3bp.m                        Size:2 KB
    <https://file.savannah.gnu.org/file/lp3bp.m?file_id=51271>

File name: lp3hp.m                        Size:2 KB
    <https://file.savannah.gnu.org/file/lp3hp.m?file_id=51272>

File name: lp3bs.m                        Size:2 KB
    <https://file.savannah.gnu.org/file/lp3bs.m?file_id=51273>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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