Shop OBEX P1 Docs P2 Docs Learn Events
Sound input-encoding-decoding-output with Propeller 1 — Parallax Forums

Sound input-encoding-decoding-output with Propeller 1

Dear all,

I am looking for suggestions and help on a project. The general idea would be, without too many details, to make a phone, or in any case a system that communicates voice inputs and output, with a multi Propeller 1 system.

To achieve this the first step is to assess the audio input and output capabilities of the P1. I have achieved and acceptable level of quality with the microphone-to-headphone object and, convinced that audio input, encoding, decoding and output is doable with a P1 system, I am now looking on how to actually implement proper audio management.

I would thus need a bit of guidance in the process, since I am very very rusty in signal processing: let's say that the ADC is taken care by the PLL of one of the cogs, I would now need to develop a way encode the signal coming out of it (and to decode it). How is this possible with the P1, let's say in an 8-bit encoding fashion?

Any help and hint is greatly appreciated!

Domenico

Comments

  • evanhevanh Posts: 15,848

    Not recording?

  • @evanh said:
    Not recording?

    No, my idea is that it would need to do only direct audio and input and output: forgetting about how the signals get from walkie-talkie A to walkie-talkie B, the P1 in walkie-talkie A gets the signal coming from a microphone, does a ADC (PLL in POS W/feedback), encodes such output in 8-bit, sends it over to walkie-talkie B, which decodes it and outputs it. I already have quite a good result in audio out with the jack in the activity board and the propeller is capable of doing the ADC part, what I am a bit struggling with is to understand how to encode the converted signal in a more communicable way (say 8-bit audio) and how to decode it in the same fashion.

  • evanhevanh Posts: 15,848

    Ah, I haven't read up on the details but A-law encoding will be what you're after - https://en.wikipedia.org/wiki/G.711

  • AribaAriba Posts: 2,690

    It's not clear what you mean with encoding and decoding. The Mic-to-headphones example already has pcm samples in the register
    asm_sample with the width you define in the CON section (bits = ). Say you have 11 bits chosen, you can write the asm_sample register
    to 11 port bits and an additional sync-signal on another pin.
    The other Propeller waits for the sync signal and then reads the 11 bits and puts it to it's DAC with this 2 instructions:

                  shl       asm_sample,#32-bits             'justify sample and output to FRQB
                  mov       frqb,asm_sample
    

    This needs a bus with 13 wires between the 2 propellers: 11 data, 1 sync, 1 GND.

    If you want to reduce the 11 bits to 8 bits non linear, like in uLaw or A-Law, you can maybe use the Log/Antilog tables in
    P1-ROM.

    If you want to reduce the number of pins between the cogs, you can send the data serially asynchron or synchron (with a clock pin)
    between the 2 Propellers.

    Andy

  • The Hydra system had some sound demos

Sign In or Register to comment.