normiranje na rbw. preveri pravilno sirino rbw
parent
8a91491d47
commit
5a29885d27
|
@ -17,7 +17,7 @@ sd.default.device = 0
|
||||||
fskala=np.linspace(0,fs/2,2*pts+1)[:-1] #Izračunaj frekvenčno skalo [Hz]
|
fskala=np.linspace(0,fs/2,2*pts+1)[:-1] #Izračunaj frekvenčno skalo [Hz]
|
||||||
|
|
||||||
### podatki za kalibracijo sistema
|
### podatki za kalibracijo sistema
|
||||||
dSB = -61.86+15.33 #dB
|
dSB = -62.86+15.83 #dB
|
||||||
L = 1256 #metrov
|
L = 1256 #metrov
|
||||||
tau = L*1.4676/3e8
|
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
|
### izris z animacijo
|
||||||
f=fskala[4:-1]
|
f=fskala[4:-1]
|
||||||
|
rbw = np.diff(f)[0]
|
||||||
|
print(rbw)
|
||||||
initsum = spekter(fs,pts,avg,fskala)
|
initsum = spekter(fs,pts,avg,fskala)
|
||||||
fig,ax = plt.subplots()
|
fig,ax = plt.subplots()
|
||||||
raw,pn, = ax.plot(f,initsum,f,initsum)
|
raw,pn, = ax.plot(f,initsum,f,initsum)
|
||||||
|
@ -60,7 +62,7 @@ def meritev(nic):
|
||||||
s = spekter(fs,pts,avg,fskala)
|
s = spekter(fs,pts,avg,fskala)
|
||||||
Pcal = np.amax(s)
|
Pcal = np.amax(s)
|
||||||
K = Pcal - 3 - dSB
|
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)
|
raw.set_data(f,s)
|
||||||
pn.set_data(f,fsum)
|
pn.set_data(f,fsum)
|
||||||
ax.figure.canvas.draw()
|
ax.figure.canvas.draw()
|
||||||
|
@ -73,7 +75,7 @@ plt.show()
|
||||||
s = spekter(fs,pts,avg,fskala)
|
s = spekter(fs,pts,avg,fskala)
|
||||||
Pcal = np.amax(s)
|
Pcal = np.amax(s)
|
||||||
K = Pcal - 3 - dSB
|
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))
|
data = np.column_stack((f,fsum,s))
|
||||||
np.savetxt('rezultat.csv',data,delimiter=',')
|
np.savetxt('rezultat.csv',data,delimiter=',')
|
||||||
print('*** Konec ***')
|
print('*** Konec ***')
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue