This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC2650STK: How to increase the PDM audio sampling rate by increasing the sampling points?

Part Number: CC2650STK

Tool/software: TI-RTOS

Hi,

The default (uncompressed)  setting in PDM driver is that the PDM sampling 192 audio samples in 12 ms. Can I increase the sampling rate by increasing the audio sampling points? (For example, Sample 384 audio points in 12ms)

Thank you in advance

  • Hello,

    Currently the PDM microphone is sampled using BCLK at 1.024 Mbps. In order to effectively double the sampling rate, the easiest way is to double the BCLK frequency. This is set in the PDMCC26XX_I2S_open() call.

    However, I should warn you that the entire ecosystem is based on a 16kHz sample rate, doubling this could have affects later on during decimation/filtering that occurs inside pdm2pcm16k().

    What drives the need for a higher sample rate?

  • I want to sample high-freq audio(near ultrasonic audio), about 16k-20k Hz.
    Besides the BCLK frequency, what else should I do? I don't think it's necessary to rewrite the whole PDM driver file, right?
  • No you wouldn't need to change the entire driver.

    The main concern is that the decimiators/filtering are optimized for Fs = 16kHz.

    I'd recommend changing the BCLK and test out the results for your use case.
  • Hi, I have tested with 17Khz sine wave. My main requirement is time accuracy, now it seems this is fine.

    But I found that the audio signal sampled by sensortag has severe distortion when it comes to the audio wave shape. I plotted the sampled audio signal by Matlab, it can be seen clearly the audio wave shape distortion, this will affect further DSP process such as corss-correlation algorithm

  • Hi Jason,

    I have reached out to our expert for advice. I will continue to look into this.

    However, I feel that there is a possibility that the filtering inside the pdm2pcm16k() function may be affecting your waveform.

    What is the use case that requires a higher than 16kHz sample rate?

  • thank you for ur kindness help.

    I know that the PDM driver was originally designed for human speech processing, but I wanna use it for distance measurement.

    Thank you

  • Through my studies,I found that the following coefficients matter decimation/filtering(different freq),is it right?
    const int32_t PDMCC26XX_aBqCoeffs[] = { //--v-- Adjust overall gain by changing this coefficient 331, 0, -1024, -1356, 342, // DC-notch, halfband LP filter (@32 kHz) 200, 789, 934, -994, 508, 538, 381, 944, -519, 722, 732, 124, 987, -386, 886, 763, 11, 1014, -386, 886, 0, // Terminate first filter // Insert optional second filter here (@16 kHz). Some examples: //1147,-1516, 522, -1699, 708, // +5dB peak filter (F0=500 Hz, BW=3 octaves) //1313, -565, -6, -725, 281, // +5dB peak filter (F0=2.5 kHz, BW=2 octaves) //1335, 532, -66, 694, 225, // +5 dB peak filter (F0=5.5 kHz, BW=1 octave) 0, // Terminate second filter };

    P.S. I found a phenomenon that once I add the PDMCC26xx.c driver file to my project tree, the time the PDM takes to sample a buffer(for example 192 sampling points) will change( In the past, the PDM takes relatively constant time to sample one buffer, but now the time it takes can vary, I am really confused since I didn't change anything to my driver file) 

  • Hi, after my test, I think just modifying the BCLK frequency is enough for increasing the sampling frequency, the received audio waveform will NOT have distortion( I also tested the decimation filter), I hope people who do similar applications can see this thread