I am workng on a project where I need to sample audio inputs. How shall I increase the ADC sampling rate on the edison such that it meets the audio sampling rate of 8khz or more..?
I have already looked into the above two threads but they dont give an answer.I want to go with the MRAA way to sample the signal but at frequencies like 2,4, and 8khz. Could some one tell me how do I get high sample rate with MRAA?
Can some body please tell me how to increase the ADC sampling rate using MRAA? I was able to generate fast PWM enough for audio data where the audio is being played from a file but now I want live audio from a mic and for that the sampling frequency needs to be high.
I see that the adc pins on the edison are connected to ADS7951 and it has a 1mhz sampling rate. So how shall I achieve 8khz sampling rate on the edison arduino board.
Is that at a uniform sample rate? I have a project where I was trying to get uniform sampling rate from the Edison ADC in python. Specifically, I read analogin values from python for a second, sleeping 1ms between samples. Obviously this wouldn't actually give me 1000 samples per second every time, but there was also way too much variability, from around 540-890.
Since Edison doesn't have an RTOS, I tried to switch to the Quark, but I saw that the Quark sleep can only go as low as 0.01s, whereas I need to be sampling an ADC (this time, I have an I2C ADC connected) at least 1KHz. Can someone provide some insight into how I might do this in an accurate manner?
But the edison arduino hardware guide says that the 1MHz is the sampling rate of the ADS7951 Chip. So atleast it should give samples in the order of KHz. Since the ADS7951 is connected to SPI0 cant we change SPI0 interface parameters and get higher sampling rate?
menonv That is the lowest sleep the Quark can do.
Sriranjan The chip is fixed on the board and cannot be changed, that is the fastest sampling rate Edison is capable of.
It is true ADS7951 has maximum sampling rate of 1 MSPS (MSPS means Million Sample Per Second not to be confused with MHz). Which means the ADS7951 can be connected to 1 MHz SPI to sample and transfer data at 1 MHz. Edison SPI linux driver in the current release that is used by Arduino for Edison can only reach 2.9KHz. Intel made the SPI driver source code available through the BSP for the users to make changes and customize the SPI driver to fits their needs.
Could you give us a step by step guide to change the SPI driver, change the kernel and how to compile/ upload it to edison.I followed the procedure given in the bsp (last page) but I never could update the kernel or reflect the changes through a pr_info() print statement.
There is no document that discusses increasing speed of ADC through kernel changes. The engineering team is aware of this and they may have improvements in future releases.
The sampling rate was obtained by creating a C++code that loops without delay or print statements. In the loop the following was done:
Sample analog pin
Write high to GPIO
Sample analog pin
Write low to GPIO
C++ sample code can be found here: https://github.com/intel-iot-devkit/mraa/tree/master/examples/c%2B%2B mraa/examples/c++ at master · intel-iot-devkit/mraa · GitHub