1

I'm trying to make a linear interpolation between 2 representations of an audio spectrogram.

For the sound, I'm using a linear sweep going from 0Hz to 22KHz. Here are 2 spectrograms using respectively a linear and a logarithmic scale for the y axis :

enter image description here enter image description here

My goal is to find 2 functions to interpolate the y axis :

  • from lin to log
  • from log to lin

The idea being, by converting the linear image with my "lin-to-log" function I'd obtain the log image, and vice-versa.

I've tried to understand lin to log conversions but can't wrap my head around it. Any explanation or ressource for my novice brain is welcome !

Thanks for your help !

  • 1
    It looks as if to go from left to right you take $\log(y)$ so to go in the opposite direction you take $e^y$ or $10^y$ or $2^y$ using the base of the logarithm. Your images are too small to read the scales – Henry May 08 '23 at 23:09
  • @Henry Hi, thx for the quick answer !! Sorry I've updated the links so it links to the bigger images. I don't exactly know how the log image is generated. I'm using ffmpeg showspectrumpic function, and I don't know if it uses log10 or something else. – holybobine May 08 '23 at 23:21
  • OK - so the right hand chart uses the values for the left hand chart on its axis. So you can use any base for your logarithm so long as you keep track of the values. (so reading both charts, $x=0.31\rm{s}$ seems to concentrate around about $y=3500\rm{Hz}$ in both charts, while the values on the left chart $y$-axis go up with constant additive steps, those on the right chart $y$-axis go up with constant multiplicative steps – Henry May 08 '23 at 23:33

0 Answers0