# v_lpcss2zz

## PURPOSE

V_LPCSS2ZZ Convert s-plane poles to z-plane poles ZZ=(SS,NR)

## SYNOPSIS

function zz=v_lpcss2zz(ss,nr)

## DESCRIPTION

    V_LPCSS2ZZ Convert s-plane poles to z-plane poles ZZ=(SS,NR)

      Inputs: ss(n,q)  n frames each with q complex-valued pole positions in normalized-Hz units.
                       A formant with frequency f (in range 0 to 0.5) and bandwidth b will give an
                       s-plane pole-pair of approximately (-b/2 +-j*f)/fs where fs is the sample frequency.
              nr       Optional argument specifying how many of the q poles should *not* be
                       supplemented by including their conjugate pair. The conjugates of poles nr+1:q
                       will be appended to ss as additional columns. As a special case, nr=-1
                       will include the conjugate of any column containing a non-real number.

     Outputs: zz(n,p)  z-plane poles. If nr is omitted, then p=q; if nr>=0, then p=2*q-nr.

     The inverse function is zz=v_lpczz2ss(zz)

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function zz=v_lpcss2zz(ss,nr)
    0002 %V_LPCSS2ZZ Convert s-plane poles to z-plane poles ZZ=(SS,NR)
    0003 %
    0004 %  Inputs: ss(n,q)  n frames each with q complex-valued pole positions in normalized-Hz units.
    0005 %                   A formant with frequency f (in range 0 to 0.5) and bandwidth b will give an
    0006 %                   s-plane pole-pair of approximately (-b/2 +-j*f)/fs where fs is the sample frequency.
    0007 %          nr       Optional argument specifying how many of the q poles should *not* be
    0008 %                   supplemented by including their conjugate pair. The conjugates of poles nr+1:q
    0009 %                   will be appended to ss as additional columns. As a special case, nr=-1
    0010 %                   will include the conjugate of any column containing a non-real number.
    0011 %
    0012 % Outputs: zz(n,p)  z-plane poles. If nr is omitted, then p=q; if nr>=0, then p=2*q-nr.
    0013 %
    0014 % The inverse function is zz=v_lpczz2ss(zz)
    0015
    0016 %      Copyright (C) Mike Brookes 1997-2025
    0017 %
    0018 %   VOICEBOX is a MATLAB toolbox for speech processing.
    0019 %   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
    0020 %
    0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    0022 %   This program is free software; you can redistribute it and/or modify
    0023 %   it under the terms of the GNU Lesser General Public License as published by
    0024 %   the Free Software Foundation; either version 3 of the License, or
    0025 %   (at your option) any later version.
    0026 %
    0027 %   This program is distributed in the hope that it will be useful,
    0028 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
    0029 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    0030 %   GNU Lesser General Public License for more details.
    0031 %
    0032 %   You can obtain a copy of the GNU Lesser General Public License from
    0033 %   https://www.gnu.org/licenses/ .
    0034 %
    0035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    0036 if nargin>1 && nr<size(ss,2)
    0037     if nr>=0
    0038         ss=[ss conj(ss(:,nr+1:end))];
    0039     else
    0040         ss=[ss conj(ss(:,any(imag(ss)~=0,1)))];
    0041     end
    0042 end
    0043 zz=exp(2*pi*ss);
    0044 if ~nargout
    0045     q=(0:200)*2*pi/200;
    0046     plot(real(zz.'),imag(zz.'),'x',cos(q),sin(q),':k',[-1.05 0; 1.05 0],[0 -1.05; 0 1.05],':k');
    0047     axis([-1.05 1.05 -1.05 1.05]);
    0048     axis equal;
    0049     xlabel('Real');
    0050     ylabel('Imag');
    0051 end
    0052