<jupyter_start><jupyter_text>to plot histogram use plt.hist() >   1. Generate normal random process and plot the probability density function (PDF) of random variable for different value of $t$. Find out whether the process is wide sense stationary (WSS).<jupyter_code>time_size = 10000
samples_size = 10000
tau = 5
mu = 10
sigma = 5
rp = np.random.normal(mu,sigma,[samples_size,time_size])
temp = rp[:,tau]
x=plt.hist(temp,50)
a=np.mean(temp)
temp= rp[:,tau+100]
b=np.mean(temp)
print('mean at t=5: '+str(a))
print('mean at t=105: '+str(b))
auto1=np.mean(np.matmul(np.transpose(rp[:,10]),rp[:,20]))
auto2=np.mean(np.matmul(np.transpose(rp[:,30]),rp[:,40]))
print('Rx(10,20): '+str(auto1))
print('Rx(30,40): '+str(auto2))<jupyter_output>mean at t=5: 9.968473900246472
mean at t=105: 9.99652515385165
Rx(10,20): 1005940.5730458765
Rx(30,40): 1007153.4134257912<jupyter_text>2. For the random process given by $X(t)=A \cos(\omega_ot+\theta)$, where $\theta$ is a random variable uniformly distributed between $0$ and $2\pi$. Find out whether the process is wide sense stationary (WSS).<jupyter_code>time_size = 10000
samples_size = 1000
Amplitude = 2
fc = 1000
theta = np.random.uniform(0,2*3.14,1000)
t = np.arange(0,1,1/time_size)
for i in range(0,samples_size-1):
    rp[i,:]=Amplitude*np.cos(2*3.14*fc*t+theta[i])

temp = rp[:,5]
a=np.mean(temp)
temp= rp[:,105]
b=np.mean(temp)
print('mean at t=5: '+str(a))
print('mean at t=105: '+str(b))
auto1=np.mean(np.matmul(np.transpose(rp[:,10]),rp[:,20]))
auto2=np.mean(np.matmul(np.transpose(rp[:,30]),rp[:,40]))
print('Rx(10,20): '+str(auto1))
print('Rx(30,40): '+str(auto2))
#write code here<jupyter_output>mean at t=5: 8.949271227886085
mean at t=105: 8.993566282143926
Rx(10,20): 907335.081232163
Rx(30,40): 907607.3608065369<jupyter_text>3. Let $Z(t)=X\cos(\omega_ct)+Y\sin(\omega_ct)$, where $X$ and $Y$ are independent Gaussian random variables, each with 0 mean and unit variance. Show that $Z(t)$ is WSS and $R_z(\tau)=\cos(\omega_ct)$. Let $Z(t_1)=V$. Show that $V$ is $N(0,1)$.<jupyter_code>mu = 0
sigma = 1
fc=5
xy = np.random.normal(0,1,[2,10000])
time_size = 10000
t = np.arange(0,1,1/time_size)

for i in range(0,9999):
    rp[i,:]=xy[0,i]*np.cos(2*np.pi*fc*t)+xy[1,i]*np.sin(2*np.pi*fc*t)

temp = rp[:,5]
a=np.mean(temp)
temp= rp[:,105]
b=np.mean(temp)
print('mean at t=5: '+str(a))
print('mean at t=105: '+str(b))
auto1=np.mean(np.matmul(np.transpose(rp[:,10]),rp[:,20]))
auto2=np.mean(np.matmul(np.transpose(rp[:,30]),rp[:,40]))
print('Rx(10,20): '+str(auto1))
print('Rx(30,40): '+str(auto2))
R=np.zeros([10000,1])
for i in range(0,9999):
    R[i]=np.matmul(np.transpose(rp[:,0]),rp[:,i])
plt.figure()
plt.plot(R)
plt.figure()
plt.plot(np.cos(2*3.14*fc*t))
plt.figure()
x=plt.hist(temp,50)<jupyter_output>mean at t=5: 4.396848775422342e-05
mean at t=105: -0.00540224212815275
Rx(10,20): 9954.193192113602
Rx(30,40): 9913.161694565912
{'fraction_non_alphanumeric': 0.21374309392265192, 'fraction_numerical': 0.14433701657458564, 'mean_word_length': 6.664021164021164, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '235337', 'license': 'MIT', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1290, 'n_words': 248, 'path': 'CT/314_statistical_communication_theory/mv_joshi/2019/lab_sessions/lab9.ipynb', 'repo_name': 'u-square2/AcadVault', 'size': '2896'}