Oscillators and mixers are used in heterodyne bat detectors.
Oscillators generate a signal of a certain frequency.
The multiplication operation that is required to generate a signal of a frequency equal to the difference of the input frequencies, can be implemented in several ways. When using a square wave oscillator, the multiplication operation simply comes down to reversing the polarity of the bat signal at the frequency of the local oscillator. This can be implemented by using an analog switch to switch between the bat signal and an inverted version of the bat signal. In the picture on the right a basic implementation of this idea is shown. The leftmost opamp is configured as an inverting amplifier to give the signal some extra boost.