Remix.run Logo
davidhoell 9 hours ago

The coolest thing I ever did with that was finding wires in a friends wall - we needed to drill a hole and it was unclear whether the wires went up (problem) or right from the outlet. I didn't have a cable finder on hand but did have the epiphany to put a large load on the outlet (we used a kettle, a hairdryer would also work, just needs a lot of watts) and use the Fourier transform magnet spectrum to find the 50 Hz grid frequency in the wall. Worked beautifully.

Sadly, since most smartphone magnetometers seem to have a sample rate of 100/s, this will not be applicable to Americans and everyone else with a 60 Hz grid frequency, the 50 Hz were already at the Nyquist–Shannon limit.

gus_massa 8 hours ago | parent | next [-]

> this will not be applicable to Americans and everyone else with a 60 Hz grid frequency, the 50 Hz were already at the Nyquist–Shannon limit.

The trick should work fine, but you may confuse the 60Hz signal with a 40Hz signal [1] [2].

This should work for higher frequencies too, but if the frequency is toooo high the problem is that the magnetometers averages a short period of time (or use a window) instead of being an actual an instant measurement.

[1] Calculated using my fingers moving in the air. 60=50+10 -> 50-10=40. I think it's 40Hz, but I would need a pencil and paper to be sure.

[2] https://en.wikipedia.org/wiki/Aliasing

fragmede 2 hours ago | parent [-]

(40Hz's right)

The hack you can do is to additionally sample at, say, 97Hz as well as 100Hz. A 97Hz sampling rate will then see a 60 Hz aliased to 40Hz signal go from 40Hz to 37Hz, showing that your signal is probably actually really 60Hz and not 40Hz. If it was 40Hz at 100 and 97Hz sampling frequency, then it's probably actually 40Hz.

(It's been a looong time since signals class though.)

slow_typist 4 hours ago | parent | prev [-]

If your sample rate is 100 Hz you would usually apply analog lowpass filtering at around 40 Hz, well below Nyquist. But with enough load on the line, since no filter has perfect attenuation in the stop band…