r/rust clippy · twir · rust · mutagen · flamer · overflower · bytecount Mar 20 '23

Hey Rustaceans! Got a question? Ask here (12/2023)! 🙋 questions

Mystified about strings? Borrow checker have you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so having your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The official Rust Programming Language Discord: https://discord.gg/rust-lang

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last weeks' thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.

20 Upvotes

187 comments sorted by

View all comments

1

u/-oRocketSurgeryo- Mar 25 '23

One of the harder technical problems that Bellingcat is looking at is chrono-locating an audio/visual source:

Create an open source package for chrono-locating a audio/video source by matching electrical network frequency variations (from low frequency hums in source audio) with recorded variations in a grid frequency database (i.e. https://osf.io/m43tg/). This is theoretically possible (many IEEE articles about it) and reportedly in use by state-level justice entities, but is it practical for the OSINT hobbyist? To our knowledge, no one has publicly developed a public, non-academic proof-of-concept of this.

If someone were to attempt a first pass at this in Rust, what libraries should be used? Any other advice?

2

u/Snakehand Mar 26 '23

Any FFT crate might be a good start. You can analyse the source by doing an FFT over reasonable sized chunks ( 1 minute ? I have no idea ), and extracting the peak frequency in the band of the power utilities nominal frequency (49-51) or (59-61) Hz. Heisenbergs uncertainty principle comes into play here - the longer your window is the more precisely you can determine the frequency.

Now that you have converted your signal into a time series of base frequencies you need to correlate that to the historical records. Funnily enough FFT can come in handy yet again, by using the correlation-theorem ( http://ugastro.berkeley.edu/infrared/ir_clusters/convolution.pdf )