Monday, July 10, 2017

AFSK modulation experiments - Part 1

AFSK modulation experiments - Part 1


So, on the next version of my Wisp tracker, I would like to attempt AFSK (APRS) modulation in addition to the WSPR modulation.  The Si5351b clock generator chip provides a VC input pin, which allows for FM modulation.  By using the DAC on the Microcontroller to make the appropriate sine waves, I should be able to achieve the proper 1200 and 2200hz tones necessary to modulate AFSK.

Step 0 of this project is to make a sine wave on an ARM Cortex processor similar to the one I will use in flight. The STM Nucleo L152RE fits the bill nicely.  I use the L151 processor on my Wisp tracker.  I did a fair bit of prototyping for the Wisp1 with this Nucleo.



Using STM32CubeMx, I was able to build some skeleton code to drive the DAC.  I found a Sinewave table online that someone had built that fit the bill nicely.  It had 128 points.

I ran the code, and it generated an absolutely beautiful Sine wave.  Sorry I forgot to take a picture. Unfortunately, when I tried to increase the frequency of the sine wave, I couldn't get above about 1500hz before the microcontroller failed to make a signal.  I didn't look into it deeply, but I suspect there simply wasn't time for the DAC to process the values between interrupts.

I reduced the number of samples from 128 to 36.  It made a respectable sine wave.


Having done that, I was curious how it would look with 12 samples.  As expected, it was rather lumpy.


So, I wondered whether I could throw a simple RC filter into the mix to smooth out the sine wave.  I built one with a 330 ohm resistor and 0.1uF cap.  



According to an online calculator, with those values, the filter cutoff frequency should be about 4825 hz, which is well above the 2200hz I was experimenting with.  Voila.  This is the sine wave with just 12 data points, run through the RC filter.


About attenuation


Note that the signal before filtering was about 3.3v peak to peak.  After the filter, it was about 2.7v peak to peak.  I didn't expect this much attenuation from the filter, but still, it's not bad.  It could simply be due to the breadboard and cheezy connections I was using.  Still, provided that 2.7v is sufficient to swing the signal on the Si5351b to achieve the proper deviation, I should be fine.

Alternatives


Should the attenuation prove too much to make a good signal on the Si5351, I have the option of running without a filter, and just fooling with the number of samples in the sine wave until I strike a good compromise.  Still, I'd really like to use the filter if I can.  I figure the GIGO (Garbage In, Garbage Out) philosophy applies here.  The cleaner the signal I put into the Si5351, the nicer the output should be.

Watch future blog posts for more experiments.


1 comment:

  1. Gripping! I didn't know that a low-pass filter can "smooth out" a sine wave like that.

    Could the Nucleo produce 2200 hz at 36 samples?

    So the Si5351 seems to be a CMOS clock generator. How does that produce a radio signal. Does the Si5351 do the FM? I'm pretty confused.

    ReplyDelete