This tutorial is the second part of the series on signal generators. It is a continuation showing how to create real-time signals on the BF706-EZMINI only from sine waves as in a Fourier Series additive harmonics based signal synthesis. For the signals above, for example, the ramp signal shown on my scope consists of sinewaves harmonic series related to the following equation, as explained in the book written by called
As you can see this is an additive process, that follows a sequence of incremental fractional harmonics inside the 2nd, 3rd and 4th frequency bin away from of the fundamental.
Likewise, for an Fourier Series summation that generates a square wave, we can have the following equation :
Here we can see odd fractions of an odd harmonic series in 3rd, 5th and 7th harmonic bin added into summation with the fundamental.
I have modified the selection terminal to allow much quicker waveform selection and frequency adjustment. Launching the terminal you can quickly see the simplifications I've made by selecting from the keypad rather than typing up whole words to get around.
The top right-most corner keys are the ones used to trigger the frequency and modes of the signal generator. For example to turn on the first mode, just type: aud on to increase frequency, just type '+' at the terminal. To decrease frequency just type '-'. Likewise, to switch modes up or down type '*' for mode up or '/' for mode down. That's really about it. I think these modes have made my terminal a bit buggy, so I will fix it in future versions when I have some time. I just wanted to illustrate the possibilities and not get bogged down into details. The new console should be self explanatory. I have noticed sometimes there are strange hangups that can happen on the Blackfin in debug mode. Sometimes violations pop-up if one moves too quickly with the keystrokes while the waveforms refresh within the DMA circular buffer, there might be some opportunities for data corruption. Some delays may be in order while the scaled frequencies and calculations adjust themselves. There may be some strange division by zero or something else rather quirky with the scaling factors. Its not perfect code, just a quick illustration of what can be done rather quickly as a demo.
In a nutshell, the Additive, Harmonic Signal Generator can generate, Sinewave, Sawtooth Wave, Square Wave and Sweep. Here is what the console looks like with these new modes...
Once again, this more complex code will raise some issues now and then, but I hope it can be developed further to become bug free in some future iterations of it...Until then, have fun and hopefully we learned something quite new and useful! Cheers, Mario G.