Sampling rate of BS2P
allan_melvin
Posts: 16
Hi,
How to determine the sampling rate of BS2P?
How to determine the sampling rate of BS2P?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike2545
This message sent to you on 100% recycled electrons.
Post Edited (Mike Green) : 7/13/2009 3:39:42 AM GMT
What kind of sample rate do you want? How long a sample do you need to record?
I suspect you will need something like the Propeller. The Propeller Demo Board already comes with a microphone (and can do its own ADC) and a headphone jack (and can do its own DAC). There already exists sample code for digitizing audio and you can probably fit 16K or more samples in memory. It's easy to add additional memory for data. You could log the data to an SD card if you want and that can be read on a PC for analysis. The main problem is that SD cards are unpredictably slow at times. You can speed up things by preallocating the files. The large buffers can help a great deal.
Thank you for your comments. I will seriously consider it. My project is actually to analyze vibration and noise inputs from accelerometer and microphone respectively using microcontroller. I wish to use BS2P but if follow your comments, it might be not suitable. You have any other idea on the project?
Thank you
For audible sound, which peeks at about 22KHz, this will mean you need a sample rate of 44KHz to get a decent recording.
Sound sampled at 22KHz is still audible, but contains lots of static.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
As I mentioned, the Propeller is perfectly capable of digitizing audio with a 44KHz sample rate with one processor while doing other things with the other 7 processors. The main issue is where to put the data and, for that, you'll need to estimate how much data you'll need to keep. You should be able to record your raw data (if that's what you want) on an SD card by using large buffers to smooth out the variations in writing speed of the SD card (and preallocating file space).
For your information, I am using 3 accelerometers connected at different area to detect vibration and having a microphone to detect the noise level. The signals supposed to be analyzed using MatLAB's neural network one by one. Each sample is taken for around 5 seconds and analyzed. Once the four signals have been analyzed, the numeric value of the analyzed signals will be compared to the trained value in the Basic Stamp microcontroller. The microcontroller will send signal to the LCD to display the Comfort Level Index (CLI). The process will be continuous, so that the LCD will display the CLI of current state. This is basically what my project all about. The problem now is that I am not sure how big will be trained values database. I need to think about the storage of the actual data also once it is analyzed. Do you have any idea on how the storage problem can be solved? I am think also an option of doing all the processing in the laptop and send the final CLI value to the microcontroller to be displayed. But I am not sure how much will be the success rate. Please advice.
P/S: I am using Parallax's 3 axis accelerometer with the sample duration of 5 seconds each. Once sample from 1st accelerometer is analyzed, the next sample will be taken from the next accelerometer. So, the sampling rate should be faster
-Allan-
For the accelerometer, i might need 10-20 samples for every 5 seconds and 10-20 samples for every 10 seconds for the microphone.
-Allan-
The EEPROM can only write 1 byte at a time and takes 5-10ms to do so. There's still plenty of time at 14 samples per second.
What is your comment about BS2P? Is it suitable for my project?
-Allan-
You haven't talked much about the Stamp to PC interface. Remember that any transmission time for the data to a PC will take away from the time available for reading the ADC and writing to EEPROM. You need to be pretty exact about the number of samples per second and the number of bits per sample and the number of bytes needed to transmit to a PC, etc. Do you plan to accumulate the samples for an extended period, the send them all to a PC for analysis or do you need to send them as they're received?
The better and more complete your information is, the better an answer I can give you
Ok. I will go for BS2pe instead of BS2p since it may need more time to process the data with the additional of stamp to PC interface.
I plan to accumulate the data from all sensors for an extended period and send them to the PC for analysis. The Parallax 3 axis accelerometer has build-in ADC. I believe I can save some time in converting the vibration signal. I am just concern about the microphone signal since it requires external ADC.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
Thank you for the information. I will check the specification
-Allan-
Just to give you an example:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
Thank you for the coding. Is Javelin having any software to analyze the signal from the accelerator?
-Allan-
It's fairly easy, depending on your programming skills.
The code in the previous post wil output the X,Y, and Z values or a tri-axis accelerometer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
Ok. It is quite suitable for my application then. I think I am having new problem in choosing my microcontroller. Haha. Thank you anyway
-Allan-