Shop OBEX P1 Docs P2 Docs Learn Events
Newbe - RF Sound Modulation — Parallax Forums

Newbe - RF Sound Modulation

Areal PersonAreal Person Posts: 197
edited 2007-08-30 14:40 in Propeller 1
Hi, (I'm a newbe at this)

I'm trying to modulate my voice onto the carrier frequency I've generated
using the FrequencySynth object. (I'm in the FM range).

I have two things as follows.

1) The simple propeller setup using the FrequencySynth object on a single pin. (I'm using a good cellphone ant.) (works good)
2) a simple Condenser microphone circuit that uses a LM386N Audio Amp IC. (works good)
··· it is using a 9vdc battery.

QUESTIONS:

How can I SAFLEY get the signal onto the carrer frequency ?

Can I just plug in the output of the·LM386N·that is currently going to my headphones? (I don't think so, as it is over 3.5vdc) ?
Can I use a 3.3vdc zener diode as a clamp ?

I don't know what I'm doing and I dont want to damage my Propeller starter Kit.

Thanks for the help,
-Areal

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but

what do you expect ? I'm a programmer.

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2007-08-30 01:07
    Areal,

    If you look at the microphone to VGA object, you won't even need a LM386.
    Use the value returned from the sigma delta ADC in the microphone to VGA object to bump up or bump down the PHSx register that you are using to generate the carrier frequency with to FM modulate your voice.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Areal PersonAreal Person Posts: 197
    edited 2007-08-30 01:27
    OMG,

    I know, I love my propeller.

    Ha, Ha.. Silly me, I dident even know it had a microphone on it [noparse]:)[/noparse]
    Ua.. Hey, If I stand on my head and spin round and round could I get a free scope ? [noparse]:)[/noparse]

    Take it from me!
    -Areal Person

    Thats really nice!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a tree growing out of my head, but

    what do you expect ? I'm a programmer.

    Post Edited (Areal Person) : 8/30/2007 1:32:14 AM GMT
  • Areal PersonAreal Person Posts: 197
    edited 2007-08-30 02:23
    Ok, Ok, Yep [noparse]:)[/noparse]

    Ua... And my next question, after reviewing the code objects is...

    hOW do you do that [noparse]:)[/noparse]

    Now I'm taking a real deep lmao [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a tree growing out of my head, but

    what do you expect ? I'm a programmer.

    Post Edited (Areal Person) : 8/30/2007 2:28:44 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-08-30 04:16
    "hOW do you do that [noparse]:)[/noparse]"

    The Wikipedia is a great source for basic electronics information. Google for "wiki sigma delta" and see what you get!

    There already is a logic analyzer that runs on the Propeller that Paul Baker put together (http://forums.parallax.com/showthread.php?p=606048). Someone did a frequency domain display. The built-in ADC capability isn't fast enough to handle anything beyond the audio range, but a high speed external ADC would enable you to make an oscilloscope.
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2007-08-30 06:12
    Mike,

    I think he means how do you combine the microphone and a synthesized frequency in order to modulate it via the Propeller.
    smilewinkgrin.gif


    Areal,

    I had originally suggested looking at the microphone to VGA, but it turns out (for me anyway) it was easier to get my head around the
    microphone to headset ... pun intended.

    Anyway, here is something to get you started....

    Note: I used 900kHz to test, because 1MHz (1000kHz) is already allocated as one of the local radio stations.

    I should point out that the modulation scheme used here is Phase Modulation and not Frequency Modulation. In order to do Frequency Modulation
    it would be necessary to re-calculate on the fly the CTRB values and guarantee that it does not drift from your Carrier frequency. With Phase Modulation,
    the time domain of the frequency is altered, but the frequency remains the same providing it's allowed to complete a cycle.

    The drawback to Phase modulation, is that you are limited to the frequency in which you can modulate a signal and still have decent audio quality.
    The lower frequencies are much better than the higher ones in terms of audio quality.

    Frequency Modulation is very doable, and would allow very good quality audio at higher frequencies as well as lower frequencies, but it is a bit more complicated.
    Perhaps someone else will take the challenge.

    Both Phase Modulation or Frequency Modulation should be audible on a standard radio receiver

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 8/30/2007 6:51:42 AM GMT
  • m.r.b.m.r.b. Posts: 36
    edited 2007-08-30 11:53
    FM modulation is not overly tricky... I was the first 'play' I had, when I started with the propeller a few weeks ago... Had to be done??!!??

    The problem that I had with high quality (wide audio bandwidth) FM, was that SPIN is an interpreted language, (and runs a LOT slower than assembly..)
    ... As a result, if you use SPIN AT ALL ... anywhere in your modulation path... the update rate is low [noparse][[/noparse]audio bandwidth is low] .. so it sounds rubbish.

    You really need to use assembly to get fast enough modulation updates, to accomodate DECENT audio bandwidth (Nyquist's rule ... Fsample => 2*Max freq.)
    {for FM broadcast spec audio @ 15Khz (* 2)= 30Khz or faster!!}




    ... By the way .... this should be possible, but I haven't tried it yet...

    If you have 2* sigma-delta ADC, for left and right channnels, and swap the modulating source for freq. synth. between the two at 38Khz
    (so the modulation chops between Left and Right @38Khz) ... and addition alternatively add / subtract a small amount of modulation at 19Khz (pilot)
    .... You should get stereo!!! Albiet rough and ready!!!

    I did get as far as a mono 'broadcast' with the stereo 'pilot' tone (which lit the stereo light on my HiFi) .. But this was not TRUE stereo!!

    Regards M.R.B.
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2007-08-30 13:39
    m.r.b.,
    You said...
    If you have 2* sigma-delta ADC, for left and right channnels, and swap the modulating source for freq. synth. between the two at 38Khz (so the modulation chops between Left and Right @38Khz) ... and addition alternatively add / subtract a small amount of modulation at 19Khz (pilot) .... You should get stereo!!! Albiet rough and ready!!!
    That's correct... the problem with "add / subtract a small amount of modulation at 19Khz" or what ever frequency, is that it's not always going to return to center or average Zero.· As a result, the carrier frequency may drift without some way of regulating it.

    Really, you could still transmit in stereo, only the Left and Right would be Mono if you only used 1 Sigma-delta ADC and alternated which path (Left or Right) you updated at 38kHz.

    "I did get as far as a mono 'broadcast' with the stereo 'pilot' tone (which lit the stereo light on my HiFi) .. But this was not TRUE stereo!!"

    Yes, you can also "fake" out the stereo pilot light by only using the Frequency Synthesizer object... Set one CTR to your carrier frequency and set the other CTR to 19kHz.· Assign BOTH CTR's to the same pin.

    Here is an informative link as far as how FM radio is organized: http://www.st-andrews.ac.uk/~jcgl/Scots_Guide/RadCom/part21/page1.html



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 8/30/2007 3:43:24 PM GMT
  • Areal PersonAreal Person Posts: 197
    edited 2007-08-30 14:40
    I just wanted to say, Thank you !

    Thanks Beau for all the details, and everyone else for your help.

    I really enjoy working with my propeller chip because eventhough
    I'm a newbe and dont know much about electronics, I can learn and be
    succussfull because the support here is the best !

    Now, I'm gonna go study everything.

    Thank you,
    -Areal Person




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I have a tree growing out of my head, but

    what do you expect ? I'm a programmer.
  • mstrammstram Posts: 49
    edited 2016-05-11 19:26
    Mike,

    Anyway, here is something to get you started....

    Note: I used 900kHz to test, because 1MHz (1000kHz) is already allocated as one of the local radio stations.

    I should point out that the modulation scheme used here is Phase Modulation and not Frequency Modulation. In order to do Frequency Modulation
    it would be necessary to re-calculate on the fly the CTRB values and guarantee that it does not drift from your Carrier frequency. With Phase Modulation,
    the time domain of the frequency is altered, but the frequency remains the same providing it's allowed to complete a cycle.

    The drawback to Phase modulation, is that you are limited to the frequency in which you can modulate a signal and still have decent audio quality.
    The lower frequencies are much better than the higher ones in terms of audio quality.

    Beau,

    "The drawback to Phase modulation, is that you are limited to the frequency in which you can modulate a signal and still have decent audio quality."

    Do you mean Phase Modulation in general (any hardware) or specifically the prop ?

    My a.m. band is "crowded" around 900Khz, so I tried changing the frequency in your program, first to 1600kHz, then 90Mhz, but I'm not sure what frequency range your code will work with. (I'm not getting output at either freq on my clock radio)

    Mike

Sign In or Register to comment.