PDA

View Full Version : optical voice link



Macgman2000
- 18th May 2008, 04:46
Hello All,

Has anyone experimented with an optical voice link ( mic interface to A/D serially transmitting voice data to another pic to reproduce back to analog output) ? Basically a audio codec.

Is it feasible or will the PIC latency in decoding limit the resolution of the audio? I am trying to get a high power IR digital system working. So far I have an analog solution working (PFM, pulse frequency modulation) with a PLL for the RX side. I want to do the same thing in the digital domain.

Thanks!
Nick

skimask
- 18th May 2008, 05:24
Is it feasible or will the PIC latency in decoding limit the resolution of the audio?
It's not so much the PIC's latency as it is the speed of the A/D converter. Some of the newer PICs are capable of decent sample rates, but the older ones aren't good for much more than LOW quality audio. Check the datasheet for your PIC in question for it's A/D converter max. sample rate.

Darrel Taylor
- 18th May 2008, 07:44
It's not so much the PIC's latency as it is the speed of the A/D converter. Some of the newer PICs are capable of decent sample rates, but the older ones aren't good for much more than LOW quality audio.
I've heard this argument many times.
But, I suppose it depends on what "Low Quality" means to the user.

With a minimum TAD of 1.6us, it takes 11 TAD for 1 conversion, plus 2 TAD in-between conversions. That's 20.8uS.
With a single channel of audio, you don't have to add in the acquisition time, because the A/D multiplexer never changes channels.

So @ 20.8uS per sample, that's ...

1/.0000208 = 48,076 samples/sec.
Audio can't be too Bad, with a sample rate like that.

But then, the hard part is sending the data fast enough.
You'd need over 480kbaud. SPI might work. Infrared probably won't ????

An easier way might be to use the comparators to create a PCM encoded data stream at 44kbits/sec.
Good enough for an intercom system or something.
And it's easier to play back too.
<br>

Macgman2000
- 18th May 2008, 14:32
Great info, I appreciate the feedback.

Darrel, how is your PCM method different than PFM?

I am using a oscillator with an unmodulated 300Khz pulse train, when modulated it deviates the frequency proportional to the audio amplitude. At the receiver I am using a PLL to pull off the audio from the VCO feedback loop.

Nick

tenaja
- 18th May 2008, 16:29
It's not so much the PIC's latency as it is the speed of the A/D converter. Some of the newer PICs are capable of decent sample rates, but the older ones aren't good for much more than LOW quality audio. Check the datasheet for your PIC in question for it's A/D converter max. sample rate.
I believe this is a myth generated by those who use the default adcin settings of the PBP compiler. For those people, it IS too slow, because the adcin compiler command consumes 100% of the cpu time, AND is much slower than necessary.

For those who read the datasheet so they may operate the adc manually, you get full use of the cpu for other calculations during charge and conversion, and you get it to run at maximum speed. Take note that this is twice as easy with an 18F, because they have a built in sample delay, so there is only one start. With 16F and lower, you have to delay, then start the sample.

skimask
- 18th May 2008, 20:18
I believe this is a myth generated.........

For those who read the datasheet........

I know that...you know that...a few other people know that...
That 2nd line above is the kicker for most 'first timers'...

Darrel Taylor
- 18th May 2008, 21:11
I am using a oscillator with an unmodulated 300Khz pulse train, when modulated it deviates the frequency proportional to the audio amplitude. At the receiver I am using a PLL to pull off the audio from the VCO feedback loop.
That sounds more like plain old FM, where you modulate the frequency of a carrier with an analog signal.

With PCM, the analog signal is converted to a data stream that can be stored or transmitted like any other data. The data rate is about 1/10th that required by a direct 8-bit A/D conversion, although the quality isn't quite as good, and will probably never match the quality of your FM system.
<br>