Linear interpolation lin scale to log scale, and vice-versa

165 Views Asked by At

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 !