load '../definitions.gnuplot' #LOUDSPEAKER MODEL---use your model from Lab 5 # The model here is for a low-frequency "puck" for shaking furniture, # and is NOT appropriate for other loudspeakers Zloud(f) = Rnom+Zlsemi(f,Lhi,Lhipow)+Zpar(Rs,Zpar(Zl(f,Ls),Zc(f,Cs))) Rnom=14.43 Lhi= 56.42E-03 ; Lhipow = 0.669 Ls=4.60E-3 ; Cs=7.94E-3 ; Rs=21.86 # CHOOSE A SERIES RESISTOR IF YOU PLAN TO MEASURE LOUDSPEAKER CURRENT Rseries = 0.0 # extra resistor for displaying current on scope # real power into loudspeaker with no filter (voltage from amplifier V at frequency f) nofilter_power(V,f)=real_power(V*divider(Rseries,Zloud(f)), Zloud(f)) # LC FILTER MODEL # voltage divider with Lf+Rf and (Cf || loudspeaker+resistor) gain(f,Lf,Rf,Cf) = \ divider(Zl(f,Lf)+Rf, Zpar(Zloud(f)+Rseries,Zc(f,Cf))) Lf=330e-6; Rf=0.394 # parameters for AIUR-06-331 inductor # total impedance, in case we want to plot that also Ztotal(f,Lf,Rf,Cf) = Zl(f,Lf)+Rf + Zpar(Zloud(f)+Rseries,Zc(f,Cf)) # real power into loudspeaker with voltage from amplifier V at frequency f # using the LC filter loud_power(V,f,Lf,Rf,Cf) = \ real_power(V*gain(f,Lf,Rf,Cf)*divider(Rseries,Zloud(f)), Zloud(f)) # CHOOSE YOUR SUPPLY VOLTAGE (note: 8V is too large for our components!) V_supply=8 # +/- power supply voltage V_RMS = V_supply/sqrt(2) # RMS voltage for largest sine wave from supply peak_power_freq = 33 # approximate frequency where power is maximized half_power=0.5*loud_power(V_RMS,peak_power_freq,Lf,Rf,3.3e-6) # half the peak power set title sprintf("Low-pass LC filter, louspeaker+%.3gohm resistor, %.1gV to H-bridge ",\ Rseries,V_supply) set yrange [1e-4:40] set ylabel 'Real power to speaker' set format y '%.1s%cW' key_format = "L=%.3guH+%.3gohm C=%.3guF" plot half_power title sprintf("half-power=%.3gW",half_power), \ nofilter_power(V_RMS,x) title "no filter", \ loud_power(V_RMS,x,Lf,Rf,10e-6) title sprintf(key_format, Lf*1e6, Rf, 10), \ loud_power(V_RMS,x,Lf,Rf,4.7e-6) title sprintf(key_format, Lf*1e6, Rf, 4.7), \ loud_power(V_RMS,x,Lf,Rf,2.2e-6) title sprintf(key_format, Lf*1e6, Rf, 2.2), \ loud_power(V_RMS,x,Lf,Rf,1e-6) title sprintf(key_format, Lf*1e6, Rf, 1), \ loud_power(V_RMS,x,Lf,Rf,0.47e-6) title sprintf(key_format, Lf*1e6, Rf, 0.47), \ loud_power(V_RMS,x,Lf,Rf,0.22e-6) title sprintf(key_format, Lf*1e6, Rf, 0.22), \ loud_power(V_RMS,x,Lf,Rf,0.1e-6) title sprintf(key_format, Lf*1e6, Rf, 0.1)