<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Product of independent complex-circular Gaussian Random Variable
Let $z\sim \mathcal{CN}(0, \sigma^2)$ and if $z = x + {\rm j}y$, both $x$ and $y$ are zero mean Gaussian r.v. with variance $\sigma^2/2$.
Step1:  Express $z = |z|e^{j\phi}$. The magnitude $|z|$ is Rayleigh distributed while the phase $\phi = \operatorname{arg}(z)$ is uniform over the interval $[-\pi, \pi)$.
Step2:  Consider two independent complex gaussian r.v. $w$ and $z$ both $\mathcal{CN}(0, \sigma^2)$. Let $w = |w|e^{j\theta}$ and $p = |p|e^{j\omega}$.
Q What is the distribution of the phase of the product $p = wz$?
<ASSISTANT_TASK:>
Python Code:
# magic
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
# prettyplot stuff
import seaborn as sns
sns.set(style='ticks', palette='Set2')
sns.despine()
mu = 0
sigmasq = 1
sd = np.sqrt(sigmasq)
# Generate complex gaussian r.v. samples
x = np.random.normal(loc = mu, scale = sd/np.sqrt(2), size = 1000)
y = np.random.normal(loc = mu, scale = sd/np.sqrt(2), size = 1000)
z = x + 1j*y
h = plt.plot(np.real(z), np.imag(z), 'o')
plt.axis('equal')
plt.grid(True)
Explanation: Product of independent complex-circular Gaussian Random Variable
Let $z\sim \mathcal{CN}(0, \sigma^2)$ and if $z = x + {\rm j}y$, both $x$ and $y$ are zero mean Gaussian r.v. with variance $\sigma^2/2$.
End of explanation
z_mag = np.abs(z)
z_arg = np.angle(z)
plt.subplot(211)
plt.hist(z_mag, 20)
plt.ylabel('Histogram of |z|')
plt.subplot(212)
plt.hist(z_arg, 20)
plt.ylabel('Histogram of arg(z)')
Explanation: Express $z = |z|e^{j\phi}$. The magnitude $|z|$ is Rayleigh distributed while the phase $\phi = \operatorname{arg}(z)$ is uniform over the interval $[-\pi, \pi)$.
End of explanation
# Generate complex gaussian r.v. samples for w
u = np.random.normal(loc = mu, scale = sd/np.sqrt(2), size = 1000)
v = np.random.normal(loc = mu, scale = sd/np.sqrt(2), size = 1000)
w = u + 1j*v
p = w*z
p_arg = np.angle(p)
h = plt.hist(p_arg)
Explanation: Consider two independent complex gaussian r.v. $w$ and $z$ both $\mathcal{CN}(0, \sigma^2)$. Let $w = |w|e^{j\theta}$ and $p = |p|e^{j\omega}$.
Q What is the distribution of the phase of the product $p = wz$?
End of explanation
<END_TASK>