ADC little question

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
The high pass filter is optional but you should still use it, but for a reliable ADC you must have a low pass filter, preferably pretty steep, cutting anything above Fs/2.
How about this:

Mic ---> Hardware filter ---> ADC ---> Digital filter ---> Control section ---> Leds

In the above, hardware filter: high pass filter + Low pass filter to limit the frequency input between ~150Hz and ~2000Hz

ADC, sample at 4Khz

Digital filters, used to subdivide frequency spectrum into several sub-intervals for analysis of specific frequency spectrum of word being spoken...

But how does the number of digital filters influence on the result?

Control section, basically find/compute the fingerprint of sample word spoken...then perform some kind of comparison with stored words in the dictionary (memory)...

You still didn´t say what method of recognition youre using.

Either your method will be so good that it can keep running all the time and take care of this problem by itself in a way that it doesn´t produce false positives, or you will have to set up a thing known as Noise gate.
This monitors the input signal and when it reaches some level the gate opens and passes the signal to the next stage. When the signal drops below the threshold, the gate waits for some time and if the signal didn´t get above the threshold again, it closes and stops passing the signal. Offcourse it is easier to do this in software rather than in hardware.
(by level I mean absolute voltage wrt the resting level)
As for the method of recognition, I have explained a bit above but basicaly I can use euclidean distance to find the fingerprint that is closest match...

Or use a correlation of the two fingerprints...

Well I'm still reading and doing reseachs as I only have vague ideas...not a very clear picture yet...

But I'm very interrested in your method about Noise gate...threshold...where does it fit in my block diagram?

Thanks so much!
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
I'm trying to do some reading on Digital filter design and implementation...

BTW, what is a (the) threshold!?

I think I will need a fast PIC and with enough RAM...I haven't decided the PIC uC yet...any suggestion?

Thx!
 

joeyd999

Joined Jun 6, 2011
5,283
I'm trying to do some reading on Digital filter design and implementation...

BTW, what is a (the) threshold!?

I think I will need a fast PIC and with enough RAM...I haven't decided the PIC uC yet...any suggestion?

Thx!
My WAG (wild a** guess) is that you are not going to be able to accomplish this project on standard 16F or 18F silicon. Granted, I have no idea how much computation you will need to do to get a reliable result, but it's probably going to be considerable.

The dsPICs have built in MACs that can crunch *real fast*, but this will be another big learning curve for you.

Perhaps, rather than diving right into actual speech recognition, how about limiting your initial design to something simpler, like frequency detection. Set it up so a certain LED turns on if a tone of a particular frequency is heard.

This will require much of what you need for the real speech project, but it is something that is doable with about 1/100th the effort you are going to spend otherwise!
 
Last edited:

kubeek

Joined Sep 20, 2005
5,795
I'm trying to do some reading on Digital filter design and implementation...

BTW, what is a (the) threshold!?

I think I will need a fast PIC and with enough RAM...I haven't decided the PIC uC yet...any suggestion?

Thx!
I don't know how it is on planet mars, but in English it used to mean the wooden board at the bottom of your doorway which keeps trash from entering your house.
Lately it means a level above which something happens and below which nothing happens.

For this kind of project you should use some uC designed for DSP, but I haven't used one yet so I can't recommend anything.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
My WAG (wild a** guess) is that you are not going to be able to accomplish this product on standard 16F or 18F silicon.
I am:D... and I MUST! So all y'all got to help me...
Actually it will not be my accomplishment but ours...some ***** made it happen with a mega32 AVR (which is not that powerful) with 70% accuracy so I Must...

Granted, I have no idea how much computation you will need to do to get a reliable result, but it's probably going to be considerable.
Yes Sir! It gon be some crazy computation and it even scarying me...:(

The dsPICs have built in MACs that can crunch *real fast*, but this will be another big learning curve for you.
Oh yes...I still have lots to learn wit ordinary Pics so not ready to shift to dspic....

Perhaps, rather than diving right into actual speech recognition, how about limiting your initial design to something simpler, like frequency detection. Set it up so a certain LED turns on if a tone of a particular frequency is heard.
This will require much of what you need for the real speech project, but it is something that is doable with about 1/100th the effort you are going to spend otherwise!

Actually I'm always doing things upside down...after this one I think I will stop discussing about things beyond me...and try do simple stuffs

I have lots of crazy stuff in my mind that I would like to do...but I will...with time...I got to be patient but I'm not...lol

Thx
 
Last edited by a moderator:

CraigHB

Joined Aug 12, 2011
127
You might be surprised to find the dsPICs, 24F, and 24H are actually easier to work with. The processor architecture is the same for all the 16 bit PICs.

The addressing is linear which is really nice. They also have a much better instruction set. There's a bunch of other nice things about them in terms of additional features.

The main thing that makes the 16 bit parts harder to work with is they do a lot more stuff so there's more to familiarize yourself with. But, once you're comfortable with their feature set, they really are a joy to use. Like night and day in comparison to the 8 bit parts.

I'm not trying to say you should jump into using the 16 bit parts, there's still a big learning curve with them, but I think you'll be pleasantly surprised when you get that far.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
http://www.embeddedadventures.com/chipkit_uno_32_bit_arduino_plt-1005.html?setcurrency=USD

80Mhz Microchip PIC32 processor can do it if it can be done on an AVR32
Humm...I'll decide on which PIC to use after studying carefully what minimun RAm and what minimum speed I need to achieve this...I'm going to experiment this with one 'word' and one 'Led' first then will see how many words can be implemented...

I give myself 4 weeks from the 3rd of Jan...to acheive this and I will and I Must...(For now it party time sipping on alcohool n ...) I've set the bar very high to myself...

BTW, it a personal project...do it for fun while learning at the same time...

Actually I'm preparing myself to design my first robot (lol) that will include many things at the same time (speech recognition, wireless control, etc...)

So if I acheive this, the next thing will be learning different type of wireless techniques...then....

Thx all!
 

thatoneguy

Joined Feb 19, 2009
6,359
Party now, that's what this whole week is for, chilling out.

That board for $25 has a ton of hardware and options, in addition to being compatible with "Arduino code". If the Arduino code slows you down too much, you can use a PIC compiler and ICSP to directly program the chip, 80 million instructions per second should easily give you enough headroom.

It's a decent and very affordable board from what I've read about it and seen on YouTube.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Assume the following:

Analog signal ---> ADC ---> processing ---> output

Assume you want to PROCESS, let's say, 1000 samples from ADC.
I want to know how ADC work...
How do you store these 1000 samples in the RAM and how do you call them (samples) from 1st sample to last one for processeing??

Is it possible to process those samples without storing them in the RAM??

Regards, Eric
 

kubeek

Joined Sep 20, 2005
5,795
Depends on HOW you want to process them. If you want to calculate an average, you don't need to store more than the partial sum and the number of measurements. If you need something like FFT you need the whole set before you can do anything.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Ohk!

But assume the first alternative, ie How do you store these 1000 samples in the RAM and how do you call them (samples) from the RAM from 1st sample to last one for further processing??
 
Last edited:

kubeek

Joined Sep 20, 2005
5,795
First, you need to say if it is assembler or C. In assembler you simple put each value to the absolute memory location of your choice.

In C, for 1000 8bit samples, you would declare an array with length 1000 and then store data into it.
Rich (BB code):
unsigned char array[1000];
array[0]=value0;
array[1]=value1;
...
But I presume your ADC will be 10-bit so you need 1000*10/8 fileds in the array. (you could also use the next higher number type than char which would have 16 bits and therefore enough space to store the single value, but that would waste a lot of valuable RAM)

Then you would store the frist 8bits of the first value into the first byte and the rest 2 bits into the second byte,
then the first 6 bits of the second value would go into the second byte and the rest into the third byte etc., until you fill the whole array.
This way you will probably need to make a function which finds the two bytes in which the value is stored and loads/stores the data where it should go.
That function would contain some modulo and division calculations to find the byte address and the amount of bits to be stored into each byte. Then some bit masking to store it without overwriting the adjacent values.
 
Last edited:

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
BTW, it is assembler and the PIC I have at the moment is the PIC16F690 but ima order better PICs (18F) in a few days...lemme read ur comment again...

Thx
 

thatoneguy

Joined Feb 19, 2009
6,359
I hope you aren't going to try to match an analog waveform to another to see if the voice commands match.

You'll need to make a "signature" that can be processed and matched.

Somebody did it with a Basic Stamp 2 and external ADC, so with 400,000 instructions per second, they have voice recognition.

It's finesse, not brute force.

Here is one with a dsPIC using multiple commands
 

kubeek

Joined Sep 20, 2005
5,795
BTW, it is assembler and the PIC I have at the moment is the PIC16F690 but ima order better PICs (18F) in a few days...lemme read ur comment again...
Sorry I never worked with PICs, I just remember they had their RAM divided into some sort of banks between which you have to switch to access the whole memory, but I don't know if it is still the case with the newer ones.
But on other architectures the instruction is usually something like:
MOV "some number or register" "to some address in memory"
In assembler you decide how you use your memory, so you place the number on the address of your choice.

Anyway, the thing I described in the last post is basically how you need to divide 10bit numbers into 8bit buckets, with the numbers sitting next to each other without spaces between them. Just draw 4x 8-boxes in a row on a piece of paper and place 10box long numbers next to each other and you will see what I mean.
 

thatoneguy

Joined Feb 19, 2009
6,359
The RAM issue is correct Kubeek for the PIC10/12/16 series.

The enhanced mid range PIC16 and PIC18 have linear memory access now, making things much easier compared to switching banks to do anything.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Thanks Kubeek and thatoneguy for your useful comments...

I'll reply/question them later coz I'm kinda sleepy now...it 2:57am here at Planet Mars!
 
Top