AM and FM transmitters - AM wav FM two tone
mstram
Posts: 49
in Propeller 1
I have been examining / experimenting with the a.m. and f.m. transmitter code from these threads :
F.M. "wav file" transmitter
DEMO: Direct 2M FM broadcast modulation with the Propeller
A.M. "two tone" transmitter
AM and FM Transmitters
I am using the Application Note AN001 Propeller P8X32A Counters PDF to try to understand the programs and the prop1 counters.
It would be helpful to see how the A.M. "two tone" transmitter could transmit a .WAV file and
how the F.M. transmitter could transmit single tone(s).
I've tried replacing the relevant sections of code, but I'm not receiving the audio.
E.g.
For the A.M. transmitter I tried replacing
with
Conversely for the (former) F.M. "wav player" , to make it output "single tones", I tried replacing the "wav-loop"
with :
F.M. "wav file" transmitter
DEMO: Direct 2M FM broadcast modulation with the Propeller
A.M. "two tone" transmitter
AM and FM Transmitters
I am using the Application Note AN001 Propeller P8X32A Counters PDF to try to understand the programs and the prop1 counters.
It would be helpful to see how the A.M. "two tone" transmitter could transmit a .WAV file and
how the F.M. transmitter could transmit single tone(s).
I've tried replacing the relevant sections of code, but I'm not receiving the audio.
E.g.
For the A.M. transmitter I tried replacing
repeat frqa := freqa1 waitcnt(clkfreq/2 + cnt) frqa := freqa2 waitcnt(clkfreq/2 + cnt)
with
repeat p := @wav1 '+ 44 time := cnt x := clkfreq / 11025 ' ' "wav-loop from the F.M "wav player" ' repeat while p++ < @wav2_end ' just continue from one 'File to next ' ' the "mystery section" for the A.M. wav playback ' ' FRQA := magicnum + byte[p] << 10 ?????????????????? what should go here ????????????? 'or ' wavbyt := byte[p] '<< 10 ' 'frqa := round( wavbyt * 4_294_967_296.0 / 80_000_000.0) ' waitcnt(time += x) DAT wav1 byte
Conversely for the (former) F.M. "wav player" , to make it output "single tones", I tried replacing the "wav-loop"
with :
frqa := freqa1
Comments
Re:
The code fragment above frequency modulates the carrier frequency (magicnum) with the current byte read from the wav file.
But how / why does that work ?
Sending magicnum to FRQA causes the counter (in PLL SingleEnded PLLDIV=1 mode) to output a particular "carrier" frequency.
So why doesn't the code above just output a slightly higher carrier frequency than magicnum "alone"
It should. Do you have the equipment to measure such a change? The modulation needs to be small enough that from the receiver's standpoint it is still the same channel. For the FM broadcast band the deviation must be less the +-75kHz. If your radio tunes in 100kHz steps, such a change would be almost unnoticeable. And in practice you don't want to use the maximum allowed deviation.
If byte[] was signed, then it would not affect the carrier frequency. But, that is not the case. 8 bit WAV files are unsigned. And, spin interprets bytes as unsigned.
From the propeller manual:
I have made my own FM transmitter for Propeller: https://github.com/SaucySoliton/propeller-dds It may have bit-rotted.
>It should. Do you have the equipment to measure such a change?
No I don't. My "equipment" is a ~30 yr old clock-radio
>For the FM broadcast band the deviation must be less the (than) +-75kHz
Ah! I think I understand how the modulation is working.
Since the modulation source (wav file) only contains 20 > f < 20k, then that falls within the +-75Khz.
And since 20-20K is in the audio range, the radio therefore can demodulate it back to audio.
I downloaded your program and will take a look at it.
The fmtx_demo / Retronitus is very cool !
And it gave me an idea
Woo hoo !! Your transmitter works great with the SidCog (C64 emulation) !
I was messing with trying to "connect" SidCog with Fm Transmission, and was only getting very noisy / crude results.
I'm glad to hear it's working! The didn't seem to be a lot of interest in it when I first released it. I was kind of disappointed with the signal purity myself. That is different than sound quality.
Very true. I've done extensive testing of propeller RF output here: forums.parallax.com/discussion/comment/1429181/#Comment_1429181 This is mostly why I haven't developed the code since. There were hard tradeoffs between sampling rate, number of bits, and cogs used. Getting decent purity requires 2 io pins for 1 output bit. Then add the difficulty of designing an accurate resistive DAC. After all, if you are buying a DAC chip, why not just buy a DDS chip and make things much easier? Hopefully this will change with the P2.
It's not meant to be anything more than a learning experience.
The A.M. transmitter has a range of about 2 inches (no antennas used)
The F.M. transmitter is a lot better, but is only about 10 feet.