Sine wave detector Microcontroller

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.

Reply to
richardscheff
Loading thread data ...

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

Good Luck! Rich

Reply to
Rich Grise

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.

Reply to
richardscheff

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

Reply to
cs_posting

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

Reply to
Joerg

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.