#Calculations of box for Peerless CSX176H

#Parameters:
fs = 38.0
Qts = 0.43
VAS = 27.7
Ql = 7

#Nesset formelsett 1:
VB = 15*VAS*Qts**2.87
FB = fs*sqrt(VAS/VB)
Fport3dB = fs*(VAS/VB)**(0.32)

#Set the vloume and the tunig frequency here, ore comment out to
#use the calculated values.
VB = 30
FB = 37

#Frequency respone
f1(x) = (x/fs)**2
A = (FB/fs)**2
B = (A/Qts) + (FB/(fs*Ql))
C(x) = f1(x)*(1+A+(VAS/VB)+(FB/(fs*Qts*Ql)))
D(x) = f1(x)*((1/Qts)+(FB/(fs*Ql)))
SPL(x) = 10*log10((f1(x)**4)/((f1(x)**2-C(x)+A)**2+f1(x)*(D(x)-B)**2))

#Plot SPL(x)
set nologscale
set logscale x
set grid
set xr [10:1000]
set yr [-20:5]
set title "SPL for box with Peerless CSX176H (formelsett 1)"
set xlabel "f [Hz]"
set ylabel "SPL [dB]"
set xtic auto
set ytic 1
plot SPL(x) title 'SPL', -3 title '-3dB line'



