1
$\begingroup$

I have data that is sampled at 12 kHz. The downsample function in software such as MATLAB only allow you to downsample by an integer factor, i.e. from $12\to{6,4,3,2,1,\ldots}$ kHz. How would I downsample by a non-integer factor, say, from $12\to{10,9,8,7,5,...}$ kHz (pseudocode/description is fine)? You can assume that the signal has been appropriately lowpass filtered prior to downsampling. Also, the desired new sampling rate (after downsampling) is a "nice" number (i.e., I'm not trying to do $12 \to 9.7432$ or something like that).

$\endgroup$

2 Answers 2

3
$\begingroup$

I can recommend the resample command in MATLAB. It's a combination of up- and down-sampling. To get from 12kHz to a sampling rate of 9kHz, you upsample by 3 and downsample by 4. resample just needs your signal and the two factors for up- and down-sampling. Remember, when downsampling, to first low-pass filter out everything between 4.5 kHz and 6 kHz. Very little energy should exist above the resulting Nyquist frequency.

$\endgroup$
2
  • $\begingroup$ Ah, thanks. It should be up first and then down, but that's fine. $\endgroup$
    – user5839
    Commented Oct 31, 2013 at 16:43
  • $\begingroup$ good point! according to the docu of matlab, it first samples up and afterwards down. the other way round, it wouldn't make much sense. $\endgroup$
    – Pascal
    Commented Oct 31, 2013 at 16:50
3
$\begingroup$

Another common method of downsampling is low-pass filtering followed by Sinc interpolation of the new sample point set. These methods can be approximated and combined by choosing an appropriate width windowed Sinc as the interpolation kernel. For a rational downsampling ratio, this interpolation kernel can be precalculated into a polyphase FIR filter bank.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.