Luckily the fridge/freezer is only buzzing when the compressor is on, so I can in principle take my headphones off when the compressor is not active... But with headphones on, it's hard to notice when the compressor stops!
This project shows a live spectrogram of the audio picked up by your computer microphone, using NumPy to compute the spectrogram and Pulseaudio's parec program to record audio. There's a companion program that listens for the noise level in the 50-55 Hz band and emits a desktop notification using notify-send when the noise levels drops below -18 dB, telling you to take off your headphones to let your ears get some rest.
This solves my very specific problem, but the spectrogram is somehow very soothing to watch, so I thought I would share it here. Who knows, maybe I'm not the only one with a home office right next to a noisy refrigerator!