CW generator

Hi Pete - Do you have further thoughts on this? I have summertime activities under partial control, so I have some time, now. But I didn't want to duplicate your efforts. Bob
 
I haven't got anywhere with it. I thought I had found all the places where you have to differentiate between the 12kHz sampling rate and the final output sampling rate but all I get is buzzing.
I hope you have better luck than I did :)

Pete
 
Hi All - I had distractions, but did finally get a CW Modulator that runs with sample rates near 12, 24, 48 and 96 ksps. It does not have the efficient interpolation that I was hoping for, but more importantly, it works. I put it up on the OpenAudio_ArduinoLibrary github as a .h file and the .cpp file.

There is also an example that runs all four sample rates.

Give these a try, if you want, and let us know of success or issues.

I still plan to do a FFT of the resulting spectrum as well as timing tests. Maybe next week.

Bob
 
Not tried but looking at changes this prior PR#31 fix looks to have been undone with the removal of the "=" in the .h file?
1757657462318.png

That allowed the head==tail IIRC?
 
Hi All - just got back from weekend trip and got to the CW modulator. I re-fixed PR 31! Also I removed some unused variables and did the timing tests.

At Sample rate = 12 ksps, the update uses 81 uSec which is less than 1% of the available processor time (0.76%). At 24 ksps it is 59 uSec, at 48 ksps it is 48 uSec and at 96 ksps it is 41 uSec or about 3.1% of available processor time. Thes are all small enough that I don't plan any further
 
(sent b4) These are all small enough that I don't plan anything further for time improvement, but there are things that could be done if anyone cares.

I will pursue spectrum measurements, yet.

Oh, also, I will update the F32 Design Tool. And, if you want to bring a hand key in through an I/O pin, there is support for that now. I will include that in the Design Tool. To get info now, look at the .h file for the CW modulator class.
 
The spectrum of the F32 CW Modulator was measured by sending the alphabet in 5 character words along with some numbers. This was adequately random to suppress periodic spikes when averaged over a number of FFT. Measurements were done at a sample rates of 12 ksps and 48 ksps. The FFT size was 1024 for the lower rate and4096 for the higher rate. That made the bin size and location the same for both sample rates, making comparisons simple. Here is a plot made at 20 words per minute, with a 750 Hz tone.
CWSpectrum.png

The 48 ksps curve represents two stages of data interpolation, but the results for the close-in spectrum are still very close to that of the 12 ksps rate with no interpolation. The interpolation filters do add a couple of percent of overshoot, but the effect of this on the spectrum can be seen to be very small.

The lower plot shows the full half sample-rate frequency ranges. The three higher frequency replica spikes are a direct result of doing the interpolation, and the level of about -70 dBc is controlled by the associated low pass filter response.

The bandwidth achieved with the Gaussian filter approach is quite a bit smaller than non-DSP approaches that normally use a resistor-capacitor network to limit the rise time of the CW keying.

There should be no key click issues from using this modulator as long as following amplifiers are reasonably linear.
 
Back
Top