0
$\begingroup$

I'm loading a signal with librosa in python. With the original sample rate of 22050 Hz, i get the following waveplot:

enter image description here

When i choose to resample my signal with the sample rate of 512 Hz, i get the following waveplot:

enter image description here

My question is, how come the amplitude is less with 512 Hz than with 22050 Hz? I assume that since the interval at which we record the amplitude is larger at 512Hz, the values should be larger too.

$\endgroup$
4
  • $\begingroup$ Can you tell us what "loading with a sample rate" means? The signal you have in your computer already is sampled, so it has a sample rate. Are you just reinterpreting sample times? In that case, zoom in by a factor of 22050/512 in your upper plot and you'll see the lower. $\endgroup$ – Marcus Müller Nov 2 '20 at 8:11
  • $\begingroup$ By loading with a sample rate i mean loading and resampling it, yes. So by resampling it, my new amplitude intervals become: original interval / (22050/512)...or zoomed in. Thank you, i get it now $\endgroup$ – mojbius Nov 2 '20 at 8:26
  • $\begingroup$ Could you edit your question to include that you mean resampling? $\endgroup$ – Marcus Müller Nov 2 '20 at 8:28
  • $\begingroup$ One of the factors, here $\endgroup$ – OverLordGoldDragon Nov 2 '20 at 10:26
4
$\begingroup$

In order to resample without aliasing, the resampling process needs to apply an anti aliasing filter at the new Nyquist Frequency (or thereabouts). So chances are, your resampling process applied a low pass filter at 256 Hz or so and that removed A LOT of the energy.

$\endgroup$
1
  • $\begingroup$ If the OP takes the FFT of the original signal, and plots the magnitude it would give an idea of how much energy is in the higher frequency components. $\endgroup$ – David Nov 2 '20 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.