Skip to content

Instantly share code, notes, and snippets.

@tobin
Created February 28, 2013 16:52
Show Gist options
  • Save tobin/5058156 to your computer and use it in GitHub Desktop.
Save tobin/5058156 to your computer and use it in GitHub Desktop.
Plot PDH error signal in Gnuplot
f_mod = 35.5e6
pcav = 300e3
i = {0, 1}
conj(z) = real(z) - i*imag(z)
r_c(f) = i*f / (i*f + pcav)
pdh(f) = imag(r_c(f)*conj(r_c(f+f_mod))-conj(r_c(f))*r_c(f-f_mod))
set samples 501
set xrange [-f_mod*2 : f_mod*2]
set yrange [-1.2 : 1.2]
plot pdh(x)
set xrange [-pcav*4 : pcav*4]
plot pdh(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment