Sine wave detector Microcontroller

Nov 09, 2005 4 Replies

I am sure the solution is in some first year college course, but here is the question. I am recieving an increasing sine wave at 40khz. I also have noise at about 40 khz. The noise peak to peak is about .5 V. The first wave in the sine is about .5V peak to peak. The second is about .7 and third wave is 1 volt.



I am trying to find the point where the first wave crosses zero. Since the noise and the first wave are about the same there is no analog way of detecting that point. So I am wondering how to do it with a microcontroller. I know about analog design not digital.



Any help would be greatly appreciated. Thank you.



If you can string a wire from the sender to the receiver, you could synchronously detect it.

Good Luck! Rich

The idea is to analize find the time between sent and recived pulse form a transducer. I am looking into a DFT function, but I am trying to figure out if the microcontroller can handle the 40khz. it is the pic16f648a at 20Mhz. I have read that the A/D input should be limited to 25Khz.

Basically I have two seperate problems. Is the pic capable and if so, how to implement.

Why don't you find the time when the third wave crosses zero, and then back-estimate when the first wave would have?

Hello Richard,

If the ADC can't stomach 40kHz and you absolutely have to use a PIC you might want to think about down-converting. If it's only that 40kHz you are after build an LC filter, downconvert either to DC (I and Q) or to a couple kHz or so. Make the BW wide enough not to lose the features you are looking for in your 40kHz signal. Then run the DFT on that.

If you have to detect features such as the exact onset of a 40kHz signal a DFT might not be the ticket. You may need more of a correlation algorithm where you compare what's coming in against a template of what you'd expect. Don't know if an eight-bitter is going to cut the mustard though.

Regards, Joerg

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required