Hello, rak technicians,
When I use RAK4631 as WisBlock Core and RAK19001 as WisBlock Base, Using RAK18032 WisBlock ultrasonic microphone Audio module in the official sample repository RAKwireless-Audi -Library running HighRatePDMSerialPlotterFFT. ino, The ultrasonic signal can be output normally except the sampling frequency with the maximum sampling rate below 200kHz. However, when the maximum sampling rate is 200kHz, the ultrasonic data is not output, which is caused by what problem. In the code, as shown in the figure, the relevant sample rate section has been modified。
Is there still some unmodified code, or does RAK18032 not support 200kHz sampling rate?
Hi,
The RAK18032 has a frequency response of 20 - 80kHz. What is the frequency of the signal you are trying to record with the microphone?
Unfortunately the code used to generate the PCM was not written by RAK, so it will take me a bit of digging to try to understand your problem.
(from our early development tests I believe we were able to get a PCM sample rate of 500kHz, unfortunately the engineer is no longer with us).
Hi,
At present, we hope to use 200kHz sampling rate, that is, to obtain the ultrasonic frequency between 20kHz and 100kHz. 200kHz sampling rate can be selected in the PDM.h file PCM_20000. Using HighRatePDMSerialPlotterFFT.ino example code, after the sampling rate is modified to 200 KHZ sampling rate, the program card at the end of the setup function. Using PDM.h file below 200 KHZ sampling rate data can be normal output, The following figure shows the program output using the 200kHz sampling rate, and there is no reaction at this point.
From a program point of view, since read_flag does not set 1, that is, PDM.read not read data in the OnPDMdata function, how do I modify the code to make the 200kHz sampling rate work?
A screenshot of the code is also included below.
Hi,
I have verified and the nrf52 (RAK4631) can support a sample rate of 200kHz.
The problem is that when also printing out the FFT to the serial port the nrf52 is overloaded, so the PDM clock to the microphone runs at a much lower clock rate.
(if you remove the println as shown below the clock to the microphone is correct)
What is your application doing with the FFT data?
(I may be able to help you modify the sample to work correctly for your application)
Hi,
I removed the println code segment according to your suggestion, and changed the sampling rate to 200 kHz in the HighRatePDMSerialPlotterFFT.ino program at the corresponding location. However, when I imported the code to the board consisting of Rak19001 (WisBlock Base) + Rak4631 (WisBlock Core) + Rak18032, the output was still stuck at the end of the Serial.println(“=====================FFT example =====================”) in the setup function of Arduino. I added a Serial.println(“Read the PDM!” after the if (read_flag == 1). ); However, after the program was imported, the statement was not printed, indicating that the onPDMdata function is still not working and has not caused read_flag to be set to 1.
How do you confirm that rak18032 is working properly and that it did not read pdm according to your suggestion.
The following is a picture of the relevant program.
Hi,
We mainly want to use rak18032 to detect ultrasonic signals, and want to characterize the frequency band of 20kHz~100kHz through the 200kHz sampling rate, and know the frequency intensity corresponding to the frequency points in the corresponding frequency band according to FFT.
I wanted to let you know we are still looking into this.
I have checked the PDM clock and it is correct with a sample rate of 200000, but as you have noted there doesn’t seem to be any data (no call back ( PDM.onReceive(onPDMdata) )).
Thank you for your continued attention! yeah, this is a very strange thing, we even traced back to the underlying code, but did not solve this problem, we do not know where the problem occurred, is the hardware problem or the software problem is not clear at present