normiranje na rbw. preveri pravilno sirino rbw

master
lso hp 8540w 2021-02-22 13:07:45 +01:00
parent 8a91491d47
commit 5a29885d27
3 changed files with 8187 additions and 4094 deletions

View File

@ -17,7 +17,7 @@ sd.default.device = 0
fskala=np.linspace(0,fs/2,2*pts+1)[:-1] #Izračunaj frekvenčno skalo [Hz]
### podatki za kalibracijo sistema
dSB = -61.86+15.33 #dB
dSB = -62.86+15.83 #dB
L = 1256 #metrov
tau = L*1.4676/3e8
@ -45,6 +45,8 @@ def spekter(fs,pts,avg,fskala): #Zajem signala z zvočno kartico in povprečenje
### izris z animacijo
f=fskala[4:-1]
rbw = np.diff(f)[0]
print(rbw)
initsum = spekter(fs,pts,avg,fskala)
fig,ax = plt.subplots()
raw,pn, = ax.plot(f,initsum,f,initsum)
@ -60,7 +62,7 @@ def meritev(nic):
s = spekter(fs,pts,avg,fskala)
Pcal = np.amax(s)
K = Pcal - 3 - dSB
fsum = s - K - 3 - 6 - 20*np.log10(np.sin(f*np.pi*tau))
fsum = s - K - 3 - 6 - 20*np.log10(np.sin(f*np.pi*tau)) -10*np.log10(rbw)
raw.set_data(f,s)
pn.set_data(f,fsum)
ax.figure.canvas.draw()
@ -73,7 +75,7 @@ plt.show()
s = spekter(fs,pts,avg,fskala)
Pcal = np.amax(s)
K = Pcal - 3 - dSB
fsum = s - K - 3 - 6 - 20*np.log10(np.sin(f*np.pi*tau))
fsum = s - K - 3 - 6 - 20*np.log10(np.sin(f*np.pi*tau)) -10*np.log10(rbw)
data = np.column_stack((f,fsum,s))
np.savetxt('rezultat.csv',data,delimiter=',')
print('*** Konec ***')

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff