swadhin Analog circuitry is simple : just directly sampling from the 7 analog pins of BBB as shown in the first figure.
I am not going to try to reverse-engineer the electronic circuit and the parts in use from that blurry picture.
Also, if you want any sort of pseudo-deterministic timing, you could try to use Xenomai's timers (accurate down to a few tens of microsecond), e.g. (untested code):
#include <signal.h>
int gShouldStop = 0;
void signal_handler(int signal)
{
gShouldStop = 1;
}
int main()
{
signal(SIGINT, signal_handler);
rt_task_shadow(NULL, "my-main-task", 90, T_FPU); // turn the current thread in a Xenomai task
while(!gShouldStop)
{
// this loop will run till you hit ctrl-C (SIGINT)
/*
do your acquisition here, stash the samples to a buffer
*/
rt_task_sleep(100000); // sleep 100 microseconds.
// Careful when reducing sleep time: you may become unable
// to stop the task if it takes too much CPU time
}
/*
once the loop is done,
dump your buffer to disk
*/
}
see here for more info on the Xenomai functions in use.
Then compile this with
g++ `/usr/xenomai/bin/xeno-config --skin=native --ldflags --cflags`
/usr/xenomai/bin/xeno-config --skin=native --ldflags --cflags
swadhin First one was the original and second one was the mic's data. I will try your suggestion.
Thanks, but this does not explain
giuliomoro what is "original" and what is "mic"? How is each of these digitized? The plots are zoomed out too far to see anything meaningful, we have no idea of what the signal should look like and the axes are not labelled.
Tell us where the "original" signal comes from: what is the source? How is it fed to the microphone? Is there a speaker involved? What is the signal?