Demo: How to Adjust PWM Rate for Audio Output


#1

I'm making a Type D amplifier using the PWM object so I made this demo video of how to change the PWM clock to run fast enough for 12-bit output at 66 kHz. It's a sneaky video because I shot it after hours in the dark at my friend's studio in Brooklyn while someone was trying to sleep :slight_smile: Enjoy...

https://www.youtube.com/watch?v=7IghcJdfL60

p.s. I am doing this bc I need to run the power amp at varying voltages between 4 and 40 volts, so a typical analog amp connect to codec outputs won't work, but if anyone has any suggestions on how to design that, let me know :slight_smile:


#2

I might have an application for this. Would you mind to tell how you modified your object to have an audio-rate input? Or simply share the .axo file?
BTW, I would expect the clock frequency range to be dependent on the processor type. Therefore, a lower maximum value for AxolotiCore than for Akso. Have you tried both?
Regards, Jens


#3

Hi Jens,

This was an output-only experiment I was doing, so I didn't have any audio-rate input at all. In case it is too hard to tell from the video and the nice responses I got there, the s-rate of Axoloti/Akso runs at 3kHz, just like the k-rate. And at each tick it runs 16x and fills the codec buffer with all 16 frames. Forgive me if this is old hat for some people or correct me please if I've made some math mistakes, but this is why the PWM value changes I was seeing occured at 3kHz. Because the audio objects only get called at 3 kHz. There are some possiblities to work around this, including triggering a timer to run 16 times at 1/3000/16th second intervals following the initial trigger from the 3kHz "Axoloti frame interrupt," but for now...

Since I was originally hoping to drive a custom amplifier circuit in this way, but for now I've switched to an all analog route for increased fidelity and not having to write new software drivers. Ordering parts for this nw.

I have a few Aksos here and have definitely only scratched the surface. I find them great for travel because they don't have all the delicate music connectors on them like DIN, then when I get back home I can move the design I did on Akso into my Axolotis. The mailer they come in is actually the perfect holder for them... if it's good enough to mail it in, it's good enough to carry around in my suitcase/backpack.

I haven't verified this or anything, but this looks like the file I was using at them time:
PWM Test_07.axp (4.2 KB)

Good luck with your applicatoin, I'm curious what your application is.


#4

I need some digital signal processing and multiple (more than 2) high-power audio-bandwidth outputs. In my case, for the amplifiers it's not the wide supply voltage range why I want digital ones but the low power loss. PWM is an option, but I think I will prefer delta-sigma modulation. There are affordable off-the-shelf stereo "digital amp" modules with analog input.
AxolotiCore has the DSP capacity needed but, since it has only 2 analog audio outputs, it's probably not appropriate.
"Except if I could use several of its PWM outputs?" I was thinking yesterday. 12-bit resolution may be sufficient but I would really need audio rate. And need PWM and s-rate synchronized.
Hmmm, 48kHz x 4096 = 196608kHz -- can AxolotiCore do this? Well, I remember to have seen a Cortex M type processor comparison which probably indicates: No.
Nevertheless, thanks for the inspiration!