Backend & AI

What is numpy (fast numerical computing)

What it is

A Python library for calculations over large arrays of numbers: what ordinary code would take minutes to compute, numpy does in a fraction of a second.

How we use it

In ToshaMusic numpy breaks a fragment of a track down by frequency (FFT) and finds the spectral cut-off. That is how the bot catches a FLAC rebuilt from an MP3 and a CD master stretched to 24-bit / 192 kHz.

Where it helps a business

When data must not just be stored but crunched heavily and fast: signal analysis, statistics over large arrays, file quality checks.

How we use it

In ToshaMusic the bot checks that a downloaded FLAC really is Hi-Res. A fragment from the middle of the track is decoded to uncompressed audio, and numpy breaks it down by frequency (an averaged FFT) and finds the frequency above which the spectrum is empty. A cut-off in the 14 to 20.6 kHz range gives away a file rebuilt from an MP3, and nothing above 24 kHz on a "96/192 kHz" release reveals a stretched CD master.

Common problems

  • False alarms. A cut-off at 19 to 20.6 kHz also occurs in honest, dark masterings, so that warning is worded softly, and an unambiguous verdict is given only for a drop below 19.5 kHz.
  • A check is not the truth. The analysis is heuristic and can be switched off in settings.

When you do not need it

For ordinary record-keeping, orders and reports, a database and its queries are enough: numpy is for when the calculations are many and heavy.

โ† All terms

Need a website, a bot or automation?

Terms explained โ€” now let's get to work: tell us about the task and we'll turn it into a clear work plan.