Richard Corfield (M0RJC)
Trying to predict the effect of variable sample rate sine wave synthesis
I've been exploring variable sample rate (where the voltage step is constant) and also base 3 digital to analog conversion. Combining the two techniques gives me an interesting way of implementing a PIC microcontroller based AX25 modem using just 3 output pins rather than the normal 4. My limitation has been PIC processor speed to keep up with the rapid ramping needed as the signal crosses 0. I could do it, with some high frequency spikes from the switching, but I'd need to up the PIC's clock frequency to its full 32MHz, or I start skipping samples.
This graph is a prediction for a 4 bit binary converter using variable sample rate. The circles penned in are the actual sample points that the software is trying to follow. It is moving half a sample early to try to reduce error and therefore noise.
If the noise amplitude is taken as the maximum deviation from the target sine then I need to avoid skipping samples and try to keep close. A fixed sample rate solution could also achieve this quite well as long as the sample rate is fast enough to keep up with the fast ramping. Then the maximum error will be equal to half of the converter's resolution. The resolution of this 4 bit converter is -24dB.
The frequency content of the noise will vary here as the sample rate varies. In fact I'm frequency modulating the sample signal (d/dt of sin(t) is cos(t)), so I think I should expect the noise signal to occupy an FM type spectrum with extra harmonics from the step functions. Mix in any non-linearities in the system and that could become problematic!
Thinking of this, the better solution may be a fixed sample rate that is fast enough not to allow the noise amplitude to become too large as the waveform ramps quickly crossing zero. (That would be effectively amplitude modulating the noise). The fixed sample rate does also have the advantage of simpler code and less resource usage on the microcontroller, and noise is easy to filter in the analogue stage.
Maybe this is why we don't see variable sample rate synthesis. Searching for commercial direct synthesis solutions it looks like effort has been spent achieving very fast fixed sample rates.
Trying to predict the effect of variable sample rate sine wave synthesis
I've been exploring variable sample rate (where the voltage step is constant) and also base 3 digital to analog conversion. Combining the two techniques gives me an interesting way of implementing a PIC microcontroller based AX25 modem using just 3 output pins rather than the normal 4. My limitation has been PIC processor speed to keep up with the rapid ramping needed as the signal crosses 0. I could do it, with some high frequency spikes from the switching, but I'd need to up the PIC's clock frequency to its full 32MHz, or I start skipping samples.
This graph is a prediction for a 4 bit binary converter using variable sample rate. The circles penned in are the actual sample points that the software is trying to follow. It is moving half a sample early to try to reduce error and therefore noise.
If the noise amplitude is taken as the maximum deviation from the target sine then I need to avoid skipping samples and try to keep close. A fixed sample rate solution could also achieve this quite well as long as the sample rate is fast enough to keep up with the fast ramping. Then the maximum error will be equal to half of the converter's resolution. The resolution of this 4 bit converter is -24dB.
The frequency content of the noise will vary here as the sample rate varies. In fact I'm frequency modulating the sample signal (d/dt of sin(t) is cos(t)), so I think I should expect the noise signal to occupy an FM type spectrum with extra harmonics from the step functions. Mix in any non-linearities in the system and that could become problematic!
Thinking of this, the better solution may be a fixed sample rate that is fast enough not to allow the noise amplitude to become too large as the waveform ramps quickly crossing zero. (That would be effectively amplitude modulating the noise). The fixed sample rate does also have the advantage of simpler code and less resource usage on the microcontroller, and noise is easy to filter in the analogue stage.
Maybe this is why we don't see variable sample rate synthesis. Searching for commercial direct synthesis solutions it looks like effort has been spent achieving very fast fixed sample rates.