atanh of negative complex numbers
1 view (last 30 days)
Show older comments
Derek Neal on 24 Mar 2023
Answered: David Goodmanson on 31 Mar 2023
Given x is a 1x1000 vector of complex numbers with positive real parts and both positive and negative imaginary parts, the function y=atan(x), the real part of y is correct, whereas the imaginary part of y cycles from postive to negative when I expect it to climb ever more positive, following my model as in the figure below. I believe this is a wrapping issue. How does one keep y from wrapping?
Torsten on 25 Mar 2023
The imag gamma should follow the same pattern as the real plot. But it is wrapping.
So you think MATLAB's atanh is wrong ?
David Goodmanson on 31 Mar 2023
For the troublesome subplot, try
The idea is that the phase is proportional to x*gamma, and that is what has to be unwrapped. The factor of 2 has to do with getting unwrap into its comfort zone where the jumps are close to 2*pi.instead of pi.
More Answers (1)
Walter Roberson on 26 Mar 2023
Moved: Walter Roberson on 30 Mar 2023
%% Compares multicore cable model calculations to mixed mode open/short
% measurments. Based on IEEE paper: "S-Parameter Measurements Yielding
% the Characteristic Matrices of Multiconductor Transmission Lines"
%% Cable length
%% Import open/short measurements
%disp('select the S11_OC file')
%disp('select the S11_SC file')
Z0=sqrt(Zsc.*Zoc); % from IEEE S-Parameter Measurements Yielding the Characteristic Matrices of Multiconductor Transmission Lines
% confirmed https://www.antenna-theory.com/tutorial/txline/transmission6.php
%% QUESTION LINE
% gamma returns complex number. Real portion agrees with my expectation.
% Imaginary part oscillates around 0 starting at 700kHz, related to quarter
% wavelength resonance.
ylabel('attenuation constant (neper/m)')
ylabel('phase constant (radians/m)')
title('real before atanh')
title('imag before atanh')
semilogx(f, movmean(real(y), 10))
That last plot shows a smoothed version of the real part of the y value, before the atanh. It shows that the real coordinate is oscillating around 1.
Now let us look at the formula for atanh:
Notice the 1-z . With real components < 1, the 1-z would be positive, and log() of that part would be real-valued. But with real components > 1, the 1-z would be negative, and log() of that part would be complex-valued.
I am not taking into account the complex component here, but the above suggests to me that it is not unreasonable that the imaginary component of the atanh would be oscillating.
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!