ARDUINO Square PWM signal output with RLC circuit to achieve Amplitude Modulatio

Hello, Everyone

I am very new to Arduino and electrical engineering. I am trying to use a RLC circuit(which give a resonant

frequency) after Arduino (which produce a square PWM change between 20% and 50% at 40kHz) to do

amplitude modulation so the voltage oscillation will looks like shown in the attachment. In another word, I

am simply looking for a way to do amplitude modulation with Arduino.

Thank you in advance! Any suggestion on the circuit design will be very helpful.

Forgot to mention the project I am working on. Here is the link:

I am working on a acoustic levitation project. And want to use it to levitate liquid droplet and hope it can show some harmonic oscillation by the voltage oscillation behavior mentioned in the main post.

A PWM signal has a fixed amplitude, while frequency and duty cycle are adjustable in code. An adjustable DC level can be achieved by a RC low pass filter, but not a level adjustable AC signal.

If you need both variable amplitude and frequency, use a DAC as built into some Arduinos or as an external module.