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.