I’m a beginner in electronics and am trying to understand how the signal path of the oscillators/control on Shruthi. I’m actually studying other synths onboard, and Shruthi is the only one seen so far to send the output signals through a high frequency carrier, which is a very smart solution.
At several points the documentation I saw that the control signals (cutoff, resonance, etc.) has a frequency of about 900Hz in a carrier around 40KHz. It is also said that the oscillators (as a maximum frequency around 20KHz, I suppose) are sent to the filter (SMR-4 in this case) also a carrier of approximately 40KHz. This seems odd, because they would be two periods to transmit a carrier oscillator period, ie there is enough resolution. I also found elsewhere in the documentation stating that the audio signal is sent on a 10MHz carrier, which makes much more sense. Then there are times I’m rolling code and documentation, and can not find how or where it happens.
Basically, the carrier frequency of called “analog outputs” (including oscillators) is 40K or 10MHz? These signals are the audio output (before the filter, of course), or only the control signals (used in the modulation, for instance)?
Last, and not least: where’s on the code happens the multiplexing signal, which initially has 39KHz/8bits and is transmited in 10MHz/1bit?
Well, sorry for the many questions. I’m really banging my head with this for some time, I’m stuck. I hope you can help me, and thanks Olivier for making the Shruthi a project so inspiring.
> which is a very smart solution.
It isn’t. I did that because of very tight hardware/CPU limitations, but I wouldn’t do it on a commercial product. It can bite back in many different ways, including vintage digital equipment (FXs, samplers…) which do not have anti-aliasing filters. I suspect that having those signals run everywhere on a board might cause EMI problems too.
> Basically, the carrier frequency of called “analog outputs” (including oscillators) is 40K or 10MHz?
The oscillators signals are rendered at a sample rate of 39215.7 Hz (10M / 255), with a resolution of 8 bits. Each “sample” is converted into a sequence of 255 bits by the ATMega hardware (there is no code doing that!) using PWM modulation. So if you look at the signal you will see that:
- The smallest unit of time over which the signal is constant is (1 / 10 MHz) and it can only take 2 values, 0 or 1 (Hence the 1-bit, 10 MHz).
- The equivalent sample-rate / resolution in terms of internal computations is 39215.7 Hz / 8-bit.
- Because of the way PWM works, the resulting signal has a strong frequency peak at 39215.7 Hz, and all its odd harmonics. For example, to output a null, centered signal, the only possible way to do it with PWM is to go back and forth between 0V and 5V at the carrier frequency. So when the Shruthi-1 is not playing any sound, you still see a 39kHz square wave on the oscillators output. Ouch!
As for the control signals, the modulation PWM modulation frequency is the same (10 MHz, 1-bit, 8-bit internal resolution so a peak at 39215.7 Hz), but the signals are recomputed only every 40th audio sample.
sorry for posting on this very old thread, but as I’m looking to experiment myself with similar stuff (just as an exercise… I’m an EE student), I was wondering: what’s with the ~39kHz carrier? If you internally have a 39,2kHz sampling rate, and you send the signal stream (well, array of samples really) to the PWM output, and the uC natively converts this into a 10MHz 1-bit signal (255x the sampling rate, it provides 8-bit output, this is consistent with plain delta modulation, ie. oversampling with no noise shaping techniques), then why do you get a 39kHz carrier anyway? Shouldn’t silence result in basically a 5MHz square wave? (1 bit on, 1 bit off, and repeat).
To send a mid-value, delta modulation would generate a 5 MHz square wave, pulse-width modulation would generate a 39kHz square wave.
The Shruthi uses the latter.
OK, so I don’t understand what that 10MHz/1-bit spec refers to.
The output is 0 or 1 so it’s 1-bit. The smallest interval over which the signal is constant (time-base) is 0.1µs.
There are multiple ways of building a 10 MHz bitstream that approximates a target signal - PWM is one of them, delta modulation is an even better one. The former is used.