Source: https://ece.uwaterloo.ca/~lab140/scope_notes.pdf