
TCP/IP Protoco Suite에서 물리계층은 1계층

물리계층 확인
디지털 <--> 아날로그
1 비트는 어떻게 만드나?
→ 사인함수
0과 1 메시지 → 1 비트는 어떻게 만들까 ? : 물리계층
이더넷 프레임? 링크계층
물리계층에서 신호는 어떻게 생겼을까



import numpy as np
import matplotlib.pyplot as plt
fs = 100
t = np.arange(0,2,1/fs)
f1 = 1
f2 = 1
signal1= np.sin(2*np.pi * f1 * t)
signal2= 2*np.sin(2*np.pi * f2 * t)
plt.subplot(2,1,1)
plt.plot(t,signal1)
plt.grid()
plt.subplot(2,1,2)
plt.plot(t,signal2)
plt.grid()

signal1, signal2는 사인함수 앞 곱셈 차이 (크기차이임)
오른쪽 그래프에서 -1 ~ 1 과 -2 ~ 2 가 크기의 차이다.
import numpy as np
import matplotlib.pyplot as plt
fs = 100
t = np.arange(0,2,1/fs) # 0에서 2 사이에 0.01 단위 값 생성
f1 = 6
f2 = 12
signal1= np.sin(2*np.pi * f1 * t)
signal2= np.sin(2*np.pi * f2 * t)
plt.subplot(2,1,1)
plt.plot(t,signal1)
plt.grid()
plt.subplot(2,1,2)
plt.plot(t,signal2)
plt.grid()

import numpy as np
import matplotlib.pyplot as plt
fs = 100
t = np.arange(0,2,1/fs)
f1 = f2 = f3 = 1
signal1= np.sin(2*np.pi * f1 * t)
signal2= np.sin(2*np.pi * f2 * t + 2*np.pi/2)
signal3= np.sin(2*np.pi * f3 * t + 2 * np.pi/4)
plt.subplot(3,1,1)
plt.plot(t,signal1)
plt.grid()
plt.subplot(3,1,2)
plt.plot(t,signal2)
plt.grid()
plt.subplot(3,1,3)
plt.plot(t,signal3)
plt.grid()

f= 1
t = np.linspace(0, 2, 201) #two cycles, 100 points each
y1 = (4/np.pi)*np.sin(2*np.pi*f*t)
y3 = y1 + (4/(3*np.pi))*np.sin(2*np.pi*3*f*t)
у5 = y3 + (4/(5*np.pi))*np.sin(2*np.pi*5*f*t)
sqwave = np.sin(np.sin(2*np.pi*f*t)) #an actual square wave
plt.plot(t,y1, t,y3, t,у5, t, sqwave)

sq = np.zeros(len(t)) #preallocate the output array
t = np.linspace(0, 2, 201) #two cycles, 100 points each
f = 1
for h in np.arange(1,25,2):
sq += (4/(np.pi*h))*np.sin(2*np.pi*f*h*t)
sqwave = np.sin(np.sin(2*np.pi*f*t))
plt.plot(t,sq, t,sqwave)
