Author Topic: upsampling and spectrogram  (Read 277 times)

jakob

  • Posts: 140
upsampling and spectrogram
« on: 16 Jul '21 - 10:56 »
hi
we are upsampling 8kHz 16bit pcm audio to 16kHz 16 bit pcm using the mixer.
When looking at the spetrogram of an opsampled file we see that there is substantial energy between 4kHz-5kHz. This seem wrong.
We have tried using other tools to see if this is a common thing and it doesn't seem so, so I think that either we are using the mixer in a wrong way or else there might be a problem with it.
attacked is two files 1022(original 8kHz file) and the converted file 1022-16kHz( pcm mono file, no header). Ignore the first part of 1022-16kHz.
« Last Edit: 16 Jul '21 - 11:32 by jakob »

Ian @ un4seen

  • Administrator
  • Posts: 23889
Re: upsampling and spectrogram
« Reply #1 on: 16 Jul '21 - 12:51 »
There will be some energy beyond 4 kHz due to the resampling filter's rolloff. The steepness of the rolloff can be controlled via the source's BASS_ATTRIB_SRC setting. Try setting that to 6 for the highest quality (the default is 2 on Windows). Note that higher settings need more sample data, which might be an issue for you if the data is live (it'll add a little delay).

jakob

  • Posts: 140
Re: upsampling and spectrogram
« Reply #2 on: 16 Jul '21 - 13:04 »
hi Ian
thank you for the quick reply. The documentation on BASS_ATTRIB_SRC states that it does not effect decoding channels. My mixer is used for decoding. Will it still work?
I know nothing about 'resampling filter's rolloff', can you also point me to some documentation on the phenomenon?

« Last Edit: 16 Jul '21 - 13:17 by jakob »

Ian @ un4seen

  • Administrator
  • Posts: 23889
Re: upsampling and spectrogram
« Reply #3 on: 16 Jul '21 - 14:36 »
BASS won't do anything with a decoding channel's BASS_ATTRIB_SRC setting, but BASSmix will use it (see the BASS_Mixer_StreamAddChannel documentation), so it will still have effect in your case.

Here's some info on lowpass filters, including rolloff:

   https://en.wikipedia.org/wiki/Low-pass_filter
   https://en.wikipedia.org/wiki/Low-pass_filter#/media/File:Butterworth_Filter_Orders.svg

jakob

  • Posts: 140
Re: upsampling and spectrogram
« Reply #4 on: 16 Jul '21 - 15:19 »
I tried it and it works. As you said it might not be applicable on real time data, but it works. Thank you for help the links.